View previous topic :: View next topic |
Author |
Message |
deama1234 Master Cheater Reputation: 3
Joined: 20 Dec 2014 Posts: 328
|
Posted: Sun Feb 22, 2015 7:33 am Post subject: Problem hacking the discount feature... |
|
|
So, there's this RPG that has a skill that gives me a 5% discount on items I buy from any vendor; this increases by 5% everytime I upgrade it. Problem is, I can't seem to find that discount value in memory! I tried a bunch of searches, increased, decreased, unchanged, but in the end it just comes up with 0 results. I even tried just "changed" but that still comes up with 0 results.
So, any of you more experienced members have any ideas? Cause I'm lost... |
|
Back to top |
|
|
Zanzer I post too much Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Sun Feb 22, 2015 11:36 am Post subject: |
|
|
Have you tried searching strictly by the level of the skill?
Some games calculate those values on the fly.
Also, did you try both float and double using your other methods? |
|
Back to top |
|
|
deama1234 Master Cheater Reputation: 3
Joined: 20 Dec 2014 Posts: 328
|
Posted: Sun Feb 22, 2015 12:15 pm Post subject: |
|
|
Zanzer wrote: | Have you tried searching strictly by the level of the skill?
Some games calculate those values on the fly.
Also, did you try both float and double using your other methods? |
Yeah, I tried those ways out too.
I just can't seem to find that damn price discount thing!
The game's name is "Divine Divinity".
Yeah, I got no idea, this is making me crazy. |
|
Back to top |
|
|
Zanzer I post too much Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Sun Feb 22, 2015 12:31 pm Post subject: |
|
|
Is there a reason you just don't hack player gold?
edit:
Are you able to level the discount while a vendor window is open?
Do the gold values decrease as you level it?
If so, find those gold values and look through the code that accesses them.
Several lines above may be the discount variable. |
|
Back to top |
|
|
deama1234 Master Cheater Reputation: 3
Joined: 20 Dec 2014 Posts: 328
|
Posted: Sun Feb 22, 2015 2:51 pm Post subject: |
|
|
Zanzer wrote: | Is there a reason you just don't hack player gold? |
I tried that, didn't work.
Pretty much I'm trying to increase the amount of gold the player needs to buy stuff, so originally I was gonna hack the gold and just find the "sub" opcode and double the amount taken; though with more thought put into it I found that it would be a bit messy...
So I thought if I hack the vendor prices I could double or triple them from their normal prices, that would be much less messy; apparentely it ain't so easy :/
Zanzer wrote: |
edit:
1. Are you able to level the discount while a vendor window is open?
2. Do the gold values decrease as you level it?
3. If so, find those gold values and look through the code that accesses them.
Several lines above may be the discount variable. |
1. No, but I can straight after open a vendor window
2. Yes
3. Tried that, no luck. I tried to search for "increased" "Decreased" and even just "changed", still nothing! Man, this game is making me go crazy!
All the other variables were simple to hack; the hp of the player, the exp, even the damage you do... |
|
Back to top |
|
|
Zanzer I post too much Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Sun Feb 22, 2015 4:36 pm Post subject: |
|
|
So you haven't been able to find the player's gold value at all?
Have you found an item's durability?
Hopefully the game's structure has other related variables in the same location.
See if you can just browse close by and find the item's value property.
You can then right-click that and Find out what accesses this address.
Then go up and open the trade window. Some code should get the base value, then multiply/divide it by your discount. |
|
Back to top |
|
|
deama1234 Master Cheater Reputation: 3
Joined: 20 Dec 2014 Posts: 328
|
Posted: Sun Feb 22, 2015 5:17 pm Post subject: |
|
|
Zanzer wrote: | So you haven't been able to find the player's gold value at all?
Have you found an item's durability?
Hopefully the game's structure has other related variables in the same location.
See if you can just browse close by and find the item's value property.
You can then right-click that and Find out what accesses this address.
Then go up and open the trade window. Some code should get the base value, then multiply/divide it by your discount. |
Nope, can't find the gold AT ALL; though I can find the gold "display" on the character's stat sheet; but that doesn't do anything...
Well, I found the durability and looked at the opcodes, can't seem to find the price nearby, maybe it's some weird "fld qword [eax+blabalba]" or something. At anyrate, even if I found the price, wouldn't it effect that weapon? I need it to effect every item in the game. |
|
Back to top |
|
|
Zanzer I post too much Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Sun Feb 22, 2015 5:41 pm Post subject: |
|
|
No, I meant to browse the memory region (bottom half of the memory viewer) around the durability value.
Try a display type to 4-byte and float. Look around the general area for a number matching the weapon's value.
Once you find that, you can find the code that accesses that value. |
|
Back to top |
|
|
deama1234 Master Cheater Reputation: 3
Joined: 20 Dec 2014 Posts: 328
|
Posted: Mon Feb 23, 2015 3:09 pm Post subject: |
|
|
Zanzer wrote: | No, I meant to browse the memory region (bottom half of the memory viewer) around the durability value.
Try a display type to 4-byte and float. Look around the general area for a number matching the weapon's value.
Once you find that, you can find the code that accesses that value. |
Well, I found the durability (it's a 4 byte integer, how nice of them...), then I managed to find the max durability, the first damage number and the second damage number; however, there is no sign of the price...
I think the problem lies in trying to even find the base value of the item, as it changes depending on the durability of it, your skill, and your relationship with the "vendor"...
Since cheat engine highlights changes in the memory viewer as a red colour, I thought maybe if I changed the durability the price would also change (when I change the durability it instantly changes it in-game too), but I didn't see any reds pop up nearby. So I'm guessing it uses some other thing somewhere far away to calculate the price; but I think the base price should be nearby somewhere... |
|
Back to top |
|
|
Zanzer I post too much Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Mon Feb 23, 2015 7:55 pm Post subject: |
|
|
Chances are the game does not update the value in memory. The value is calculated on the fly.
So when you go to the vender, it loads the full value, then applies all the math you mentioned before displaying the number.
It is also likely that the value is assigned to a general item type, and not your specific item.
In this case, there is likely a pointer around those values you found which takes you to a new structure containing the item's value.
By the way, I grabbed the game just so I could give you a hand. I'll post something shortly
edit:
Well this is a pain in the butt...
Gold counts as a normal inventory item with a stack size (obviously).
Maximum gold stack size is 50,000 by the way.
Quantities are stored as 2-bytes, except the bytes are reversed.
So a decimal 20 (0x0014) should be stored as bytes 14 00.
However, the game reverses those to 00 14, so the value is decimal 5120 (0x1400).
What's worse is the address is not aligned to a 2-byte memory address, so you'll need to turn off Fast Scan.
Trying to make a script to help you find the value. |
|
Back to top |
|
|
deama1234 Master Cheater Reputation: 3
Joined: 20 Dec 2014 Posts: 328
|
Posted: Tue Feb 24, 2015 8:08 am Post subject: |
|
|
Zanzer wrote: |
edit:
Well this is a pain in the butt...
Gold counts as a normal inventory item with a stack size (obviously).
Maximum gold stack size is 50,000 by the way.
Quantities are stored as 2-bytes, except the bytes are reversed.
So a decimal 20 (0x0014) should be stored as bytes 14 00.
However, the game reverses those to 00 14, so the value is decimal 5120 (0x1400).
What's worse is the address is not aligned to a 2-byte memory address, so you'll need to turn off Fast Scan.
Trying to make a script to help you find the value. |
Could you explain this "Fast Scan" thing? All I get is stuff like "unaligned memory" and "aligned memory" by googling that...
EDIT: Just playing with that value... it's so weird how they implemented gold; why couldn't they do it more simply???
EDIT2: Well, I manged to find the base-price, it's reversed just like the quantity...
it's just right from the quantity in the memory viewer. |
|
Back to top |
|
|
Zanzer I post too much Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Thu Feb 26, 2015 7:30 pm Post subject: |
|
|
Just checking, did you find what you needed?
Here's my table with the various pointers and hacks I've played around with.
It allows you to set the vendor's purchase and sale multipliers.
They default at 10x purchase price and 1/4 sale price. I believe you wanted the opposite, but you can see how it's done.
You can go to the vendor's base address and see various other 4-byte and float values which may have significance to things.
Play around and see what all you can break. |
|
Back to top |
|
|
deama1234 Master Cheater Reputation: 3
Joined: 20 Dec 2014 Posts: 328
|
Posted: Sat Feb 28, 2015 8:44 am Post subject: |
|
|
Zanzer wrote: | Just checking, did you find what you needed?
Here's my table with the various pointers and hacks I've played around with.
It allows you to set the vendor's purchase and sale multipliers.
They default at 10x purchase price and 1/4 sale price. I believe you wanted the opposite, but you can see how it's done.
You can go to the vendor's base address and see various other 4-byte and float values which may have significance to things.
Play around and see what all you can break. |
Damn, how did you find all that stuff???
None seem to work, when I try to activate them they don't, when I force their execution they pop an error out "Error while scanning for AOB's : vendor_buy
Error:"
The numbers are all "??" as well; what version of the game you got? |
|
Back to top |
|
|
Zanzer I post too much Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Sat Feb 28, 2015 2:48 pm Post subject: |
|
|
I am using GOG version 1.0062A. Some scene release.
Are you using the original release? Is the process still "div.exe"?
The values were rather easy to find once I found something relating to the vendor.
I used the relationship value, Neutral (0), to find the vendor. Started search at 0.
Stole something in front of him to reduce it, searched -30.
Stole again, etc. Of course, they become aggressive quite fast.
Found out what instructions accessed this address and found the base pointer.
base+1C4 == Relationship (4 byte)
base+208 == Sell Price Multiplier (float)
base+20C == Buy Price Multiplier (float)
Now you can't simply set those values because they are calculated through some other values. Probably by other values in the same memory region. But instead of trying to figure that out, I simply found out what instructions accessed the multipliers. I hacked the calculation so that it simply puts the final float value I want into the address. |
|
Back to top |
|
|
deama1234 Master Cheater Reputation: 3
Joined: 20 Dec 2014 Posts: 328
|
Posted: Sat Feb 28, 2015 8:36 pm Post subject: |
|
|
Zanzer wrote: | I am using GOG version 1.0062A. Some scene release.
Are you using the original release? Is the process still "div.exe"?
The values were rather easy to find once I found something relating to the vendor.
I used the relationship value, Neutral (0), to find the vendor. Started search at 0.
Stole something in front of him to reduce it, searched -30.
Stole again, etc. Of course, they become aggressive quite fast.
Found out what instructions accessed this address and found the base pointer.
base+1C4 == Relationship (4 byte)
base+208 == Sell Price Multiplier (float)
base+20C == Buy Price Multiplier (float)
Now you can't simply set those values because they are calculated through some other values. Probably by other values in the same memory region. But instead of trying to figure that out, I simply found out what instructions accessed the multipliers. I hacked the calculation so that it simply puts the final float value I want into the address. |
Hmm, I use the same version...
Oh, I see, makes sense... |
|
Back to top |
|
|
|