| View previous topic :: View next topic |
| Author |
Message |
MORHSN81 I post too much
Reputation: 0
Joined: 10 Nov 2006 Posts: 3432
|
Posted: Sat Jun 02, 2007 3:03 am Post subject: [Request] How to code Dupex in C++ |
|
|
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 |
|
 |
Madman I post too much
Reputation: 1
Joined: 04 May 2006 Posts: 3978
|
Posted: Sat Jun 02, 2007 7:36 am Post subject: |
|
|
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  _________________
|
|
| Back to top |
|
 |
SXGuy I post too much
Reputation: 0
Joined: 19 Sep 2006 Posts: 3551
|
Posted: Sat Jun 02, 2007 7:59 am Post subject: |
|
|
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 |
|
 |
MORHSN81 I post too much
Reputation: 0
Joined: 10 Nov 2006 Posts: 3432
|
Posted: Sat Jun 02, 2007 10:47 am Post subject: |
|
|
Nuuuu,
I can't just take the code and put it in __asm  _________________
|
|
| Back to top |
|
 |
TheSorc3r3r I post too much
Reputation: 0
Joined: 06 Sep 2006 Posts: 2404
|
Posted: Sat Jun 02, 2007 1:16 pm Post subject: |
|
|
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 |
|
 |
SXGuy I post too much
Reputation: 0
Joined: 19 Sep 2006 Posts: 3551
|
|
| Back to top |
|
 |
xentar Grandmaster Cheater
Reputation: 0
Joined: 08 Jul 2006 Posts: 708 Location: USA, Mass
|
Posted: Mon Jun 04, 2007 7:54 am Post subject: |
|
|
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 |
|
 |
|