View previous topic :: View next topic |
Author |
Message |
Marcus101RR Expert Cheater
Reputation: 2
Joined: 09 Mar 2011 Posts: 131 Location: USA, FL
|
Posted: Thu Mar 11, 2021 1:44 pm Post subject: [Help] Using Label to get Address of Symbol? |
|
|
What I am trying to do is get the address that is allocated in the newmem for the inventory and use that so I can set all values from that address to something else using DB 00 00 00 00 for example. How would I assign a label or symbol to that specific address?
Code: | [ENABLE]
aobscanmodule(gGiveAllItems,MonsterHunterWorld.exe,8B 8F A0 00 00 00 8B C1 F7) // should be unique
alloc(newmem,$128,MonsterHunterWorld.exe)
label(code)
label(return)
label(inventory)
registersymbol(inventory)
newmem:
code:
mov ecx,rdi
add ecx,38A10
mov [inventory],ecx
mov ecx,[rdi+000000A0]
jmp return
inventory:
inventory2:
db 00 00 00 00 00
gGiveAllItems:
jmp newmem
nop
return:
registersymbol(gGiveAllItems)
[DISABLE]
gGiveAllItems:
db 8B 8F A0 00 00 00
unregistersymbol(gGiveAllItems)
dealloc(newmem)
unregistersymbol(inventory)
unregistersymbol(inventory2)
{ |
|
|
Back to top |
|
 |
sbryzl Master Cheater
Reputation: 6
Joined: 25 Jul 2016 Posts: 252
|
Posted: Thu Mar 11, 2021 3:45 pm Post subject: |
|
|
You already have inventory as a registered symbol, you don't need inventory2. I would recommend adding addresses to your table using inventory as a base.
|
|
Back to top |
|
 |
Marcus101RR Expert Cheater
Reputation: 2
Joined: 09 Mar 2011 Posts: 131 Location: USA, FL
|
Posted: Thu Mar 11, 2021 5:47 pm Post subject: |
|
|
sbryzl wrote: | You already have inventory as a registered symbol, you don't need inventory2. I would recommend adding addresses to your table using inventory as a base. |
I need a script that still edits all items in that address to some value. That defeats the purpose, I want to get the address where the items start, label it and that use
I remember someone showing me how to take the address that a memory you created is stored at and label it so you can create the script that nulls or adds values to the destination address, while getting it from the assembly intstructions.
ActualInventory:
DB 00 00 00 00
|
|
Back to top |
|
 |
sbryzl Master Cheater
Reputation: 6
Joined: 25 Jul 2016 Posts: 252
|
Posted: Thu Mar 11, 2021 6:44 pm Post subject: |
|
|
If you need another script using the value at inventory as a pointer you can do this and only enable it at a point you know the pointer is there.
Code: | [ENABLE]
label(inventory2)
registersymbol(inventory2)
[inventory]:
inventory2:
[DISABLE]
registersymbol(inventory2) |
|
|
Back to top |
|
 |
Marcus101RR Expert Cheater
Reputation: 2
Joined: 09 Mar 2011 Posts: 131 Location: USA, FL
|
Posted: Fri Mar 12, 2021 2:14 pm Post subject: |
|
|
sbryzl wrote: | If you need another script using the value at inventory as a pointer you can do this and only enable it at a point you know the pointer is there.
Code: | [ENABLE]
label(inventory2)
registersymbol(inventory2)
[inventory]:
inventory2:
[DISABLE]
registersymbol(inventory2) |
|
Why can this not be done in the same script?
|
|
Back to top |
|
 |
sbryzl Master Cheater
Reputation: 6
Joined: 25 Jul 2016 Posts: 252
|
Posted: Fri Mar 12, 2021 4:41 pm Post subject: |
|
|
inventory: is a label at an address, so [inventory]: is a label made by using the value at inventory: as a pointer. When you enable a script the value at inventory: will be 0x0000, so the label [inventory]: will be at address 0x0000. You would have to wait until there is a value located at inventory: to make [inventory]: a valid label that doesn't point to 0.
You could unroll pointers in asm but every time you do that you risk a memory access violation.
Code: | mov rcx,rdi
add rcx,38A10
mov rcx,[rcx] //<-- this will cause crash if rcx does not contain a real pointer
mov [inventory],rcx
mov ecx,[rdi+000000A0]
jmp return |
edit: changed order of pointer move
|
|
Back to top |
|
 |
|