Closed sebastianwalla closed 6 years ago
Hi, you need to set kernelMode to false for your dll (and remove userMode). Also, the address is not relative but native. E.g., if the DLL's default load address is 0x1000000, specify 0x1006ce0. I'll add an issue to allow specifying functions by name, it should make it much easier.
Hi, thank you. Yeah I was unsure about the kernelMode.. I tried using native addresses but it didn't work either (probably since more than one dll is loaded the ws2_32 dll is not at the default load address). Being able to simply specify functions by name would be a great relief.
Why would it even work with specifying the dlls prefered load address? Shouldn't ASLR destroy this assumption, since the dll will be loaded each time at a random base address and not at its prefered address?
I want to annotate the recv function from the ws2_32.dll in windows 10. I retrieved the dll from the guest (win10 enterprise 1703) and ran
dumpbin ws2_32.dll /exports :more
in a visual studio console in order to get the relative address of the recv function. As a result I got back0x6ce0
. I then registered the dll to be monitored in the ModuleExecutionDetector plugin in the s2e-config.lua file of my project. I also activated qemus default network settings in order to be able to receive something via the network.I then activated the listed plugins, like stated in the Annotations tutorial:
All the other plugins like KeyValueStore were already active by default, since I created the project using the
s2e new_project
command.I then registered the annotation for the recv function like this:
However when I know execute the program I never seem to find neither of this printed output. What am I doing wrong? Is the virtual address I found out wrong? If so how else could I find this address out? I know that the recv function is actually executed, print statements of the to analyzing program, which follow the recv call can be observed. (They are printed into the serial.txt, since I removed the piping of stdin and stdout into /dev/null from bootstrap.sh
I'm trying to get this working for several days but I can't seem to find the problem. Right know I'm following your documentation at Annotations, but I also read your article The S2E Platform: Design, Implementation, and Application to see how to annotate functions. However the way to do this in s2e seems to have changed since this article was published.