Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[Help] Using Label to get Address of Symbol?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
Marcus101RR
Expert Cheater
Reputation: 2

Joined: 09 Mar 2011
Posts: 131
Location: USA, FL

PostPosted: Thu Mar 11, 2021 1:44 pm    Post subject: [Help] Using Label to get Address of Symbol? Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
sbryzl
Master Cheater
Reputation: 6

Joined: 25 Jul 2016
Posts: 252

PostPosted: Thu Mar 11, 2021 3:45 pm    Post subject: Reply with quote

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
View user's profile Send private message
Marcus101RR
Expert Cheater
Reputation: 2

Joined: 09 Mar 2011
Posts: 131
Location: USA, FL

PostPosted: Thu Mar 11, 2021 5:47 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
sbryzl
Master Cheater
Reputation: 6

Joined: 25 Jul 2016
Posts: 252

PostPosted: Thu Mar 11, 2021 6:44 pm    Post subject: Reply with quote

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
View user's profile Send private message
Marcus101RR
Expert Cheater
Reputation: 2

Joined: 09 Mar 2011
Posts: 131
Location: USA, FL

PostPosted: Fri Mar 12, 2021 2:14 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
sbryzl
Master Cheater
Reputation: 6

Joined: 25 Jul 2016
Posts: 252

PostPosted: Fri Mar 12, 2021 4:41 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites