Skip to content

Instantly share code, notes, and snippets.

@tmr232
tmr232 / settrace.py
Last active July 26, 2025 17:53
sys.settrace usage sample
import sys
import inspect
class Tracer(object):
def __init__(self):
self._indentation_level = 0
@property
def indentation_level(self):
@tmr232
tmr232 / bitmapper.py
Last active July 26, 2025 17:53
Bitmapper - Visual Reverse Engineering
"""Bitmapper
Usage:
bitmapper.py <input> <output> [<width>]
Options:
-h --help Show this screen.
<input> The input binary file.
<output> The output bitmap.
<width> The width of the bitmap in pixels. Optional.
@tmr232
tmr232 / jcef_helper_killer.py
Last active July 26, 2025 17:51
Utility script to kill jcef_helper processes (because IntelliJ likes leaking them during debugging)
# /// script
# dependencies = [
# "psutil>=6.1.0",
# "rich>=13.9.4",
# "structlog>=24.4.0",
# "typer>=0.15.1",
# ]
# ///
import time
from typing import Iterator
import time
from pathlib import Path
import typer
import maya
import psutil
from loguru import logger
app = typer.Typer()
@tmr232
tmr232 / delete_multychunk.py
Created December 2, 2016 11:17
Delete functions with multiple chunks in IDA
import idaapi
import idautils
def iter_all_funcs():
for func_ea in idautils.Functions(idaapi.cvar.inf.minEA, idaapi.cvar.inf.maxEA):
yield idaapi.get_func(func_ea)
def iter_multichunk_funcs():
for func_t in iter_all_funcs():
if func_t.tailqty > 0:
@tmr232
tmr232 / Debugging-Inkscape-in-Visual-Studio.md
Last active January 26, 2024 13:49
Debugging Inkscape on Windows using Visual Studio

Debugging Inkscape with Visual Studio

Debug Build

To properly debug with Visual Studio, it's recommended that you use a debug build.

Follow the instructions for building Inkscape on Windows and substitute the first cmake command with:

@tmr232
tmr232 / simple_names.py
Created February 7, 2016 11:58
Simplify names in IDA for long template-infested C++ symbols
import re
import idaapi
import sark
import abc
class IDATracker(idaapi.UI_Hooks):
__metaclass__ = abc.ABCMeta
def __init__(self):
@tmr232
tmr232 / create-pdf.py
Last active October 21, 2023 11:00
Edge enables all PDF layers for printing
"""
Create a PDF with multiple layers to demonstrate issues with MS Edge printing.
See https://github.com/pymupdf/PyMuPDF-Utilities/blob/master/jupyter-notebooks/optional-content.ipynb for reference.
"""
import fitz # PyMuPDF
def main():
@tmr232
tmr232 / README.md
Created April 24, 2023 13:55
C++ Scoped Enums implementation

C++ Scoped Enums Implementation

This is an implementation for my C++ Scoped Enums blogpost.

The names are a bit different than in the post, but the ideas are the same and should map across.

@tmr232
tmr232 / README.md
Created January 4, 2023 21:33
Removing that pesky GB keyboard!

To remove the GB language pack:

Get-AppxPackage -AllUsers Microsoft.LanguageExperiencePacken-GB | Remove-AppxPackage

Then in the registry, remove the GB entry from Computer\HKEY_CURRENT_USER\Keyboard Layout\Preload. According to MSDN docs the value should be 0x809. If it is not the last value, make sure to rename the others!