| View previous topic :: View next topic |
| Author |
Message |
Freiza Grandmaster Cheater
Reputation: 22
Joined: 28 Jun 2010 Posts: 662
|
Posted: Fri Jul 30, 2010 3:14 pm Post subject: red alert 2 tanya health. |
|
|
Game : red alert2
hack : Tanya's infinite life
genre: rts
i am trying to make Tanya's life infinite.
BUT MY CODE ALSO BENEFITS COMPUTER AI.
what is wrong with my code.
| Code: |
[ENABLE]
//code from here to '[DISABLE]' will be used to enable the cheat
alloc(playerhealth,4)
alloc(newmem,2048) //2kb should be enough
label(returnhere)
label(originalcode)
label(exit)
playerhealth:
dw 0
005D3D31:
jmp newmem
returnhere:
newmem: //this is allocated memory, you have read,write,execute access
//place your code here
pushad
mov ebx,[esi+6c]
mov [playerhealth],ebx
popad
originalcode:
mov eax,[esi+6c]
test eax,eax
exit:
jmp returnhere
//*****************************************************
alloc(newmem2,2048) //2kb should be enough
label(returnhere2)
label(originalcode2)
label(exit2)
005D3E65:
jmp newmem2
nop
nop
nop
nop
returnhere2:
newmem2: //this is allocated memory, you have read,write,execute access
//place your code here
pushad
mov ebx,[esi+6c]
cmp ebx,[playerhealth]
jne originalcode2
mov [esi+6c],fa
popad
jg 005d3f39
jmp returnhere2
originalcode2:
mov [esi+6c],eax
jg 005d3f39
exit2:
jmp returnhere2
//*******************************************************
[DISABLE]
//code from here till the end of the code will be used to disable the cheat
dealloc(newmem)
005D3D31:
mov eax,[esi+6c]
test eax,eax
dealloc(newmem2)
005D3E65:
mov [esi+6c],eax
jg 005d3f39
|
Last edited by Freiza on Sat Jul 31, 2010 6:18 pm; edited 6 times in total |
|
| Back to top |
|
 |
XaLeX Expert Cheater
Reputation: 0
Joined: 19 Aug 2008 Posts: 226
|
Posted: Fri Jul 30, 2010 4:12 pm Post subject: |
|
|
The function you're editing is a class method, e.g. setHealth(int value).
It's called both by your troops and by your enemy's. Inspect the class and you should find a field along the lines of playerNumber or isPlayerControlled. Just check that and make your code skip the godmode part if the caller is an enemy object. |
|
| Back to top |
|
 |
Freiza Grandmaster Cheater
Reputation: 22
Joined: 28 Jun 2010 Posts: 662
|
Posted: Fri Jul 30, 2010 4:37 pm Post subject: |
|
|
I already dissected the data. but found nothing useful.(i was unable to understand the data)
some more help needed.
How to find playerunit. any clue. |
|
| Back to top |
|
 |
XaLeX Expert Cheater
Reputation: 0
Joined: 19 Aug 2008 Posts: 226
|
Posted: Fri Jul 30, 2010 6:12 pm Post subject: |
|
|
| Just set a breakpoint in that function, write down esi and unpause the game. Get at least two values obviously and then dissect them in memory and check all the differences. Some patience and you'll find it. |
|
| Back to top |
|
 |
Freiza Grandmaster Cheater
Reputation: 22
Joined: 28 Jun 2010 Posts: 662
|
Posted: Sat Jul 31, 2010 7:54 am Post subject: |
|
|
setting breakpoint freezes the game. and there is way out.
and i dont have dual monitor support. |
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25807 Location: The netherlands
|
Posted: Sat Jul 31, 2010 8:10 am Post subject: |
|
|
set a break and trace at that location for a count of 1
or even better, use the function "Find out what addresses this code accesses" _________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
| Back to top |
|
 |
Freiza Grandmaster Cheater
Reputation: 22
Joined: 28 Jun 2010 Posts: 662
|
Posted: Sat Jul 31, 2010 1:59 pm Post subject: solved |
|
|
| Thanx Dark Byte and XaLeX for reply. |
|
| Back to top |
|
 |
|