<?xml version="1.0" encoding="utf-8"?>
<CheatTable CheatEngineTableVersion="16">
  <CheatEntries>
    <CheatEntry>
      <ID>0</ID>
      <Description>"Spellforce Platinum Edition Script (AOB)"</Description>
      <Options moHideChildren="1"/>
      <Color>80000008</Color>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>{
===========================================
 Spellforce - Platinum Edition
 Game Version  : 1.54.75000
 Script Version: 2.0
 CE Version    : 6.0
 GodMode, Mana, Resource, XP and points
 01-Aug-2010
 15-Aug-2010 (God Mode also for buildings - AOB Version)
 15-Feb-2011 Added _MonMoneyS and _MonMoneyB
 By Recifense
===========================================
}

[ENABLE]
//=========================================
alloc(MyCode,1024)
//=========================================

aobscan(aobMonHP,66 8b 44 01 48 66 89 85 3c fe ff ff)
aobscan(aobMonMana,66 8b 44 01 56 66 89 85 38 fe ff ff)
aobscan(aobMonRes,03 d0 8b 44 91 0b c2 0c 00)
aobscan(aobMonXP,8b 4a 04 66 8b 52 08 03 c6)
aobscan(aobMonSP,66 ff 88 d3 00 00 00 8b c7 5f 5e)
aobscan(aobMonAP,66 ff 88 d1 00 00 00 8b c7 5f 5e 5d)
aobscan(aobGodMode,66 89 41 06 5b 59 c2 04 00)
aobscan(aobGodModeB,8d 4c 81 11 33 c0 66 8b 01 66 3b c2 ?? ?? 2b c2 66 89 01 c2 08 00)
aobscan(aobMonMoneyS,89 7c 24 10 89 74 24 0c b9 05 00 00 00 8d 74 24 08) //+08
aobscan(aobMonMoneyB,2b fa 89 7c 24 1c 8b 7c 24 2c b9 05 00 00 00 8d 74 24 10 f3 a5) //+0A

//=========================================
// Declaration section
label(pMonHP)
label(pMonMana)
label(pMonRes)
label(pMonXP)
label(pMonSP)
label(pMonAP)
label(pGodMode)
label(pGodModeB)
label(pMonMoneyS)
label(pMonMoneyB)
label(_MonHP)
label(_BackMH)
label(_ExitMH)
label(_MonMana)
label(_BackMM)
label(_ExitMM)
label(_MonRes)
label(_BackMR)
label(_ExitMR)
label(_MonXP)
label(_BackMX)
label(_ExitMX)
label(_MonSP)
label(_BackMS)
label(_ExitMS)
label(_MonAP)
label(_BackMA)
label(_ExitMA)
label(_GodMode)
label(_GodModeZ)
label(_BackGM)
label(_ExitGM)
label(_GodModeB)
label(_BackGMB)
label(_ExitGMB)
label(_MonMoneyS)
label(_BackMMS)
label(_ExitMMS)
label(_MonMoneyB)
label(_BackMMB)
label(_ExitMMB)
label(pHero)
label(pRes)
label(pMoney)
label(iEnableMH)
label(iEnableGodmodeZ)
label(iEnableGodmodeB)
label(iEnableMM)
label(iEnableMR)
label(iEnableMX)
label(iEnableMSA)
label(iEnableMMo)
label(iMinMoney)
label(iEAX)

registersymbol(MyCode)
registersymbol(pHero)
registersymbol(pRes)
registersymbol(pMoney)
registersymbol(iEnableMH)
registersymbol(iEnableGodmodeZ)
registersymbol(iEnableGodmodeB)
registersymbol(iEnableMM)
registersymbol(iEnableMR)
registersymbol(iEnableMX)
registersymbol(iEnableMSA)
registersymbol(iEnableMMo)
registersymbol(iMinMoney)
registersymbol(pMonHP)
registersymbol(pMonMana)
registersymbol(pMonRes)
registersymbol(pMonXP)
registersymbol(pMonSP)
registersymbol(pMonAP)
registersymbol(pGodMode)
registersymbol(pGodModeB)
registersymbol(pMonMoneyS)
registersymbol(pMonMoneyB)

