<?xml version="1.0" encoding="utf-8"?>
<CheatTable CheatEngineTableVersion="18">
  <CheatEntries>
    <CheatEntry>
      <ID>4</ID>
      <Description>"Get crypto key"</Description>
      <LastState Activated="0"/>
      <Color>0080FF</Color>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>[ENABLE]
{$lua}
local CryptoKey=readInteger('[["AGE.EXE"+00270990]+5D708]-4')
writeIntegerLocal(getAddress("AgeCryptoKey",true),CryptoKey)
{$asm}
[DISABLE]
</AssemblerScript>
      <CheatEntries>
        <CheatEntry>
          <ID>0</ID>
          <Description>"0 here means decryption OK"</Description>
          <LastState Value="??" Activated="0" RealAddress="00000000"/>
          <Color>80000008</Color>
          <VariableType>Custom</VariableType>
          <CustomType>AGE Engine encrypted int</CustomType>
          <Address>"AGE.EXE"+00270990</Address>
          <Offsets>
            <Offset>FFFFFFFC</Offset>
            <Offset>5D708</Offset>
          </Offsets>
        </CheatEntry>
        <CheatEntry>
          <ID>17508</ID>
          <Description>"money (edit this pointer)"</Description>
          <LastState Value="??" Activated="0" RealAddress="00000000"/>
          <Color>80000008</Color>
          <VariableType>Custom</VariableType>
          <CustomType>AGE Engine encrypted int</CustomType>
          <Address>AGE.EXE+270818</Address>
          <Offsets>
            <Offset>5C484</Offset>
            <Offset>5D3D0</Offset>
          </Offsets>
        </CheatEntry>
      </CheatEntries>
    </CheatEntry>
  </CheatEntries>
  <UserdefinedSymbols/>
  <LuaScript>local AGEEncryptedInt=[[
alloc(ConvertRoutine,1024)
alloc(ConvertBackRoutine,1024)
alloc(TypeName,256)
alloc(ByteSize,4)
alloc(UsesFloat,1)
globalalloc(AGECryptoKey_buffer,4)
label(AGECryptoKey)
registersymbol(AGECryptoKey)
TypeName:
db 'AGE Engine encrypted int',0
//version 2
//by Gniarf
ByteSize:
dd 4
UsesFloat:
db 0
AGECryptoKey_buffer:
AGECryptoKey:
dd 0
//The convert routine should hold a routine that converts the data to an integer (in eax)
//function declared as: stdcall int ConvertRoutine(unsigned char *input);
ConvertRoutine:
[64-bit]
//rcx=address of input
mov eax,[rcx] //eax now contains the bytes 'input' pointed to
//decrypt
xor eax,dword [AGECryptoKey]
ror eax,#14
ret
[/64-bit]
[32-bit]
//parameters: (32-bit)
push ebp
mov ebp,esp
//[ebp+8]=input
mov eax,[ebp+8] //place the address that contains the bytes into eax
mov eax,[eax] //place the bytes into eax so it's handled as a normal 4 byte value
//decrypt
xor eax,dword [AGECryptoKey]
ror eax,#14
pop ebp
ret 4
[/32-bit]
//The convert back routine should hold a routine that converts the given integer back to a row of bytes (e.g when the user wats to write a new value)
//function declared as: stdcall void ConvertBackRoutine(int i, unsigned char *output);
ConvertBackRoutine:
[64-bit]
//parameters: (64-bit)
//ecx=input
//rdx=address of output
//encrypt
rol ecx,#14
xor ecx,dword [AGECryptoKey]
mov [rdx],ecx //place the integer the 4 bytes pointed to by rdx
ret
[/64-bit]
[32-bit]
//parameters: (32-bit)
push ebp
mov ebp,esp
//[ebp+8]=input
//[ebp+c]=address of output
//example:
push eax
push ebx
mov eax,[ebp+8] //load the value into eax
mov ebx,[ebp+c] //load the address into ebx
//encrypt
rol eax,#14
xor eax,dword [AGECryptoKey]
mov [ebx],eax //write the value into the address
pop ebx
pop eax
pop ebp
ret 8
[/32-bit]
]]
registerCustomTypeAutoAssembler(AGEEncryptedInt)
</LuaScript>
</CheatTable>
