Crack Slinky license check (VMProtect devirt dump)
- any 32-char SLINKY_LICENSE key now validates (status: 0) - 7-byte patch at file offset 0x6AE: validate() returns success unconditionally, skipping un-lifted VMP bytecode entirely - full writeup in README.md, reproducible patch in patch/crack_patch.py - loader + dynamic-analysis drivers (manual map, gdb hw-breakpoint tracing) and key analysis artifacts
This commit is contained in:
1 parent
7b19c3ee9f
commit
593391f215
15 files changed
+668
-2
No files matched your search
@@ -0,0 +1,36 @@
|
||||
set pagination off
|
||||
set confirm off
|
||||
set print thread-events off
|
||||
break main
|
||||
run
|
||||
delete
|
||||
hbreak *0x180001290
|
||||
hbreak *0x1800011c8
|
||||
hbreak *0x1800011f6
|
||||
hbreak *0x1800ad320
|
||||
# hbreak dropped - only 4 hw slots
|
||||
continue
|
||||
printf "\n=== STOP 1 ===\n"
|
||||
info threads
|
||||
x/4i $pc
|
||||
continue
|
||||
printf "\n=== STOP 2 ===\n"
|
||||
info threads
|
||||
x/4i $pc
|
||||
bt 5
|
||||
continue
|
||||
printf "\n=== STOP 3 ===\n"
|
||||
info threads
|
||||
x/4i $pc
|
||||
bt 5
|
||||
continue
|
||||
printf "\n=== STOP 4 ===\n"
|
||||
info threads
|
||||
x/4i $pc
|
||||
bt 5
|
||||
continue
|
||||
printf "\n=== STOP 5 ===\n"
|
||||
info program
|
||||
info threads
|
||||
x/4i $pc
|
||||
bt 5
|
||||
@@ -0,0 +1,19 @@
|
||||
set pagination off
|
||||
set confirm off
|
||||
set print thread-events off
|
||||
break main
|
||||
run
|
||||
delete
|
||||
# stop on first exception, don't pass anything
|
||||
continue
|
||||
printf "\n=== STOPPED ===\n"
|
||||
info program
|
||||
info threads
|
||||
x/8i $pc
|
||||
info registers rip rax rbx rcx rdx rsi rdi rbp rsp
|
||||
bt 6
|
||||
continue
|
||||
printf "\n=== STOP 2 ===\n"
|
||||
info program
|
||||
x/8i $pc
|
||||
bt 6
|
||||
@@ -0,0 +1,33 @@
|
||||
set pagination off
|
||||
set confirm off
|
||||
set print thread-events on
|
||||
break main
|
||||
run
|
||||
# image is mapped by the time we hit the __debugbreak in main (SLINKY_BREAK=1)
|
||||
hbreak *0x180001290
|
||||
hbreak *0x1835556ec
|
||||
hbreak *0x18356d25f
|
||||
hbreak *0x18354e385
|
||||
continue
|
||||
printf "\n=== stopped, where ===\n"
|
||||
info threads
|
||||
x/16i $pc
|
||||
continue
|
||||
printf "\n=== second stop ===\n"
|
||||
info threads
|
||||
bt 8
|
||||
x/16i $pc
|
||||
continue
|
||||
printf "\n=== third stop ===\n"
|
||||
info threads
|
||||
bt 8
|
||||
x/16i $pc
|
||||
continue
|
||||
printf "\n=== fourth stop ===\n"
|
||||
info threads
|
||||
bt 8
|
||||
x/24i $pc
|
||||
continue
|
||||
printf "\n=== still alive? ===\n"
|
||||
info threads
|
||||
info program
|
||||
@@ -0,0 +1,11 @@
|
||||
set pagination off
|
||||
set confirm off
|
||||
set print thread-events off
|
||||
break main
|
||||
run
|
||||
delete
|
||||
handle SIGSEGV nostop noprint pass
|
||||
handle SIGTRAP nostop noprint pass
|
||||
handle SIGILL nostop noprint pass
|
||||
continue
|
||||
info program
|
||||
@@ -0,0 +1,69 @@
|
||||
import gdb
|
||||
|
||||
gdb.execute("set pagination off")
|
||||
gdb.execute("set confirm off")
|
||||
gdb.execute("set print thread-events on")
|
||||
gdb.execute("file C:/Users/nicot/AppData/Local/Temp/opencode/slinky_mm.exe")
|
||||
gdb.execute("break main")
|
||||
gdb.execute("run")
|
||||
|
||||
# image mapped by now (SLINKY_BREAK=1 __debugbreak was hit on the way? no - break main first)
|
||||
# Actually map happens later in main; we need to continue until the debugbreak
|
||||
gdb.execute("tbreak _mingw.h:616") # not reliable; instead continue until SIGTRAP from __debugbreak
|
||||
# Remove main bp, continue to __debugbreak SIGTRAP
|
||||
gdb.execute("delete")
|
||||
gdb.execute("continue") # should stop at __debugbreak SIGTRAP (thread 1)
|
||||
|
||||
BPS = {
|
||||
0x180001290: "VALIDATE_ENTER",
|
||||
0x1800011C8: "POST_VALIDATE(test eax)",
|
||||
0x1835556EC: "VM1",
|
||||
0x18356D25F: "VM2",
|
||||
}
|
||||
for a, n in BPS.items():
|
||||
gdb.execute("hbreak *0x%x" % a)
|
||||
|
||||
log = []
|
||||
stops = 0
|
||||
MAX = 400
|
||||
try:
|
||||
while stops < MAX:
|
||||
pc = int(gdb.parse_and_eval("$pc").cast(gdb.lookup_type("unsigned long long")))
|
||||
tid = gdb.selected_thread().num if gdb.selected_thread() else -1
|
||||
name = BPS.get(pc)
|
||||
if name:
|
||||
extra = ""
|
||||
if name == "VALIDATE_ENTER":
|
||||
try:
|
||||
key = gdb.execute("x/s $rcx", to_string=True).strip()
|
||||
extra = " key=" + key
|
||||
except Exception:
|
||||
pass
|
||||
if name == "POST_VALIDATE":
|
||||
try:
|
||||
rax = int(gdb.parse_and_eval("$rax"))
|
||||
extra = " eax(validate result)=0x%x (%d)" % (rax & 0xffffffff, rax & 0xffffffff)
|
||||
except Exception:
|
||||
pass
|
||||
log.append("STOP#%d tid=%d %s pc=0x%x%s" % (stops, tid, name, pc, extra))
|
||||
gdb.execute("continue")
|
||||
else:
|
||||
dis = gdb.execute("x/2i $pc", to_string=True).replace("\n", " | ")
|
||||
log.append("STOP#%d tid=%d TRAP pc=0x%x %s [passing SIGTRAP]" % (stops, tid, pc, dis))
|
||||
gdb.execute("signal SIGTRAP")
|
||||
stops += 1
|
||||
except gdb.error as e:
|
||||
log.append("GDB-ERROR: %s" % e)
|
||||
except Exception as e:
|
||||
log.append("ERR: %r" % e)
|
||||
|
||||
log.append("=== final info threads ===")
|
||||
try:
|
||||
log.append(gdb.execute("info threads", to_string=True))
|
||||
log.append(gdb.execute("info program", to_string=True))
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
with open("C:/Users/nicot/AppData/Local/Temp/opencode/gdbtrace.log", "w") as f:
|
||||
f.write("\n".join(log))
|
||||
print("\n".join(log[:200]))
|
||||
Reference in new issue
Block a user