[Request] Some help with Inline asm in C++

09/08/2008 11:37 MushyPeas#1
I'm trying to read a "string" (not necessarily human readable characters) that may also contain 0x00's using an injected dll.
Is there a way to (efficiently) copy a string of a length that can be up to 400 bytes or so into a c++ variable?
I have a pointer to the memory location inside EDI.
09/08/2008 15:08 unknownone#2
move EDI into a unsigned char*, then use memcpy()
09/08/2008 16:29 MushyPeas#3
Quote:
Originally Posted by unknownone View Post
move EDI into a unsigned char*, then use memcpy()
Just checking for completion:
The unsigned char* will then be like a duplicate of the state EDI is in at that moment, eg point directly to where EDI is pointing?
09/08/2008 16:51 unknownone#4
Yep.

Code:
//MSVC method
    unsigned char* addr;
    __asm
    {
        //...
        mov addr, EDI;
    }
    memcpy(my_string, addr, my_string_length);