Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[Request] How to code Dupex in C++

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
MORHSN81
I post too much
Reputation: 0

Joined: 10 Nov 2006
Posts: 3432

PostPosted: Sat Jun 02, 2007 3:03 am    Post subject: [Request] How to code Dupex in C++ Reply with quote

Im personally extremly confused and lost, I have this code Me and my friends made, but it doesn't work,
Can anyone show me how or something?

_________________
Back to top
View user's profile Send private message
Madman
I post too much
Reputation: 1

Joined: 04 May 2006
Posts: 3978

PostPosted: Sat Jun 02, 2007 7:36 am    Post subject: Reply with quote

it shouldnt be too different than others
like

__asm
code


i dont think you use the allocating crap though... ive never put scripts into code b4 Confused

_________________
Back to top
View user's profile Send private message
SXGuy
I post too much
Reputation: 0

Joined: 19 Sep 2006
Posts: 3551

PostPosted: Sat Jun 02, 2007 7:59 am    Post subject: Reply with quote

dont quote me, but i think if you were to convert a script to a code cave, and then use that for c++

_ASM {

}

it should work.

_________________
Proud member of "The DACEF" (Distruction Against Criminal Egotistical Forces"

Sign up today and receive your free "I Hate x0r Badge"
Back to top
View user's profile Send private message
MORHSN81
I post too much
Reputation: 0

Joined: 10 Nov 2006
Posts: 3432

PostPosted: Sat Jun 02, 2007 10:47 am    Post subject: Reply with quote

Nuuuu,
I can't just take the code and put it in __asm Sad

_________________
Back to top
View user's profile Send private message
TheSorc3r3r
I post too much
Reputation: 0

Joined: 06 Sep 2006
Posts: 2404

PostPosted: Sat Jun 02, 2007 1:16 pm    Post subject: Reply with quote

READ BOOKS ON C++ BEFORE YOU POST ABOUT IT (OR ASK ME ON MSN!)
_________________


Don't laugh, I'm still learning photoshop!
Back to top
View user's profile Send private message
SXGuy
I post too much
Reputation: 0

Joined: 19 Sep 2006
Posts: 3551

PostPosted: Sat Jun 02, 2007 3:25 pm    Post subject: Reply with quote

MORHSN81 wrote:
Nuuuu,
I can't just take the code and put it in __asm Sad


thats not actually what i said.

_________________
Proud member of "The DACEF" (Distruction Against Criminal Egotistical Forces"

Sign up today and receive your free "I Hate x0r Badge"
Back to top
View user's profile Send private message
xentar
Grandmaster Cheater
Reputation: 0

Joined: 08 Jul 2006
Posts: 708
Location: USA, Mass

PostPosted: Mon Jun 04, 2007 7:54 am    Post subject: Reply with quote

You can almost use the AA script in C as is.
If in your script you use a "ret" to go back to right after you branch off to your script. Then you must do a push 0xXXXXXXXX, this X is your jump back address at the beginning of your script.

For example:
if you plan to hook at address 1000, assume the 5 bytes you are to place your jump is already perfectly code align. So your jump back address will be 1005, if it not perfectly align, you must add appropriate nop then adjust the jump back address.

Code:

void __declspec(naked) dupexDetour(void)
{
   __asm
   {
       push 0x1005
       //your scripts
       ret
   }
}


1000 : jmp dupexDetour
1005 : blah blah

Another is you don't use 'ret' to go back to the calling code, but use jump, in that case you don't push the jump back address

Code:

void __declspec(naked) dupexDetour(void)
{
   __asm
   {
       //your scripts
       jmp 0xXXXXXXXX
   }
}


You need to calculate the offset for X and patch that jump accordingly, you only know what that offset is after your code is loaded into memory. So you have to patch this jump before it execute.[/code]

_________________
People encountered at CEF.

* I don't care if he wrote the code, I say it is open source then it is open source.
* I don't care if it is his trainer, if I say he can't have that hack in there, then he can't.
* Appalsap, your trainer is L337
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites