Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted by Aragnir ( 15 years ago )
//=========================================
// Hearts of Iron III
// Game Version : 1.3
// Script Version: 1.0
// CE Version : 5.6
// Resources, Production, Research, City, God Mode, Weak Foe,
// Quick Ownership
// 22-Feb-2010
//=========================================
[ENABLE]
//=========================================
// Check if script is compatible to this game version
// If false the script will not be loaded
assert(hoi3game.exe+250c7c,81 7c b8 04 18 dd f5 05)
assert(hoi3game.exe+020435,8b 51 34 85 d2 56 8b 71)
assert(hoi3game.exe+0df46c,8b 8e fc 01 00 00 8b 14)
assert(hoi3game.exe+260e85,8b 48 20 89 4c 24 10 db)
assert(hoi3game.exe+15384c,39 86 a4 00 00 00 7e 06)
assert(hoi3game.exe+154729,8b bb ac 00 00 00 85 ff)
//=========================================
alloc(MyCode,1024)
//=========================================
// Declaration section
label(_MonResource)
label(_BackMRo)
label(_ExitMRo)
label(_MonProd)
label(_BackMP)
label(_ExitMP)
label(_MonP0)
label(_MonResearch)
label(_BackMRe)
label(_ExitMRe)
label(_MonCity)
label(_BackMC)
label(_ExitMC)
label(_MonC0)
label(_GodMode)
label(_BackGM)
label(_ExitGM)
label(_GodM0)
label(_MonUnits)
label(_BackMU)
label(_ExitMU)
label(_MonU0)
label(_MonU1)
label(_MonU2)
label(_MonU3)
label(_MonU4)
label(_MonU5)
label(iEnableMRo)
label(iEnableMP)
label(iEnableMRe)
label(iEnableMC)
label(iEnableGM)
label(iEnableWF)
label(iEnableQO)
label(iEnableMU)
label(pReso)
label(pProd)
label(pRese)
label(pCity)
label(pUnit)
label(iMinRP)
label(iPlayerID)
label(aLastRot)
registersymbol(MyCode)
registersymbol(pReso)
registersymbol(pProd)
registersymbol(pRese)
registersymbol(pCity)
registersymbol(pUnit)
registersymbol(iEnableMRo)
registersymbol(iEnableMP)
registersymbol(iEnableMRe)
registersymbol(iEnableMC)
registersymbol(iEnableGM)
registersymbol(iEnableWF)
registersymbol(iEnableQO)
registersymbol(iEnableMU)
registersymbol(iMinRP)
registersymbol(iPlayerID)
registersymbol(aLastRot)
//=========================================
// Hacking Points
hoi3game.exe+250c7c:
jmp _MonResource
nop
nop
nop
_BackMRo:
hoi3game.exe+020435:
jmp _MonProd
_BackMP:
hoi3game.exe+0df46c:
jmp _MonResearch
nop
_BackMRe:
hoi3game.exe+260e85:
jmp _MonCity
nop
nop
_BackMC:
hoi3game.exe+15384c:
jmp _GodMode
nop
_BackGM:
hoi3game.exe+154729:
jmp _MonUnits
nop
_BackMU:
MyCode:
//=========================================
_MonResource:
mov dword ptr [aLastRot],'Reso'
push ecx
mov ecx,[hoi3game.exe+942078]// Get ptr to Player Structure
mov ecx,[ecx+0000227c] // Get Player ID
mov [iPlayerID],ecx // Save ID for further use
pop ecx
cmp dword ptr [iEnableMRo],0
je _ExitMRo // Jump if feature is disabled
mov [pReso],eax // Save ptr for debugging
cmp [eax+edi*4+04],#50000000 // current value >= 50000?
jge _ExitMRo // Jump if true
mov [eax+edi*4+04],#50000000 // current value = 50000
_ExitMRo:
cmp [eax+edi*4+04],05f5dd18 // Original code
jmp _BackMRo // Back to main code
//=========================================
_MonProd:
mov dword ptr [aLastRot],'Prod'
cmp dword ptr [iEnableMP],0
je _ExitMP // Jump if feature is disabled
mov [pProd],ecx // Save ptr for debugging
mov edx,[ecx+30] // Get total production time
sub edx,[ecx+38] // Decrease 1 day
cmp dword ptr [ecx+34],0 // New production?
jne _MonP0 // Jump if false
sub edx,[ecx+38] // Decrease 1 more day
_MonP0:
mov [ecx+34],edx // Update current production time
_ExitMP:
mov edx,[ecx+34] // Original code
test edx,edx // Original code
jmp _BackMP // Back to main code
//=========================================
_MonResearch:
mov dword ptr [aLastRot],'Rese'
mov ecx,[esi+000001fc] // Original code
cmp dword ptr [iEnableMRe],0
je _ExitMRe // Jump if feature is disabled
mov [pRese],esi // Save ptr for debugging
mov edx,[iMinRP] // Get minimum Research Progress
cmp edx,[ecx+edi*4] // Current value >= Minimum ?
jle _ExitMRe // Jump if true
mov [ecx+edi*4],edx // Make current value = minimum
_ExitMRe:
jmp _BackMRe // Back to main code
//=========================================
_MonCity:
mov dword ptr [aLastRot],'City'
push edx
cmp dword ptr [iEnableMC],0
je _ExitMC // Jump if feature is disabled
mov edx,[eax+18] // Get ptr to City
mov [pCity],edx // Save ptr for debugging
mov ecx,[edx+00000280] // Get City Owner ID
cmp ecx,[iPlayerID] // Player?s city?
jne _MonC0 // Jump if false
mov dword ptr [edx+000002f0],0 // Revolt Risk = 0
mov dword ptr [edx+000002f8],0 // Revolt Risk = 0
mov ecx,[eax+1c] // Get maximum level
cmp ecx,[eax+20] // Current value = maximum ?
je _ExitMC // Jump if true
dec ecx // Make level almost complete
mov [eax+20],ecx // Update current level
jmp _ExitMC
_MonC0:
cmp dword ptr [iEnableQO],0
je _ExitMC // Jump if feature is disabled
mov ecx,[eax+18] // Get ptr to City
mov edx,[ecx+00000288] // Get City Invader ID
cmp edx,[iPlayerID] // Player?s Invasion?
jne _ExitMC // Jump if false
mov [ecx+00000280],edx // Update City owner
mov edx,[ecx+0000028c] // Get City Invader ID
mov [ecx+00000284],edx // Update City owner
_ExitMC:
pop edx
mov ecx,[eax+20] // Original code
mov [esp+10],ecx // Original code
jmp _BackMC // Back to main code
//=========================================
_GodMode:
mov dword ptr [aLastRot],'GodM'
cmp dword ptr [iEnableGM],0
je _ExitGM // Jump if feature is disabled
mov [pUnit],esi // Save ptr for debugging
mov eax,[esi+00000090] // Get Unit Owner ID
cmp eax,[iPlayerID] // Player?s Unit?
je _GodM0 // Jump if false
cmp dword ptr [iEnableWF],0
je _ExitGM // Jump if feature is disabled
mov eax,[esi+00000058]
mov [esi+000000a4],eax // Strength value to decrease = 0
mov eax,[esi+0000005c]
mov [esi+000000a8],eax // Organization value to decrease = 0
jmp _ExitGM // Jump if false
_GodM0:
xor eax,eax
mov [esi+000000a4],eax // Strength value to decrease = 0
mov [esi+000000a8],eax // Organization value to decrease = 0
_ExitGM:
mov eax,[esi+58] // Original code
cmp [esi+000000a4],eax // Original code
jmp _BackGM // Back to main code
//=========================================
_MonUnits:
mov dword ptr [aLastRot],'Unit'
push eax // Save context
push ebx
push ecx
push edi
push esi
mov edi,ebx // for Minimum changings
cmp dword ptr [iEnableMU],0
je _ExitMU // Jump if feature is disabled
mov ecx,[edi+000000ac] // Get ptr to Army
test ecx,ecx
jz _ExitMU // Jump if null pointer
mov eax,[edi+00000090] // Get Unit Owner ID
cmp eax,[iPlayerID] // Player?s Unit?
jne _ExitMU // Jump if false
mov esi,[ecx+000000cc] // Get pArmyInfo
test esi,esi
jz _ExitMU // Jump if null pointer
mov ebx,[edi+00000054] // Get pTroopInfo
test ebx,ebx
jz _ExitMU // Jump if null pointer
// EBX = TroopInfo, ECX = Army, EDI = Army_Troop, ESI = ArmyInfo
//--> Strength and Organization
mov eax,[ebx+000000c4] // Get Max Strength
mov [edi+00000058],eax // Make Currrent troop strength = max
mov eax,[ebx+000000c8] // Get Max Organization
mov [edi+0000005c],eax // Make Currrent troop Organization = max
//--> Food and Fuel
mov dword ptr [ecx+000000f4],#1000 // Food = 100%
mov dword ptr [ecx+000000f8],#1000 // Fuel = 100%
mov dword ptr [ecx+000000d8],00 // Hours2NextAttack = 0
//--> Morale
mov eax,#990
mov [ebx+000000cc],eax // Troop Morale = 99%
mov [esi+000000cc],eax // Army Morale = 99%
//--> Speed
mov eax,#90000
cmp eax,[esi+000000dc] // Current army speed >= 90?
jge _MonU0
mov eax,[esi+000000dc] // Get Army Speed
_MonU0:
cmp eax,[ebx+000000dc] // Current troop speed >= 90 or Army?
jge _MonU1
mov eax,[ebx+000000dc] // Get Troop Speed
_MonU1:
mov [ebx+000000dc],eax // Update Troop Speed
mov [esi+000000dc],eax // Update Army Speed
//--> Toughness
cmp dword ptr [ebx+000000f4],00
je _MonU2 // Jump if toughness is not applicable
mov eax,#10000
cmp eax,[ebx+000000f4] // Troop Toughness >= 10?
jle _MonU2 // Jump if true
sub eax,[ebx+000000f4] // Make eax = 10 - current value
add [ebx+000000f4],eax // Make current troop value = 10
add [esi+000000f4],eax // Update army toughness
//--> Soft Attack
_MonU2:
cmp dword ptr [ebx+00000104],00
je _MonU3 // Jump if Soft Attack is not applicable
mov eax,#10000
cmp eax,[ebx+00000104] // Troop Soft Attack >= 10?
jle _MonU3 // Jump if true
sub eax,[ebx+00000104] // Make eax = 10 - current value
add [ebx+00000104],eax // Make current troop value = 10
add [esi+00000104],eax // Update army Soft Attack
//--> Hard Attack
_MonU3:
cmp dword ptr [ebx+00000108],00
je _MonU4 // Jump if Hard Attack is not applicable
mov eax,#10000
cmp eax,[ebx+00000108] // Troop Hard Attack >= 10?
jle _MonU4 // Jump if true
sub eax,[ebx+00000108] // Make eax = 10 - current value
add [ebx+00000108],eax // Make current troop value = 10
add [esi+00000108],eax // Update army Hard Attack
//--> Hull
_MonU4:
cmp dword ptr [ebx+00000144],00
je _MonU5 // Jump if Hull is not applicable
mov eax,#10000
cmp eax,[ebx+00000144] // Troop Hull >= 10?
jle _MonU5 // Jump if true
sub eax,[ebx+00000144] // Make eax = 10 - current value
add [ebx+00000144],eax // Make current troop value = 10
add [esi+00000144],eax // Update army Hull
_MonU5:
_ExitMU:
pop esi // Recover context
pop edi
pop ecx
pop ebx
pop eax
mov edi,[ebx+000000ac] // Original code
jmp _BackMU // Back to main code
//=========================================
// Variables
pReso:
dd 0
pProd:
dd 0
pRese:
dd 0
pCity:
dd 0
pUnit:
dd 0
iEnableMRo:
dd 1
iEnableMP:
dd 1
iEnableMRe:
dd 1
iEnableMC:
dd 1
iEnableGM:
dd 1
iEnableWF:
dd 1
iEnableQO:
dd 1
iEnableMU:
dd 1
iMinRP:
dd #400000
iPlayerID:
dd 0
aLastRot:
dd 'last'
//=========================================
// Original Codes
[DISABLE]
hoi3game.exe+250c7c:
cmp [eax+edi*4+04],05f5dd18
hoi3game.exe+020435:
mov edx,[ecx+34]
test edx,edx
hoi3game.exe+0df46c:
mov ecx,[esi+000001fc]
hoi3game.exe+260e85:
mov ecx,[eax+20]
mov [esp+10],ecx
hoi3game.exe+15384c:
cmp [esi+000000a4],eax
hoi3game.exe+154729:
mov edi,[ebx+000000ac]
dealloc(MyCode)
unregistersymbol(MyCode)
unregistersymbol(pReso)
unregistersymbol(pProd)
unregistersymbol(pRese)
unregistersymbol(pCity)
unregistersymbol(pUnit)
unregistersymbol(iEnableMRo)
unregistersymbol(iEnableMP)
unregistersymbol(iEnableMRe)
unregistersymbol(iEnableMC)
unregistersymbol(iEnableGM)
unregistersymbol(iEnableWF)
unregistersymbol(iEnableQO)
unregistersymbol(iEnableMU)
unregistersymbol(iMinRP)
unregistersymbol(iPlayerID)
unregistersymbol(aLastRot)
Revise this Paste