Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Programming
You last visited: Today at 05:53

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



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

Discussion on [Request] Some help with Inline asm in C++ within the CO2 Programming forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
MushyPeas's Avatar
 
elite*gold: 0
Join Date: Oct 2006
Posts: 800
Received Thanks: 89
[Request] Some help with Inline asm in C++

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.
MushyPeas is offline  
Old 09/08/2008, 15:08   #2
 
unknownone's Avatar
 
elite*gold: 20
Join Date: Jun 2005
Posts: 1,013
Received Thanks: 381
move EDI into a unsigned char*, then use memcpy()
unknownone is offline  
Old 09/08/2008, 16:29   #3
 
MushyPeas's Avatar
 
elite*gold: 0
Join Date: Oct 2006
Posts: 800
Received Thanks: 89
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?
MushyPeas is offline  
Old 09/08/2008, 16:51   #4
 
unknownone's Avatar
 
elite*gold: 20
Join Date: Jun 2005
Posts: 1,013
Received Thanks: 381
Yep.

Code:
//MSVC method
    unsigned char* addr;
    __asm
    {
        //...
        mov addr, EDI;
    }
    memcpy(my_string, addr, my_string_length);
unknownone is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
Inline ASM
06/07/2010 - General Coding - 5 Replies
Huhu was mich schon länger beschäftigt ist die Frage wieso inline assembler unbedingt vermieden werden sollte. Es geht mir vorallem um windows tools/game hacks. Wäre nett wenn mich jemand mit ein paar schönen begründungen erleuchten könnte.
Inline ASM Question [C++]
02/05/2008 - Conquer Online 2 - 0 Replies
Hi all, I've been trying but can't seem to work this out, basically I want the following DWORD to be put into an unsigned long in C++. dword ptr ss: into this variable unsigned long itemx; __asm mov itemx, dword ptr ss: Doesn't work and neither do all the other things I tried so I could really use some help.



All times are GMT +2. The time now is 05:53.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.