//=========================================
MyCode:
//=========================================
_MonHP:
 cmp dword ptr [iEnableMH],0
 je short _ExitMH                // Jump if feature is disabled

 cmp dword ptr [iEnableGodmodeZ],0
 jne short _ExitMH               // MonHP is disabled if Godmode Z is used

 cmp byte ptr [ecx+eax+1c],01   // Playerﾂｴs unit ?
 jne short _ExitMH

 mov word ptr [ecx+eax+48],0000 // Negative HP = 0

_ExitMH:
 mov ax,[ecx+eax+48]            // Original code
 jmp _BackMH                    // Back to main code

//=========================================
_MonMana:
 cmp dword ptr [iEnableMM],0
 je _ExitMM                     // Jump if feature is disabled

 cmp byte ptr [ecx+eax+1c],01   // Playerﾂｴs unit ?
 jne _ExitMM

 mov word ptr [ecx+eax+56],0000 // Negative HP = 0

_ExitMM:
 mov ax,[ecx+eax+56]            // Original code
 jmp _BackMM                    // Back to main code

//=========================================
_MonRes:
 add edx,eax                    // Original code

 mov [pRes],ecx                 // Save pointer for debugging

 cmp dword ptr [iEnableMR],0
 je _ExitMR                     // Jump if feature is disabled

 cmp dword ptr [ecx+edx*4+0b],0 // Is thare some of this resource?
 je _ExitMR                     // Jump if false

 mov eax,#4000                  // Get minimum resource value

 cmp eax,[ecx+edx*4+0b]         // Current value &amp;gt;= minimum?
 jle _ExitMR                    // Jump if true

 mov [ecx+edx*4+0b],eax         // Update current resource value

_ExitMR:
 mov eax,[ecx+edx*4+0b]         // Original code
 jmp _BackMR                    // Back to main code

//=========================================
_MonXP:
 mov ecx,[edx+04]               // Original code
 mov dx,[edx+08]                // Original code

 cmp dword ptr [iEnableMX],0
 je _ExitMX                     // Jump if feature is disabled

 mov eax,ecx                    // Make current XP = Next Level Value

_ExitMX:
 jmp _BackMX                    // Back to main code

//=========================================
// Stat Points
_MonSP:
 cmp dword ptr [iEnableMSA],0
 je _ExitMS                     // Jump if feature is disabled

 inc word ptr [eax+000000d3]    // Points = Points + 1

_ExitMS:
 dec word ptr [eax+000000d3]    // Original code
 jmp _BackMS                    // Back to main code

//=========================================
// Ability Points
_MonAP:
 cmp dword ptr [iEnableMSA],0
 je _ExitMA                     // Jump if feature is disabled

 inc word ptr [eax+000000d1]    // Points = Points + 1

_ExitMA:
 dec word ptr [eax+000000d1]    // Original code
 jmp _BackMA                    // Back to main code

//=========================================
_GodMode:
 cmp byte ptr [ecx-26],01       // Playerﾂｴs unit ?
 jne short _ExitGM

 cmp dword ptr [iEnableGodmodeZ],0
 jne short _GodModeZ            // Jump if Godmode Z is enabled

 cmp dword ptr [iEnableMH],0
 je short _ExitGM               // Jump if feature is disabled

 xor eax,eax                    // Negative HP = 0

_ExitGM:
 mov [ecx+06],ax                // Original code
 pop ebx                        // Original code
 jmp _BackGM                    // Back to main code

_GodModeZ:
  cmp ax, word [ecx]             //hp+damage = max HP ?
  jne short _ExitGM              //no-&gt;apply damage

  sub eax,edx                    // undo the previous add eax,edx if the player is receiving damage equal or greater than his remaning hp
jmp short _ExitGM

//=========================================
_GodModeB:
 cmp dword ptr [iEnableGodmodeB],0
 je _ExitGMB                    // Jump if feature is disabled

 cmp byte ptr [ecx-09],01       // Playerﾂｴs Building ?
 jne _ExitGMB                   // Jump if false

 xor edx,edx                    // Value2Decrease = 0
 mov ax,[ecx+04]                // Gt maximum HP

_ExitGMB:
 sub eax,edx                    // Original code
 mov [ecx],ax                   // Original code
 jmp _BackGMB                   // Back to main code

