-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathOffsetLocator.au3
85 lines (75 loc) · 1.91 KB
/
OffsetLocator.au3
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#RequireAdmin
#include <NomadMemory.au3>
#include <Array.au3>
HotKeySet("!k", "GetOffsets")
HotkeySet("!t", "TestOffset")
HotKeySet("{Esc}", "EmptyLogs")
Local $LOGS[200]
Local $pid = WinGetProcess("Grand Fantasia")
Local $mid = _MemoryOpen($pid)
Func EmptyLogs()
Exit
EndFunc
Func TestOffset()
_ArrayDisplay($LOGS)
EndFunc
Dim $base[1] = [0x009AD9C8]
Func GetOffsets()
ToolTip("Looking values...", 50,60)
;For $b In $base
For $i = 8 To 12
For $j = 300 To 2000
$m = _MemoryRead("0x" & Hex(_MemoryRead("0x" & Hex(_MemoryRead(0x009AD9C8, $mid) + $i), $mid) + $j), $mid)
If $m == 1 Then
_ArrayPush($LOGS," - Off1:" & Hex($i) & " Off2:" & Hex($j) & " = " & $m)
TestOffset()
Exit
EndIf
Next
Next
;Next
MsgBox(0,"Not Found","Nothing found")
EndFunc
Func ReadMemoryOffset($pointer, $offset = 0, $type = "dword")
Dim $tmp
If IsArray($pointer) Then
$tmp = ReadMemoryOffset($pointer[1])
For $i = 2 To UBound($pointer) -1
If UBound($pointer) - 1 == $i Then
$tmp = ReadMemoryOffset($tmp, $pointer[$i], $type)
Else
$tmp = ReadMemoryOffset($tmp, $pointer[$i])
EndIf
Next
Return $tmp
Else
If $offset == 0 Then
$tmp = $pointer
Else
$tmp = "0x" & Hex($pointer + Dec($offset))
EndIf
Return _MemoryRead($tmp, $mid, $type)
EndIf
EndFunc
Func WriteMemoryOffset($data, $pointer, $offset = 0, $type = 'dword')
Dim $tmp
If IsArray($pointer) Then
$tmp = ReadMemoryOffset($pointer[1])
For $i = 2 To UBound($pointer) -1
If UBound($pointer) - 1 == $i Then
$tmp = WriteMemoryOffset($data, $tmp, $pointer[$i], $type)
Else
$tmp = ReadMemoryOffset($tmp, $pointer[$i])
EndIf
Next
Return $tmp
Else
If $offset == 0 Then
$tmp = $pointer
Else
$tmp = "0x" & Hex($pointer + Dec($offset))
EndIf
Return _MemoryWrite($tmp, $mid, $data, $type)
EndIf
EndFunc
GetOffsets()