Skip to content

[오토핫키] 메모리 및 포인터 오프셋 읽어오기

by CroitzK posted Mar 08, 2020 Views 122 Likes 0 Replies 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄 첨부


#샘플 코드

; The contents of this file can be copied directly into your script. Alternately, you can copy the classMemory.ahk file into your library folder,
; in which case you will need to use the #include directive in your script i.e. 
  
#Include <classMemory>
 
; You can use this code to check if you have installed the class correctly.
 
if (_ClassMemory.__Class != "_ClassMemory")
{
    msgbox class memory not correctly installed. Or the (global class) variable "_ClassMemory" has been overwritten
    ExitApp
}
 
f1::
; Open a process with sufficient access to read and write memory addresses (this is required before you can use the other functions)
; You only need to do this once. But if the process closes/restarts, then you will need to perform this step again.
; .isHandleValid() can be used to check if program has restarted.
; Note: The program identifier can be any AHK windowTitle i.e.ahk_exe, ahk_class, ahk_pid, or simply the window title. 
; Unlike AHK this defaults to an exact match, but this can be changed via the passed parameter.
; hProcessCopy is an optional variable in which the opened handled is stored. 
; *****  change FTLGAME.exe to your process name ******
mem := new _ClassMemory("ahk_exe FTLGAME.exe", "", hProcessCopy) ; *****
 
; Check if the above method was successful.
if !isObject(mem) 
{
    msgbox failed to open a handle
    if (hProcessCopy = 0)
        msgbox The program isn't running (not found) or you passed an incorrect program identifier parameter. 
    else if (hProcessCopy = "")
        msgbox OpenProcess failed. If the target process has admin rights, then the script also needs to be ran as admin. Consult A_LastError for more information.
    ExitApp
}
 
; read a pointer - mem.BaseAddress is automatically set to the base address.
value := mem.read(mem.BaseAddress + 0x00B8C83C, "UInt", 0x0, 0xA8, 0x3FC)
 
msgbox val = %value%
 
return


  • PS. classMemory.ahk 파일은 내문서\[사용자명]\doucuments\autohotkey\lib 폴더? 에 첨부
  • PS2. 실행중 오류발생시 관리자권한으로 실행


# 본문 코드 출처: https://www.autohotkey.com/boards/viewtopic.php?t=44241

# 다운로드 링크: classMemory-master.zip - 자료 출처: https://github.com/Kalamity/classMemory

?

Calender

2020.07
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  

Time Info

Counter Info

방문자수

전체 : 44,995
오늘 : 9
어제 : 34

페이지뷰

전체 : 1,615,703
오늘 : 181
어제 : 1,686

COPYRIGHT 2009 by AGMServer.com

Powered by Xpress Engine / Designed by Sketchbook

sketchbook5, 스케치북5

sketchbook5, 스케치북5

나눔글꼴 설치 안내


이 PC에는 나눔글꼴이 설치되어 있지 않습니다.

이 사이트를 나눔글꼴로 보기 위해서는
나눔글꼴을 설치해야 합니다.

설치 취소