[Win32] Remotely execute functions of a D program

alex info at alexanderbothe.com
Sat Sep 15 06:35:00 PDT 2012


On Saturday, 15 September 2012 at 13:02:32 UTC, Denis 
Shelomovskij wrote:
>....
> Again, Digital Mars C runtime library is the problem for 
> everything in D language including DLL-s.

Lol okay I think I've also seen it. I've tried to build a hybrid 
dll with mixed C and D code (just compiled with dmc+dmd), and 
it's just not working, even if it's raw C exclusively..


I'll try an other approach now that is probably way more elegant 
and doesn't need any LoadLibrary calls:
I simply create a code cave in the debuggee and inject some 
assembler into it.
The method I'll be executing then takes a variable address (that 
has been stored in an other space), makes an object pointer out 
of it, and calls the virtual toString() overload - whereas the 
pointer to that function is stored at a fixed offset, 
fortunately. The returned string struct/pointer whatever will be 
stored to the variable address then (so I don't have to allocate 
another variable space), and the debug engine will finally read 
out the string.
That's my theory so far, I hope it'll work somehow :)

@Rainer I'll try my method first, and if that's not working at 
all, or if it's working, I'll contact you ;)


More information about the Digitalmars-d mailing list