 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
Henley Grandmaster Cheater
Reputation: 0
Joined: 03 Oct 2006 Posts: 671
|
Posted: Thu Mar 06, 2008 12:13 am Post subject: C++ ASM Help |
|
|
I changed the question:
CE:
| Code: | alloc(Apple,8)
alloc(begin,24)
begin:
mov [Apple+4], eax |
If I put that into C++, Apple wouldn't be defined, how would I define it?
I tried this, but DCed from game:
| Code: | void _declspec(naked) begin(void)
{
_asm
{
mov [Apple+4], eax
Apple:
}
} |
Last edited by Henley on Thu Mar 06, 2008 10:18 pm; edited 1 time in total |
|
| Back to top |
|
 |
Flyte Peanuts!!!!
Reputation: 6
Joined: 19 Apr 2006 Posts: 1887 Location: Canada
|
Posted: Thu Mar 06, 2008 12:51 am Post subject: |
|
|
| At this point one would ask: "Why are you jumping into oblivion?"
|
|
| Back to top |
|
 |
Noz3001 I'm a spammer
Reputation: 26
Joined: 29 May 2006 Posts: 6220 Location: /dev/null
|
Posted: Thu Mar 06, 2008 2:26 am Post subject: |
|
|
| Code: | void _declspec(naked) Orange(void)
{
_asm {
cmp eax,ebx
je Orange
Orange:
//abc
}
} |
|
|
| Back to top |
|
 |
Henley Grandmaster Cheater
Reputation: 0
Joined: 03 Oct 2006 Posts: 671
|
Posted: Thu Mar 06, 2008 11:12 pm Post subject: |
|
|
| I changed the question and Thanks noz, I can't believe I couldn't figure that out >.>
|
|
| Back to top |
|
 |
Jani Grandmaster Cheater
Reputation: 2
Joined: 29 Dec 2006 Posts: 804
|
Posted: Fri Mar 07, 2008 3:58 am Post subject: |
|
|
| aznkidtroll wrote: | | I changed the question and Thanks noz, I can't believe I couldn't figure that out >.> | Why to change the question? Why not to post a reply with an another question?
The answer: new operator.
|
|
| Back to top |
|
 |
Symbol I'm a spammer
Reputation: 0
Joined: 18 Apr 2007 Posts: 5094 Location: Israel.
|
Posted: Fri Mar 07, 2008 4:30 am Post subject: |
|
|
Look at the code:
| Code: | alloc(Apple,8)
alloc(begin,24)
begin:
mov [Apple+4], eax |
It allocates "begin" and "Apple" and makes changes at "begin", simply allocate memory and there make your changes. (mov [Apple+4], eax and whatever you need)
Jump from the address you want to code cave to that address you allocated and at the end of your code cave jump back. (look for a code caving tutorial, see how a code cave works)
|
|
| Back to top |
|
 |
Henley Grandmaster Cheater
Reputation: 0
Joined: 03 Oct 2006 Posts: 671
|
Posted: Sat Mar 08, 2008 1:15 pm Post subject: |
|
|
| Symbol wrote: | Look at the code:
| Code: | alloc(Apple,8)
alloc(begin,24)
begin:
mov [Apple+4], eax |
It allocates "begin" and "Apple" and makes changes at "begin", simply allocate memory and there make your changes. (mov [Apple+4], eax and whatever you need)
Jump from the address you want to code cave to that address you allocated and at the end of your code cave jump back. (look for a code caving tutorial, see how a code cave works) |
I'm stuck at allocating memory for Apple .
i'll just give the whole code out :\
| Code: | void _declspec(naked) CamVacON(void)
{
_asm
{
push edx
push ecx
mov edx,[0x00850460]
mov ecx,[edx+658]
cmp esi,ecx
je normal
mov [y], eax //eax = y
mov ecx,[edi-4]
mov [x], ecx //ecx = x
cmp [edx+380],6
je dotele
cmp [edx+380],2
je dotele
jmp normal
dotele:
mov ecx,[x]
sub ecx, 50 //ecx =x
mov [edx+0xF00],ecx
mov ecx,[y] //eax = y
sub ecx, 15 //eax = y
mov [edx+0xF04],ecx
mov [edx+380],13
normal:
pop ecx
pop edx
mov [edi],eax
mov ebx,[ebp+14]
jmp returnhere
returnhere:
}
} |
Look at the script, the "x" and "y" isn't identified and I'm pretty much stuck on allocating memory for them. So when I allocate memory for it, they are defined right?
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Sat Mar 08, 2008 1:47 pm Post subject: |
|
|
Use VirtualAlloc/VirtualAllocEx to allocate memory of a given size.
_________________
- Retired. |
|
| Back to top |
|
 |
Henley Grandmaster Cheater
Reputation: 0
Joined: 03 Oct 2006 Posts: 671
|
Posted: Sat Mar 08, 2008 11:36 pm Post subject: |
|
|
| Wiccaan wrote: | | Use VirtualAlloc/VirtualAllocEx to allocate memory of a given size. |
but that doesn't define x and y
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Sat Mar 08, 2008 11:48 pm Post subject: |
|
|
Just define them as DWORDs outside of the function?
DWORD X;
DWORD Y;
At the top under your includes. They are given memory addresses then and can be used to store values. You can also access them from other functions if need be.
_________________
- Retired. |
|
| Back to top |
|
 |
GMZorita Grandmaster Cheater Supreme
Reputation: 0
Joined: 21 Mar 2007 Posts: 1361
|
Posted: Sun Mar 09, 2008 7:00 am Post subject: |
|
|
| aznkidtroll wrote: | | Symbol wrote: | Look at the code:
| Code: | alloc(Apple,8)
alloc(begin,24)
begin:
mov [Apple+4], eax |
It allocates "begin" and "Apple" and makes changes at "begin", simply allocate memory and there make your changes. (mov [Apple+4], eax and whatever you need)
Jump from the address you want to code cave to that address you allocated and at the end of your code cave jump back. (look for a code caving tutorial, see how a code cave works) |
I'm stuck at allocating memory for Apple .
i'll just give the whole code out :\
| Code: | void _declspec(naked) CamVacON(void)
{
_asm
{
push edx
push ecx
mov edx,[0x00850460]
mov ecx,[edx+658]
cmp esi,ecx
je normal
mov [y], eax //eax = y
mov ecx,[edi-4]
mov [x], ecx //ecx = x
cmp [edx+380],6
je dotele
cmp [edx+380],2
je dotele
jmp normal
dotele:
mov ecx,[x]
sub ecx, 50 //ecx =x
mov [edx+0xF00],ecx
mov ecx,[y] //eax = y
sub ecx, 15 //eax = y
mov [edx+0xF04],ecx
mov [edx+380],13
normal:
pop ecx
pop edx
mov [edi],eax
mov ebx,[ebp+14]
jmp returnhere
returnhere:
}
} |
Look at the script, the "x" and "y" isn't identified and I'm pretty much stuck on allocating memory for them. So when I allocate memory for it, they are defined right? |
Thank you ^_^
PM Me your msn i will help you out w/ it!
_________________
Gone |
|
| Back to top |
|
 |
|
|
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
|
|