Skip to content

Instantly share code, notes, and snippets.

@w4kfu
w4kfu / idapythonrc.py
Last active November 7, 2019 15:59
IDA user initialisation script
import idc
import idautils
import idaapi
import struct
# > copy idapythonrc.py %APPDATA%\Hex-Rays\IDA Pro\idapythonrc.py
def myreload():
"""
@w4kfu
w4kfu / fdia.py
Last active April 5, 2018 14:40
fuck DIA
import argparse
import ctypes
import os
HANDLE = ctypes.c_void_p
HMODULE = HANDLE
DWORD = ctypes.c_uint
DWORD64 = ctypes.c_uint64
PVOID = ctypes.c_void_p
BOOL = ctypes.c_bool
@w4kfu
w4kfu / bcrypt_rsapublic.py
Created April 25, 2018 13:25
BCRYPT_RSAPUBLIC_BLOB
import ctypes
def convert_bytes_to_structure(st, byte):
ctypes.memmove(ctypes.addressof(st), byte, ctypes.sizeof(st))
def s2n(s):
if not len(s):
return 0
return int(s.encode("hex"), 16)
@w4kfu
w4kfu / solve_marsanalytica.py
Created May 24, 2018 13:56
MarsAnalytica z3 solver
from z3 import *
def display_model(m):
block = {}
for x in m:
if str(x)[0] == "p":
block[int(str(x)[1:])] = int(str(m[x]))
password = "".join(map(chr, block.values()))
print password
@w4kfu
w4kfu / adp_converter.py
Last active January 17, 2024 09:47
Stupid Invaders ADP to WAV
import struct
import wave
import argparse
amplitude_lookuptable = [
0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007,
0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x0010,
0x0011, 0x0013, 0x0015, 0x0017, 0x0019, 0x001C, 0x001F, 0x0022,
0x0025, 0x0029, 0x002D, 0x0032, 0x0037, 0x003C, 0x0042, 0x0049,
0x0050, 0x0058, 0x0061, 0x006B, 0x0076, 0x0082, 0x008F, 0x009D,