[Help] Using Address pointer in symbol as a new label?
Posted: Fri Mar 12, 2021 1:06 am
Lets say I grab an address from an instruction that leads to the exact location of a dynamic inventory storage that I can later null out with DB 00 00 00 00 or add my own sequence of default items in bytes. The address is stored in inventory, but to gain access to the exact address I need to use [inventory]. Using it in the table is fine and dandy, but wasn't there a way to do this in assembler? Why does this not work as simple as:
What is the best way going about this, or did I over complicate it and there is an easy way?
Code: Select all
[inventory]:
db 00 00 00 00
Code: Select all
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:
db 0
gGiveAllItems:
jmp newmem
nop
return:
registersymbol(gGiveAllItems)