 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
mibiz Cheater
Reputation: 0
Joined: 14 Jun 2009 Posts: 31
|
Posted: Thu Sep 01, 2011 3:00 pm Post subject: Civilization V v1.1.348 city culture |
|
|
Hi everyone,
I'm trying to create a script/trainer for the mentioned game version and run into a problem. Could someone please help me troubleshoot this problem?
I found the selected city's culture to be at 2D919E9C having value of 15.
Disassembler information on the desired address:
| Code: | CvResourceInfo::isFeatureTerrain+20 - 8B 81 10020000 - mov eax,[ecx+00000210]
CvResourceInfo::isFeatureTerrain+26 - 8B 4C 24 04 - mov ecx,[esp+04]
CvResourceInfo::isFeatureTerrain+2A - 8B 04 88 - mov eax,[eax+ecx*4]
CvResourceInfo::isFeatureTerrain+2D - C2 0400 - ret 0004
CvPlayerColorInfo::GetColorTypePrimary - 8B 81 04010000 - mov eax,[ecx+00000104]
CvPlayerColorInfo::GetColorTypePrimary+6 - C3 - ret
CvPlayerColorInfo::GetColorTypePrimary+7 - CC - int 3 |
Debugging information for accessing the desired address:
| Code: | 0703A11A - 8B 04 88 - mov eax,[eax+ecx*4]
0703A11D - C2 0400 - ret 0004
0703A120 - 8B 81 04010000 - mov eax,[ecx+00000104] <<
0703A126 - C3 - ret
0703A127 - CC - int 3
EAX=0000000F
EBX=00000400
ECX=2D919D98
EDX=432C09C0
ESI=10DE2400
EDI=2D919D98
ESP=0018FAFC
EBP=00000001
EIP=0703A126 |
My AA script segments:
| Code: | _CityCulture:
mov [pCityCulture],ecx
// mov [pCityCulture],edi
cmp [iCityResources],0
je _ExitCityCulture
mov eax,[ecx+00000104]
cmp eax,[iCityCulture]
jge _ExitCityCulture
mov eax,[iCityCulture]
mov [ecx+00000104],eax
jmp _BackCityCulture
_ExitCityCulture:
mov eax,[ecx+00000104]
jmp _BackCityCulture
"CvGameCoreDLLFinal Release.dll"+CA120:
jmp _CityCulture
nop
_BackCityCulture:
[DISABLE]
"CvGameCoreDLLFinal Release.dll"+CA120: // city culture
mov eax,[ecx+00000104]
|
In the table, I've added a pointer pCityCulture+104 but it points to the wrong address with a different value. I've also tried it mov [pCityCulture],edi but still shows the incorrect address and value. This is done within the same turn.
Thanks for your time.
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 475
Joined: 09 May 2003 Posts: 25987 Location: The netherlands
|
Posted: Thu Sep 01, 2011 5:55 pm Post subject: |
|
|
The code you found is accesses by other stuff. In this case, it's accessed for every CvPlayerColorInfo object whenever GetColorTypePrimary is called
You will have to find a way to distinguish between cities and playercolors and then the specific city at that.
Perhaps you can find a different better address.
Tip: Look at the economics view when using find what accesses. Or do a next turn
_________________
Tools give you results. Knowledge gives you control.
Like my help? Join me on Patreon so i can keep helping |
|
| Back to top |
|
 |
mibiz Cheater
Reputation: 0
Joined: 14 Jun 2009 Posts: 31
|
Posted: Sat Sep 03, 2011 8:59 pm Post subject: |
|
|
| Thanks DB for the reply. You're right. After some more digging, I got the right address I was looking for.
|
|
| Back to top |
|
 |
|
|
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
|
|