Sign in to follow this  
Followers 0
Golbez

_memoryopen problem

98 posts in this topic

i dont think it is reading the memory to find my address xD

did i do it right i cant figure out what im doing wroung

#include <NomadMemory.au3>

$PlayerHPadr = 0x00F86E18
$PlayerHPoff = 0x1D4
$TargetLockadr = 0x18DBD325
$PlayerMana = "1A5E5BC0"
$test = Hex(Dec($PlayerHPadr) + Dec($PlayerHPoff))

$gamepid = "FlorensiaEN.bin"

$gamehandle = _MemoryOpen($gamepid)
$address = $PlayerMana 
$health = _MemoryRead($address, $gamehandle)

MsgBox(1, $gamehandle, "Address: " & $address & " Found: " & $health)

Share this post


Link to post
Share on other sites



i dont think it is reading the memory to find my address xD

did i do it right i cant figure out what im doing wroung

#include <NomadMemory.au3>

$PlayerHPadr = 0x00F86E18
$PlayerHPoff = 0x1D4
$TargetLockadr = 0x18DBD325
$PlayerMana = "1A5E5BC0"
$test = Hex(Dec($PlayerHPadr) + Dec($PlayerHPoff))

$gamepid = "FlorensiaEN.bin"

$gamehandle = _MemoryOpen($gamepid)
$address = $PlayerMana 
$health = _MemoryRead($address, $gamehandle)

MsgBox(1, $gamehandle, "Address: " & $address & " Found: " & $health)
FRom NomadMemory.au3

Parameter(s): $iv_Address - The memory address you want to read from. It must

; be in hex format (0x00000000).

TRy

$PlayerMana = "0x1A5E5BC0"


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

FRom NomadMemory.au3

TRy

$PlayerMana = "0x1A5E5BC0"

That's kind of silly.

Edit:

Could just do an IsString() check to validate one way or the other.

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

the address should work either way...

i cant get it to read the memory of the game

Share this post


Link to post
Share on other sites

the address should work either way...

i cant get it to read the memory of the game

Did you set debug privileges?

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

i get errors with that command..

and all the post i read i dont understand how to fix it so i was going to try not to use it ;)

Edited by Golbez

Share this post


Link to post
Share on other sites

i get errors with that command..

and all the post i read i dont understand how to fix it so i was going to try not to use it ;)

Then you're more than likely not going to access it either.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

still not working...

#include <NomadMemory.au3>
SetPrivilege("SeDebugPrivilege", 1)

$PlayerHPadr = 0x00F86E18
$PlayerHPoff = 0x1D4
$TargetLockadr = 0x18DBD325
$PlayerMana = "0x1A5E5BC0"
$test = Hex(Dec($PlayerHPadr) + Dec($PlayerHPoff))

$gamepid = "FlorensiaEN.bin"

$gamehandle = _MemoryOpen($gamepid)
$health = _MemoryRead($test, $gamehandle)

MsgBox(1, $gamehandle, "Address: " & $test & " Found: " & $health)
ClipPut($test)

Share this post


Link to post
Share on other sites

still not working...

#include <NomadMemory.au3>
SetPrivilege("SeDebugPrivilege", 1)

$PlayerHPadr = 0x00F86E18
$PlayerHPoff = 0x1D4
$TargetLockadr = 0x18DBD325
$PlayerMana = "0x1A5E5BC0"
$test = Hex(Dec($PlayerHPadr) + Dec($PlayerHPoff))

$gamepid = "FlorensiaEN.bin"

$gamehandle = _MemoryOpen($gamepid)
$health = _MemoryRead($test, $gamehandle)

MsgBox(1, $gamehandle, "Address: " & $test & " Found: " & $health)
ClipPut($test)
Memory

Have you done this? Do you understand how it works?

BTW, you're opening "_MemoryOpen(FlorensiaEN.bin)". Which is NOT a PID ;)

Share this post


Link to post
Share on other sites

Memory

Have you done this? Do you understand how it works?

BTW, you're opening "_MemoryOpen(FlorensiaEN.bin)". Which is NOT a PID ;)

no this is the first time ive tried this.. i want to learn how to do it :D

Share this post


Link to post
Share on other sites

no this is the first time ive tried this.. i want to learn how to do it ;)

Whats your OS?

At least look at the guide, and if you're on Vista then try it.

If your on XP then you can still try it. The principle is the same, just might not match the pictures =D

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

ok i got cheat engine to work.. but i cant figure out how to make it look for the address with the offset..

Address: 00FA8958

Offset: 1D4

#include <NomadMemory.au3>
SetPrivilege("SeDebugPrivilege", 1)

$PlayerHPadr = 0x00FA8958
$PlayerHPoff = 0x1D4
$TargetLockadr = 0x18DBD325
$PlayerMana = "0x1A5E5BC0"
$test = Hex(Dec($PlayerHPadr) + Dec($PlayerHPoff))

$gamepid = "FlorensiaEN.bin"

$gamehandle = _MemoryOpen($gamepid)
$health = _MemoryRead($test, $gamehandle)

MsgBox(1, $gamehandle, "Address: " & $test & " Found: " & $health)
ClipPut($test)oÝ÷ Ú«¨µéÚ
Edited by Golbez

Share this post


Link to post
Share on other sites

That's kind of silly.

It's not obvious to me why $PlayerMana = "0x1A5E5BC0" is silly. Why is it silly?

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

It's not obvious to me why $PlayerMana = "0x1A5E5BC0" is silly. Why is it silly?

i know it is in ""

im not using that variable to test it anymore xD

its not reading the health address...

the mana one wont work yet i dont have the right address yet

idk if i got the pid right but idk how to test it...

#include <NomadMemory.au3>
SetPrivilege("SeDebugPrivilege", 1)

$PlayerHPadr = 0x00FA8958
$PlayerHPoff = 0x1D4
$test = "0x" & Hex(Dec($PlayerHPadr) + Dec($PlayerHPoff))

$gamepid = ProcessExists("FlorensiaEN.bin")

$gamehandle = _MemoryOpen($gamepid)
$health = _MemoryRead($test,  $gamehandle)

MsgBox(1, $gamepid, "Address: " & $test & " Found: " & $health)

Share this post


Link to post
Share on other sites

i know it is in ""

No, that's not silly because it works in NomadMemory.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

#16 ·  Posted (edited)

uh?

nvm i got it..

but i dont get why its not finding the right address...

it works with cheat engine..

Address: 00FA8958

Offset: 1D4

Edited by Golbez

Share this post


Link to post
Share on other sites

Are you reading into FFXI?? If so I can post some code examples.


Need a website: http://www.iconixmarketing.com

Share this post


Link to post
Share on other sites

no im reading a game called Florensia

post some examples anyway maybe i can get it off of them.. i dont think im making it find the right address.. idk how to get it to find the right addres because it changes everytime i open the game.. i need to some how make it look for the offset also

Share this post


Link to post
Share on other sites

If you have the proper address in CE simply combine the address with the offset (in hex of course) and use the new address. That might help you out.

Share this post


Link to post
Share on other sites

#20 ·  Posted (edited)

If you have the proper address in CE simply combine the address with the offset (in hex of course) and use the new address. That might help you out.

i think i did that

$test = "0x" & Hex(Dec($PlayerHPadr) + Dec($PlayerHPoff))

right? or did i do it wroung

new code:

;#include <NomadMemory.au3>
#Include <String.au3>

SetPrivilege("SeDebugPrivilege", 1)

Global $mainwindow = "Florensia"
If WinExists($mainwindow) Then
    $PlayerHPadr = 0x00FA8958
    $PlayerHPoff = 0x1D4
    $test = $PlayerHPadr + $PlayerHPoff

    $gamepid = ProcessExists("FlorensiaEN.bin")

    $gamehandle = _MemoryOpen($gamepid)
    $health = _MemoryRead($test, $gamehandle)

    MsgBox(1, $gamepid, "Address: " & $test & " -|- Health: " & $health)
    ClipPut($health)
Else
    MsgBox(1, "Error", "ERROR: " & $mainwindow & " Not Found!")
EndIf

#cs
    - Health -
    Value: 0C299DB0
    Address: 00FA8958
    Offset: 1D4
    
    - Mana -
    Value: 0C6D5608
    Address: 0C5A8C68
    Offest: 10
#ce


#cs
    -- Memory Adresses
    PlayerHPadr = 0x00F86E18;
    PlayerHPoff = 0x1D4;
    TargetLockadr = 0x18DBD325;
    -- Setup --
    -- Sit When HP Reaches.. --
    PlayerHPStop = 300;
    -- Stand Up When HP Reaches.. --
    PlayerHPSit = 630;
    -- Enables Looting, increases the time between killing --
    EnableLooting = 1;
    -- Reviving Enabled? --
    Revive = 1;
    -- Mouse Coords of the Revive Button
    ReviveX = 547;
    ReviveY = 411;
    -- End of Setup--
    
    function GetTarget()
    TargetLock = memoryReadByte(proc, TargetLockadr);
    if( TargetLock == 1 and PlayerHP > PlayerHPStop and Sitting == 0) then
    keyboardPress( key.VK_1 );
    rest(20);
    keyboardPress( key.VK_7 );
    end
    if( TargetLock == 0 and PlayerHP > PlayerHPStop and Sitting == 0 ) then
    Loot();
    keyboardPress( key.VK_0 );
    rest(20);
    end
    rest(20);
    end
    
    function Heal()
    PlayerHP = memoryReadIntPtr(proc, PlayerHPadr, PlayerHPoff);
    if( PlayerHP <= PlayerHPStop and TargetLock == 0 and Sitting == 0 ) then
    rest(5000);
    keyboardPress( key.VK_8 );
    rest(4000);
    Sitting = 1;
    end
    if( PlayerHP >= PlayerHPSit and TargetLock == 0 and Sitting == 1 ) then
    keyboardPress( key.VK_8 );
    rest(4000);
    Sitting = 0;
    end
    end
    
    function DefeatAttacker()
    if( Sitting == 1 and TargetLock == 1 ) then
    keyboardPress( key.VK_S );
    rest(500);
    Sitting = 0;
    keyboardPress( key.VK_7 );
    end
    end
    
    function Loot()
    if( EnableLooting == 1 ) then
    keyboardPress( key.VK_X );
    rest(4000);
    end
    end
    
    function Reviving()
    if( Revive == 1 and PlayerHP == 0 ) then
    yrest(5000);
    mouseSet(ReviveX, ReviveY);
    yrest(500);
    mouseLClick();
    end
    end
    
    function main()
    attach( findWindow("Florensia") );
    proc = openProcess( findProcess("Florensia") );
    Sitting = 0;
    while(true) do
    Heal();
    DefeatAttacker();
    GetTarget();
    Reviving();
    rest(10);
    end
    end
    startMacro(main, true);
#ce

Func _MemoryOpen($iv_Pid, $iv_DesiredAccess = 0x1F0FFF, $iv_InheritHandle = 1)
    If Not ProcessExists($iv_Pid) Then
        SetError(1)
        Return 0
    EndIf
    Local $ah_Handle[2] = [DllOpen('kernel32.dll')]
    If @error Then
        SetError(2)
        Return 0
    EndIf
    Local $av_OpenProcess = DllCall($ah_Handle[0], 'int', 'OpenProcess', 'int', $iv_DesiredAccess, 'int', $iv_InheritHandle, 'int', $iv_Pid)
    If @error Then
        DllClose($ah_Handle[0])
        SetError(3)
        Return 0
    EndIf
    $ah_Handle[1] = $av_OpenProcess[0]
    Return $ah_Handle
EndFunc   ;==>_MemoryOpen
Func _MemoryRead($iv_Address, $ah_Handle, $sv_Type = 'dword')
    If Not IsArray($ah_Handle) Then
        SetError(1)
        Return 0
    EndIf
    Local $v_Buffer = DllStructCreate($sv_Type)
    If @error Then
        SetError(@error + 1)
        Return 0
    EndIf
    DllCall($ah_Handle[0], 'int', 'ReadProcessMemory', 'int', $ah_Handle[1], 'int', $iv_Address, 'ptr', DllStructGetPtr($v_Buffer), 'int', DllStructGetSize($v_Buffer), 'int', '')
    If Not @error Then
        Local $v_Value = DllStructGetData($v_Buffer, 1)
        Return $v_Value
    Else
        SetError(6)
        Return 0
    EndIf
EndFunc   ;==>_MemoryRead
Func SetPrivilege($privilege, $bEnable)
    Const $TOKEN_ADJUST_PRIVILEGES = 0x0020
    Const $TOKEN_QUERY = 0x0008
    Const $SE_PRIVILEGE_ENABLED = 0x0002
    Local $hToken, $SP_auxret, $SP_ret, $hCurrProcess, $nTokens, $nTokenIndex, $priv
    $nTokens = 1
    $LUID = DllStructCreate("dword;int")
    If IsArray($privilege) Then $nTokens = UBound($privilege)
    $TOKEN_PRIVILEGES = DllStructCreate("dword;dword[" & (3 * $nTokens) & "]")
    $NEWTOKEN_PRIVILEGES = DllStructCreate("dword;dword[" & (3 * $nTokens) & "]")
    $hCurrProcess = DllCall("kernel32.dll", "hwnd", "GetCurrentProcess")
    $SP_auxret = DllCall("advapi32.dll", "int", "OpenProcessToken", "hwnd", $hCurrProcess[0], "int", BitOR($TOKEN_ADJUST_PRIVILEGES, $TOKEN_QUERY), "int_ptr", 0)
    If $SP_auxret[0] Then
        $hToken = $SP_auxret[3]
        DllStructSetData($TOKEN_PRIVILEGES, 1, 1)
        $nTokenIndex = 1
        While $nTokenIndex <= $nTokens
            If IsArray($privilege) Then
                $priv = $privilege[$nTokenIndex - 1]
            Else
                $priv = $privilege
            EndIf
            $ret = DllCall("advapi32.dll", "int", "LookupPrivilegeValue", "str", "", "str", $priv, _
                    "ptr", DllStructGetPtr($LUID))
            If $ret[0] Then
                If $bEnable Then
                    DllStructSetData($TOKEN_PRIVILEGES, 2, $SE_PRIVILEGE_ENABLED, (3 * $nTokenIndex))
                Else
                    DllStructSetData($TOKEN_PRIVILEGES, 2, 0, (3 * $nTokenIndex))
                EndIf
                DllStructSetData($TOKEN_PRIVILEGES, 2, DllStructGetData($LUID, 1), (3 * ($nTokenIndex - 1)) + 1)
                DllStructSetData($TOKEN_PRIVILEGES, 2, DllStructGetData($LUID, 2), (3 * ($nTokenIndex - 1)) + 2)
                DllStructSetData($LUID, 1, 0)
                DllStructSetData($LUID, 2, 0)
            EndIf
            $nTokenIndex += 1
        WEnd
        $ret = DllCall("advapi32.dll", "int", "AdjustTokenPrivileges", "hwnd", $hToken, "int", 0, _
                "ptr", DllStructGetPtr($TOKEN_PRIVILEGES), "int", DllStructGetSize($NEWTOKEN_PRIVILEGES), _
                "ptr", DllStructGetPtr($NEWTOKEN_PRIVILEGES), "int_ptr", 0)
        $f = DllCall("kernel32.dll", "int", "GetLastError")
    EndIf
    $NEWTOKEN_PRIVILEGES = 0
    $TOKEN_PRIVILEGES = 0
    $LUID = 0
    If $SP_auxret[0] = 0 Then Return 0
    $SP_auxret = DllCall("kernel32.dll", "int", "CloseHandle", "hwnd", $hToken)
    If Not $ret[0] And Not $SP_auxret[0] Then Return 0
    Return $ret[0]
EndFunc   ;==>SetPrivilege
Edited by Golbez

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0