3 days and nothing come on guys
originalcode:
fstp dword ptr [edi+eax*8+04]
pop edi
now what i want to do with this is have EAX which would be the "stored value"
The Acculmulator register. It can also be used as storage. <
now i know pop EDI means is going to take the value that is in edi "transfer the number" to something
but what i want to do is add the value of iunno 10 or somthing so EAX now reads EAX
alloc(newmem,2048)
label(returnhere)
label(originalcode)
label(exit)
label(amount)
label(type_coins)
newmem:
pushad
mov [amount],(float)10 // the amount i want EAX to be
push [amount]
push type_coins
push 01
add esp,0c
popall
mov eax,-1000 // i am under the impression of it that this is the problem.
originalcode:
fstp dword ptr [edi+eax*8+04] // the code i need to edit.
pop edi
exit:
jmp returnhere
amount:
db 00 00 00 00
type_coins:
db 'coins'
db 00
this above is the code i have so far i just wonder how i would make it so i have 10 in EAX any tips or help? forgot to add the fact that right now all it does is freeze the value @ its current state 5 and if i build somthing or sell somthing it remains at one but still spends the coins so im not sure what i did wrong =(
---------- Post added 11-07-2012 at 12:21 AM ---------- Previous post was 11-06-2012 at 10:54 PM ----------
so in a nutshell i want edi+eax*8+04 < to edit this so that it will
newmem:
pushad
mov [amount],(float)10
accept this.
3 days and nothing come on guys
Um if you just want to put 10 into eax then why don't you just do that. Like
push eax
mov eax, 10
pop eax
But that's not really what you are after I think, Because the FTSP is a mov pop, and the value in [] is edi+eax+4*8 I mean you could just break and find edi, eax and mov four to get the value of eax+4 add them and multiply but that's lot of work I would just replace it with your own label like
alloc(newmem,2048)
label(turnItOn)
label(originalCode)
label(WantedNumber)
label(DontWantedNumber)
registersymbol(WantedNumber)
registersymbol(DontWantedNumber)
[enable]
turnItOn:
fstp dword ptr [WantedNumber]
pop edi
jmp DontWantedNumber
WantedNumber:
dd (float) 10.0
DontWantedNumber:
fstp dword ptr [edi+eax*8+04]
pop edi
[disable]
originalCode:
fstp dword ptr [edi+eax*8+04]
pop edi
unregistersymbol(WantedNumber)
unregistersymbol(DontWantedNumber)
dealloc(newmem)
If its a multiplayer game you might want to add a cmp switch to check the player and make sure you are not also helping them. This is easy to do. Most games store you as the default player one on your console. So just search for a 1 on your turn and 0 on opponents turn if 2 player normally works. Or just 1 on my turn and not 1 on opponent. If this fails then try you as a 0 and not 0 for opponent. If not, get creative. Once you have this find the offset and get a good static address and just add it like this
AOBSCAN(Player, ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ??)
label(Player)
registersymbol(Player)
cmp [Player], (int)1 // if the player value you found for your turn is = to 1// compare Player to Number 1
jne DontWantedNumber
je WantedNumber
jmp originalCode
Blah blah. I think I covered your question. Only 7 years later.
Player:
dd (int)0