-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathx64dbg.script
53 lines (44 loc) · 937 Bytes
/
x64dbg.script
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
run
bpc
// set BP on NtAllocateVirtualMemory if allocate size (RCX) == 0x8181 (for testing syscalls etc, set alloc size to 0x8181)
bp NtAllocateVirtualMemory
bpcnd NtAllocateVirtualMemory,"[r9]==8181"
// are we in user mod, if not run
cmp mod.user(cip), 0
je nope
jmp inuser
ret
nope:
run
cmp mod.user(cip), 0
je nothere
jmp inuser
ret
// we are in user module, test go asm func start with xor r15,r15 so set a BP there
inuser:
// set bp on mov rax,rax
findasm "mov rax,rax"
cmp $result, 0
je no_rax
i=0
loop_rax:
bp ref.addr(i)//, "DBGRAX{d:i}"
log "found mov rax,rax tag: breakpoint set: {p:ref.addr(i)}"
i++
cmp i, ref.count()
jne loop_rax
no_rax:
// set bp on mov rbx,rbx
findasm "mov rbx,rbx"
cmp $result, 0
je no_rbx
i=0
loop_rbx:
bp ref.addr(i)//, "DBGRAX{d:i}"
log "found mov rbx,rbx tag: breakpoint set: {p:ref.addr(i)}"
i++
cmp i, ref.count()
jne loop_rbx
no_rbx:
nothere:
ret