| View previous topic :: View next topic |
| Author |
Message |
thefreestyle Cheater
Reputation: 0
Joined: 29 Oct 2015 Posts: 35
|
Posted: Thu Dec 17, 2015 2:15 pm Post subject: help finding ai\ computer units stats |
|
|
Hello everyone,
Now that i know how to change basic stats with CE, ie money my player health etc, i would like knowing how to find the AI \ Computer units stats (location, health, money etc) and modifying it, and i'm not sure where to start and what ways are there to achieve this, can anyone point me where to start ? what strategies you use ?
for start in RTS game like the 1st CnC:Red Alert
and then in games like Splinter Cell
Any help is much appreciated ! |
|
| Back to top |
|
 |
vng21092 Grandmaster Cheater
Reputation: 15
Joined: 05 Apr 2013 Posts: 644
|
Posted: Thu Dec 17, 2015 4:17 pm Post subject: |
|
|
| Literally, the same way you find your own. When you search for values, you know whose values you're searching for, C.E doesn't, C.E just looks for values you tell it to find. So, how do you find your health? You look for unknowns (maybe), get hurt, look for decreased, blah blah blah. Now do the same for the AI. Chances are, the instruction that handles your values, will probably manage the AIs as well. |
|
| Back to top |
|
 |
thefreestyle Cheater
Reputation: 0
Joined: 29 Oct 2015 Posts: 35
|
Posted: Thu Dec 17, 2015 5:50 pm Post subject: |
|
|
Hey vng21092
Thanks for reply.
Yes i tried that and for example in Red Alert i found the health of AI building, but now what ? i want to find all AI building and units and change their health, how can i do this ? My wild guess would be to find some address (which represents the AI player) and within a some offset of it there would be a list of all AI units, another offset would be a list of all AI building, and another offset would be some other AI data. But i really do not know how to find this address and offsets and i have feeling its got something to do with "dissect data/structures" |
|
| Back to top |
|
 |
Zanzer I post too much
Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Thu Dec 17, 2015 6:32 pm Post subject: |
|
|
Find out what accesses that address. This instruction will likely access the health of all units.
You can then create an AA script to change all addresses which pass through that instruction.
Now the trouble is that the instruction probably touches the player's units too.
So you'll need to look within that general memory location to find a value unique to the player.
For example, most games have an owner_id value close by health and the player is almost always assigned the value 0.
http://forum.cheatengine.org/viewtopic.php?t=572465
http://forum.cheatengine.org/viewtopic.php?t=583376
Best of luck! |
|
| Back to top |
|
 |
thefreestyle Cheater
Reputation: 0
Joined: 29 Oct 2015 Posts: 35
|
Posted: Sun Dec 20, 2015 1:24 pm Post subject: |
|
|
Hey Zanzer, thank you for your input it was helpful.
I finally managed to find the "owner_id" and make an invincibility mode. Yet i have a few more questions :
1. Once in a while invincibility is not working.. seems when unit is under massive fire it still takes damage, how does this happening and how can be solved?
2. What i found is one unit data (to whom it belongs) but how can i find AI other data, like money / power ? or all building, all units ?
units location coordinates ?
Thanks a lot in advance, |
|
| Back to top |
|
 |
Zanzer I post too much
Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Sun Dec 20, 2015 1:46 pm Post subject: |
|
|
I'm assuming your injection point is code that constantly queries unit health for display purposes or to check if dead.
For true invulnerability, you want to inject at the location which actually deals damage to the unit.
Otherwise, if the unit takes a hit that subtracts all of its health, the game will kill it before executing your script a second time to refill it.
Have you checked the instructions which access your money? Does the AI share one of those instructions?
If the AI uses different instructions, then you need to slaughter them up until a point where you can predict their values.
For example, start with an unknown initial value after killing all of their resource gatherers.
Now you know their resources are not increasing, so wait for them to build something and then rescan decreased value.
Or watch as their single gatherer returns to base and rescan increased value.
A little more difficult, sure. But doable. |
|
| Back to top |
|
 |
thefreestyle Cheater
Reputation: 0
Joined: 29 Oct 2015 Posts: 35
|
Posted: Sun Dec 20, 2015 2:48 pm Post subject: |
|
|
Ok Good idea Ill try that.
But still something is bothering me regarding invulnerability. Generally i can sweep the map with one tank and NOT take a hit, and then when i send few tanks to AI base usually once in a while i hear that unit is lost (and im not talking about some poor soldier RIP overrun by heavy machinery ) .
So my question is how come invulnerability is working most of the time ...
Feels like something is not adding up
EDIT:
For invulnerability i found the shared opcode for taking damage (both my units ans AIs) from this point how can i find the location which actually deals damage to the unit ? |
|
| Back to top |
|
 |
Zanzer I post too much
Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Sun Dec 20, 2015 3:14 pm Post subject: |
|
|
I'm assuming when the unit takes 1 hit, you found two new instructions.
One which reads the value of the address and then one which writes to the value.
Most of the time, you can simply prevent that new write instruction from executing.
Some games, however, perform the isDead() check in between those two instructions.
So you'll need to break and trace and find the instruction which is actually subtracting from the value after the initial read.
Example:
| Code: | mov eax,[ecx+0C] // first new instruction when getting hit
sub eax,ebx // instruction between the two that actually subtracts
mov [ecx+0c],eax // second new instruction when getting hit |
|
|
| Back to top |
|
 |
thefreestyle Cheater
Reputation: 0
Joined: 29 Oct 2015 Posts: 35
|
Posted: Sun Dec 20, 2015 4:03 pm Post subject: |
|
|
its a bit messy and i couldn't understand this, that what access when unit under attack (there are much more opcodes but only those change when taking damage):
| Code: |
004A33BF - 8B 58 1D - mov ebx,[eax+1D]
0051E08D - 8B 46 23 - mov eax,[esi+23]
0051E216 - 66 89 56 25 - mov [esi+25],dx // <-- thats where i inject
0051E236 - 83 38 FF - cmp dword ptr [eax],-01
004C1C5E - 8B 56 24 - mov edx,[esi+24]
005680E1 - 8B 50 24 - mov edx,[eax+24]
004C1D7F - 8B 56 24 - mov edx,[esi+24]
0051DF7B - 8B 58 21 - mov ebx,[eax+21]
|
in my injection point it says take what in "dx" and put it in [esi+25], which i suppose is units health, but i cant see no where where "dx" is populated.
It does not make any sense .. any ideas ?
And again, thanks a lot for help  |
|
| Back to top |
|
 |
Zanzer I post too much
Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Sun Dec 20, 2015 5:46 pm Post subject: |
|
|
Select "Find out what accesses this address" instead of "writes to" and you'll find where it retrieves the value.
You could similarly do:
| Code: | newmem:
cmp [esi+25],dx
jg code
mov [esi+25],dx
code:
cmp dword ptr [eax],-01 |
|
|
| Back to top |
|
 |
thefreestyle Cheater
Reputation: 0
Joined: 29 Oct 2015 Posts: 35
|
Posted: Mon Dec 21, 2015 11:04 am Post subject: |
|
|
Hey Zanzer, thanks again for your help
whats the meaning of last opcode ?
| Code: | | cmp dword ptr [eax],-01 |
EDIT:
Also found that the reason some units die anyway its seems because that the offset for owner_id is different .. some units have the right offset and thus are invulnerable, others die normally because offset not point to owner_id ..
Does this make any sense ? how could that be ? |
|
| Back to top |
|
 |
|