-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Return Values #3
Comments
Glad you like it. What do you find it useful for, if you don't mind sharing? W.r.t. logging return values, it should not be hard to log such values using the existing vv8 JS object serialization code. Repositioning the instrumentation to capture return values or retrieved property values would be straightforward in some cases and potentially tricky in others (esp. property access bytecode injection). Definitely possible, just a question of pain points. The capabality would, of course, be useful! As I have opportunity, I will look into it. W.r.t. patch updates: I am aware of more up to date patches created by other researchers using vv8 and am working to get those updates pulled back into this repository. Hopefully soon. |
I'm looking at various applications, including seeing what advantages there are for fingerprinting detection (over something extension-based like OpenWPM), studying obfuscated JavaScript code (looking forward to reading your IMC paper :) ), and doing some general script and site clustering by applying some ML to the generated traces. I'm also working on combining the trace output with data from the DevTools Glad to hear you think return values are (mostly) pretty straightforward -- I think it would be a welcome addition for several applications. If you're interested/available, I'd love to do a call sometime just to pick your brain a little bit about some of these possibilities and your thoughts about the future of the tool. I know sometimes research projects like this tend to be one-and-done-type things, but I think it's a valuable capability that still has a lot of untapped potential, and I'd be thrilled to collaborate if we can find a project where it makes sense. |
hi @jueckstock @pmurley , i think getting the return value will be great if it's string or int , i think the Graal is to have the possibility to get and hook the returned value, like Frida , we can hook a function, and when it's called we can return a value, or just log the function call or play with arguments. |
Any updates on this? |
Another +1 for this |
great idea! |
I was playing around with this for a while today (just for fun), and based on a bit of testing, it appears that in the latest version of Chrome, you could just potentially hook into HandleApiCallHelper(
Isolate* isolate, Handle<HeapObject> new_target,
Handle<FunctionTemplateInfo> fun_data, Handle<Object> receiver,
Address* argv, int argc) {
....
} in That being said, we (at the lab) don't have a specific usecase for this feature yet, but if any one of y'all are still interested in adding it, I'll be happy to help out and provide a code review/walk you through some of our modifications. |
Still very much interested in this! Interesting find. |
Hi @sohomdatta1, |
Hi @naifmeh HandleApiCallHelper(
Isolate* isolate, Handle<HeapObject> new_target,
Handle<FunctionTemplateInfo> fun_data, Handle<Object> receiver,
Address* argv, int argc) {
....
} should in theory be the return value that will eventually passed to our Javascript API function. The idea I had back then was to add a few lines of CPP to intercept the return value and then call a new function that logs return values using the VisibleV8 logger. While we don't have a function that explicitly log return values at the moment, it should be mostly easy to create one based on the functions we use to log function calls (Most of the code can be copypasted minus the constructor checks and the argument printing, in its place you need to add code to print a single return value) |
Thanks for the instructions @sohomdatta1! I managed to add something that prints the expected returns of the function by adding the following call logs starting from here:
But it doesn't exactly log the value, but rather the returned type. I get logs that look like this:
Maybe I'm doing something wrong, so I'Il keep looking. But if you have any idea in the meantime, it would be really helpful :) Thanks again! |
Hi @jueckstock, hope all is well. I've been enjoying using this tool over the past few months. I'm wondering if you've considered modifying the instrumentation such that it logs simple return values as well. I think this would apply to
get
andcall
methods most clearly, right? I guess it's probably impractical to log any arbitrary return type, but how difficult do you think it would be just to grab and ints or strings that are returned? Is this functionality already there and I've just been missing it?Sidenote as well: Do you plan to continue pushing updated patches for newer versions of Chromium at all?
Thanks!
The text was updated successfully, but these errors were encountered: