Solved Memory Reading Pointer AUTOIT

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

insomniac420

Newbie
Full Member
Dec 29, 2013
5
142
1
Hi guys i am trying to read this static address:74EB4720 with this offset:264 i have them saved to a INI. My script for some reason it only returns a 0. Please take a look for me ty
By the way im using autoit so i dont want to hear you trolls talking shit against autoit.

C++:
#RequireAdmin
#include "[Includes]\NomadMemory.au3"
$INI=@ScriptDir&"\options.ini"
$StaticAddress =IniRead($INI,"GameClient","BaseAddress",0);read and declare Static Address from ini
$ProcName=IniRead($INI,"GameClient","ProcName",0);read and declare Proc Full Name from ini
$ClientName=StringSplit($ProcName,".");read and declare Proc short name from ini
$Value=IniRead($INI,"GameClient","AddValue",0);read and declare Value from ini
$Offset=IniRead($INI,"GameClient","Offset",0);read and declare offset from ini
SetPrivilege("SeDebugPrivilege", 1);set Privileges

$PID = ProcessExists($ProcName);get PID for program
Global $Offset[1] = ["0x" & dec($Offset)]; declare offset and or offset
$StaticAddress = "0x"&$StaticAddress;Static address Offsets
$openmem = _MemoryOpen($PID);Open PID memory
$baseADDR = _MemoryGetBaseAddress($openmem, 1);Recover PID Base Address
$finalADDR = "0x" & Hex($baseADDR + $StaticAddress);Get final read addresss
$Mread = _MemoryPointerRead($finalADDR, $openmem, $Offset, 'dword');Read pointer $StaticAddress w/ $Offset added
_MemoryClose($openmem);Close Memory
MsgBox(0, "Result", "My HP = "&$Mread[1],-1,"");Display Results of pointer
 

insomniac420

Newbie
Full Member
Dec 29, 2013
5
142
1
OK well I got it working and it works well here it is:


C#:
#RequireAdmin
#include "[Includes]\NomadMemory.au3"
#include "[Includes]\String.au3"
$INI=@ScriptDir&"\options.ini"
$StaticAddress =IniRead($INI,"GameClient","StaticAddress",0)
$ProcName=IniRead($INI,"GameClient","ProcName",0)
$Value=IniRead($INI,"GameClient","AddValue",0)
$CurHPoffset=IniRead($INI,"Offsets","CurHPOffset",0)
$MaxHPoffset=IniRead($INI,"Offsets","MaxHPOffset",0)

SetPrivilege("SeDebugPrivilege", 1)
$HX_REF="0123456789ABCDEF"

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;USE STATIC TO GET BASE DYNAMIC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$PID = _MemoryOpen(ProcessExists($ProcName));GET PID OF PROC
$ReadBaseAdress =  _MemoryRead("0x"&hex($StaticAddress), $PID,'dword');READ STATIC ADDRESS TO GET DYNAMIC BASE ADDRESS
$AddressCorrection = StringRegExpReplace($ReadBaseAdress, "^0*(d+)", "$1"); CORRECTLY CONVERT ADDRESS
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;USE BASE DYNAMIC TO ADD OFFSETS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$CurHPnew=$AddressCorrection+$CurHPoffset
$hexaddress=_DecimalToHex($CurHPnew, 9)
$curHPaddress=StringTrimLeft($hexaddress,1)
$curHPvalue =  _MemoryRead("0x"&$curHPaddress, $PID,'dword');READ DYNAMIC ADDRESS w/ OFFSET
MsgBox(-1,"","Current HP Value="&$curHPvalue,-1,"")

_MemoryClose($PID)


;dec to hex func

Func _DecimalToHex($hx_dec, $hx_length = 21)

If IsInt($hx_dec) = 0 Then
SetError(1)
        MsgBox(0,"Error","Wrong input, try again ...")
Return ""
EndIf
Local $ret = "", $Ii, $hx_tmp, $hx_max
If $hx_dec < 4294967296 Then
If $hx_length < 9 Then Return Hex($hx_dec, $hx_length)
If $hx_length = 21 Then
$ret = Hex($hx_dec)
While StringLeft($ret, 1) = "0"
$ret = StringMid($ret, 2)
WEnd
Return $ret
EndIf
EndIf
For $Ii = $hx_length - 1 To 0 Step -1
$hx_max = 16 ^ $Ii - 1
If $ret = "" And $hx_length = 21 And $hx_max > $hx_dec Then ContinueLoop
$hx_tmp = Int($hx_dec/($hx_max+1))
If $ret = "" And $hx_length = 21 And $Ii > 0 And $hx_tmp = 0 Then ContinueLoop
$ret &= StringMid($HX_REF, $hx_tmp+1, 1)
$hx_dec -= $hx_tmp * ($hx_max + 1)
Next
$ret=String($ret)
If $hx_length < 21 And StringLen($ret) < $hx_length Then SetError(1)
Return $ret
EndFunc ;==>_DecToHex()

; ----------------------------------------------------------------
; Hex to Decimal Conversion ; Correct till Decimal 65789 ?!
Func _HexToDecimal_NotCorrect($Input)
Local $Temp, $i, $Pos, $Ret, $Output

If StringRegExp($input,'[[:xdigit:]]') then
$Temp = StringSplit($Input,"")

For $i = 1 to $Temp[0]
    $Pos = $Temp[0] - $i
    $Ret = Dec (Hex ("0x" & $temp[$i] )) * 16 ^ $Pos
    $Output &= $Ret
Next
    return $Output
Else
    MsgBox(0,"Error","Wrong input, try again ...")
    Return
EndIf
EndFunc

; Decimal To Hex Conversion


But now my problem is something different ;

When i close the window in cheat engine; the window that accesses op codes and allows you to see what is accessing a address"the dynamic address for my HP", well when i close that my static addresses stop responding and always return 0.

So let me re-state that this script will only returns correct values if CE is running and finding out what acceses the dynamic address, but if its not running the Base static address will point to another address that has a value of 0.



thank you for your help
 
Last edited:

Cyrion

Coder
Dank Tier Donator
Nobleman
Dec 31, 2013
107
618
7
Ehhm , i think you should read a pointer for your FinalAddr , then read another pointer with your offset. Otherwise , did you try with CE to see if you got the right address/offset ?
 

insomniac420

Newbie
Full Member
Dec 29, 2013
5
142
1
Ok i found out what was wrong the static address i was reading was part of the CE debugger itself LOL i feel dumb now oh well... now too look for some better pointers :D
 
Attention! Before you post:

Read the How to Ask Questions Guide
99% of questions are answered in the Beginner's Guide, do it before asking a question.

No Hack Requests. Post in the correct section.  Search the forum first. Read the rules.

How to make a good post:

  • Fill out the form correctly
  • Tell us the game name & coding language
  • Post everything we need to know to help you
  • Ask specific questions, be descriptive
  • Post errors, line numbers & screenshots
  • Post code snippets using code tags
  • If it's a large project, zip it up and attach it

If you do not comply, your post may be deleted.  We want to help, please make a good post and we will do our best to help you.

Community Mods