| View previous topic :: View next topic |
| Author |
Message |
KalasDev Master Cheater
Reputation: 1
Joined: 29 May 2016 Posts: 311
|
Posted: Sun Mar 05, 2017 3:12 pm Post subject: Youtuber Life Float Script Question |
|
|
This is my code for Money:
| Code: | [ENABLE]
aobscan(aobMoney,D9 9F 90 00 00 00 83)
alloc(newmem,$100)
label(code)
label(return)
newmem:
code:
fstp dword ptr [edi+00000090]
jmp return
aobMoney:
jmp newmem
nop
return:
registersymbol(aobMoney)
[DISABLE]
aobMoney:
db D9 9F 90 00 00 00
unregistersymbol(aobMoney)
dealloc(newmem) |
I want to move a new value of let's say 9999999 - HEX or DEC I don't mind, how exactly should I do it ?
I mean common sense will be:
mov [edi+00000090],(int)9999999
But is that right, I don't know if It will mess up with other stuff.
EDIT: It's a float my bad, I'm dumb (float)9999999 |
|
| Back to top |
|
 |
++METHOS I post too much
Reputation: 92
Joined: 29 Oct 2010 Posts: 4197
|
Posted: Sun Mar 05, 2017 3:55 pm Post subject: Re: Youtuber Life Float Script Question |
|
|
| Code: | newmem:
mov [edi+90],(float)9999999.0
code:
fstp dword ptr [edi+00000090]
jmp return |
| KalasWD wrote: | | But is that right, I don't know if It will mess up with other stuff. | -In memory viewer, right-click on the instruction and check to see what addresses it is accessing. Return to the game and play for a bit. If you see any other addresses populate the list (besides the address that you are wanting to manipulate), then you may need to segregate that code so that none of the unwanted addresses are affected. |
|
| Back to top |
|
 |
ParkourPenguin I post too much
Reputation: 152
Joined: 06 Jul 2014 Posts: 4711
|
Posted: Sun Mar 05, 2017 4:04 pm Post subject: |
|
|
Putting the fstp after the mov will negate the effects of the mov. Either put it before the mov or replace its operand with st(0).
| Code: | fstp st(0)
mov [edi+90],(float)9999999.0
jmp return |
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
| Back to top |
|
 |
++METHOS I post too much
Reputation: 92
Joined: 29 Oct 2010 Posts: 4197
|
Posted: Sun Mar 05, 2017 4:20 pm Post subject: |
|
|
Sigh. I wasn't paying attention. I just woke up.
Thanks, ParkourPenguin. |
|
| Back to top |
|
 |
KalasDev Master Cheater
Reputation: 1
Joined: 29 May 2016 Posts: 311
|
Posted: Sun Mar 05, 2017 4:35 pm Post subject: |
|
|
Wait so
| Code: | fstp dword ptr [edi+00000090]
mov [edi+90],(float)9999999.0
jmp return |
Like that?
Oh never mind I understand,
I will just out the mov after the fstp. |
|
| Back to top |
|
 |
STN I post too much
Reputation: 43
Joined: 09 Nov 2005 Posts: 2676
|
Posted: Sun Mar 05, 2017 4:36 pm Post subject: |
|
|
No
fstp st(0)
mov [edi+90],(float)9999999.0
by doing this, you're popping twice
fstp dword ptr [edi+00000090]
fstp st(0)
LIFO or FILO _________________
|
|
| Back to top |
|
 |
KalasDev Master Cheater
Reputation: 1
Joined: 29 May 2016 Posts: 311
|
Posted: Sun Mar 05, 2017 4:51 pm Post subject: |
|
|
Wait so:
| Code: | fstp dword ptr [edi+00000090]
mov [edi+90],(float)9999999.0
jmp return |
This is not right?
| Code: | fstp st(0)
mov [edi+90],(float)9999999.0
jmp return |
This is right? |
|
| Back to top |
|
 |
STN I post too much
Reputation: 43
Joined: 09 Nov 2005 Posts: 2676
|
Posted: Sun Mar 05, 2017 5:18 pm Post subject: |
|
|
Both are correct in what you're trying to achieve. In the second one, you write to top of stack. The FSTP instruction performs the same operation as the FST instruction and then pops the register stack. To pop the register stack, the processor marks the ST(0) register as empty and increments the stack pointer (TOP) by 1. So you're pretty much writing nowhere as top of stack will now be pointing to what st(1) was. _________________
|
|
| Back to top |
|
 |
KalasDev Master Cheater
Reputation: 1
Joined: 29 May 2016 Posts: 311
|
Posted: Sun Mar 05, 2017 5:19 pm Post subject: |
|
|
| Aww ok thank you. |
|
| Back to top |
|
 |
|