Skip to content

Commit 7fd72e2

Browse files
authored
Create UpxUnpacker.py
1 parent d76948b commit 7fd72e2

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

UpxUnpacker.py

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
from x64dbgpy.pluginsdk import *
2+
import sys
3+
4+
cip = register.GetCIP()
5+
if memory.ReadByte(cip) != 0x60:
6+
gui.Message("Start at UPX entry point (1:[CIP]==0x60)")
7+
exit(0)
8+
9+
x64dbg.DbgCmdExecDirect("bc")
10+
x64dbg.DbgCmdExecDirect("bphwc")
11+
found = pattern.FindMem(cip, 0x1000, "83 EC ?? E9");
12+
if found == 0:
13+
gui.Message("Could not find pattern!");
14+
exit(0)
15+
16+
debug.SetBreakpoint(found + 3)
17+
debug.Run()
18+
debug.StepIn()
19+
20+
cip = register.GetCIP()
21+
comment.Set(cip, "OEP Found by Python!")
22+
gui.Message("Reached OEP. Use Scylla to dump and restore imports!")
23+
x64dbg.DbgCmdExec("scylla")

0 commit comments

Comments
 (0)