Skip to content

Instantly share code, notes, and snippets.


Hugo Porcher icecr4ck

View GitHub Profile

PostgreSQL cheatsheet

Get a root postgres shell

sudo -u postgres psql

Shell commands

icecr4ck /
Last active Jan 11, 2021
Notes on CTREE usage with IDAPython


Important links


The CTREE is built from the optimized microcode (maturity at CMAT_FINAL), it represents an AST-like tree with C statements and expressions. It can be printed as C code.

icecr4ck /
Last active Feb 8, 2020
Cheatsheet to format a USB drive easily on Linux

Format a USB drive on Linux

Identify the volume

sudo fdisk -l
df -h # if already mounted
icecr4ck /
Created Dec 26, 2019
Mount a Windows qcow2 image on Linux

Mount a Windows qcow2 image on Linux

  1. Convert .qcow2 image to raw image
qemu-img convert -p -O raw image.qcow2 image.raw
  1. Get the startsector of the partition you want to mount with the command file
  2. Multiply the startsector value by 512 (referenced as SS_OFFSET in the next steps)
  3. Create a directory where to mount the partition with mkdir /mnt/image
  4. Run the mount command as follows to mount the partition


Definitions and architecture


Virtualisation: hardware assisted virtualisation where the VM’s processor matches host computer’s processor.

Emulation: faking the hardware to virtualise OSes using a different processor than the host computer's processor.

icecr4ck /
Last active Feb 2, 2020
Notes on the usage of Ansible



In /etc/ansible/ansible.cfg by default, but the path can be overwritten by creating a file .ansible.cfg in the home directory.

Create a hosts file in /etc/ansible to add the hosts, it is possible to create groups with [group_name].

# /etc/ansible/hosts
icecr4ck /
Created Oct 9, 2019
Example of IDA Microcode script to parse the arguments of a call to a decryption function
import idautils
import ida_range
import ida_hexrays as hr
class decryptor(hr.mop_visitor_t):
def visit_mop(self, op, type, is_target):
if op.t != hr.mop_f:
return 0
icecr4ck /
Last active Nov 25, 2020
Squelette pour plugin IDA Python
import idaapi
class ExamplePlugin(idaapi.plugin_t):
flags = idaapi.PLUGIN_DRAW
comment = "This plugin does nothing useful"
help = "No help is needed"
wanted_name = "Example"
wanted_hotkey = "Alt-F11"
def init():
icecr4ck /
Last active Jan 14, 2021
Cheatsheet for IDAPython
icecr4ck / keybindings.json
Created Jun 27, 2019
Binary Ninja keybindings.
View keybindings.json
"Miasm\\IR graph" : "Ctrl+Shift+M",
"Miasm\\IR graph (simplified)" : "Ctrl+Shift+I",
"Disassembly Graph" : "Ctrl+Shift+G",
"Hex Editor" : "Ctrl+Shift+H",
"Strings" : "Ctrl+Shift+S",
"Triage Summary" : "Ctrl+Shift+T"
You can’t perform that action at this time.