<?xml version='1.0' encoding='utf-8'?>
<CheatTable CheatEngineTableVersion="45">
  <CheatEntries>
    <CheatEntry>
      <ID>1</ID>
      <Description>"Auto-Attach and Version Check"</Description>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
if not RA2YR then error("Allow this table to run its setup script, then try again.",0) end
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
{$asm}
</AssemblerScript>
    </CheatEntry>
    <CheatEntry>
      <ID>2</ID>
      <Description>"☕ Fuel the Cheats — Tip Katzy (Toggle to open my Ko-fi page)"</Description>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
if not RA2YR then error("Allow this table to run its setup script, then try again.",0) end
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
{$asm}
</AssemblerScript>
    </CheatEntry>
    <CheatEntry>
      <ID>3</ID>
      <Description>"How to use - Katzy"</Description>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
if not RA2YR then error("Allow this table to run its setup script, then try again.",0) end
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
{$asm}
</AssemblerScript>
    </CheatEntry>
    <CheatEntry>
      <ID>5</ID>
      <Description>"Restart Cheat Engine as Administrator"</Description>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
if not RA2YR then error("Allow this table to run its setup script, then try again.",0) end
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
{$asm}
</AssemblerScript>
    </CheatEntry>
    <CheatEntry>
      <ID>4</ID>
      <Description>"Clear All"</Description>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
if not RA2YR then error("Allow this table to run its setup script, then try again.",0) end
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
{$asm}
</AssemblerScript>
    </CheatEntry>
    <CheatEntry>
      <ID>10</ID>
      <Description>"[MAIN] Command &amp; Conquer: Red Alert 2"</Description>
      <Options moHideChildren="1" />
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
if not RA2YR then error("Allow this table to run its setup script, then try again.",0) end
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
{$asm}
</AssemblerScript>
      <CheatEntries>
        <CheatEntry>
          <ID>11</ID>
          <Description>"Infinite Money"</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
if not RA2YR then error("Allow this table to run its setup script, then try again.",0) end
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
{$asm}
</AssemblerScript>
        </CheatEntry>
        <CheatEntry>
          <ID>12</ID>
          <Description>"Infinite Power"</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
if not RA2YR then error("Allow this table to run its setup script, then try again.",0) end
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
{$asm}
</AssemblerScript>
        </CheatEntry>
        <CheatEntry>
          <ID>13</ID>
          <Description>"Instant Build"</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
if not RA2YR then error("Allow this table to run its setup script, then try again.",0) end
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
{$asm}
</AssemblerScript>
        </CheatEntry>
        <CheatEntry>
          <ID>14</ID>
          <Description>"Infinite Aircraft Ammo"</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
if not RA2YR then error("Allow this table to run its setup script, then try again.",0) end
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
{$asm}
</AssemblerScript>
        </CheatEntry>
        <CheatEntry>
          <ID>15</ID>
          <Description>"Instant Superweapons"</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
if not RA2YR then error("Allow this table to run its setup script, then try again.",0) end
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
{$asm}
</AssemblerScript>
        </CheatEntry>
        <CheatEntry>
          <ID>18</ID>
          <Description>"Invulnerability - Selected Units and Buildings"</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
if not RA2YR then error("Allow this table to run its setup script, then try again.",0) end
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
{$asm}
</AssemblerScript>
        </CheatEntry>
        <CheatEntry>
          <ID>17</ID>
          <Description>"Reveal Map - Full"</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
if not RA2YR then error("Allow this table to run its setup script, then try again.",0) end
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
{$asm}
</AssemblerScript>
        </CheatEntry>
        <CheatEntry>
          <ID>16</ID>
          <Description>"Reveal Map - Visual Only"</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
if not RA2YR then error("Allow this table to run its setup script, then try again.",0) end
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
{$asm}
</AssemblerScript>
        </CheatEntry>
        <CheatEntry>
          <ID>19</ID>
          <Description>"Promote Selected Units - Maximum Veterancy (One Shot)"</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
if not RA2YR then error("Allow this table to run its setup script, then try again.",0) end
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
{$asm}
</AssemblerScript>
        </CheatEntry>
      </CheatEntries>
    </CheatEntry>
    <CheatEntry>
      <ID>20</ID>
      <Description>"[MAIN] Command &amp; Conquer: Yuri's Revenge and Mental Omega"</Description>
      <Options moHideChildren="1" />
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
if not RA2YR then error("Allow this table to run its setup script, then try again.",0) end
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
{$asm}
</AssemblerScript>
      <CheatEntries>
        <CheatEntry>
          <ID>21</ID>
          <Description>"Infinite Money"</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
if not RA2YR then error("Allow this table to run its setup script, then try again.",0) end
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
{$asm}
</AssemblerScript>
        </CheatEntry>
        <CheatEntry>
          <ID>22</ID>
          <Description>"Infinite Power"</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
if not RA2YR then error("Allow this table to run its setup script, then try again.",0) end
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
{$asm}
</AssemblerScript>
        </CheatEntry>
        <CheatEntry>
          <ID>23</ID>
          <Description>"Instant Build"</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
if not RA2YR then error("Allow this table to run its setup script, then try again.",0) end
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
{$asm}
</AssemblerScript>
        </CheatEntry>
        <CheatEntry>
          <ID>24</ID>
          <Description>"Infinite Aircraft Ammo"</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
if not RA2YR then error("Allow this table to run its setup script, then try again.",0) end
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
{$asm}
</AssemblerScript>
        </CheatEntry>
        <CheatEntry>
          <ID>25</ID>
          <Description>"Instant Superweapons"</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
if not RA2YR then error("Allow this table to run its setup script, then try again.",0) end
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
{$asm}
</AssemblerScript>
        </CheatEntry>
        <CheatEntry>
          <ID>28</ID>
          <Description>"Invulnerability - Selected Units and Buildings"</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
if not RA2YR then error("Allow this table to run its setup script, then try again.",0) end
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
{$asm}
</AssemblerScript>
        </CheatEntry>
        <CheatEntry>
          <ID>27</ID>
          <Description>"Reveal Map - Full"</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
if not RA2YR then error("Allow this table to run its setup script, then try again.",0) end
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
{$asm}
</AssemblerScript>
        </CheatEntry>
        <CheatEntry>
          <ID>26</ID>
          <Description>"Reveal Map - Visual Only"</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
if not RA2YR then error("Allow this table to run its setup script, then try again.",0) end
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
{$asm}
</AssemblerScript>
        </CheatEntry>
        <CheatEntry>
          <ID>29</ID>
          <Description>"Promote Selected Units - Maximum Veterancy (One Shot)"</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
if not RA2YR then error("Allow this table to run its setup script, then try again.",0) end
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
{$asm}
</AssemblerScript>
        </CheatEntry>
      </CheatEntries>
    </CheatEntry>
  </CheatEntries>
  <UserdefinedSymbols />
  <LuaScript>--[[
Table identification: Katzy
Command &amp; Conquer Red Alert 2 and Yuri's Revenge | v1.35
RA2 1.0.0.1 and Yuri's Revenge 1.0.1.1; Steam build 15918130.
Original installed code independently disassembled. Highest stock cost 5000;
difficulty cost factors 1.0. Allowance 30000 by explicit user preference.
Mental Omega 3.3.6 uses its independently validated mod profile. CnCReloaded is unsupported.
]]
if RA2YR then
  -- Releases 1.5/1.6 requested NOP 2, which CE emits as 66 90.
  -- Reconcile only the exact recorded jump plus that known padding variant.
  for feature,state in pairs(RA2YR.active or {}) do
    if feature=='ammo' and getOpenedProcessID()==state.pid then
      for _,site in ipairs(state.sites or {}) do
        local expected=site.patched
        if expected and #expected==7 and expected[1]==0xE9 and expected[6]==0x90 and expected[7]==0x90 then
          local actual=readBytes(site.address,7,true)
          local match=actual and actual[6]==0x66 and actual[7]==0x90
          for i=1,5 do if not actual or actual[i]~=expected[i] then match=false end end
          if match then site.patched=actual end
        end
      end
    end
  end
  if next(RA2YR.active or {}) then
    if not RA2YR.shutdown() then error('Clear the previous table first.',0) end
  else
    -- A failed setup may leave a disabled timer and already-destroyed records.
    if RA2YR.timer then RA2YR.timer.destroy();RA2YR.timer=nil end
    if RA2YR.close then getMainForm().unregisterCloseCallback(RA2YR.close);RA2YR.close=nil end
    if RA2YR.closeQuery and getMainForm().OnCloseQuery==RA2YR.closeQuery then getMainForm().OnCloseQuery=RA2YR.previousCloseQuery end
  end