//=========================================
// On Selling
_MonMoneyS:
 mov [pMoney],eax

 cmp dword ptr [iEnableMMo],0
 je _ExitMMS                    // Jump if feature is disabled

 cmp edx,[iMinMoney]
 cmovl edx,[iMinMoney]
 mov ecx,[iMinMoney]
 cmp ecx,[esp+0c]
 cmovl ecx,[esp+0c]
 mov [esp+0c],ecx
 mov ecx,[iMinMoney]
 cmp ecx,[esp+10]
 cmovl ecx,[esp+10]
 mov [esp+10],ecx

_ExitMMS:
 mov ecx,00000005               // Original code
 jmp _BackMMS                   // Back to main code

//=========================================
// On Buying
_MonMoneyB:
 mov [pMoney],edi

 cmp dword ptr [iEnableMMo],0
 je _ExitMMB                    // Jump if feature is disabled

 mov ecx,[iMinMoney]
 cmp ecx,[esp+10]
 cmovl ecx,[esp+10]
 mov [esp+10],ecx
 mov ecx,[iMinMoney]
 cmp ecx,[esp+14]
 cmovl ecx,[esp+14]
 mov [esp+14],ecx
 mov ecx,[iMinMoney]
 cmp ecx,[esp+18]
 cmovl ecx,[esp+18]
 mov [esp+18],ecx

_ExitMMB:
 mov ecx,00000005               // Original code
 jmp _BackMMB                   // Back to main code

//=========================================
// Variables
pHero:
 dd 0
pRes:
 dd 0
pMoney:
 dd 0
iEnableMH:
 dd 1
iEnableGodmodeZ:
 dd 1
iEnableGodmodeB:
 dd 1
iEnableMM:
 dd 1
iEnableMR:
 dd 1
iEnableMX:
 dd 1
iEnableMSA:
 dd 1
iEnableMMo:
 dd 1
iMinMoney:
 dd #5000
iEAX:
 dd 0

//=========================================
// Hacking Points
//SpellForce.exe+3fdc38:
aobMonHP:
pMonHP:
 jmp _MonHP
_BackMH:

//SpellForce.exe+3fdc62:
aobMonMana:
pMonMana:
 jmp _MonMana
_BackMM:

//SpellForce.exe+23e96c:
aobMonRes:
pMonRes:
 jmp _MonRes
 nop
_BackMR:

//SpellForce.exe+674c89:
aobMonXP:
pMonXP:
 jmp _MonXP
 nop
 nop
_BackMX:

//SpellForce.exe+6741e4:
aobMonSP:
pMonSP:
 jmp _MonSP
 nop
 nop
_BackMS:

//SpellForce.exe+67415b:
aobMonAP:
pMonAP:
 jmp _MonAP
 nop
 nop
_BackMA:

//SpellForce.exe+454890:
aobGodMode:
pGodMode:
 jmp _GodMode
_BackGM:

//SpellForce.exe+3418b1:
aobGodModeB+0e:
pGodModeB:
 jmp _GodModeB
_BackGMB:

aobMonMoneyS+08:
pMonMoneyS:
 jmp _MonMoneyS
_BackMMS:

aobMonMoneyB+0A:
pMonMoneyB:
 jmp _MonMoneyB
_BackMMB:

//=========================================
// Original Codes
[DISABLE]
//SpellForce.exe+3fdc38:
pMonHP:
// mov ax,[ecx+eax+48]
 db 66,8b,44,01,48

//SpellForce.exe+3fdc62:
pMonMana:
// mov ax,[ecx+eax+56]
 db 66,8b,44,01,56

//SpellForce.exe+23e96c:
pMonRes:
// add edx,eax
 db 03,d0
 mov eax,[ecx+edx*4+0b]

//SpellForce.exe+674c89:
pMonXP:
 mov ecx,[edx+04]
 mov dx,[edx+08]

//SpellForce.exe+6741e4:
pMonSP:
 dec word ptr [eax+000000d3]

//SpellForce.exe+67415b:
pMonAP:
 dec word ptr [eax+000000d1]

//SpellForce.exe+454890:
pGodMode:
 mov [ecx+06],ax
 pop ebx

