How to create "Highlighted Item" codes?

Memory scanning, code injection, debugger internals and other gamemodding related discussion
Post Reply
User avatar
NumberXer0
Expert Cheater
Expert Cheater
Posts: 1028
Joined: Sun Mar 12, 2017 2:17 pm
Reputation: 92

How to create "Highlighted Item" codes?

Post by NumberXer0 »

One of my favorite type of cheats are inventory editors. I know how to find addresses, create pointer, even basic scripts, but I have no clue how to go about something like this. I can easily find the value of an individual item in my inventory in most games, but a lot of tables have a cheat to edit whatever is currently highlighted in your inventory. How would I start with that?

predprey
Expert Cheater
Expert Cheater
Posts: 207
Joined: Thu Mar 02, 2017 8:46 pm
Reputation: 140

Re: How to create "Highlighted Item" codes?

Post by predprey »

You would first need to find the item object first, usually by searching for its quantity. Once you find a single item, you can find out what instruction accesses the quantity or the nearby ID as you move the cursor over the item. Once you find a suitable one, double check it by finding out what addresses the instruction accesses as you move the cursor and make sure it only accesses one item and it's the one you are highlighting. Once that's done you can confirm it is the right instruction and hook it to grab the address in the correct register to store in an allocated memory somewhere where your cheat entry can read. Sometimes you will not be able to find an instruction that only access one single item as developers may opt to parse all visible items for optimization or other reason, but you can still hook it and add multiple cheat entries and offset(s) to the last address that gets stored.

Next for Item IDs, you probably want to do a Structure Spider or Dissect Structure to search for item name strings then use a lua script match item IDs to names and print them all out in the console or into a text file. But some games do not store their item names as plain text or unicode and instead as font images, in that case you will have to reverse that logic or go the idiot's way of trying all possible item ID values and looking at what the name changes to in game.

User avatar
NumberXer0
Expert Cheater
Expert Cheater
Posts: 1028
Joined: Sun Mar 12, 2017 2:17 pm
Reputation: 92

Re: How to create "Highlighted Item" codes?

Post by NumberXer0 »

predprey wrote:
Wed Dec 12, 2018 11:17 pm
You would first need to find the item object first, usually by searching for its quantity. Once you find a single item, you can find out what instruction accesses the quantity or the nearby ID as you move the cursor over the item. Once you find a suitable one, double check it by finding out what addresses the instruction accesses as you move the cursor and make sure it only accesses one item and it's the one you are highlighting. Once that's done you can confirm it is the right instruction and hook it to grab the address in the correct register to store in an allocated memory somewhere where your cheat entry can read. Sometimes you will not be able to find an instruction that only access one single item as developers may opt to parse all visible items for optimization or other reason, but you can still hook it and add multiple cheat entries and offset(s) to the last address that gets stored.

Next for Item IDs, you probably want to do a Structure Spider or Dissect Structure to search for item name strings then use a lua script match item IDs to names and print them all out in the console or into a text file. But some games do not store their item names as plain text or unicode and instead as font images, in that case you will have to reverse that logic or go the idiot's way of trying all possible item ID values and looking at what the name changes to in game.
Thanks for the info! I'm still pretty new to making my own tables, so I honestly don't know a few of those terms. I'll do some more research though. I appreciate it.

Post Reply

Who is online

Users browsing this forum: No registered users