include("addresses.lua"); repeat mywin = findProcess("AION*"); proc = openProcess(mywin); mainOffset = getModuleAddress(mywin, "Game.dll"); until mainOffset ~= 0 player = {}; target = {}; function memoryReadRepeat(_type, proc, address, offset) local readfunc; local ptr = false; local val; if( type(proc) ~= "userdata" ) then error("Invalid proc", 2); end if( type(address) ~= "number" ) then error("Invalid address", 2); end if( _type == "int" ) then readfunc = memoryReadInt; elseif( _type == "uint" ) then readfunc = memoryReadUInt; elseif( _type == "float" ) then readfunc = memoryReadFloat; elseif( _type == "byte" ) then readfunc = memoryReadByte; elseif( _type == "string" ) then readfunc = memoryReadString; elseif( _type == "intptr" ) then readfunc = memoryReadIntPtr; ptr = true; elseif( _type == "uintptr" ) then readfunc = memoryReadUIntPtr; ptr = true; elseif( _type == "byteptr" ) then readfunc = memoryReadBytePtr; ptr = true; elseif( _type == "floatptr" ) then readfunc = memoryReadFloatPtr; ptr = true; else return nil; end for i = 1, 10 do if( ptr ) then val = readfunc(proc, address, offset); else val = readfunc(proc, address); end if( val ~= nil ) then return val; end end if( settings.options.DEBUGGING ) then printf("Error in memory reading: memoryread%s(proc,0x%X", _type, address) if ptr then if type(offset) == "number" then printf(" ,0x%X)\n",offset) elseif type(offset) == "table" then printf(" ,{") for k,v in pairs(offset) do printf("0x%X,",v) end printf("})\n") end else print(")") end end end -- Everything offset from Game.dll print(memoryReadFloat(proc, mainOffset + 0xFAD4B8)) player.Name = memoryReadUString(proc, mainOffset + addresses.playerName); printf("Character name:\t\t%s\n",player.Name); player.MaxHp = memoryReadRepeat("int",proc, mainOffset + addresses.playerMaxHp); player.CurHp = memoryReadRepeat("int",proc, mainOffset + addresses.playerCurHp); printf("Character hitpoints:\t(%d/%d)\n",player.CurHp,player.MaxHp); player.MaxMp = memoryReadRepeat("int",proc, mainOffset + addresses.playerMaxMp); player.CurMp = memoryReadRepeat("int",proc, mainOffset + addresses.playerCurMp); printf("Character mana:\t\t(%d/%d)\n",player.CurMp,player.MaxMp); player.CurDp = memoryReadRepeat("int",proc, mainOffset + addresses.playerCurDp); printf("Character Dp Points:\t%d\n",player.CurDp); player.CurExp = memoryReadRepeat("int",proc, mainOffset + addresses.playerCurExp); player.MaxExp = memoryReadRepeat("int",proc, mainOffset + addresses.playerMaxExp); printf("Character Experience:\t(%d/%d)\n",player.CurExp,player.MaxExp); player.ExpDebt = memoryReadRepeat("int",proc, mainOffset + addresses.playerExpDebt); printf("Character Exp Debt:\t%d\n",player.ExpDebt); player.Level = memoryReadShort(proc, mainOffset + addresses.playerLevel); printf("Character Level:\t%d\n",player.Level); player.X = memoryReadRepeat("float",proc, mainOffset + addresses.playerXPos); player.Z = memoryReadRepeat("float",proc, mainOffset + addresses.playerZPos); player.Y = memoryReadRepeat("float",proc, mainOffset + addresses.playerYPos); printf("Character Position:\t(%d,%d,%d)\n",player.X,player.Z,player.Y); --target.Pointer = memoryReadRepeat("uint",proc, mainOffset + addresses.targetPtr); if memoryReadRepeat("int",proc,mainOffset + addresses.targetPtr) ~= 0 then target.X = memoryReadRepeat("floatptr",proc, mainOffset + addresses.targetPtr, addresses.targetXOffset); target.Z = memoryReadRepeat("floatptr",proc, mainOffset + addresses.targetPtr, addresses.targetZOffset); target.Y = memoryReadRepeat("floatptr",proc, mainOffset + addresses.targetPtr, addresses.targetYOffset); printf("Target Position:\t(%d,%d,%d)\n",target.X,target.Z,target.Y); --target.Info = memoryReadRepeat("int",proc, target.Pointer + addresses.targetOffset); target.Name = memoryReadUStringPtr(proc, mainOffset + addresses.targetPtr, {addresses.targetOffset, addresses.targetName}); target.CurHp = memoryReadRepeat("intptr",proc, mainOffset + addresses.targetPtr, {addresses.targetOffset, addresses.targetCurHp}); target.MaxHp = memoryReadRepeat("intptr",proc, mainOffset + addresses.targetPtr, {addresses.targetOffset, addresses.targetMaxHp}); target.Name = string.sub(target.Name,2); printf("Target Name:\t\t%s\n",target.Name); printf("Target hitpoints:\t(%d/%d)\n",target.CurHp,target.MaxHp); end closeProcess(proc);