//SpellForce.exe+3418b1:
pGodModeB:
// sub eax,edx
 db 2b,c2
 mov [ecx],ax

pMonMoneyS:
 mov ecx,00000005

pMonMoneyB:
 mov ecx,00000005

unregistersymbol(MyCode)
unregistersymbol(pHero)
unregistersymbol(pRes)
unregistersymbol(pMoney)
unregistersymbol(iEnableMH)
unregistersymbol(iEnableGodmodeZ)
unregistersymbol(iEnableGodmodeB)
unregistersymbol(iEnableMM)
unregistersymbol(iEnableMR)
unregistersymbol(iEnableMX)
unregistersymbol(iEnableMSA)
unregistersymbol(iEnableMMo)
unregistersymbol(iMinMoney)
unregistersymbol(pMonHP)
unregistersymbol(pMonMana)
unregistersymbol(pMonRes)
unregistersymbol(pMonXP)
unregistersymbol(pMonSP)
unregistersymbol(pMonAP)
unregistersymbol(pGodMode)
unregistersymbol(pGodModeB)
unregistersymbol(pMonMoneyS)
unregistersymbol(pMonMoneyB)

dealloc(MyCode)
</AssemblerScript>
      <CheatEntries>
        <CheatEntry>
          <ID>1</ID>
          <Description>"Enable/Disable God Mode (units only)"</Description>
          <Color>80000008</Color>
          <VariableType>4 Bytes</VariableType>
          <Address>iEnableMH</Address>
        </CheatEntry>
        <CheatEntry>
          <ID>9</ID>
          <Description>"Enable/Disable God Mode (Buildings only)"</Description>
          <Color>80000008</Color>
          <VariableType>4 Bytes</VariableType>
          <Address>iEnableGodmodeB</Address>
        </CheatEntry>
        <CheatEntry>
          <ID>8</ID>
          <Description>"Enable/Disable God ModeZ (1hit kills only)"</Description>
          <Color>80000008</Color>
          <VariableType>4 Bytes</VariableType>
          <Address>iEnableGodmodeZ</Address>
        </CheatEntry>
        <CheatEntry>
          <ID>2</ID>
          <Description>"Enable/Disable Fast Mana Refuel"</Description>
          <Color>80000008</Color>
          <VariableType>4 Bytes</VariableType>
          <Address>iEnableMM</Address>
        </CheatEntry>
        <CheatEntry>
          <ID>3</ID>
          <Description>"Enable/Disable Minimum Resources"</Description>
          <Color>80000008</Color>
          <VariableType>4 Bytes</VariableType>
          <Address>iEnableMR</Address>
        </CheatEntry>
        <CheatEntry>
          <ID>4</ID>
          <Description>"Enable/Disable Quick Level Up"</Description>
          <Color>80000008</Color>
          <VariableType>4 Bytes</VariableType>
          <Address>iEnableMX</Address>
        </CheatEntry>
        <CheatEntry>
          <ID>5</ID>
          <Description>"Enable/Disable Unlimted Points"</Description>
          <Color>80000008</Color>
          <VariableType>4 Bytes</VariableType>
          <Address>iEnableMSA</Address>
        </CheatEntry>
        <CheatEntry>
          <ID>6</ID>
          <Description>"Enable/Disable Minimum Money"</Description>
          <Color>80000008</Color>
          <VariableType>4 Bytes</VariableType>
          <Address>iEnableMMo</Address>
        </CheatEntry>
        <CheatEntry>
          <ID>7</ID>
          <Description>"Minimum Money Value"</Description>
          <Color>80000008</Color>
          <VariableType>4 Bytes</VariableType>
          <Address>iMinMoney</Address>
        </CheatEntry>
      </CheatEntries>
    </CheatEntry>
  </CheatEntries>
  <UserdefinedSymbols/>
  <Comments>===========================================
 Spellforce - Platinum Edition
 Game Version  : 1.54.75000
 Script Version: 2.0
 CE Version    : 6.0
 GodMode, Mana, Resource, XP and points
 01-Aug-2010
 15-Aug-2010 (God Mode also for buildings - AOB Version)
 15-Feb-2011 Added _MonMoneyS and _MonMoneyB
 By Recifense
===========================================
</Comments>
</CheatTable>
