Need some coding help.

10/28/2009 03:57 Hunter_1#1
I need some help with these aion pointers and offsets.

I can get the base address of the game.dll module but I cannot for the life of me get any information from the target such as level.

Coding in autoit3.

This function is what I use to get the game.dll base address as teh nomad version won't work for me for what ever reason.

PHP Code:
Func _ProcessGetModuleBase($ivPID$svModuleName)
    
$ivPID ProcessExists($ivPID)
    If 
Not $ivPID Then Return(SetError(100)); Process does not exist

    Local 
Const $TH32CS_SNAPMODULE 0x00000008
    Local 
Const $sMODULEENTRY32Struct "dword Size;" _
                            
"dword 32ModuleID;" _
                            
"dword 32ProcessID;" _
                            
"dword GlblcntUsage;" _
                            
"dword ProccntUsage;" _
                            
"ptr modBaseAddr;" _; <---- hmm ?
                            
"dword modBaseSize;" _
                            
"hwnd hModule;" _
                            
"char Module[255];" _
                            
"char ExePath[260]"

    
Local $hvSnapShot DllCall("Kernel32.dll""hwnd""CreateToolhelp32Snapshot""dword"$TH32CS_SNAPMODULE"dword"$ivPID)
    If 
Not $hvSnapShot[0Then Return(SetError(200)); Could not create snapshot?

    
Local $stMODULEENTRY32 DllStructCreate($sMODULEENTRY32Struct)
    
DllStructSetData($stMODULEENTRY32"Size"DllStructGetSize($stMODULEENTRY32))

    
Local $ivState DllCall("Kernel32.dll""int""Module32First""hwnd"$hvSnapShot[0], "long_ptr"DllStructGetPtr($stMODULEENTRY32))
    If 
Not $ivState[0Then Return(SetError(3_WinAPI_CloseHandle($hvSnapShot[0]), 0)); Could not enumerate first module in list?
    
Local $ivRet 0
    Local $svModule

    
Do
        
$ivRet DllStructGetData($stMODULEENTRY32"modBaseAddr")
        
$svModule DllStructGetData($stMODULEENTRY32"Module")
        If 
$svModule $svModuleName Then ExitLoop
        $ivState 
DllCall("Kernel32.dll""int""Module32Next""hwnd"$hvSnapShot[0], "long_ptr"DllStructGetPtr($stMODULEENTRY32))
        
Sleep(1)
    
Until Not $ivState[0]

    
DllCall("Kernel32.dll""int""CloseHandle""int"$hvSnapShot[0])

    Return 
$ivRet
EndFunc 

This is the code i'm actually calling and nothing is being returned from it, its always 0.

PHP Code:
Func getTargetLevel()
    
$StaticOffset Dec("4F68FC"); this hex value is the entrypoint
    
Global $CUROffset[1]
    
$CUROffset[0] = 0
    $baseADDR2 
_ProcessGetModuleBase($PID"Game.dll")
    
$finalAddr "0x" Hex($baseADDR2 $StaticOffset)
    
$out Read_Memory($PID$finalAddr)
    
$out Read_Memory($PID$out 0x1C4)
    
$out Read_Memory($PID$out 0x0032)
    Return 
$out
EndFunc 

Any help or examples would be great.