end
if RA2YRScaffold then RA2YRScaffold.shutdown(); RA2YRScaffold=nil end
local S={resumeProfiles={},active={},profiles={[ [=[ra2]=] ]={[ [=[exe]=] ]=[=[game.exe]=],[ [=[version]=] ]=[=[1.0.0.1]=],[ [=[md5]=] ]=[=[799c80c40f28a350b64e52f44f02ea9a]=],[ [=[title]=] ]=[=[Command &amp; Conquer Red Alert 2]=]},[ [=[yr]=] ]={[ [=[exe]=] ]=[=[gamemd.exe]=],[ [=[version]=] ]=[=[1.0.1.1]=],[ [=[md5]=] ]=[=[2a1307f6f57c9c492f985b4e3afb88e6]=],[ [=[title]=] ]=[=[Command &amp; Conquer Yuri's Revenge]=],[ [=[archives]=] ]={[ [=[ra2.mix]=] ]=[=[4509764448090c5d6497e4255d1db5d7]=],[ [=[ra2md.mix]=] ]=[=[995d8d6a21f7b17627bbaeaf96814330]=],[ [=[expandmd01.mix]=] ]=[=[faefa0d8fae321c01e7dc5cf6c153c06]=]}}},sites={{[ [=[group]=] ]=[=[money]=],[ [=[rva]=] ]=928608,[ [=[original]=] ]=[=[E8 AB C5 29 00]=],[ [=[pattern]=] ]=[=[E8 AB C5 29 00 5E 59 C2 04 00 90 90 90 90 90 90 56 8B 74 24 08 8D 8E 18]=],[ [=[body]=] ]=[=[call game.exe+0x37F110
pushfd
cmp dword ptr [game.exe+0x63D298],0
je mode_ok
cmp dword ptr [game.exe+0x63D298],5
jne original
mode_ok:
push edx
mov edx,esi
sub edx,0x24
cmp edx,[game.exe+0x635DB4]
pop edx
jne original
cmp eax,0x7FFF8ACF
jg capped
add eax,#30000
jmp original
capped:
mov eax,0x7FFFFFFF
original:
popfd
jmp RETURN]=]},{[ [=[group]=] ]=[=[power]=],[ [=[rva]=] ]=928439,[ [=[original]=] ]=[=[8B 88 A8 52 00 00]=],[ [=[pattern]=] ]=[=[8B 88 A8 52 00 00 8B B0 AC 52 00 00 3B CE 5E 0F 9D C2 8A C2 C2 04 00 90]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x63D298],0
je mode_ok
cmp dword ptr [game.exe+0x63D298],5
jne original
mode_ok:
push edx
mov edx,eax
sub edx,0x28
cmp edx,[game.exe+0x635DB4]
pop edx
jne original
mov ecx,[eax+0x52AC]
add ecx,#5000
popfd
jmp RETURN
original:
popfd
db 8B 88 A8 52 00 00
jmp RETURN]=]},{[ [=[group]=] ]=[=[power]=],[ [=[rva]=] ]=928676,[ [=[original]=] ]=[=[8B 80 AC 52 00 00]=],[ [=[pattern]=] ]=[=[8B 80 AC 52 00 00 C2 04 00 90 90 90 8B 44 24 04 8B 80 B0 52 00 00 C2 04]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x63D298],0
je mode_ok
cmp dword ptr [game.exe+0x63D298],5
jne original
mode_ok:
push edx
mov edx,eax
sub edx,0x24
cmp edx,[game.exe+0x635DB4]
pop edx
jne original
mov eax,[eax+0x52B0]
add eax,#5000
popfd
jmp RETURN
original:
popfd
db 8B 80 AC 52 00 00
jmp RETURN]=]},{[ [=[group]=] ]=[=[power]=],[ [=[rva]=] ]=935997,[ [=[original]=] ]=[=[8B 8E D0 52 00 00]=],[ [=[pattern]=] ]=[=[8B 8E D0 52 00 00 8B 86 D4 52 00 00 3B C8 89 4C 24 10 89 44 24 14 0F 8D]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x63D298],0
je mode_ok
cmp dword ptr [game.exe+0x63D298],5
jne original
mode_ok:
cmp esi,[game.exe+0x635DB4]
jne original
mov ecx,[esi+0x52D4]
add ecx,#5000
popfd
jmp RETURN
original:
popfd
db 8B 8E D0 52 00 00
jmp RETURN]=]},{[ [=[group]=] ]=[=[power]=],[ [=[rva]=] ]=951091,[ [=[original]=] ]=[=[8B 81 D0 52 00 00]=],[ [=[pattern]=] ]=[=[8B 81 D0 52 00 00 8B 89 D4 52 00 00 3B C1 89 44 24 00 89 4C 24 04 7D 1E]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x63D298],0
je mode_ok
cmp dword ptr [game.exe+0x63D298],5
jne original
mode_ok:
cmp ecx,[game.exe+0x635DB4]
jne original
mov eax,[ecx+0x52D4]
add eax,#5000
popfd
jmp RETURN
original:
popfd
db 8B 81 D0 52 00 00
jmp RETURN]=]},{[ [=[group]=] ]=[=[power]=],[ [=[rva]=] ]=956796,[ [=[original]=] ]=[=[8B 95 D0 52 00 00]=],[ [=[pattern]=] ]=[=[8B 95 D0 52 00 00 8B 34 81 8B 85 88 5F 01 00 2B D0 8B 85 D4 52 00 00 8B]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x63D298],0
je mode_ok
cmp dword ptr [game.exe+0x63D298],5
jne original
mode_ok:
cmp ebp,[game.exe+0x635DB4]
jne original
mov edx,[ebp+0x52D4]
add edx,#5000
popfd
jmp RETURN
original:
popfd
db 8B 95 D0 52 00 00
jmp RETURN]=]},{[ [=[group]=] ]=[=[power]=],[ [=[rva]=] ]=968473,[ [=[original]=] ]=[=[8B 96 D0 52 00 00]=],[ [=[pattern]=] ]=[=[8B 96 D0 52 00 00 8B BE D4 52 00 00 8B 0D 74 07 A4 00 3B D7 0F 9C C0 85 C9 88 44 24 38 0F 85 02]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x63D298],0
je mode_ok
cmp dword ptr [game.exe+0x63D298],5
jne original
mode_ok:
cmp esi,[game.exe+0x635DB4]
jne original
mov edx,[esi+0x52D4]
add edx,#5000
popfd
jmp RETURN
original:
popfd
db 8B 96 D0 52 00 00
jmp RETURN]=]},{[ [=[group]=] ]=[=[power]=],[ [=[rva]=] ]=968802,[ [=[original]=] ]=[=[8B 9E D0 52 00 00]=],[ [=[pattern]=] ]=[=[8B 9E D0 52 00 00 3B D8 0F 9C C3 03 C1 8B CE 89 86 D4 52 00 00 E8 34 01]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x63D298],0
je mode_ok
cmp dword ptr [game.exe+0x63D298],5
jne original
mode_ok:
cmp esi,[game.exe+0x635DB4]
jne original
mov ebx,[esi+0x52D4]
add ebx,#5000
popfd
jmp RETURN
original:
popfd
db 8B 9E D0 52 00 00
jmp RETURN]=]},{[ [=[group]=] ]=[=[power]=],[ [=[rva]=] ]=968828,[ [=[original]=] ]=[=[8B 96 D0 52 00 00]=],[ [=[pattern]=] ]=[=[8B 96 D0 52 00 00 8B BE D4 52 00 00 8B 0D 74 07 A4 00 3B D7 0F 9C C0 85 C9 88 44 24 38 0F 85 FE]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x63D298],0
je mode_ok
cmp dword ptr [game.exe+0x63D298],5
jne original
mode_ok:
cmp esi,[game.exe+0x635DB4]
jne original
mov edx,[esi+0x52D4]
add edx,#5000
popfd
jmp RETURN
original:
popfd
db 8B 96 D0 52 00 00
jmp RETURN]=]},{[ [=[group]=] ]=[=[power]=],[ [=[rva]=] ]=994505,[ [=[original]=] ]=[=[8B 8E D0 52 00 00]=],[ [=[pattern]=] ]=[=[8B 8E D0 52 00 00 8B 86 D4 52 00 00 3B C8 89 4C 24 08 89 44 24 0C 7D 24 3B C3 74 20 3B CB 74 15 DB 44 24 08 DA 74 24 0C DC 1D 08 A7 79 00 DF E0 F6 C4 01 74 07 C6 44 24]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x63D298],0
je mode_ok
cmp dword ptr [game.exe+0x63D298],5
jne original
mode_ok:
cmp esi,[game.exe+0x635DB4]
jne original
mov ecx,[esi+0x52D4]
add ecx,#5000
popfd
jmp RETURN
original:
popfd
db 8B 8E D0 52 00 00
jmp RETURN]=]},{[ [=[group]=] ]=[=[power]=],[ [=[rva]=] ]=994793,[ [=[original]=] ]=[=[8B 8E D0 52 00 00]=],[ [=[pattern]=] ]=[=[8B 8E D0 52 00 00 8B 86 D4 52 00 00 3B C8 89 4C 24 08 89 44 24 0C 7D 24 3B C3 74 20 3B CB 74 15 DB 44 24 08 DA 74 24 0C DC 1D 08 A7 79 00 DF E0 F6 C4 01 74 07 B8 01 00]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x63D298],0
je mode_ok
cmp dword ptr [game.exe+0x63D298],5
jne original
mode_ok:
cmp esi,[game.exe+0x635DB4]
jne original
mov ecx,[esi+0x52D4]
add ecx,#5000
popfd
jmp RETURN
original:
popfd
db 8B 8E D0 52 00 00
jmp RETURN]=]},{[ [=[group]=] ]=[=[power]=],[ [=[rva]=] ]=994986,[ [=[original]=] ]=[=[8B 91 D0 52 00 00]=],[ [=[pattern]=] ]=[=[8B 91 D0 52 00 00 8B 81 D4 52 00 00 3B D0 89 54 24 14 89 44 24 18 7D 25]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x63D298],0
je mode_ok
cmp dword ptr [game.exe+0x63D298],5
jne original
mode_ok:
cmp ecx,[game.exe+0x635DB4]
jne original
mov edx,[ecx+0x52D4]
add edx,#5000
popfd
jmp RETURN
original:
popfd
db 8B 91 D0 52 00 00
jmp RETURN]=]},{[ [=[group]=] ]=[=[power]=],[ [=[rva]=] ]=997482,[ [=[original]=] ]=[=[8B 86 D0 52 00 00]=],[ [=[pattern]=] ]=[=[8B 86 D0 52 00 00 3B D0 7F 18 A1 90 D2 A3 00 6A 01 6A 00 8D 88 18 02 00]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x63D298],0
je mode_ok
cmp dword ptr [game.exe+0x63D298],5
jne original
mode_ok:
cmp esi,[game.exe+0x635DB4]
jne original
mov eax,[esi+0x52D4]
add eax,#5000
popfd
jmp RETURN
original:
popfd
db 8B 86 D0 52 00 00
jmp RETURN]=]},{[ [=[group]=] ]=[=[power]=],[ [=[rva]=] ]=1002630,[ [=[original]=] ]=[=[8B 8D D0 52 00 00]=],[ [=[pattern]=] ]=[=[8B 8D D0 52 00 00 8B 85 D4 52 00 00 3B C8 89 4C 24 1C 89 44 24 18 7D 1F]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x63D298],0
je mode_ok
cmp dword ptr [game.exe+0x63D298],5
jne original
mode_ok:
cmp ebp,[game.exe+0x635DB4]
jne original
mov ecx,[ebp+0x52D4]
add ecx,#5000
popfd
jmp RETURN
original:
popfd
db 8B 8D D0 52 00 00
jmp RETURN]=]},{[ [=[group]=] ]=[=[power]=],[ [=[rva]=] ]=1003125,[ [=[original]=] ]=[=[8B 8D D0 52 00 00]=],[ [=[pattern]=] ]=[=[8B 8D D0 52 00 00 8B 85 D4 52 00 00 3B C8 89 4C 24 14 89 44 24 18 7D 24]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x63D298],0
je mode_ok
cmp dword ptr [game.exe+0x63D298],5
jne original
mode_ok:
cmp ebp,[game.exe+0x635DB4]
jne original
mov ecx,[ebp+0x52D4]
add ecx,#5000
popfd
jmp RETURN
original:
popfd
db 8B 8D D0 52 00 00
jmp RETURN]=]},{[ [=[group]=] ]=[=[power]=],[ [=[rva]=] ]=2216406,[ [=[original]=] ]=[=[8B 90 D0 52 00 00]=],[ [=[pattern]=] ]=[=[8B 90 D0 52 00 00 51 52 68 96 02 00 00 68 28 BF 7E 00 33 D2 B9 18 BF 7E]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x63D298],0
je mode_ok
cmp dword ptr [game.exe+0x63D298],5
jne original
mode_ok:
cmp eax,[game.exe+0x635DB4]
jne original
mov edx,[eax+0x52D4]
add edx,#5000
popfd
jmp RETURN
original:
popfd
db 8B 90 D0 52 00 00
jmp RETURN]=]},{[ [=[group]=] ]=[=[power]=],[ [=[rva]=] ]=968453,[ [=[original]=] ]=[=[3B C3 0F 9C C3]=],[ [=[pattern]=] ]=[=[3B C3 0F 9C C3 03 C1 8B CE 89 86 D0 52 00 00 E8 97 02 00 00 8B 96 D0 52]=],[ [=[body]=] ]=[=[cmp eax,ebx
setl bl
pushfd
cmp dword ptr [game.exe+0x63D298],0
je mode_ok
cmp dword ptr [game.exe+0x63D298],5
jne original
mode_ok:
cmp esi,[game.exe+0x635DB4]
jne original
mov bl,0
original:
popfd
jmp RETURN]=]},{[ [=[group]=] ]=[=[build]=],[ [=[rva]=] ]=758594,[ [=[original]=] ]=[=[8D 7E 28 8B CF]=],[ [=[pattern]=] ]=[=[8D 7E 28 8B CF E8 64 AB F9 FF 85 C0 0F 85 C0 00 00 00 8B 4E 34 85 C9 0F]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x63D298],0
je mode_ok
cmp dword ptr [game.exe+0x63D298],5
jne original
mode_ok:
push eax
mov eax,[esi+0x68]
cmp eax,[game.exe+0x635DB4]
pop eax
jne original
cmp dword ptr [esi+0x54],0
je original
cmp dword ptr [esi+0x34],0
jle original
cmp dword ptr [esi+0x24],0
jl original
cmp dword ptr [esi+0x24],#54
jge original
pushad
mov eax,[esi+0x68]
add eax,0x24
push eax
call game.exe+0xE2B30
cmp eax,[esi+0x5C]
popad
jl original
popfd
lea edi,[esi+0x28]
mov ecx,[esi+0x34]
mov eax,#54
sub eax,[esi+0x24]
jmp game.exe+0xB9362
original:
popfd
lea edi,[esi+0x28]
mov ecx,edi
jmp RETURN]=]},{[ [=[group]=] ]=[=[build]=],[ [=[rva]=] ]=945589,[ [=[original]=] ]=[=[8B 17 56 8B CF]=],[ [=[pattern]=] ]=[=[8B 17 56 8B CF FF 92 F8 00 00 00 83 F8 02 74 56 83 F8 01 75 16 8B 07 8B]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x63D298],0
je mode_ok
cmp dword ptr [game.exe+0x63D298],5
jne original
mode_ok:
cmp ebp,[game.exe+0x635DB4]
jne original
cmp dword ptr [edi],game.exe+0x39CBBC
jne original
cmp dword ptr [edi+0x41C],0
je original
mov byte ptr [ebx+0x59],1
popfd
jmp game.exe+0xE6D6F
original:
popfd
mov edx,[edi]
push esi
mov ecx,edi
jmp RETURN]=]},{[ [=[group]=] ]=[=[build]=],[ [=[rva]=] ]=945644,[ [=[original]=] ]=[=[68 E0 A4 7D 00]=],[ [=[pattern]=] ]=[=[68 E0 A4 7D 00 E8 FA FA F1 FF 8B 44 24 4C 8B 4C 24 48 8B 54 24 44 83 C4]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x63D298],0
je mode_ok
cmp dword ptr [game.exe+0x63D298],5
jne original
mode_ok:
cmp ebp,[game.exe+0x635DB4]
jne original
mov byte ptr [ebx+0x59],1
popfd
jmp game.exe+0xE6E0F
original:
popfd
push game.exe+0x3DA4E0
jmp RETURN]=]},{[ [=[group]=] ]=[=[ammo]=],[ [=[rva]=] ]=85069,[ [=[original]=] ]=[=[48 89 86 54 02 00 00]=],[ [=[pattern]=] ]=[=[48 89 86 54 02 00 00 8B CE E8 E5 F8 1B 00 8B 0D 48 98 83 00 DC 99 70 13]=],[ [=[body]=] ]=[=[pushfd
push edx
mov edx,[esi+0x1B4]
cmp dword ptr [game.exe+0x63D298],0
je mode_ok
cmp dword ptr [game.exe+0x63D298],5
jne original
mode_ok:
cmp edx,[game.exe+0x635DB4]
jne original
cmp dword ptr [esi],game.exe+0x39B12C
jne original
cmp eax,0
jle original
pop edx
popfd
jmp RETURN
original:
pop edx
popfd
dec eax
mov [esi+0x254],eax
jmp RETURN]=]},{[ [=[group]=] ]=[=[ammo]=],[ [=[rva]=] ]=96527,[ [=[original]=] ]=[=[48 89 86 54 02 00 00]=],[ [=[pattern]=] ]=[=[48 89 86 54 02 00 00 8B 86 28 02 00 00 3B C3 0F 84 86 06 00 00 39 9E 54]=],[ [=[body]=] ]=[=[pushfd
push edx
mov edx,[esi+0x1B4]
cmp dword ptr [game.exe+0x63D298],0
je mode_ok
cmp dword ptr [game.exe+0x63D298],5
jne original
mode_ok:
cmp edx,[game.exe+0x635DB4]
jne original
cmp dword ptr [esi],game.exe+0x39B12C
jne original
cmp eax,0
jle original
pop edx
popfd
jmp RETURN
original:
pop edx
popfd
dec eax
mov [esi+0x254],eax
jmp RETURN]=]},{[ [=[group]=] ]=[=[ammo]=],[ [=[rva]=] ]=96631,[ [=[original]=] ]=[=[48 89 86 54 02 00 00]=],[ [=[pattern]=] ]=[=[48 89 86 54 02 00 00 8B 86 28 02 00 00 88 9E BA 05 00 00 3B C3 0F 84 3A]=],[ [=[body]=] ]=[=[pushfd
push edx
mov edx,[esi+0x1B4]
cmp dword ptr [game.exe+0x63D298],0
je mode_ok
cmp dword ptr [game.exe+0x63D298],5
jne original
mode_ok:
cmp edx,[game.exe+0x635DB4]
jne original
cmp dword ptr [esi],game.exe+0x39B12C
jne original
cmp eax,0
jle original
pop edx
popfd
jmp RETURN
original:
pop edx
popfd
dec eax
mov [esi+0x254],eax
jmp RETURN]=]},{[ [=[group]=] ]=[=[ammo]=],[ [=[rva]=] ]=99342,[ [=[original]=] ]=[=[48 89 86 54 02 00 00]=],[ [=[pattern]=] ]=[=[48 89 86 54 02 00 00 39 9E 54 02 00 00 75 5F 38 9E 2C 03 00 00 75 0F 8B]=],[ [=[body]=] ]=[=[pushfd
push edx
mov edx,[esi+0x1B4]
cmp dword ptr [game.exe+0x63D298],0
je mode_ok
cmp dword ptr [game.exe+0x63D298],5
jne original
mode_ok:
cmp edx,[game.exe+0x635DB4]
jne original
cmp dword ptr [esi],game.exe+0x39B12C
jne original
cmp eax,0
jle original
pop edx
popfd
jmp RETURN
original:
pop edx
popfd
dec eax
mov [esi+0x254],eax
jmp RETURN]=]},{[ [=[group]=] ]=[=[super]=],[ [=[rva]=] ]=2741270,[ [=[original]=] ]=[=[8B 28 8B 48 08]=],[ [=[pattern]=] ]=[=[8B 28 8B 48 08 3B EA 74 0E 8B 3D 2C 0D A4 00 2B FD 3B F9 7D 0A 2B CF 85]=],[ [=[body]=] ]=[=[pushfd
push ecx
mov ecx,[esi+0x28]
cmp dword ptr [game.exe+0x63D298],0
je mode_ok
cmp dword ptr [game.exe+0x63D298],5
jne original
mode_ok:
cmp ecx,[game.exe+0x635DB4]
jne original
mov ecx,[esi+0x24]
cmp byte ptr [ecx+0xDD],0
jne original
mov dword ptr [eax+8],0
original:
pop ecx
popfd
mov ebp,[eax]
mov ecx,[eax+8]
jmp RETURN]=]},{[ [=[group]=] ]=[=[visual]=],[ [=[rva]=] ]=480544,[ [=[original]=] ]=[=[53 55 56 8B F1]=],[ [=[pattern]=] ]=[=[53 55 56 8B F1 8B 0D 6C 99 83 00 57 8D 7E 24 6A 00 57 E8 09 38 23 00 88]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x63D298],0
je mode_ok
cmp dword ptr [game.exe+0x63D298],5
jne original
mode_ok:
popfd
ret 8
original:
popfd
push ebx
push ebp
push esi
mov esi,ecx
jmp RETURN]=]},{[ [=[group]=] ]=[=[visual]=],[ [=[rva]=] ]=2790938,[ [=[original]=] ]=[=[E8 A1 ED EB FF]=],[ [=[pattern]=] ]=[=[E8 A1 ED EB FF 84 C0 0F 85 25 04 00 00 8B 06 8D 8C 24 C4 00 00 00 51 8B]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x63D298],0
je mode_ok
cmp dword ptr [game.exe+0x63D298],5
jne original
mode_ok:
popfd
add esp,4
mov al,0
jmp RETURN
original:
popfd
call game.exe+0x1683C0
jmp RETURN]=]},{[ [=[group]=] ]=[=[visual]=],[ [=[rva]=] ]=2791502,[ [=[original]=] ]=[=[E8 6D EB EB FF]=],[ [=[pattern]=] ]=[=[E8 6D EB EB FF 84 C0 0F 85 F1 01 00 00 8B 16 6A 00 E9 39 FF FF FF 83 F8]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x63D298],0
je mode_ok
cmp dword ptr [game.exe+0x63D298],5
jne original
mode_ok:
popfd
add esp,4
mov al,0
jmp RETURN
original:
popfd
call game.exe+0x1683C0
jmp RETURN]=]},{[ [=[group]=] ]=[=[visual]=],[ [=[rva]=] ]=2791647,[ [=[original]=] ]=[=[E8 DC EA EB FF]=],[ [=[pattern]=] ]=[=[E8 DC EA EB FF 84 C0 0F 85 60 01 00 00 8B 16 C6 86 85 00 00 00 01 6A 00]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x63D298],0
je mode_ok
cmp dword ptr [game.exe+0x63D298],5
jne original
mode_ok:
popfd
add esp,4
mov al,0
jmp RETURN
original:
popfd
call game.exe+0x1683C0
jmp RETURN]=]},{[ [=[group]=] ]=[=[visual]=],[ [=[rva]=] ]=2792605,[ [=[original]=] ]=[=[E8 1E E7 EB FF]=],[ [=[pattern]=] ]=[=[E8 1E E7 EB FF 84 C0 0F 85 25 01 00 00 8B 13 8D 84 24 A4 00 00 00 50 8B]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x63D298],0
je mode_ok
cmp dword ptr [game.exe+0x63D298],5
jne original
mode_ok:
popfd
add esp,4
mov al,0
jmp RETURN
original:
popfd
call game.exe+0x1683C0
jmp RETURN]=]},{[ [=[group]=] ]=[=[visual]=],[ [=[rva]=] ]=82515,[ [=[original]=] ]=[=[E8 68 41 15 00]=],[ [=[pattern]=] ]=[=[E8 68 41 15 00 84 C0 74 3A 8B 0E 8B 56 04 8B 46 08 89 4C 24 20 8D 4C 24]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x63D298],0
je mode_ok
cmp dword ptr [game.exe+0x63D298],5
jne original
mode_ok:
popfd
add esp,4
mov al,0
jmp RETURN
original:
popfd
call game.exe+0x1683C0
jmp RETURN]=]},{[ [=[group]=] ]=[=[visual]=],[ [=[rva]=] ]=82554,[ [=[original]=] ]=[=[E8 41 41 15 00]=],[ [=[pattern]=] ]=[=[E8 41 41 15 00 84 C0 74 13 8B 8D B4 01 00 00 E8 22 10 0E 00 84 C0 0F 84]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x63D298],0
je mode_ok
cmp dword ptr [game.exe+0x63D298],5
jne original
mode_ok:
popfd
add esp,4
mov al,0
jmp RETURN
original:
popfd
call game.exe+0x1683C0
jmp RETURN]=]},{[ [=[group]=] ]=[=[visual]=],[ [=[rva]=] ]=240900,[ [=[original]=] ]=[=[E8 B7 D6 12 00]=],[ [=[pattern]=] ]=[=[E8 B7 D6 12 00 84 C0 75 4D 8D 4C 24 34 51 B9 E0 24 83 00 E8 A4 D6 12 00]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x63D298],0
je mode_ok
cmp dword ptr [game.exe+0x63D298],5
jne original
mode_ok:
popfd
add esp,4
mov al,0
jmp RETURN
original:
popfd
call game.exe+0x1683C0
jmp RETURN]=]},{[ [=[group]=] ]=[=[visual]=],[ [=[rva]=] ]=240919,[ [=[original]=] ]=[=[E8 A4 D6 12 00]=],[ [=[pattern]=] ]=[=[E8 A4 D6 12 00 84 C0 75 3A 8B 06 8D 54 24 28 8D 8C 24 18 01 00 00 52 51]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x63D298],0
je mode_ok
cmp dword ptr [game.exe+0x63D298],5
jne original
mode_ok:
popfd
add esp,4
mov al,0
jmp RETURN
original:
popfd
call game.exe+0x1683C0
jmp RETURN]=]},{[ [=[group]=] ]=[=[visual]=],[ [=[rva]=] ]=2785439,[ [=[original]=] ]=[=[E8 AC 4A DD FF]=],[ [=[pattern]=] ]=[=[E8 AC 4A DD FF 84 C0 0F 85 4C 01 00 00 83 BE EC 00 00 00 02 74 08 85 FF]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x63D298],0
je mode_ok
cmp dword ptr [game.exe+0x63D298],5
jne original
mode_ok:
popfd
mov al,0
jmp RETURN
original:
popfd
call game.exe+0x7CB50
jmp RETURN]=]},{[ [=[group]=] ]=[=[visual]=],[ [=[rva]=] ]=2895059,[ [=[original]=] ]=[=[E8 78 9E DB FF]=],[ [=[pattern]=] ]=[=[E8 78 9E DB FF 84 C0 75 66 8B 16 8D 4C 24 0C 8D 44 24 5C 51 50 8B CE FF]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x63D298],0
je mode_ok
cmp dword ptr [game.exe+0x63D298],5
jne original
mode_ok:
popfd
mov al,0
jmp RETURN
original:
popfd
call game.exe+0x7CB50
jmp RETURN]=]},{[ [=[group]=] ]=[=[visual]=],[ [=[rva]=] ]=2895254,[ [=[original]=] ]=[=[E8 B5 9D DB FF]=],[ [=[pattern]=] ]=[=[E8 B5 9D DB FF 84 C0 0F 85 8E 00 00 00 8B 16 8D 4C 24 0C 8D 44 24 5C 51]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x63D298],0
je mode_ok
cmp dword ptr [game.exe+0x63D298],5
jne original
mode_ok:
popfd
mov al,0
jmp RETURN
original:
popfd
call game.exe+0x7CB50
jmp RETURN]=]},{[ [=[group]=] ]=[=[visual]=],[ [=[rva]=] ]=2785423,[ [=[original]=] ]=[=[8A 86 2C 01 00 00]=],[ [=[pattern]=] ]=[=[8A 86 2C 01 00 00 A8 10 0F 84 5B 01 00 00 8B CE E8 AC 4A DD FF 84 C0 0F]=],[ [=[body]=] ]=[=[mov al,[esi+0x12C]
pushfd
cmp dword ptr [game.exe+0x63D298],0
je mode_ok
cmp dword ptr [game.exe+0x63D298],5
jne original
mode_ok:
or al,0x18
original:
popfd
jmp RETURN]=]},{[ [=[group]=] ]=[=[reveal]=],[ [=[rva]=] ]=480544,[ [=[original]=] ]=[=[53 55 56 8B F1]=],[ [=[pattern]=] ]=[=[53 55 56 8B F1 8B 0D 6C 99 83 00 57 8D 7E 24 6A 00 57 E8 09 38 23 00 88]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x63D298],0
je mode_ok
cmp dword ptr [game.exe+0x63D298],5
jne original
mode_ok:
popfd
ret 8
original:
popfd
push ebx
push ebp
push esi
mov esi,ecx
jmp RETURN]=]},{[ [=[group]=] ]=[=[reveal]=],[ [=[rva]=] ]=2790938,[ [=[original]=] ]=[=[E8 A1 ED EB FF]=],[ [=[pattern]=] ]=[=[E8 A1 ED EB FF 84 C0 0F 85 25 04 00 00 8B 06 8D 8C 24 C4 00 00 00 51 8B]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x63D298],0
je mode_ok
cmp dword ptr [game.exe+0x63D298],5
jne original
mode_ok:
popfd
add esp,4
mov al,0
jmp RETURN
original:
popfd
call game.exe+0x1683C0
jmp RETURN]=]},{[ [=[group]=] ]=[=[reveal]=],[ [=[rva]=] ]=2791502,[ [=[original]=] ]=[=[E8 6D EB EB FF]=],[ [=[pattern]=] ]=[=[E8 6D EB EB FF 84 C0 0F 85 F1 01 00 00 8B 16 6A 00 E9 39 FF FF FF 83 F8]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x63D298],0
je mode_ok
cmp dword ptr [game.exe+0x63D298],5
jne original
mode_ok:
popfd
add esp,4
mov al,0
jmp RETURN
original:
popfd
call game.exe+0x1683C0
jmp RETURN]=]},{[ [=[group]=] ]=[=[reveal]=],[ [=[rva]=] ]=2791647,[ [=[original]=] ]=[=[E8 DC EA EB FF]=],[ [=[pattern]=] ]=[=[E8 DC EA EB FF 84 C0 0F 85 60 01 00 00 8B 16 C6 86 85 00 00 00 01 6A 00]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x63D298],0
je mode_ok
cmp dword ptr [game.exe+0x63D298],5
jne original
mode_ok:
popfd
add esp,4
mov al,0
jmp RETURN
original:
popfd
call game.exe+0x1683C0
jmp RETURN]=]},{[ [=[group]=] ]=[=[reveal]=],[ [=[rva]=] ]=2792605,[ [=[original]=] ]=[=[E8 1E E7 EB FF]=],[ [=[pattern]=] ]=[=[E8 1E E7 EB FF 84 C0 0F 85 25 01 00 00 8B 13 8D 84 24 A4 00 00 00 50 8B]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x63D298],0
je mode_ok
cmp dword ptr [game.exe+0x63D298],5
jne original
mode_ok:
popfd
add esp,4
mov al,0
jmp RETURN
original:
popfd
call game.exe+0x1683C0
jmp RETURN]=]},{[ [=[group]=] ]=[=[reveal]=],[ [=[rva]=] ]=82515,[ [=[original]=] ]=[=[E8 68 41 15 00]=],[ [=[pattern]=] ]=[=[E8 68 41 15 00 84 C0 74 3A 8B 0E 8B 56 04 8B 46 08 89 4C 24 20 8D 4C 24]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x63D298],0
je mode_ok
cmp dword ptr [game.exe+0x63D298],5
jne original
mode_ok:
popfd
add esp,4
mov al,0
jmp RETURN
original:
popfd
call game.exe+0x1683C0
jmp RETURN]=]},{[ [=[group]=] ]=[=[reveal]=],[ [=[rva]=] ]=82554,[ [=[original]=] ]=[=[E8 41 41 15 00]=],[ [=[pattern]=] ]=[=[E8 41 41 15 00 84 C0 74 13 8B 8D B4 01 00 00 E8 22 10 0E 00 84 C0 0F 84]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x63D298],0
je mode_ok
cmp dword ptr [game.exe+0x63D298],5
jne original
mode_ok:
popfd
add esp,4
mov al,0
jmp RETURN
original:
popfd
call game.exe+0x1683C0
jmp RETURN]=]},{[ [=[group]=] ]=[=[reveal]=],[ [=[rva]=] ]=240900,[ [=[original]=] ]=[=[E8 B7 D6 12 00]=],[ [=[pattern]=] ]=[=[E8 B7 D6 12 00 84 C0 75 4D 8D 4C 24 34 51 B9 E0 24 83 00 E8 A4 D6 12 00]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x63D298],0
je mode_ok
cmp dword ptr [game.exe+0x63D298],5
jne original
mode_ok:
popfd
add esp,4
mov al,0
jmp RETURN
original:
popfd
call game.exe+0x1683C0
jmp RETURN]=]},{[ [=[group]=] ]=[=[reveal]=],[ [=[rva]=] ]=240919,[ [=[original]=] ]=[=[E8 A4 D6 12 00]=],[ [=[pattern]=] ]=[=[E8 A4 D6 12 00 84 C0 75 3A 8B 06 8D 54 24 28 8D 8C 24 18 01 00 00 52 51]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x63D298],0
je mode_ok
cmp dword ptr [game.exe+0x63D298],5
jne original
mode_ok:
popfd
add esp,4
mov al,0
jmp RETURN
original:
popfd
call game.exe+0x1683C0
jmp RETURN]=]},{[ [=[group]=] ]=[=[reveal]=],[ [=[rva]=] ]=2785439,[ [=[original]=] ]=[=[E8 AC 4A DD FF]=],[ [=[pattern]=] ]=[=[E8 AC 4A DD FF 84 C0 0F 85 4C 01 00 00 83 BE EC 00 00 00 02 74 08 85 FF]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x63D298],0
je mode_ok
cmp dword ptr [game.exe+0x63D298],5
jne original
mode_ok:
popfd
mov al,0
jmp RETURN
original:
popfd
call game.exe+0x7CB50
jmp RETURN]=]},{[ [=[group]=] ]=[=[reveal]=],[ [=[rva]=] ]=2895059,[ [=[original]=] ]=[=[E8 78 9E DB FF]=],[ [=[pattern]=] ]=[=[E8 78 9E DB FF 84 C0 75 66 8B 16 8D 4C 24 0C 8D 44 24 5C 51 50 8B CE FF]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x63D298],0
je mode_ok
cmp dword ptr [game.exe+0x63D298],5
jne original
mode_ok:
popfd
mov al,0
jmp RETURN
original:
popfd
call game.exe+0x7CB50
jmp RETURN]=]},{[ [=[group]=] ]=[=[reveal]=],[ [=[rva]=] ]=2895254,[ [=[original]=] ]=[=[E8 B5 9D DB FF]=],[ [=[pattern]=] ]=[=[E8 B5 9D DB FF 84 C0 0F 85 8E 00 00 00 8B 16 8D 4C 24 0C 8D 44 24 5C 51]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x63D298],0
je mode_ok
cmp dword ptr [game.exe+0x63D298],5
jne original
mode_ok:
popfd
mov al,0
jmp RETURN
original:
popfd
call game.exe+0x7CB50
jmp RETURN]=]},{[ [=[group]=] ]=[=[reveal]=],[ [=[rva]=] ]=2785423,[ [=[original]=] ]=[=[8A 86 2C 01 00 00]=],[ [=[pattern]=] ]=[=[8A 86 2C 01 00 00 A8 10 0F 84 5B 01 00 00 8B CE E8 AC 4A DD FF 84 C0 0F]=],[ [=[body]=] ]=[=[mov al,[esi+0x12C]
pushfd
cmp dword ptr [game.exe+0x63D298],0
je mode_ok
cmp dword ptr [game.exe+0x63D298],5
jne original
mode_ok:
or al,0x18
original:
popfd
jmp RETURN]=]},{[ [=[group]=] ]=[=[visual]=],[ [=[rva]=] ]=2302207,[ [=[original]=] ]=[=[E8 3C 60 F3 FF]=],[ [=[pattern]=] ]=[=[E8 3C 60 F3 FF 84 C0 C6 44 24 44 01 75 05 C6 44 24 44 00 39 2D D8 63 B2]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x63D298],0
je mode_ok
cmp dword ptr [game.exe+0x63D298],5
jne original
mode_ok:
popfd
add esp,4
mov al,0
jmp RETURN
original:
popfd
call game.exe+0x168140
jmp RETURN]=]},{[ [=[group]=] ]=[=[reveal]=],[ [=[rva]=] ]=2302207,[ [=[original]=] ]=[=[E8 3C 60 F3 FF]=],[ [=[pattern]=] ]=[=[E8 3C 60 F3 FF 84 C0 C6 44 24 44 01 75 05 C6 44 24 44 00 39 2D D8 63 B2]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x63D298],0
je mode_ok
cmp dword ptr [game.exe+0x63D298],5
jne original
mode_ok:
popfd
add esp,4
mov al,0
jmp RETURN
original:
popfd
call game.exe+0x168140
jmp RETURN]=]},{[ [=[group]=] ]=[=[reveal]=],[ [=[rva]=] ]=1474880,[ [=[original]=] ]=[=[83 EC 08 56 8B 74 24 10]=],[ [=[pattern]=] ]=[=[83 EC 08 56 8B 74 24 10 8B 46 08 99 F7 3D 30 FC A6 00 A8 01 99 0F 84 8D]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x63D298],0
je mode_ok
cmp dword ptr [game.exe+0x63D298],5
jne original
mode_ok:
popfd
mov al,0
ret 4
original:
popfd
db 83 EC 08 56 8B 74 24 10
jmp RETURN]=]},{[ [=[group]=] ]=[=[reveal]=],[ [=[rva]=] ]=1475520,[ [=[original]=] ]=[=[A1 98 D2 A3 00]=],[ [=[pattern]=] ]=[=[A1 98 D2 A3 00 83 EC 08 85 C0 56 74 1C A1 B4 5D A3 00 8A 88 3D 01 00 00]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x63D298],0
je mode_ok
cmp dword ptr [game.exe+0x63D298],5
jne original
mode_ok:
popfd
mov al,0
ret 4
original:
popfd
db A1 98 D2 A3 00
jmp RETURN]=]},{[ [=[group]=] ]=[=[reveal]=],[ [=[rva]=] ]=1343464,[ [=[original]=] ]=[=[8B 80 2C 01 00 00]=],[ [=[pattern]=] ]=[=[8B 80 2C 01 00 00 C1 E8 03 83 E0 01 59 C2 08 00 90 90 90 90 90 90 90 90]=],[ [=[body]=] ]=[=[mov eax,[eax+0x12C]
pushfd
cmp dword ptr [game.exe+0x63D298],0
je mode_ok
cmp dword ptr [game.exe+0x63D298],5
jne original
mode_ok:
or eax,8
original:
popfd
jmp RETURN]=]},{[ [=[group]=] ]=[=[iron]=],[ [=[rva]=] ]=111504,[ [=[original]=] ]=[=[8B 91 54 01 00 00]=],[ [=[pattern]=] ]=[=[8B 91 54 01 00 00 8B 81 5C 01 00 00 83 FA FF 74 1A 8B 0D 2C 0D A4 00 2B]=],[ [=[body]=] ]=[=[mov edx,[ecx+0x154]
jmp RETURN]=]},{[ [=[group]=] ]=[=[build]=],[ [=[rva]=] ]=2625334,[ [=[original]=] ]=[=[8B 47 34 85 C0]=],[ [=[pattern]=] ]=[=[8B 47 34 85 C0 74 0B 8A 47 6C 84 C0 0F 84 3D 03 00 00 8B CF E8 B1 89 E3]=],[ [=[body]=] ]=[=[pushfd
push eax
cmp dword ptr [game.exe+0x63D298],0
je mode_ok
cmp dword ptr [game.exe+0x63D298],5
jne original
mode_ok:
mov eax,[edi+0x68]
cmp eax,[game.exe+0x635DB4]
jne original
cmp dword ptr [edi+0x24],#54
jne original
mov eax,[edi+0x54]
test eax,eax
je original
mov eax,[eax]
cmp eax,game.exe+0x3ADDF8
je queue
cmp eax,game.exe+0x3A3540
je queue
cmp eax,game.exe+0x39B12C
jne original
queue:
pop eax
popfd
jmp game.exe+0x281285
original:
pop eax
popfd
db 8B 47 34 85 C0
jmp RETURN]=]},{[ [=[group]=] ]=[=[build]=],[ [=[rva]=] ]=942216,[ [=[original]=] ]=[=[8A 46 6C 32 DB]=],[ [=[pattern]=] ]=[=[8A 46 6C 32 DB 84 C0 74 17 8B 4E 54 85 C9 74 10 8B 01 FF 90 80 00 00 00]=],[ [=[body]=] ]=[=[pushfd
push eax
cmp dword ptr [game.exe+0x63D298],0
je mode_ok
cmp dword ptr [game.exe+0x63D298],5
jne original
mode_ok:
mov eax,[esi+0x68]
cmp eax,[game.exe+0x635DB4]
jne original
cmp dword ptr [esi+0x24],#54
jne original
cmp byte ptr [esp+0x3C],0
jne original
mov eax,[esi+0x54]
test eax,eax
je original
mov eax,[eax]
cmp eax,game.exe+0x3ADDF8
je queue
cmp eax,game.exe+0x3A3540
je queue
cmp eax,game.exe+0x39B12C
jne original
queue:
pop eax
popfd
xor bl,bl
jmp game.exe+0xE60A8
original:
pop eax
popfd
db 8A 46 6C 32 DB
jmp RETURN]=]}},yrSites={{[ [=[group]=] ]=[=[money]=],[ [=[rva]=] ]=1010112,[ [=[original]=] ]=[=[E8 3B F5 2C 00]=],[ [=[pattern]=] ]=[=[E8 3B F5 2C 00 5E 59 C2 04 00 90 90 90 90 90 90 56 8B 74 24 08 8D 8E D8]=],[ [=[body]=] ]=[=[call game.exe+0x3C5F00
pushfd
cmp dword ptr [game.exe+0x68B238],0
je mode_ok
cmp dword ptr [game.exe+0x68B238],5
jne original
mode_ok:
push edx
mov edx,esi
sub edx,0x24
cmp edx,[game.exe+0x683D4C]
pop edx
jne original
cmp eax,0x7FFF8ACF
jg capped
add eax,#30000
jmp original
capped:
mov eax,0x7FFFFFFF
original:
popfd
jmp RETURN]=]},{[ [=[group]=] ]=[=[power]=],[ [=[rva]=] ]=1009943,[ [=[original]=] ]=[=[8B 88 7C 53 00 00]=],[ [=[pattern]=] ]=[=[8B 88 7C 53 00 00 8B B0 80 53 00 00 3B CE 5E 0F 9D C2 8A C2 C2 04 00 90]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x68B238],0
je mode_ok
cmp dword ptr [game.exe+0x68B238],5
jne original
mode_ok:
push edx
mov edx,eax
sub edx,0x28
cmp edx,[game.exe+0x683D4C]
pop edx
jne original
mov ecx,[eax+0x5380]
add ecx,#5000
popfd
jmp RETURN
original:
popfd
db 8B 88 7C 53 00 00
jmp RETURN]=]},{[ [=[group]=] ]=[=[power]=],[ [=[rva]=] ]=1010180,[ [=[original]=] ]=[=[8B 80 80 53 00 00]=],[ [=[pattern]=] ]=[=[8B 80 80 53 00 00 C2 04 00 90 90 90 8B 44 24 04 8B 80 84 53 00 00 C2 04]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x68B238],0
je mode_ok
cmp dword ptr [game.exe+0x68B238],5
jne original
mode_ok:
push edx
mov edx,eax
sub edx,0x24
cmp edx,[game.exe+0x683D4C]
pop edx
jne original
mov eax,[eax+0x5384]
add eax,#5000
popfd
jmp RETURN
original:
popfd
db 8B 80 80 53 00 00
jmp RETURN]=]},{[ [=[group]=] ]=[=[power]=],[ [=[rva]=] ]=1018966,[ [=[original]=] ]=[=[8B 8E A4 53 00 00]=],[ [=[pattern]=] ]=[=[8B 8E A4 53 00 00 8B 86 A8 53 00 00 3B C8 89 4C 24 14 89 44 24 18 0F 8D]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x68B238],0
je mode_ok
cmp dword ptr [game.exe+0x68B238],5
jne original
mode_ok:
cmp esi,[game.exe+0x683D4C]
jne original
mov ecx,[esi+0x53A8]
add ecx,#5000
popfd
jmp RETURN
original:
popfd
db 8B 8E A4 53 00 00
jmp RETURN]=]},{[ [=[group]=] ]=[=[power]=],[ [=[rva]=] ]=1035827,[ [=[original]=] ]=[=[8B 81 A4 53 00 00]=],[ [=[pattern]=] ]=[=[8B 81 A4 53 00 00 8B 89 A8 53 00 00 3B C1 89 44 24 00 89 4C 24 04 7D 1E]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x68B238],0
je mode_ok
cmp dword ptr [game.exe+0x68B238],5
jne original
mode_ok:
cmp ecx,[game.exe+0x683D4C]
jne original
mov eax,[ecx+0x53A8]
add eax,#5000
popfd
jmp RETURN
original:
popfd
db 8B 81 A4 53 00 00
jmp RETURN]=]},{[ [=[group]=] ]=[=[power]=],[ [=[rva]=] ]=1042172,[ [=[original]=] ]=[=[8B 95 A4 53 00 00]=],[ [=[pattern]=] ]=[=[8B 95 A4 53 00 00 8B 3C 81 8B 85 B4 60 01 00 2B D0 8B 85 A8 53 00 00 8B]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x68B238],0
je mode_ok
cmp dword ptr [game.exe+0x68B238],5
jne original
mode_ok:
cmp ebp,[game.exe+0x683D4C]
jne original
mov edx,[ebp+0x53A8]
add edx,#5000
popfd
jmp RETURN
original:
popfd
db 8B 95 A4 53 00 00
jmp RETURN]=]},{[ [=[group]=] ]=[=[power]=],[ [=[rva]=] ]=1054601,[ [=[original]=] ]=[=[8B 96 A4 53 00 00]=],[ [=[pattern]=] ]=[=[8B 96 A4 53 00 00 8B BE A8 53 00 00 8B 0D AC E7 A8 00 3B D7 0F 9C C0 85 C9 88 44 24 38 0F 85 02]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x68B238],0
je mode_ok
cmp dword ptr [game.exe+0x68B238],5
jne original
mode_ok:
cmp esi,[game.exe+0x683D4C]
jne original
mov edx,[esi+0x53A8]
add edx,#5000
popfd
jmp RETURN
original:
popfd
db 8B 96 A4 53 00 00
jmp RETURN]=]},{[ [=[group]=] ]=[=[power]=],[ [=[rva]=] ]=1054930,[ [=[original]=] ]=[=[8B 9E A4 53 00 00]=],[ [=[pattern]=] ]=[=[8B 9E A4 53 00 00 3B D8 0F 9C C3 03 C1 8B CE 89 86 A8 53 00 00 E8 34 01]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x68B238],0
je mode_ok
cmp dword ptr [game.exe+0x68B238],5
jne original
mode_ok:
cmp esi,[game.exe+0x683D4C]
jne original
mov ebx,[esi+0x53A8]
add ebx,#5000
popfd
jmp RETURN
original:
popfd
db 8B 9E A4 53 00 00
jmp RETURN]=]},{[ [=[group]=] ]=[=[power]=],[ [=[rva]=] ]=1054956,[ [=[original]=] ]=[=[8B 96 A4 53 00 00]=],[ [=[pattern]=] ]=[=[8B 96 A4 53 00 00 8B BE A8 53 00 00 8B 0D AC E7 A8 00 3B D7 0F 9C C0 85 C9 88 44 24 38 0F 85 FE]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x68B238],0
je mode_ok
cmp dword ptr [game.exe+0x68B238],5
jne original
mode_ok:
cmp esi,[game.exe+0x683D4C]
jne original
mov edx,[esi+0x53A8]
add edx,#5000
popfd
jmp RETURN
original:
popfd
db 8B 96 A4 53 00 00
jmp RETURN]=]},{[ [=[group]=] ]=[=[power]=],[ [=[rva]=] ]=1084473,[ [=[original]=] ]=[=[8B 8E A4 53 00 00]=],[ [=[pattern]=] ]=[=[8B 8E A4 53 00 00 8B 86 A8 53 00 00 3B C8 89 4C 24 0C 89 44 24 10 7D 24 3B C3 74 20 3B CB 74 15 DB 44 24 0C DA 74 24 10 DC 1D 18 17 7E 00 DF E0 F6 C4 01 74 07 C6 44 24]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x68B238],0
je mode_ok
cmp dword ptr [game.exe+0x68B238],5
jne original
mode_ok:
cmp esi,[game.exe+0x683D4C]
jne original
mov ecx,[esi+0x53A8]
add ecx,#5000
popfd
jmp RETURN
original:
popfd
db 8B 8E A4 53 00 00
jmp RETURN]=]},{[ [=[group]=] ]=[=[power]=],[ [=[rva]=] ]=1084813,[ [=[original]=] ]=[=[8B 8E A4 53 00 00]=],[ [=[pattern]=] ]=[=[8B 8E A4 53 00 00 8B 86 A8 53 00 00 3B C8 89 4C 24 0C 89 44 24 10 7D 24 3B C3 74 20 3B CB 74 15 DB 44 24 0C DA 74 24 10 DC 1D 18 17 7E 00 DF E0 F6 C4 01 74 07 B8 01 00]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x68B238],0
je mode_ok
cmp dword ptr [game.exe+0x68B238],5
jne original
mode_ok:
cmp esi,[game.exe+0x683D4C]
jne original
mov ecx,[esi+0x53A8]
add ecx,#5000
popfd
jmp RETURN
original:
popfd
db 8B 8E A4 53 00 00
jmp RETURN]=]},{[ [=[group]=] ]=[=[power]=],[ [=[rva]=] ]=1085002,[ [=[original]=] ]=[=[8B 91 A4 53 00 00]=],[ [=[pattern]=] ]=[=[8B 91 A4 53 00 00 8B 81 A8 53 00 00 3B D0 89 54 24 14 89 44 24 18 7D 25]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x68B238],0
je mode_ok
cmp dword ptr [game.exe+0x68B238],5
jne original
mode_ok:
cmp ecx,[game.exe+0x683D4C]
jne original
mov edx,[ecx+0x53A8]
add edx,#5000
popfd
jmp RETURN
original:
popfd
db 8B 91 A4 53 00 00
jmp RETURN]=]},{[ [=[group]=] ]=[=[power]=],[ [=[rva]=] ]=1087562,[ [=[original]=] ]=[=[8B 86 A4 53 00 00]=],[ [=[pattern]=] ]=[=[8B 86 A4 53 00 00 3B D0 7F 18 A1 30 B2 A8 00 6A 01 6A 00 8D 88 18 02 00]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x68B238],0
je mode_ok
cmp dword ptr [game.exe+0x68B238],5
jne original
mode_ok:
cmp esi,[game.exe+0x683D4C]
jne original
mov eax,[esi+0x53A8]
add eax,#5000
popfd
jmp RETURN
original:
popfd
db 8B 86 A4 53 00 00
jmp RETURN]=]},{[ [=[group]=] ]=[=[power]=],[ [=[rva]=] ]=1093792,[ [=[original]=] ]=[=[8B 95 A4 53 00 00]=],[ [=[pattern]=] ]=[=[8B 95 A4 53 00 00 8B 85 A8 53 00 00 3B D0 89 54 24 1C 89 44 24 18 7D 1F]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x68B238],0
je mode_ok
cmp dword ptr [game.exe+0x68B238],5
jne original
mode_ok:
cmp ebp,[game.exe+0x683D4C]
jne original
mov edx,[ebp+0x53A8]
add edx,#5000
popfd
jmp RETURN
original:
popfd
db 8B 95 A4 53 00 00
jmp RETURN]=]},{[ [=[group]=] ]=[=[power]=],[ [=[rva]=] ]=1094343,[ [=[original]=] ]=[=[8B 95 A4 53 00 00]=],[ [=[pattern]=] ]=[=[8B 95 A4 53 00 00 8B 85 A8 53 00 00 3B D0 89 54 24 14 89 44 24 18 7D 24]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x68B238],0
je mode_ok
cmp dword ptr [game.exe+0x68B238],5
jne original
mode_ok:
cmp ebp,[game.exe+0x683D4C]
jne original
mov edx,[ebp+0x53A8]
add edx,#5000
popfd
jmp RETURN
original:
popfd
db 8B 95 A4 53 00 00
jmp RETURN]=]},{[ [=[group]=] ]=[=[power]=],[ [=[rva]=] ]=2360422,[ [=[original]=] ]=[=[8B 90 A4 53 00 00]=],[ [=[pattern]=] ]=[=[8B 90 A4 53 00 00 51 52 68 9E 02 00 00 68 B8 6D 83 00 33 D2 B9 A8 6D 83]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x68B238],0
je mode_ok
cmp dword ptr [game.exe+0x68B238],5
jne original
mode_ok:
cmp eax,[game.exe+0x683D4C]
jne original
mov edx,[eax+0x53A8]
add edx,#5000
popfd
jmp RETURN
original:
popfd
db 8B 90 A4 53 00 00
jmp RETURN]=]},{[ [=[group]=] ]=[=[power]=],[ [=[rva]=] ]=1054581,[ [=[original]=] ]=[=[3B C3 0F 9C C3]=],[ [=[pattern]=] ]=[=[3B C3 0F 9C C3 03 C1 8B CE 89 86 A4 53 00 00 E8 97 02 00 00 8B 96 A4 53]=],[ [=[body]=] ]=[=[cmp eax,ebx
setl bl
pushfd
cmp dword ptr [game.exe+0x68B238],0
je mode_ok
cmp dword ptr [game.exe+0x68B238],5
jne original
mode_ok:
cmp esi,[game.exe+0x683D4C]
jne original
mov bl,0
original:
popfd
jmp RETURN]=]},{[ [=[group]=] ]=[=[build]=],[ [=[rva]=] ]=826211,[ [=[original]=] ]=[=[8D 7E 2C 8B CF]=],[ [=[pattern]=] ]=[=[8D 7E 2C 8B CF E8 C3 CA F5 FF 85 C0 75 49 8B 46 38 85 C0 74 42 8B 4E 3C]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x68B238],0
je mode_ok
cmp dword ptr [game.exe+0x68B238],5
jne original
mode_ok:
push eax
mov eax,[esi+0x6C]
cmp eax,[game.exe+0x683D4C]
pop eax
jne original
cmp dword ptr [esi+0x58],0
je original
cmp dword ptr [esi+0x38],0
jle original
cmp dword ptr [esi+0x24],0
jl original
cmp dword ptr [esi+0x24],#54
jge original
pushad
mov eax,[esi+0x6C]
add eax,0x24
push eax
call game.exe+0xF6990
cmp eax,[esi+0x60]
popad
jl original
popfd
lea edi,[esi+0x2C]
mov eax,[esi+0x38]
mov ecx,#54
sub ecx,[esi+0x24]
jmp game.exe+0xC9B7B
original:
popfd
lea edi,[esi+0x2C]
mov ecx,edi
jmp RETURN]=]},{[ [=[group]=] ]=[=[build]=],[ [=[rva]=] ]=1029464,[ [=[original]=] ]=[=[A1 98 EF A8 00]=],[ [=[pattern]=] ]=[=[A1 98 EF A8 00 8B 17 50 56 8B CF FF 92 00 01 00 00 83 F8 02 74 58 83 F8]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x68B238],0
je mode_ok
cmp dword ptr [game.exe+0x68B238],5
jne original
mode_ok:
cmp ebp,[game.exe+0x683D4C]
jne original
cmp dword ptr [edi],game.exe+0x3E3EBC
jne original
cmp dword ptr [edi+0x524],0
je original
mov byte ptr [ebx+0x5D],1
popfd
jmp game.exe+0xFB512
original:
popfd
mov eax,[game.exe+0x68EF98]
jmp RETURN]=]},{[ [=[group]=] ]=[=[build]=],[ [=[rva]=] ]=1029525,[ [=[original]=] ]=[=[68 B0 49 82 00]=],[ [=[pattern]=] ]=[=[68 B0 49 82 00 E8 41 B3 F0 FF 8B 4C 24 4C 8B 54 24 48 8B 44 24 44 83 C4]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x68B238],0
je mode_ok
cmp dword ptr [game.exe+0x68B238],5
jne original
mode_ok:
cmp ebp,[game.exe+0x683D4C]
jne original
mov byte ptr [ebx+0x5D],1
popfd
jmp game.exe+0xFB5BA
original:
popfd
push game.exe+0x4249B0
jmp RETURN]=]},{[ [=[group]=] ]=[=[ammo]=],[ [=[rva]=] ]=86142,[ [=[original]=] ]=[=[48 89 86 FC 02 00 00]=],[ [=[pattern]=] ]=[=[48 89 86 FC 02 00 00 8B CE E8 D4 0B 1E 00 8B 0D E0 71 88 00 DC 99 08 17]=],[ [=[body]=] ]=[=[pushfd
push edx
mov edx,[esi+0x21C]
cmp dword ptr [game.exe+0x68B238],0
je mode_ok
cmp dword ptr [game.exe+0x68B238],5
jne original
mode_ok:
cmp edx,[game.exe+0x683D4C]
jne original
cmp dword ptr [esi],game.exe+0x3E22A4
jne original
cmp eax,0
jle original
pop edx
popfd
jmp RETURN
original:
pop edx
popfd
dec eax
mov [esi+0x2FC],eax
jmp RETURN]=]},{[ [=[group]=] ]=[=[ammo]=],[ [=[rva]=] ]=98383,[ [=[original]=] ]=[=[48 89 86 FC 02 00 00]=],[ [=[pattern]=] ]=[=[48 89 86 FC 02 00 00 8B 86 B4 02 00 00 85 C0 0F 84 B3 0C 00 00 8B 8E FC]=],[ [=[body]=] ]=[=[pushfd
push edx
mov edx,[esi+0x21C]
cmp dword ptr [game.exe+0x68B238],0
je mode_ok
cmp dword ptr [game.exe+0x68B238],5
jne original
mode_ok:
cmp edx,[game.exe+0x683D4C]
jne original
cmp dword ptr [esi],game.exe+0x3E22A4
jne original
cmp eax,0
jle original
pop edx
popfd
jmp RETURN
original:
pop edx
popfd
dec eax
mov [esi+0x2FC],eax
jmp RETURN]=]},{[ [=[group]=] ]=[=[ammo]=],[ [=[rva]=] ]=98489,[ [=[original]=] ]=[=[48 89 86 FC 02 00 00]=],[ [=[pattern]=] ]=[=[48 89 86 FC 02 00 00 8B 86 B4 02 00 00 88 9E D2 06 00 00 3B C3 0F 84 F1]=],[ [=[body]=] ]=[=[pushfd
push edx
mov edx,[esi+0x21C]
cmp dword ptr [game.exe+0x68B238],0
je mode_ok
cmp dword ptr [game.exe+0x68B238],5
jne original
mode_ok:
cmp edx,[game.exe+0x683D4C]
jne original
cmp dword ptr [esi],game.exe+0x3E22A4
jne original
cmp eax,0
jle original
pop edx
popfd
jmp RETURN
original:
pop edx
popfd
dec eax
mov [esi+0x2FC],eax
jmp RETURN]=]},{[ [=[group]=] ]=[=[ammo]=],[ [=[rva]=] ]=101390,[ [=[original]=] ]=[=[48 89 86 FC 02 00 00]=],[ [=[pattern]=] ]=[=[48 89 86 FC 02 00 00 39 9E FC 02 00 00 0F 85 B0 00 00 00 38 9E D4 03 00]=],[ [=[body]=] ]=[=[pushfd
push edx
mov edx,[esi+0x21C]
cmp dword ptr [game.exe+0x68B238],0
je mode_ok
cmp dword ptr [game.exe+0x68B238],5
jne original
mode_ok:
cmp edx,[game.exe+0x683D4C]
jne original
cmp dword ptr [esi],game.exe+0x3E22A4
jne original
cmp eax,0
jle original
pop edx
popfd
jmp RETURN
original:
pop edx
popfd
dec eax
mov [esi+0x2FC],eax
jmp RETURN]=]},{[ [=[group]=] ]=[=[super]=],[ [=[rva]=] ]=2932051,[ [=[original]=] ]=[=[8B 3A 8B 42 08]=],[ [=[pattern]=] ]=[=[8B 3A 8B 42 08 83 FF FF 74 0E 8B 0D 84 ED A8 00 2B CF 3B C8 7D 0A 2B C1]=],[ [=[body]=] ]=[=[pushfd
push ecx
mov ecx,[esi+0x2C]
cmp dword ptr [game.exe+0x68B238],0
je mode_ok
cmp dword ptr [game.exe+0x68B238],5
jne original
mode_ok:
cmp ecx,[game.exe+0x683D4C]
jne original
mov ecx,[esi+0x28]
cmp byte ptr [ecx+0xE5],0
jne original
mov dword ptr [edx+8],0
original:
pop ecx
popfd
mov edi,[edx]
mov eax,[edx+8]
jmp RETURN]=]},{[ [=[group]=] ]=[=[visual]=],[ [=[rva]=] ]=524784,[ [=[original]=] ]=[=[53 55 56 8B F1]=],[ [=[pattern]=] ]=[=[53 55 56 8B F1 8B 0D 24 73 88 00 57 8D 7E 24 6A 00 57 E8 F9 84 25 00 88]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x68B238],0
je mode_ok
cmp dword ptr [game.exe+0x68B238],5
jne original
mode_ok:
popfd
ret 8
original:
popfd
push ebx
push ebp
push esi
mov esi,ecx
jmp RETURN]=]},{[ [=[group]=] ]=[=[visual]=],[ [=[rva]=] ]=2980447,[ [=[original]=] ]=[=[E8 EC FE DA FF]=],[ [=[pattern]=] ]=[=[E8 EC FE DA FF 84 C0 0F 85 4C 01 00 00 83 BE EC 00 00 00 02 74 08 85 FF]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x68B238],0
je mode_ok
cmp dword ptr [game.exe+0x68B238],5
jne original
mode_ok:
popfd
mov al,0
jmp RETURN
original:
popfd
call game.exe+0x87950
jmp RETURN]=]},{[ [=[group]=] ]=[=[visual]=],[ [=[rva]=] ]=3101155,[ [=[original]=] ]=[=[E8 68 27 D9 FF]=],[ [=[pattern]=] ]=[=[E8 68 27 D9 FF 84 C0 75 67 8B 45 00 8D 54 24 34 8D 4C 24 4C 52 51 8B CD]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x68B238],0
je mode_ok
cmp dword ptr [game.exe+0x68B238],5
jne original
mode_ok:
popfd
mov al,0
jmp RETURN
original:
popfd
call game.exe+0x87950
jmp RETURN]=]},{[ [=[group]=] ]=[=[visual]=],[ [=[rva]=] ]=3101354,[ [=[original]=] ]=[=[E8 A1 26 D9 FF]=],[ [=[pattern]=] ]=[=[E8 A1 26 D9 FF 84 C0 0F 85 90 00 00 00 8B 55 00 8D 4C 24 34 8D 44 24 4C]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x68B238],0
je mode_ok
cmp dword ptr [game.exe+0x68B238],5
jne original
mode_ok:
popfd
mov al,0
jmp RETURN
original:
popfd
call game.exe+0x87950
jmp RETURN]=]},{[ [=[group]=] ]=[=[visual]=],[ [=[rva]=] ]=2980431,[ [=[original]=] ]=[=[8A 86 2C 01 00 00]=],[ [=[pattern]=] ]=[=[8A 86 2C 01 00 00 A8 10 0F 84 5B 01 00 00 8B CE E8 EC FE DA FF 84 C0 0F]=],[ [=[body]=] ]=[=[mov al,[esi+0x12C]
pushfd
cmp dword ptr [game.exe+0x68B238],0
je mode_ok
cmp dword ptr [game.exe+0x68B238],5
jne original
mode_ok:
or al,0x18
original:
popfd
jmp RETURN]=]},{[ [=[group]=] ]=[=[visual]=],[ [=[rva]=] ]=2448719,[ [=[original]=] ]=[=[E8 0C 06 F3 FF]=],[ [=[pattern]=] ]=[=[E8 0C 06 F3 FF 84 C0 C6 44 24 44 01 75 05 C6 44 24 44 00 39 2D 50 35 B7]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x68B238],0
je mode_ok
cmp dword ptr [game.exe+0x68B238],5
jne original
mode_ok:
popfd
add esp,4
mov al,0
jmp RETURN
original:
popfd
call game.exe+0x186360
jmp RETURN]=]},{[ [=[group]=] ]=[=[reveal]=],[ [=[rva]=] ]=524784,[ [=[original]=] ]=[=[53 55 56 8B F1]=],[ [=[pattern]=] ]=[=[53 55 56 8B F1 8B 0D 24 73 88 00 57 8D 7E 24 6A 00 57 E8 F9 84 25 00 88]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x68B238],0
je mode_ok
cmp dword ptr [game.exe+0x68B238],5
jne original
mode_ok:
popfd
ret 8
original:
popfd
push ebx
push ebp
push esi
mov esi,ecx
jmp RETURN]=]},{[ [=[group]=] ]=[=[reveal]=],[ [=[rva]=] ]=2980447,[ [=[original]=] ]=[=[E8 EC FE DA FF]=],[ [=[pattern]=] ]=[=[E8 EC FE DA FF 84 C0 0F 85 4C 01 00 00 83 BE EC 00 00 00 02 74 08 85 FF]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x68B238],0
je mode_ok
cmp dword ptr [game.exe+0x68B238],5
jne original
mode_ok:
popfd
mov al,0
jmp RETURN
original:
popfd
call game.exe+0x87950
jmp RETURN]=]},{[ [=[group]=] ]=[=[reveal]=],[ [=[rva]=] ]=3101155,[ [=[original]=] ]=[=[E8 68 27 D9 FF]=],[ [=[pattern]=] ]=[=[E8 68 27 D9 FF 84 C0 75 67 8B 45 00 8D 54 24 34 8D 4C 24 4C 52 51 8B CD]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x68B238],0
je mode_ok
cmp dword ptr [game.exe+0x68B238],5
jne original
mode_ok:
popfd
mov al,0
jmp RETURN
original:
popfd
call game.exe+0x87950
jmp RETURN]=]},{[ [=[group]=] ]=[=[reveal]=],[ [=[rva]=] ]=3101354,[ [=[original]=] ]=[=[E8 A1 26 D9 FF]=],[ [=[pattern]=] ]=[=[E8 A1 26 D9 FF 84 C0 0F 85 90 00 00 00 8B 55 00 8D 4C 24 34 8D 44 24 4C]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x68B238],0
je mode_ok
cmp dword ptr [game.exe+0x68B238],5
jne original
mode_ok:
popfd
mov al,0
jmp RETURN
original:
popfd
call game.exe+0x87950
jmp RETURN]=]},{[ [=[group]=] ]=[=[reveal]=],[ [=[rva]=] ]=2980431,[ [=[original]=] ]=[=[8A 86 2C 01 00 00]=],[ [=[pattern]=] ]=[=[8A 86 2C 01 00 00 A8 10 0F 84 5B 01 00 00 8B CE E8 EC FE DA FF 84 C0 0F]=],[ [=[body]=] ]=[=[mov al,[esi+0x12C]
pushfd
cmp dword ptr [game.exe+0x68B238],0
je mode_ok
cmp dword ptr [game.exe+0x68B238],5
jne original
mode_ok:
or al,0x18
original:
popfd
jmp RETURN]=]},{[ [=[group]=] ]=[=[reveal]=],[ [=[rva]=] ]=2448719,[ [=[original]=] ]=[=[E8 0C 06 F3 FF]=],[ [=[pattern]=] ]=[=[E8 0C 06 F3 FF 84 C0 C6 44 24 44 01 75 05 C6 44 24 44 00 39 2D 50 35 B7]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x68B238],0
je mode_ok
cmp dword ptr [game.exe+0x68B238],5
jne original
mode_ok:
popfd
add esp,4
mov al,0
jmp RETURN
original:
popfd
call game.exe+0x186360
jmp RETURN]=]},{[ [=[group]=] ]=[=[reveal]=],[ [=[rva]=] ]=1598304,[ [=[original]=] ]=[=[83 EC 08 56 8B 74 24 10]=],[ [=[pattern]=] ]=[=[83 EC 08 56 8B 74 24 10 8B 46 08 99 F7 3D 88 DE AB 00 A8 01 99 0F 84 8D]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x68B238],0
je mode_ok
cmp dword ptr [game.exe+0x68B238],5
jne original
mode_ok:
popfd
mov al,0
ret 4
original:
popfd
db 83 EC 08 56 8B 74 24 10
jmp RETURN]=]},{[ [=[group]=] ]=[=[reveal]=],[ [=[rva]=] ]=1464088,[ [=[original]=] ]=[=[8B 80 2C 01 00 00]=],[ [=[pattern]=] ]=[=[8B 80 2C 01 00 00 C1 E8 03 83 E0 01 59 C2 08 00 90 90 90 90 90 90 90 90]=],[ [=[body]=] ]=[=[mov eax,[eax+0x12C]
pushfd
cmp dword ptr [game.exe+0x68B238],0
je mode_ok
cmp dword ptr [game.exe+0x68B238],5
jne original
mode_ok:
or eax,8
original:
popfd
jmp RETURN]=]},{[ [=[group]=] ]=[=[iron]=],[ [=[rva]=] ]=114496,[ [=[original]=] ]=[=[8B 91 8C 01 00 00]=],[ [=[pattern]=] ]=[=[8B 91 8C 01 00 00 8B 81 94 01 00 00 83 FA FF 74 1A 8B 0D 84 ED A8 00 2B]=],[ [=[body]=] ]=[=[mov edx,[ecx+0x18C]
jmp RETURN]=]},{[ [=[group]=] ]=[=[build]=],[ [=[rva]=] ]=2798249,[ [=[original]=] ]=[=[8B 47 38 85 C0]=],[ [=[pattern]=] ]=[=[8B 47 38 85 C0 74 0B 8A 47 70 84 C0 0F 84 47 03 00 00 8B CF E8 6E EE E1]=],[ [=[body]=] ]=[=[pushfd
push eax
cmp dword ptr [game.exe+0x68B238],0
je mode_ok
cmp dword ptr [game.exe+0x68B238],5
jne original
mode_ok:
mov eax,[edi+0x6C]
cmp eax,[game.exe+0x683D4C]
jne original
cmp dword ptr [edi+0x24],#54
jne original
mov eax,[edi+0x58]
test eax,eax
je original
mov eax,[eax]
cmp eax,game.exe+0x3F5C70
je queue
cmp eax,game.exe+0x3EB058
je queue
cmp eax,game.exe+0x3E22A4
jne original
queue:
pop eax
popfd
jmp game.exe+0x2AB602
original:
pop eax
popfd
db 8B 47 38 85 C0
jmp RETURN]=]},{[ [=[group]=] ]=[=[build]=],[ [=[rva]=] ]=1025448,[ [=[original]=] ]=[=[8A 46 70 32 DB]=],[ [=[pattern]=] ]=[=[8A 46 70 32 DB 84 C0 74 17 8B 4E 58 85 C9 74 10 8B 01 FF 90 84 00 00 00]=],[ [=[body]=] ]=[=[pushfd
push eax
cmp dword ptr [game.exe+0x68B238],0
je mode_ok
cmp dword ptr [game.exe+0x68B238],5
jne original
mode_ok:
mov eax,[esi+0x6C]
cmp eax,[game.exe+0x683D4C]
jne original
cmp dword ptr [esi+0x24],#54
jne original
cmp byte ptr [esp+0x3C],0
jne original
mov eax,[esi+0x58]
test eax,eax
je original
mov eax,[eax]
cmp eax,game.exe+0x3F5C70
je queue
cmp eax,game.exe+0x3EB058
je queue
cmp eax,game.exe+0x3E22A4
jne original
queue:
pop eax
popfd
xor bl,bl
jmp game.exe+0xFA5C8
original:
pop eax
popfd
db 8A 46 70 32 DB
jmp RETURN]=]}}}
RA2YR=S
local list=getAddressList()
local records={}
for _,id in ipairs({1,2,3,4,5,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29}) do records[id]=list.getMemoryRecordByID(id) end
local function row(id) return records[id] end
local ids={money=11,power=12,build=13,ammo=14,super=15,visual=16,reveal=17,iron=18}
local layouts={
 ra2={main=10,mode=0x63D298,player=0x635DB4,houseVT=0x3A2DE0,frame=0x640D2C,selection=0x640C60,
   owner=0x1B4,iron=0x154,power=0x5668,surface=0x4336F8,rectangle=0x433724,width=0x112C0,height=0x112D0,
   unit=0x3ADDF8,infantry=0x3A3540,aircraft=0x39B12C,building=0x39CBBC,
   unitType=0x5AC,infantryType=0x5A8,rank=0x118,trainable=0xA9A,elite={0,0,0,0,0,0,0,64}},
 yr={main=20,mode=0x68B238,player=0x683D4C,houseVT=0x3EA8A0,frame=0x68ED84,selection=0x68ECB8,
   owner=0x21C,iron=0x18C,power=0x5778,surface=0x480A04,rectangle=0x480A30,width=0x11540,height=0x11550,
   unit=0x3F5C70,infantry=0x3EB058,aircraft=0x3E22A4,building=0x3E3EBC,
   unitType=0x6C4,infantryType=0x6C0,rank=0x150,trainable=0xC8E,elite={0,0,0,64}}
}
local function featureRow(feature,key) return row(ids[feature]+(key~='ra2' and 10 or 0)) end
local function report(message) if not S.closing then showMessage(message) end end
local function hex(value) return string.format('0x%X',value) end
local function bytes(text)
  local result={}
  for b in text:gmatch('%x%x') do result[#result+1]=tonumber(b,16) end
  return result
end
local function same(address,expected)
  local actual=readBytes(address,#expected,true)
  if not actual then return false end
  for i,b in ipairs(expected) do if actual[i]~=b then return false end end
  return true
end
local folder=[[C:\Program Files (x86)\Steam\steamapps\common\Command &amp; Conquer Red Alert II\]]
-- Only the worker reads large archives; UI callbacks consume completed results.
local archiveJob
local function archiveHash(path)
  if type(createThread)~='function' then return md5file(path) end
  local job=archiveJob
  if not job or job.pid~=getOpenedProcessID() or not job.done then return '' end
  return job.hashes[path:lower()] or ''
end
local function identifyStock(pid,full,modules)
  if not pid or pid==0 then return nil,'Start Red Alert 2 or Yuri’s Revenge first.' end
  modules=modules or enumModules(pid) or {}
  for _,m in ipairs(modules) do
    local n=m.Name:lower()
    if n=='ares.dll' or n=='phobos.dll' or n=='syringe.dll' then
      return nil,'A mod extension is loaded. Use the original Steam game for this table.'
    end
  end
  for _,m in ipairs(modules) do
    for key,p in pairs(S.profiles) do
      if m.Name:lower()==p.exe then
        if m.PathToFile:lower()~=(folder..p.exe):lower() then
          return nil,'This is another installation or a mod. Select the original Steam game.'
        end
        if full then
          local _,v=getFileVersion(m.PathToFile)
          if not v then return nil,'The file version cannot be read. Check the game installation.' end
          local version=string.format('%d.%d.%d.%d',v.major,v.minor,v.release,v.build)
          if version~=p.version or (full==true and md5file(m.PathToFile):lower()~=p.md5) then
            return nil,'Wrong game version. This executable needs a separate table profile.'
          end
          if key=='ra2' then
            for _,name in ipairs({'rules.ini','art.ini','ai.ini','ares.dll','phobos.dll'}) do
              if fileExists(folder..name) then return nil,'Modified game files were found. Use an unmodified RA2 installation.' end
            end
            for _,pattern in ipairs({'expand??.mix','ecache*.mix'}) do
              if #(getFileList(folder,pattern,false) or {})&gt;0 then return nil,'Additional RA2 archives were found. This mod needs its own profile.' end
            end
            if full==true and archiveHash(folder..'ra2.mix'):lower()~='4509764448090c5d6497e4255d1db5d7' then
              return nil,'The RA2 data archive differs from the prepared installation. Recheck the game files.'
            end
          elseif key=='yr' then
            for _,name in ipairs({'rulesmd.ini','artmd.ini','aimd.ini','rules.ini','art.ini','ai.ini','ares.dll','phobos.dll'}) do
              if fileExists(folder..name) then return nil,'Modified game files were found. Use the original Yuri’s Revenge installation.' end
            end
            for _,pattern in ipairs({'expand*.mix','ecache*.mix'}) do
              for _,path in ipairs(getFileList(folder,pattern,false) or {}) do
                local name=path:lower():match('[^/\\]+$')
                if name~='expandmd01.mix' then return nil,'Additional game archives were found. This mod needs its own profile.' end
              end
            end
            if full==true then
              for name,hash in pairs(p.archives) do
                if archiveHash(folder..name):lower()~=hash then return nil,'The Yuri’s Revenge data differs from the prepared installation. Recheck the game files.' end
              end
            end
          end
        end
        if m.Address~=0x400000 then return nil,'This executable is loaded differently. This build needs a new profile.' end
        return key,p.title,m.Address
      end
    end
  end
  return nil,'Attach to the original game process, not its launcher.'
end
local mo={[ [=[files]=] ]={[ [=[gamemd.exe]=] ]=[=[2a1307f6f57c9c492f985b4e3afb88e6]=],[ [=[ares.dll]=] ]=[=[955a3977dfeaf7c76953a7c27d205dcd]=],[ [=[ares.dll.inj]=] ]=[=[a64128bbdf2b196a1aab70ce01a78520]=],[ [=[cncnet5.dll]=] ]=[=[331ebb3b7455bf0bdebb2d5a0b43f839]=],[ [=[cncnet5mo.dll]=] ]=[=[fe3ac975d452d7847b6fc730b705071b]=],[ [=[syringe.exe]=] ]=[=[25bdfb825af45e3222986bceea19d6f6]=],[ [=[version]=] ]=[=[fb4f42f25cce9f5d389d7d00ae1f8ee1]=],[ [=[expandmo95.mix]=] ]=[=[ce804696af6f8adad9e5304815cd17e1]=],[ [=[expandmo96.mix]=] ]=[=[4806fdc4b636a796d2d2797fd63d7dbd]=],[ [=[expandmo97.mix]=] ]=[=[2a805478a4fe2a57ffaf05919d05ed86]=],[ [=[expandmo99.mix]=] ]=[=[c98096aee4947dd47fc171349f7f8652]=],[ [=[ra2.mix]=] ]=[=[4509764448090c5d6497e4255d1db5d7]=],[ [=[ra2md.mix]=] ]=[=[995d8d6a21f7b17627bbaeaf96814330]=]}}
local moArchiveCache
local function identifyMentalOmega(pid,full,modules)
  modules=modules or enumModules(pid) or {}
  local executable,loaded
  loaded={}
  for _,m in ipairs(modules) do
    local name=m.Name:lower()
    loaded[name]=m
    if name=='gamemd.exe' then executable=m end
  end
  if not executable then return nil end
  local directory=executable.PathToFile:match('^(.*[/\\])')
  if not directory or not fileExists(directory..'MentalOmegaClient.exe') then return nil end
  local title='Mental Omega 3.3.6'
  if executable.Address~=0x400000 then return false,'Mental Omega is loaded at an unsupported address.' end
  for _,name in ipairs({'ares.dll','cncnet5.dll','cncnet5mo.dll'}) do
    local m=loaded[name]
    if not m or m.PathToFile:lower()~=(directory..name):lower() then
      return false,'Start Mental Omega through its client and wait for the game to load.'
    end
  end
  if loaded['phobos.dll'] or loaded['syringe.dll'] then return false,'This Mental Omega installation has an unsupported extension.' end
  if full then
    for _,name in ipairs({'rulesmo.ini','artmo.ini','aimo.ini','rulesmd.ini','artmd.ini','aimd.ini','phobos.dll'}) do
      if fileExists(directory..name) then return false,'Additional Mental Omega overrides were found. This profile requires the prepared 3.3.6 installation.' end
    end
    for _,pattern in ipairs({'expand*.mix','ecache*.mix'}) do
      for _,path in ipairs(getFileList(directory,pattern,false) or {}) do
        local name=path:lower():match('[^/\\]+$')
        if not mo.files[name] then return false,'Additional mod archives were found. This Mental Omega build needs a separate profile.' end
      end
    end
    if full==true then
      -- Archives already loaded by this game need one full fingerprint per attachment.
      -- Recheck executable/extension files each time; never share across process/module identities.
      local identity=tostring(pid)..'|'..executable.PathToFile:lower()..'|'..tostring(executable.Address)
      for _,name in ipairs({'ares.dll','cncnet5.dll','cncnet5mo.dll'}) do identity=identity..'|'..tostring(loaded[name].Address) end
      local archivesChecked=moArchiveCache==identity
      for name,hash in pairs(mo.files) do
        if not fileExists(directory..name) then moArchiveCache=nil;return false,'Mental Omega file is missing: '..name end
        if not (archivesChecked and name:match('%.mix$')) and (name:match('%.mix$') and archiveHash(directory..name) or md5file(directory..name)):lower()~=hash then
          moArchiveCache=nil
          return false,'Mental Omega version check failed for '..name..'. This table supports the prepared 3.3.6 build.'
        end
      end
      moArchiveCache=identity
    end
  end
  return 'mo',title,executable.Address
end
local function identify(pid,full,modules)
  modules=modules or enumModules(pid) or {}
  local key,title,base=identifyMentalOmega(pid,full,modules)
  if key~=nil then return key or nil,title,base end
  return identifyStock(pid,full,modules)
end
local function prepareArchives(pid)
  if type(createThread)~='function' then return true end
  if archiveJob and archiveJob.pid==pid then return archiveJob.done end
  local modules=enumModules(pid) or {}
  local key=identify(pid,false,modules)
  if not key then return true end
  local paths={}
  if key=='mo' then
    for _,m in ipairs(modules) do
      if m.Name:lower()=='gamemd.exe' then
        local directory=m.PathToFile:match('^(.*[/\\])')
        for name in pairs(mo.files) do if name:match('%.mix$') then paths[#paths+1]=directory..name end end
      end
    end
  elseif key=='yr' then
    for name in pairs(S.profiles.yr.archives) do paths[#paths+1]=folder..name end
  else paths[1]=folder..'ra2.mix' end
  local job={pid=pid,hashes={},done=false}
  archiveJob=job
  createThread(function()
    for _,path in ipairs(paths) do
      if S.closing or archiveJob~=job then return end
      local ok,hash=pcall(md5file,path)
      job.hashes[path:lower()]=ok and type(hash)=='string' and hash or ''
    end
    job.done=true
  end)
  return false
end
local function matchesGame(actual,expected)
  return actual==expected or actual=='mo' and expected=='yr'
end
layouts.mo=layouts.yr
S.moSites={}
for _,source in ipairs(S.yrSites) do
  local site={}
  for k,v in pairs(source) do site[k]=v end
  -- Ares starts its smoke hook immediately after this seven-byte ammo operation.
  if site.rva==0x1507E then site.pattern=site.original end
  -- Charge-drain powers may recharge instantly, but their active drain must run normally.
  if site.group=='super' then
    local old='cmp byte ptr [ecx+0xE5],0\njne original'
    local new='cmp byte ptr [ecx+0xE5],0\nje recharge\ncmp dword ptr [esi+0x7C],0\njne original\nrecharge:'
    local first,last=site.body:find(old,1,true)
    assert(first,'Mental Omega recharge guard unavailable')
    site.body=site.body:sub(1,first-1)..new..site.body:sub(last+1)
  end
  S.moSites[#S.moSites+1]=site
end

for _,site in ipairs({{[ [=[group]=] ]=[=[power]=],[ [=[module]=] ]=[=[ares.dll]=],[ [=[rva]=] ]=74632,[ [=[original]=] ]=[=[39 86 A4 53 00 00]=],[ [=[pattern]=] ]=[=[39 86 A4 53 00 00 7C 05 C6 44 24 20 00 8B 35 4C 3D A8 00 8B CD 39 74 24]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x68B238],0
je mode_ok
cmp dword ptr [game.exe+0x68B238],5
jne original
mode_ok:
cmp esi,[game.exe+0x683D4C]
jne original
popfd
push ecx
mov ecx,[esi+0x53A8]
add ecx,#5000
cmp ecx,eax
pop ecx
jmp RETURN
original:
popfd
db 39 86 A4 53 00 00
jmp RETURN]=]},{[ [=[group]=] ]=[=[power]=],[ [=[module]=] ]=[=[ares.dll]=],[ [=[rva]=] ]=141675,[ [=[original]=] ]=[=[39 93 A4 53 00 00]=],[ [=[pattern]=] ]=[=[39 93 A4 53 00 00 7C 05 C6 44 24 13 00 8B 4B 6C 8B FE 8B 43 78 89 4C 24]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x68B238],0
je mode_ok
cmp dword ptr [game.exe+0x68B238],5
jne original
mode_ok:
cmp ebx,[game.exe+0x683D4C]
jne original
popfd
push eax
mov eax,[ebx+0x53A8]
add eax,#5000
cmp eax,edx
pop eax
jmp RETURN
original:
popfd
db 39 93 A4 53 00 00
jmp RETURN]=]},{[ [=[group]=] ]=[=[power]=],[ [=[module]=] ]=[=[ares.dll]=],[ [=[rva]=] ]=149616,[ [=[original]=] ]=[=[39 8F A4 53 00 00]=],[ [=[pattern]=] ]=[=[39 8F A4 53 00 00 0F 8D EF 00 00 00 80 B8 E0 00 00 00 00 74 08 DD 80 D8]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x68B238],0
je mode_ok
cmp dword ptr [game.exe+0x68B238],5
jne original
mode_ok:
cmp edi,[game.exe+0x683D4C]
jne original
popfd
push eax
mov eax,[edi+0x53A8]
add eax,#5000
cmp eax,ecx
pop eax
jmp RETURN
original:
popfd
db 39 8F A4 53 00 00
jmp RETURN]=]},{[ [=[group]=] ]=[=[power]=],[ [=[module]=] ]=[=[ares.dll]=],[ [=[rva]=] ]=205328,[ [=[original]=] ]=[=[39 86 A4 53 00 00]=],[ [=[pattern]=] ]=[=[39 86 A4 53 00 00 7C 07 5E 32 C0 5B C2 08 00 5E B0 01 5B C2 08 00 CC CC]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x68B238],0
je mode_ok
cmp dword ptr [game.exe+0x68B238],5
jne original
mode_ok:
cmp esi,[game.exe+0x683D4C]
jne original
popfd
push ecx
mov ecx,[esi+0x53A8]
add ecx,#5000
cmp ecx,eax
pop ecx
jmp RETURN
original:
popfd
db 39 86 A4 53 00 00
jmp RETURN]=]},{[ [=[group]=] ]=[=[power]=],[ [=[module]=] ]=[=[ares.dll]=],[ [=[rva]=] ]=233937,[ [=[original]=] ]=[=[39 83 A4 53 00 00]=],[ [=[pattern]=] ]=[=[39 83 A4 53 00 00 7D 04 32 DB EB 02 B3 01 80 3D 63 B2 A8 00 00 75 0D 83]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x68B238],0
je mode_ok
cmp dword ptr [game.exe+0x68B238],5
jne original
mode_ok:
cmp ebx,[game.exe+0x683D4C]
jne original
popfd
push ecx
mov ecx,[ebx+0x53A8]
add ecx,#5000
cmp ecx,eax
pop ecx
jmp RETURN
original:
popfd
db 39 83 A4 53 00 00
jmp RETURN]=]},{[ [=[group]=] ]=[=[power]=],[ [=[module]=] ]=[=[ares.dll]=],[ [=[rva]=] ]=237343,[ [=[original]=] ]=[=[39 87 A4 53 00 00]=],[ [=[pattern]=] ]=[=[39 87 A4 53 00 00 7C 05 C6 44 24 47 01 8B 44 24 50 33 F6 C6 44 24 24 00]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x68B238],0
je mode_ok
cmp dword ptr [game.exe+0x68B238],5
jne original
mode_ok:
cmp edi,[game.exe+0x683D4C]
jne original
popfd
push ecx
mov ecx,[edi+0x53A8]
add ecx,#5000
cmp ecx,eax
pop ecx
jmp RETURN
original:
popfd
db 39 87 A4 53 00 00
jmp RETURN]=]},{[ [=[group]=] ]=[=[power]=],[ [=[module]=] ]=[=[ares.dll]=],[ [=[rva]=] ]=142073,[ [=[original]=] ]=[=[8B 9B A4 53 00 00]=],[ [=[pattern]=] ]=[=[8B 9B A4 53 00 00 8B C6 C6 44 24 30 00 2B C7 FF 74 24 30 C1 F8 03 2B DA]=],[ [=[body]=] ]=[=[pushfd
cmp dword ptr [game.exe+0x68B238],0
je mode_ok
cmp dword ptr [game.exe+0x68B238],5
jne original
mode_ok:
cmp ebx,[game.exe+0x683D4C]
jne original
popfd
pushfd
mov ebx,[ebx+0x53A8]
add ebx,#5000
popfd
jmp RETURN
original:
popfd
db 8B 9B A4 53 00 00
jmp RETURN]=]}}) do S.moSites[#S.moSites+1]=site end
local function replaceProtectionSites(list,replacements)
  for i=#list,1,-1 do if list[i].group=='iron' then table.remove(list,i) end end
  for _,site in ipairs(replacements) do list[#list+1]=site end
end
local protectionSites={[ [=[ra2]=] ]={{[ [=[group]=] ]=[=[iron]=],[ [=[rva]=] ]=3131952,[ [=[original]=] ]=[=[83 EC 28 53 55]=],[ [=[pattern]=] ]=[=[83 EC 28 53 55 56 8B F1 57 8A 46 77 84 C0 74 14 8B 8E B4 01 00 00 E8 65]=],[ [=[kind]=] ]=[=[damage]=],[ [=[body]=] ]=[=[]=]},{[ [=[group]=] ]=[=[iron]=],[ [=[rva]=] ]=1047408,[ [=[original]=] ]=[=[83 EC 3C 53 55]=],[ [=[pattern]=] ]=[=[83 EC 3C 53 55 8B 5C 24 58 56 8B F1 57 8B 7C 24 50 8A 86 C3 05 00 00 84]=],[ [=[kind]=] ]=[=[damage]=],[ [=[body]=] ]=[=[]=]},{[ [=[group]=] ]=[=[iron]=],[ [=[rva]=] ]=89712,[ [=[original]=] ]=[=[8B 44 24 18 83 EC 18]=],[ [=[pattern]=] ]=[=[8B 44 24 18 83 EC 18 8B 54 24 28 55 56 8B F1 57 8B 4C 24 38 8B 7C 24 30]=],[ [=[kind]=] ]=[=[damage]=],[ [=[body]=] ]=[=[]=]},{[ [=[group]=] ]=[=[iron]=],[ [=[rva]=] ]=257648,[ [=[original]=] ]=[=[81 EC 8C 00 00 00]=],[ [=[pattern]=] ]=[=[81 EC 8C 00 00 00 8B 84 24 9C 00 00 00 53 55 56 8B F1 57 3B F0 C7 44 24]=],[ [=[kind]=] ]=[=[damage]=],[ [=[body]=] ]=[=[]=]},{[ [=[group]=] ]=[=[iron]=],[ [=[rva]=] ]=2894912,[ [=[original]=] ]=[=[81 EC 94 00 00 00]=],[ [=[pattern]=] ]=[=[81 EC 94 00 00 00 53 56 8B F1 32 DB 57 89 74 24 4C 8A 86 25 03 00 00 88]=],[ [=[kind]=] ]=[=[indicator]=],[ [=[body]=] ]=[=[]=]}},[ [=[yr]=] ]={{[ [=[group]=] ]=[=[iron]=],[ [=[rva]=] ]=3374224,[ [=[original]=] ]=[=[83 EC 34 53 56]=],[ [=[pattern]=] ]=[=[83 EC 34 53 56 8B F1 57 8A 86 83 00 00 00 84 C0 74 14 8B 8E 1C 02 00 00]=],[ [=[kind]=] ]=[=[damage]=],[ [=[body]=] ]=[=[]=]},{[ [=[group]=] ]=[=[iron]=],[ [=[rva]=] ]=1146784,[ [=[original]=] ]=[=[81 EC C0 00 00 00]=],[ [=[pattern]=] ]=[=[81 EC C0 00 00 00 53 55 8B AC 24 D4 00 00 00 8B 9C 24 DC 00 00 00 56 8B]=],[ [=[kind]=] ]=[=[damage]=],[ [=[body]=] ]=[=[]=]},{[ [=[group]=] ]=[=[iron]=],[ [=[rva]=] ]=91584,[ [=[original]=] ]=[=[8B 44 24 1C 83 EC 0C]=],[ [=[pattern]=] ]=[=[8B 44 24 1C 83 EC 0C 8B 54 24 20 55 56 8B F1 50 8B 4C 24 30 8B 44 24 28]=],[ [=[kind]=] ]=[=[damage]=],[ [=[body]=] ]=[=[]=]},{[ [=[group]=] ]=[=[iron]=],[ [=[rva]=] ]=270896,[ [=[original]=] ]=[=[81 EC 8C 00 00 00]=],[ [=[pattern]=] ]=[=[81 EC 8C 00 00 00 53 55 8B AC 24 A4 00 00 00 56 8B F1 57 3B F5 C7 44 24]=],[ [=[kind]=] ]=[=[damage]=],[ [=[body]=] ]=[=[]=]},{[ [=[group]=] ]=[=[iron]=],[ [=[rva]=] ]=3101072,[ [=[original]=] ]=[=[81 EC 8C 00 00 00]=],[ [=[pattern]=] ]=[=[81 EC 8C 00 00 00 55 8B E9 56 57 8A 85 CD 03 00 00 89 AC 24 94 00 00 00]=],[ [=[kind]=] ]=[=[indicator]=],[ [=[body]=] ]=[=[]=]}}}
replaceProtectionSites(S.sites,protectionSites.ra2)
replaceProtectionSites(S.yrSites,protectionSites.yr)
replaceProtectionSites(S.moSites,protectionSites.yr)
for _,site in ipairs({{[ [=[group]=] ]=[=[super]=],[ [=[module]=] ]=[=[ares.dll]=],[ [=[rva]=] ]=208863,[ [=[original]=] ]=[=[8B 83 A0 01 00 00]=],[ [=[pattern]=] ]=[=[8B 83 A0 01 00 00 8B CD 85 C0 7E 08 50 E8 2F EE FD FF EB 08 F7 D8 50 E8]=],[ [=[body]=] ]=[=[db 8B 83 A0 01 00 00
pushfd
push edx
cmp dword ptr [game.exe+0x68B238],0
je mode_ok
cmp dword ptr [game.exe+0x68B238],5
jne original
mode_ok:
mov edx,ebp
cmp edx,[game.exe+0x683D4C]
jne original
test eax,eax
jns original
xor eax,eax
original:
pop edx
popfd
jmp RETURN]=]},{[ [=[group]=] ]=[=[super]=],[ [=[module]=] ]=[=[ares.dll]=],[ [=[rva]=] ]=216617,[ [=[original]=] ]=[=[8B AE A0 01 00 00]=],[ [=[pattern]=] ]=[=[8B AE A0 01 00 00 85 ED 7F 42 A1 4C 3D A8 00 83 C0 24 50 8B 08 FF 51 18]=],[ [=[body]=] ]=[=[db 8B AE A0 01 00 00
pushfd
push edx
cmp dword ptr [game.exe+0x68B238],0
je mode_ok
cmp dword ptr [game.exe+0x68B238],5
jne original
mode_ok:
mov edx,[edi+0x2C]
cmp edx,[game.exe+0x683D4C]
jne original
test ebp,ebp
jns original
xor ebp,ebp
original:
pop edx
popfd
jmp RETURN]=]},{[ [=[group]=] ]=[=[super]=],[ [=[module]=] ]=[=[ares.dll]=],[ [=[rva]=] ]=216867,[ [=[original]=] ]=[=[8B B7 A0 01 00 00]=],[ [=[pattern]=] ]=[=[8B B7 A0 01 00 00 85 F6 7F 12 8B 45 2C 83 C0 24 50 8B 08 FF 51 18 F7 DE]=],[ [=[body]=] ]=[=[db 8B B7 A0 01 00 00
pushfd
push edx
cmp dword ptr [game.exe+0x68B238],0
je mode_ok
cmp dword ptr [game.exe+0x68B238],5
jne original
mode_ok:
mov edx,[ebp+0x2C]
cmp edx,[game.exe+0x683D4C]
jne original
test esi,esi
jns original
xor esi,esi
original:
pop edx
popfd
jmp RETURN]=]},{[ [=[group]=] ]=[=[super]=],[ [=[module]=] ]=[=[ares.dll]=],[ [=[rva]=] ]=217779,[ [=[original]=] ]=[=[8B 83 A0 01 00 00]=],[ [=[pattern]=] ]=[=[8B 83 A0 01 00 00 89 44 24 18 85 C0 7F 56 8D 41 24 8B 08 50 FF 51 18 8B]=],[ [=[body]=] ]=[=[db 8B 83 A0 01 00 00
pushfd
push edx
cmp dword ptr [game.exe+0x68B238],0
je mode_ok
cmp dword ptr [game.exe+0x68B238],5
jne original
mode_ok:
mov edx,[esi+0x2C]
cmp edx,[game.exe+0x683D4C]
jne original
test eax,eax
jns original
xor eax,eax
original:
pop edx
popfd
jmp RETURN]=]},{[ [=[group]=] ]=[=[super]=],[ [=[module]=] ]=[=[ares.dll]=],[ [=[rva]=] ]=219357,[ [=[original]=] ]=[=[8B B3 A4 01 00 00]=],[ [=[pattern]=] ]=[=[8B B3 A4 01 00 00 85 F6 0F 84 95 00 00 00 8B 8B A8 01 00 00 85 C9 0F 8E]=],[ [=[body]=] ]=[=[db 8B B3 A4 01 00 00
pushfd
push edx
cmp dword ptr [game.exe+0x68B238],0
je mode_ok
cmp dword ptr [game.exe+0x68B238],5
jne original
mode_ok:
mov edx,[edi+0x2C]
cmp edx,[game.exe+0x683D4C]
jne original
test esi,esi
jns original
xor esi,esi
original:
pop edx
popfd
jmp RETURN]=]}}) do S.moSites[#S.moSites+1]=site end
local function currentHouse()
  local l=layouts[S.key]
  if not S.base or not l then return nil end
  local mode=readInteger(S.base+l.mode)
  if mode~=0 and mode~=5 then return nil end
  local p=readInteger(S.base+l.player)
  if not p or p==0 or readInteger(p)~=S.base+l.houseVT then return nil end
  return p
end
local function notifyPower()
  local p=currentHouse()
  if p then
    if not writeBytes(p+layouts[S.key].power,1,1) then error('refresh failed') end
    if not same(p+layouts[S.key].power,{1,1}) then error('refresh verification failed') end
  end
end
local function notifyRadar()
  if not currentHouse() then return end
  local surface=readInteger(S.base+layouts[S.key].surface)
  if not surface or surface==0 then return end
  local vt=readInteger(surface)
  if not vt or readInteger(vt+0x7C)~=S.base+layouts[S.key].width or readInteger(vt+0x80)~=S.base+layouts[S.key].height then
    error('radar surface layout differs')
  end
  local width,height=readInteger(surface+4),readInteger(surface+8)
  if not width or not height or width&lt;1 or height&lt;1 or width&gt;4096 or height&gt;4096 then error('invalid radar dimensions') end
  -- Native RadarClass update paints and consumes this rectangle on its own thread.
  local rectangle={}
  for _,value in ipairs({0,0,width,height}) do
    for i=1,4 do rectangle[#rectangle+1]=value%256;value=math.floor(value/256) end
  end
  local address=S.base+layouts[S.key].rectangle
  if not writeBytes(address,rectangle) or not same(address,rectangle) then error('radar refresh request failed') end
end
local function transaction(fn)
  local paused,reason=pcall(pause)
  if not paused then return false,reason end
  local ok,result=pcall(fn)
  local resumed,resumeError=pcall(unpause)
  if not resumed then return false,resumeError end
  return ok,result
end
local function captureIron()
  local house=currentHouse()
  if not house then error('Start or resume a map, then select your units or buildings before enabling this option.') end
  local l=layouts[S.key]
  local count=readInteger(S.base+l.selection+0x10)
  local list=readInteger(S.base+l.selection+4)
  if not count or count&lt;1 or not list or list==0 then error('Select your units or buildings before enabling this option.') end
  if count&gt;128 then error('This option currently supports up to 128 selected units or buildings. Select a smaller group and try again.') end
  local supported={[S.base+l.unit]=true,[S.base+l.infantry]=true,[S.base+l.aircraft]=true,[S.base+l.building]=true}
  local capture={house=house,houseID=readInteger(house+0x10),frame=readInteger(S.base+l.frame),targets={}}
  local seen={}
  for i=0,count-1 do
    local p=readInteger(list+i*4)
    local vt=p and p~=0 and readInteger(p)
    if supported[vt] and not seen[p] and readInteger(p+l.owner)==house and (readInteger(p+0x6C) or 0)&gt;0 then
      local id=readInteger(p+0x10)
      if id then capture.targets[#capture.targets+1]={p=p,id=id,vt=vt};seen[p]=true end
    end
  end
  if #capture.targets==0 or not capture.houseID or not capture.frame then error('No owned units or buildings in the selection can receive this effect.') end
  return capture
end
local function ironBody(c,site)
  local b={'pushfd','push eax','cmp dword ptr [STATE+4],1','jne original',
    'mov eax,[game.exe+0x640D2C]','cmp eax,[STATE]','jb expired','mov [STATE],eax',
    'cmp dword ptr [game.exe+0x63D298],0','je mode_ok','cmp dword ptr [game.exe+0x63D298],5','jne expired','mode_ok:',
    'mov eax,[game.exe+0x635DB4]','cmp eax,'..hex(c.house),'jne expired',
    'cmp dword ptr [eax+0x10],'..hex(c.houseID),'jne expired',
    'cmp [ecx+0x1B4],eax','jne original','cmp dword ptr [ecx+0x6C],0','jle original'}
  for i,t in ipairs(c.targets) do
    b[#b+1]='cmp ecx,'..hex(t.p);b[#b+1]='jne next_'..i
    b[#b+1]='cmp dword ptr [ecx+0x10],'..hex(t.id);b[#b+1]='jne original'
    b[#b+1]='cmp dword ptr [ecx],'..hex(t.vt);b[#b+1]='je matched';b[#b+1]='jmp original';b[#b+1]='next_'..i..':'
  end
  local matched
  if site.kind=='damage' then
    -- Positive damage only: healing follows the untouched native routine.
    matched='mov eax,[esp+0xC]\ncmp dword ptr [eax],0\njle original\npop eax\npopfd\nxor eax,eax\nret '..(S.key=='ra2' and '18' or '1C')
  else
    -- Draw a steady native health bar, without changing selection or status flags.
    matched='pop eax\npopfd\npushfd\npushad\nmov edx,[esp+0x28]\nmov eax,[esp+0x2C]\npush 0\npush eax\npush edx\ncall game.exe+'..(S.key=='ra2' and '0x2C3F00' or '0x2F64A0')..'\npopad\npopfd\njmp replay'
  end
  b[#b+1]='jmp original\nexpired:\nmov dword ptr [STATE+4],0\njmp original\nmatched:\n'..matched..'\noriginal:\npop eax\npopfd\nreplay:\ndb '..site.original..'\njmp RETURN'
  local body=table.concat(b,'\n')
  if S.key~='ra2' then
    body=body:gsub('0x640D2C','0x68ED84'):gsub('0x63D298','0x68B238'):gsub('0x635DB4','0x683D4C'):gsub('0x1B4','0x21C')
  end
  return body
end
local function scriptFor(feature,capture)
  local chunks={'[ENABLE]'}
  local selected={}
  local moduleBases={}
  if S.key=='mo' and (feature=='power' or feature=='super') then
    for _,m in ipairs(enumModules(getOpenedProcessID()) or {}) do moduleBases[m.Name:lower()]=m.Address end
    if not moduleBases['ares.dll'] then error('Ares module unavailable') end
  end
  for _,site in ipairs(S.key=='mo' and S.moSites or S.key=='yr' and S.yrSites or S.sites) do
    if site.group==feature then
      local address=(site.module and assert(moduleBases[site.module]) or S.base)+site.rva
      local pattern,original=bytes(site.pattern),bytes(site.original)
      -- A single complete signature read also validates its original-byte prefix.
      for i,value in ipairs(original) do if pattern[i]~=value then error('invalid signature prefix') end end
      if not same(address,pattern) then error('signature mismatch') end
      selected[#selected+1]={address=address,original=original,source=site}
    end
  end
  for n,site in ipairs(selected) do
    local prefix='katzy_'..S.key..'_'..feature..'_'..n
    site.prefix=prefix
    chunks[#chunks+1]='define('..prefix..'_site,'..hex(site.address)..')'
    chunks[#chunks+1]='assert('..prefix..'_site,'..site.source.original..')'
    chunks[#chunks+1]='alloc('..prefix..'_code,'..(feature=='iron' and '8192' or '512')..','..prefix..'_site)'
    local body=feature=='iron' and ironBody(capture,site.source) or site.source.body
    local labels={}
    for name in body:gmatch('([%w_]+):') do labels[#labels+1]=name;chunks[#chunks+1]='label('..prefix..'_'..name..')' end
    body=body:gsub('RETURN',hex(site.address+#site.original)):gsub('STATE','katzy_'..S.key..'_'..feature..'_1_code+1800')
    body=body:gsub('game%.exe%+0x([%x]+)',function(rva) return hex(S.base+tonumber(rva,16)) end)
    for _,name in ipairs(labels) do body=body:gsub('%f[%w_]'..name..'%f[^%w_]',prefix..'_'..name) end
    chunks[#chunks+1]=prefix..'_code:\n'..body
    chunks[#chunks+1]=prefix..'_site:\njmp '..prefix..'_code'
    if #site.original&gt;5 then chunks[#chunks+1]='db'..string.rep(' 90',#site.original-5) end
  end
  chunks[#chunks+1]='[DISABLE]'
  for _,site in ipairs(selected) do chunks[#chunks+1]=hex(site.address)..':\ndb '..site.source.original end
  for _,site in ipairs(selected) do chunks[#chunks+1]='dealloc('..site.prefix..'_code)' end
  return table.concat(chunks,'\n'),selected
end
local function disableUnsafe(feature)
  local state=S.active[feature]
  if not state then return true end
  if not (getProcesslist() or {})[state.pid] then S.active[feature]=nil;return true end
  if getOpenedProcessID()~=state.pid then
    S.lastError={feature=feature,stage='cleanup',detail='Original process is not attached.'}
    return false
  end
  local key,_,base=identify(state.pid,false)
  if key~=(state.key or 'ra2') or base~=state.base then
    S.lastError={feature=feature,stage='cleanup',detail='Game identity changed.'}
    return false
  end
  local ok,detail=transaction(function()
    for _,site in ipairs(state.sites) do
      if not site.patched or not same(site.address,site.patched) then error('patch ownership changed') end
    end
    local removed,reason=autoAssemble(state.script,state.info)
    if not removed then error(reason or 'restoration failed') end
    for _,site in ipairs(state.sites) do if not same(site.address,site.original) then error('restoration verification failed') end end
    S.active[feature]=nil
    if feature=='power' then notifyPower() end
    if feature=='visual' or feature=='reveal' then notifyRadar() end
  end)
  if not ok then
    S.lastError={feature=feature,stage='cleanup',detail=tostring(detail)}
  end
  return ok
end
local function disable(feature)
  local ok,result=pcall(disableUnsafe,feature)
  if not ok then S.lastError={feature=feature,stage='cleanup',detail=tostring(result)} end
  return ok and result or false
end
local function enable(feature,expectedKey)
  if archiveJob and archiveJob.pid==getOpenedProcessID() and not archiveJob.done then report('Game files are still being checked. Please wait until the Auto-Attach status shows the game is ready.');return false end
  local ok,key,title,base=pcall(identify,getOpenedProcessID(),'option')
  if not ok or not matchesGame(key,expectedKey) then report(ok and (key and 'Use the MAIN section for the attached game.' or title) or 'The game could not be checked. Reattach and try again.');return false end
  if not row(layouts[key].main).Active or not S.mainProfile or S.mainProfile.pid~=getOpenedProcessID() or S.mainProfile.base~=base or S.mainProfile.key~=key then
    report('Turn on the matching MAIN section to validate this game process first.');return false
  end
  for _,state in pairs(S.active) do
    if state.pid~=getOpenedProcessID() or (state.key or 'ra2')~=key then report('Clear the options in the original game before switching games.');return false end
  end
  S.key,S.base=key,base
  if S.active[feature] then return true end
  local opposite=feature=='visual' and 'reveal' or feature=='reveal' and 'visual'
  if opposite and S.active[opposite] then
    if not disable(opposite) then return false end
    featureRow(opposite,key).Active=false
  end
  local script,sites,capture
  if feature=='iron' then
    local captured,result=pcall(captureIron)
    if not captured then report(tostring(result):gsub('^.-:%d+: ',''));return false end
    capture=result
  end
  ok=pcall(function() script,sites=scriptFor(feature,capture) end)
  if not ok then report('The running code differs from this build. Disable other tables or modifications and restart the original game.');return false end
  local state={pid=getOpenedProcessID(),key=key,base=base,script=script,sites=sites,capture=capture}
  local stage='validation'
  local installed,detail=transaction(function()
    for _,site in ipairs(sites) do if not same(site.address,site.original) then error('code changed') end end
    if capture then
      if currentHouse()~=capture.house then error('selection session changed') end
      for _,t in ipairs(capture.targets) do if readInteger(t.p)~=t.vt or readInteger(t.p+0x10)~=t.id or readInteger(t.p+layouts[key].owner)~=capture.house then error('selection changed') end end
    end
    stage='assembly'
    local success,info=autoAssemble(script)
    if not success then error(info or 'assembly failed',0) end
    stage='verification'
    state.info=info
    S.active[feature]=state
    for _,site in ipairs(sites) do
      local code=info.allocs[site.prefix..'_code'].address
      if capture and not state.ironState then
        state.ironState=code+0x1800
        local v=capture.frame;local initial={}
        for i=1,4 do initial[#initial+1]=v%256;v=math.floor(v/256) end
        for _,b in ipairs({1,0,0,0}) do initial[#initial+1]=b end
        if not writeBytes(state.ironState,initial) or not same(state.ironState,initial) then error('selection state failed') end
      end
      local delta=(code-site.address-5)%0x100000000
      local expected={0xE9}
      for i=1,4 do expected[#expected+1]=delta%256;delta=math.floor(delta/256) end
      while #expected&lt;#site.original do expected[#expected+1]=0x90 end
      site.patched=expected
    end
    for _,site in ipairs(sites) do if not same(site.address,site.patched) then error('patch verification failed') end end
    if feature=='power' then notifyPower() end
    if feature=='visual' or feature=='reveal' then notifyRadar() end
  end)
  if not installed then
    S.lastError={feature=feature,stage=stage,detail=tostring(detail)}
    if S.active[feature] then disable(feature) end
    if stage=='assembly' then
      report('Cheat Engine could not compile this option. Keep it off and use the latest table revision.')
    else
      report('The option did not pass its installation check. Keep it off and use Clear All before retrying.')
    end
    return false
  end
  return true
end
local function clearRows()
  local clean=true
  for _,feature in ipairs({'iron','visual','reveal','super','ammo','build','power','money'}) do
    if disable(feature) then
      if not S.closing then featureRow(feature,'ra2').Active=false;featureRow(feature,'yr').Active=false end
    else clean=false end
  end
  if clean and not S.closing then row(10).Active=false;row(20).Active=false end
  return clean
end
function S.clear()
  if not S.changingProcess then S.resumeProfiles={} end
  local ok,result=pcall(clearRows)
  if not ok then S.lastError={stage='cleanup',detail=tostring(result)} end
  local clean=ok and result or false
  if not S.closing then
    pcall(function() row(4).Description=clean and 'Clear All' or 'Clear All — cleanup incomplete; reattach the original game and retry' end)
  end
  return clean
end
function S.shutdown()
  archiveJob=nil
  if S.timer then S.timer.destroy();S.timer=nil end
  if not S.clear() then return false end
  if not S.closing then
    local form=getMainForm()
    if S.close then form.unregisterCloseCallback(S.close);S.close=nil end
    if S.closeQuery and form.OnCloseQuery==S.closeQuery then form.OnCloseQuery=S.previousCloseQuery end
  end
  return true
end
for feature,id in pairs(ids) do
  for _,key in ipairs({'ra2','yr'}) do
    featureRow(feature,key).OnActivate=function(_,before) if before then return enable(feature,key) end return true end
    featureRow(feature,key).OnDeactivate=function(_,before)
      if S.closing then return true end
      if before and S.active[feature] and matchesGame(S.active[feature].key or 'ra2',key) then return disable(feature) end
      return true
    end
  end
end
row(10).OnDeactivate=function(_,before)
  if S.closing or not before then return true end
  if S.clearingMain then return true end
  S.clearingMain=true
  local result=S.clear()
  S.clearingMain=nil
  return result
end
row(20).OnDeactivate=row(10).OnDeactivate
for id,key in pairs({[10]='ra2',[20]='yr'}) do
  row(id).OnActivate=function(_,before)
    if not before then return true end
    if not prepareArchives(getOpenedProcessID()) then report('Game files are still being checked. Please wait until the Auto-Attach status shows the game is ready.');return false end
    local ok,found,message,base=pcall(identify,getOpenedProcessID(),true)
    if not ok or not matchesGame(found,key) then report(ok and (found and 'Select the MAIN section for the attached game.' or message) or 'The game could not be checked. Reattach and try again.');return false end
    for _,state in pairs(S.active) do
      if state.pid~=getOpenedProcessID() or (state.key or 'ra2')~=found then report('Clear the options in the original game before switching games.');return false end
    end
    S.key,S.base=found,base
    S.mainProfile={pid=getOpenedProcessID(),key=found,base=base}
    return true
  end
end
-- RA2 uses a double at Techno+118 (YR's float layout does not apply).
local veteranChecks={ra2={
  {0x305020,'8B 81 AC 05 00 00 C3'},
  {0x106950,'8B 81 A8 05 00 00 C3'},
  {0x1B600,'8B 81 AC 05 00 00 C3'},
  {0x2D8554,'8D 8E 18 01 00 00 E8 C1 AE 03 00'},
  {0x313420,'DD 01 DC 1D F8 A6 79 00 DF E0 F6 C4 01 75 06'},
  {0x2CEECD,'8A 88 9A 0A 00 00 5B 84 C9 74 28'},
  {0x39A6F8,'00 00 00 00 00 00 00 40'}
},yr={{0x341490,'8B 81 C4 06 00 00 C3'},{0x11FAF0,'8B 81 C0 06 00 00 C3'},{0x1C200,'8B 81 C4 06 00 00 C3'},{0x2FA05A,'8D 9E 50 01 00 00 8B CB E8 C9 5F 05 00'},{0x350010,'D9 01 D8 1D B4 37 7E 00 DF E0 F6 C4 01 75 06'},{0x302EFF,'8A 88 8E 0C 00 00 84 C9 74 28'},{0x3E37B4,'00 00 00 40'}}}
local function promoteSelected(expectedKey)
  if archiveJob and archiveJob.pid==getOpenedProcessID() and not archiveJob.done then report('Game files are still being checked. Please wait until the Auto-Attach status shows the game is ready.');return false end
  if S.closing then return end
  local ok,key,message,base=pcall(identify,getOpenedProcessID(),'option')
  if not ok or not matchesGame(key,expectedKey) then
    report(ok and (key and 'Select the MAIN section for the attached game.' or message) or 'The game could not be checked. Reattach and try again.');return
  end
  local profile=S.mainProfile
  local l=layouts[key]
  if not row(l.main).Active or not profile or profile.pid~=getOpenedProcessID() or profile.key~=key or profile.base~=base then
    report('Turn on the matching MAIN section to validate this game process first.');return
  end
  S.key,S.base=key,base
  if not currentHouse() then report('Start or resume a map, then select your units before using this option.');return end
  local result,detail=transaction(function()
    if getOpenedProcessID()~=profile.pid then error('process changed') end
    local house=currentHouse()
    if not house then error('map changed') end
    for _,check in ipairs(veteranChecks[key=='mo' and 'yr' or key]) do
      if not same(base+check[1],bytes(check[2])) then error('veterancy code differs') end
    end
    local count=readInteger(base+l.selection+0x10)
    local capacity=readInteger(base+l.selection+8)
    local selection=readInteger(base+l.selection+4)
    if count==0 then return 'Select your units before using this option.' end
    if not count or not capacity or count&lt;0 or count&gt;capacity or count&gt;65536 or not selection or selection==0 then error('invalid selection') end
    local offsets={[base+l.unit]=l.unitType,[base+l.infantry]=l.infantryType,[base+l.aircraft]=l.unitType}
    local targets,seen={},{}
    for i=0,count-1 do
      local p=readInteger(selection+i*4)
      local vt=p and p~=0 and readInteger(p)
      local offset=offsets[vt]
      if offset and not seen[p] and readInteger(p+l.owner)==house and (readInteger(p+0x6C) or 0)&gt;0 then
        seen[p]=true
        local kind=readInteger(p+offset)
        if kind and kind~=0 and same(kind+l.trainable,{1}) then
          local rank=(key~='ra2' and readFloat or readDouble)(p+l.rank)
          if not rank or rank~=rank or rank&lt;0 or rank&gt;2 then error('invalid veterancy') end
          targets[#targets+1]={p=p,rank=rank}
        end
      end
    end
    if #targets==0 then return 'No owned units in the selection can receive this promotion.' end
    for _,target in ipairs(targets) do
      if target.rank&lt;2 then
        local address=target.p+l.rank
        local elite=l.elite
        if not writeBytes(address,elite) or not same(address,elite) then error('promotion write failed') end
      end
    end
  end)
  if not result then
    S.lastError={stage='selected veterancy',detail=tostring(detail)}
    report('The promotion could not be completed. Some selected units may already be Elite. Check the original game is attached, select your units, and try again.')
  elseif detail then report(detail) end
end
row(19).OnActivate=function(_,before) if before then promoteSelected('ra2') end return false end
row(1).OnActivate=function() return false end
row(29).OnActivate=function(_,before) if before then promoteSelected('yr') end return false end
row(2).OnActivate=function(_,before) if before then shellExecute('https://ko-fi.com/katzy') end return false end
row(3).OnActivate=function(_,before)
  if before then showMessage([[Table identification: Katzy.

Start the game, open the table in Cheat Engine and allow its Lua script. Tick the matching MAIN section, then choose your options. Mental Omega 3.3.6 uses the Yuri’s Revenge and Mental Omega MAIN section and the same option list; the table detects it automatically and shows Mental Omega 3.3.6 in the Auto-Attach status. Start the mod through MentalOmegaClient. Other mod versions and added gameplay archives are not supported. Use in campaign or single-player skirmish. If both games are running, select the desired process in Cheat Engine. Ordinary options carry over between matches, including a new game process launched while this table stays open. Choices are remembered separately for RA2, Yuri’s Revenge and Mental Omega and reapplied only after version validation. Clear All or turning MAIN off cancels remembered choices. Selected-unit protection expires with its map; promotion remains a one-time action.

Infinite Money
Adds a 30,000-credit allowance. Earnings increase the total; purchases spend the surplus down to the allowance. Turning it off removes the allowance and keeps your unspent normal credits.

Infinite Power
Meets your power needs with 5,000 spare power, including Mental Omega’s Ares power checks. Turning it off restores normal power behavior; prerequisites still apply.

Instant Build
Finishes paid production. Normal prices, prerequisites, placement and factory exit rules still apply. Turning it off restores normal future production; completed items stay completed. Clear space around blocked factory exits so queued units can be delivered. Manual pauses and queue limits still apply.

Infinite Aircraft Ammo
Stops your aircraft from spending ammunition normally reloaded at an airfield. Empty aircraft need one normal reload first. Firing speed stays normal. Turning it off restores ammunition use.

Instant Superweapons
Superweapons must be powered and available. Enable Infinite Power to prevent a low-power hold; missing or disabled buildings and other game restrictions still apply.
Readies available superweapons. In Mental Omega, your powers also ignore activation fees and ongoing cash upkeep while enabled; money rewards remain unchanged. Turning it off restores normal costs. Required buildings, power and targeting rules still apply. Turning it off restores normal recharge after use. Mental Omega charge-drain powers, including Psychic Flash, recharge instantly while their active effect keeps its normal duration.

Invulnerability - Selected Units and Buildings
Select units and buildings you own in a live match, then enable this option to block positive damage to that group. A steady health bar marks protected targets; no flashing tint or Iron Curtain status is applied. Changing selection does not move protection. Turn it off or use Clear All to remove protection; select another group and enable again to change targets. Changing maps clears protection. Healing and native temporary Iron Curtain effects continue normally. Protection does not grant immunity to capture, removal scripts or other non-damage effects.

Reveal Map - Full
Bypasses normal shroud and fog checks. Cloaking, weapon range and other attack rules still apply. Use only one Reveal Map mode at a time.

Reveal Map - Visual Only
Shows terrain and objects without granting gameplay sight. Normal scouting, targeting and cloaking rules still apply. Use this mode for campaigns. Turning either reveal mode off restores normal visibility and preserves natural exploration. Radar still needs its normal availability and power; scroll the view to refresh old screen areas.

Promote Selected Units - Maximum Veterancy (One Shot)
Select units you own in a live match and activate once to grant maximum veterancy to eligible units. Granted ranks remain after Clear All. Units that cannot gain veterancy are skipped. Eligible units are promoted to Elite. The checkbox unticks immediately; select another group and activate again to promote it.

Restart Cheat Engine as Administrator
Mental Omega needs Cheat Engine in administrator mode in this installation. Its client menu is separate from the game: after restarting CE as administrator, start a match for automatic attachment. Accept the Windows permission prompt. Active options are cleared, a temporary copy of this table opens in the new instance, and the old window closes after launch. Cancelling leaves the old window open. Allow the table Lua script again if prompted.

Clear All
Turns off the options and MAIN. If paused, resume briefly to let cleanup finish. Turn options off before saving, loading, switching processes manually or replacing the table.]]) end
  return false
end
row(4).OnActivate=function(_,before) if before then S.clear() end return false end
local function psQuote(value) return "'"..value:gsub("'","''").."'" end
local function checkAdminRestart()
  local pending=S.adminRestart
  if not pending then return false end
  local file=io.open(pending.status,'rb')
  if not file then return false end
  local status=file:read('*a');file:close();os.remove(pending.status)
  S.adminRestart=nil
  if status=='started' then
    local ok=pcall(closeCE)
    if not ok then report('The administrator instance has started. You can close this original Cheat Engine window.') end
    return true
  end
  report('The administrator restart was cancelled or could not start. This Cheat Engine window remains open.')
  return false
end
row(5).OnActivate=function(_,before)
  if not before or S.closing or S.adminRestart then return false end
  if type(isAdmin)~='function' or type(closeCE)~='function' then report('This Cheat Engine version does not support this restart helper. Reopen Cheat Engine as administrator manually.');return false end
  if isAdmin() then report('Cheat Engine is already running as administrator.');return false end
  if not S.clear() then report('Active options could not be cleared. Reattach to the original game and use Clear All before restarting.');return false end
  local ok,detail=pcall(function()
    local ownPID=getCheatEngineProcessID()
    local executable
    for _,m in ipairs(enumModules(ownPID) or {}) do
      if m.Name:lower():match('%.exe$') then executable=m.PathToFile;break end
    end
    if not executable or not fileExists(executable) then error('executable unavailable') end
    local temp=os.getenv('TEMP')
    if not temp then error('temporary folder unavailable') end
    local stem=temp..'\\Katzy-RA2YR-admin-'..ownPID..'-'..os.time()
    local tablePath=stem..'.CT'
    local statusPath=stem..'.status'
    saveTable(tablePath)
    if not fileExists(tablePath) then error('table could not be saved') end
    local script="$ErrorActionPreference='Stop'; try { $child=Start-Process -FilePath "..psQuote(executable).." -ArgumentList ([char]34+"..psQuote(tablePath).."+[char]34) -Verb RunAs -PassThru; if (!$child) { throw 'No process' }; [IO.File]::WriteAllText("..psQuote(statusPath)..",'started') } catch { [IO.File]::WriteAllText("..psQuote(statusPath)..",'cancelled') }"
    S.adminRestart={status=statusPath}
    shellExecute((os.getenv('SystemRoot') or 'C:\\Windows')..'\\System32\\WindowsPowerShell\\v1.0\\powershell.exe','-NoProfile -NonInteractive -WindowStyle Hidden -Command "'..script..'"',temp,0)
  end)
  if not ok then S.adminRestart=nil;S.lastError={stage='administrator restart',detail=tostring(detail)};report('The restart could not be prepared. This Cheat Engine window remains open. Reopen Cheat Engine as administrator manually.') end
  return false
end

local function waitingStatus(processes)
  local menu=false
  for pid,name in pairs(processes) do
    name=name:lower()
    if name=='mentalomegaclient.exe' or name=='clientdx.exe' or name=='clientxna.exe' or name=='clientogl.exe' then
      local ok,modules=pcall(enumModules,pid)
      if name=='mentalomegaclient.exe' or not ok or not modules or #modules==0 then menu=true
      else
        for _,m in ipairs(modules) do
          local path=(m.PathToFile or ''):lower():gsub('/','\\')
          if path:find('\\mental omega\\',1,true) then menu=true end
        end
      end
    end
  end
  if menu then
    if type(isAdmin)=='function' and isAdmin() then
      return 'Mental Omega menu detected — administrator mode ready; start a match to attach'
    end
    return 'Mental Omega needs administrator mode — tick Restart Cheat Engine as Administrator'
  end
  return 'Auto-Attach and Version Check — waiting for a game'
end

function S.refresh()
  if S.closing then return end
  if checkAdminRestart() then return end
  local processes=getProcesslist() or {}
  local previous=S.mainProfile
  if previous and not processes[previous.pid] then
    local wanted={}
    for feature,state in pairs(S.active) do
      if feature~='iron' and state.pid==previous.pid and state.key==previous.key then wanted[feature]=true end
    end
    S.resumeProfiles[previous.key]=wanted
    S.mainProfile=nil
  end
  for feature,state in pairs(S.active) do
    if not processes[state.pid] then S.active[feature]=nil;featureRow(feature,state.key).Active=false end
  end
  local iron=S.active.iron
  if iron and iron.pid==getOpenedProcessID() and same(iron.ironState+4,{0,0,0,0}) then
    if disable('iron') then featureRow('iron',iron.key).Active=false end
  end
  local pid=getOpenedProcessID()
  if not processes[pid] and not next(S.active) then
    local candidates={}
    local inaccessible=false
    for candidate,name in pairs(processes) do
      if name:lower()=='game.exe' or name:lower()=='gamemd.exe' then
        local ok,key=pcall(identify,candidate,false)
        if ok and key then candidates[#candidates+1]=candidate else local readable,modules=pcall(enumModules,candidate);if not readable or not modules or #modules==0 then inaccessible=true end end
      end
    end
    if #candidates==1 then openProcess(candidates[1]);pid=getOpenedProcessID()
    elseif #candidates&gt;1 then row(1).Description='Auto-Attach and Version Check — select a game';return
    elseif inaccessible then row(1).Description=(type(isAdmin)=='function' and isAdmin()) and 'Game found but access is unavailable — check the attached process' or 'Game found — administrator mode required; tick Restart Cheat Engine as Administrator';return end
  end
  if not processes[pid] then archiveJob=nil end
  if pid==S.pid and processes[pid] then return end
  if processes[pid] and not next(S.active) and not prepareArchives(pid) then
    row(1).Description='Auto-Attach and Version Check — checking game files in the background'
    return
  end
  if S.pid~=pid then moArchiveCache=nil end
  S.pid=pid
  S.mainProfile=nil
  if not processes[pid] then S.key=nil;S.base=nil;row(1).Description=waitingStatus(processes);return end
  if next(S.active) then row(1).Description='Auto-Attach and Version Check — reattach to clear the previous game';return end
  S.changingProcess=true
  row(10).Active=false;row(20).Active=false
  S.changingProcess=nil
  local ok,key,message,base=pcall(identify,pid,true)
  if not ok then key=nil;message='Game identity could not be checked.' end
  S.key,S.base=key,base
  row(1).Description='Auto-Attach and Version Check — '..message
  if not key then report(message);return end
  local wanted=S.resumeProfiles[key]
  if wanted then
    S.resumeProfiles[key]=nil
    S.mainProfile={pid=pid,key=key,base=base}
    row(layouts[key].main).Active=true
    for _,feature in ipairs({'money','power','build','ammo','super','visual','reveal'}) do
      if wanted[feature] and enable(feature,key=='mo' and 'yr' or key) then featureRow(feature,key).Active=true end
    end
  end
end
S.timer=createTimer(nil,false)
S.timer.Interval=2000
S.timer.OnTimer=function() if S.closing then return end local ok=pcall(S.refresh);if not ok then S.timer.Enabled=false;report('Game detection stopped. Reload the table after attaching to the game.') end end
S.previousCloseQuery=getMainForm().OnCloseQuery
S.closeQuery=function(sender)
  if S.previousCloseQuery then
    local ok,allowed=pcall(S.previousCloseQuery,sender)
    if ok and allowed==false then return false end
  end
  S.closing=true
  -- Detach while the records are alive. No Lua callback should run during destruction.
  for _,record in pairs(records) do
    pcall(function() record.OnActivate=nil;record.OnDeactivate=nil;record.OnDestroy=nil end)
  end
  local ok,detail=pcall(S.shutdown)
  if not ok then S.lastError={stage='close cleanup',detail=tostring(detail)} end
  return true
end
getMainForm().OnCloseQuery=S.closeQuery
-- The close notification is too late for process access: preserve its action only.
S.close=getMainForm().registerCloseCallback(function(_,action) return action end)
row(1).OnDestroy=function()
  if S.closing then return end
  -- Records may already be invalid when destruction precedes the form callback.
  S.closing=true
  local ok,detail=pcall(S.shutdown)
  if not ok then S.lastError={stage='destroy cleanup',detail=tostring(detail)} end
end
S.timer.Enabled=true
S.refresh()
</LuaScript>
</CheatTable>