Skip to content

Instantly share code, notes, and snippets.

View alexander-hanel's full-sized avatar

Alexander Hanel alexander-hanel

View GitHub Profile
alexander-hanel /
Created February 12, 2024 23:29
A hackish way to extract arguments passed to a function from hex-rays decompiler output
import idautils
ea = 0x000000140013188
name = ida_name.get_ea_name(ea)
# get xrefs to function
xrefs = [x for x in idautils.CodeRefsTo(ea, 0)]
for func in xrefs:
alexander-hanel /
Created January 4, 2024 18:10
Open cmd as Admin

from cmd or Run

powershell -Command "Start-Process cmd -Verb RunAs"
alexander-hanel /
Last active November 1, 2023 20:57 — forked from OALabs/
Build dictionary of DLL exports (Windows API Names)
import os
import pefile
import json
'kernel32.dll', 'comctl32.dll', 'advapi32.dll', 'comdlg32.dll',
'gdi32.dll', 'msvcrt.dll', 'netapi32.dll', 'ntdll.dll',
'ntoskrnl.exe', 'oleaut32.dll', 'psapi.dll', 'shell32.dll',
'shlwapi.dll', 'srsvc.dll', 'urlmon.dll', 'user32.dll',
alexander-hanel /
Last active September 17, 2023 04:42
Warmup Routine

Warmup Routine

This is my current warmup routine. I have been doing variations of it for over 10 years. I usually row or jump rope for 5 minutes and then do the warmup which typically takes about 10 minutes. Once warmed-up I start with squats and then I do a combination of overhead press, bent-over row, bench-press or deadlifts.

Upper Back and Spine Foam Rolling

  • Source: Becoming a Supple Leopard 2nd Edition: The Ultimate Guide to Resolving Pain, Preventing Injury, and Optimizing Athletic Performance
  • Note: No timelimit

Side-plank Foam Foller IT-Bands

  • Source: Combination of Supple Leopard, Limber 11 (link) and McGill 3
  • Note: No timelimit, focus on areas that trigger pain
alexander-hanel /
Last active September 7, 2023 18:46
Distraction Free Slack

Prevent distractions within slack by making the sidebar black.

Slack > Settings > Themes > Create a Custom Theme > "Copy and paste these values to share your custom theme with others" 

Cut and paste the following values

alexander-hanel /
Last active September 7, 2023 18:46
Converts 16 bytes to a UUID using Microsoft's Variant 2 format.
import ctypes
class BYTE2UUID(ctypes.Structure):
Variant 2 UUIDs
_fields_ = [
("time_low", ctypes.c_uint), ("time_mid", ctypes.c_ushort), ("time_hi_and_version", ctypes.c_ushort),
("clock_seq_hi_and_res", ctypes.c_char * 2), ("node", ctypes.c_char * 6)
import re
from anytree import Node, RenderTree, find
Author: Alexander Hanel
Description: POC for displaying function names as a folder-like structure. Relies on function names being labled with a pdb.
Version: 0.5 - 2023/04/10
Execution: open script in IDA, run export_layout() to save to file or export_layout() to print to command line
- review how mangled names are used in IDA. I'm seeing some strange results.
from binaryninja import lowlevelil
DEBUG = False
def get_rc4_xor_instru(instr):
if not instr:
return False
print(hex(instr.address), instr)
for oper in instr.operands: