Skip to content

Instantly share code, notes, and snippets.

@skochinsky
skochinsky / dump_hdr.py
Created November 16, 2019 20:30
Fujifillm
#! python2
#-------------------------------------------------------------------------------
# Name: dump_hdr.py
# Purpose: dump header of a FujiFilm FinePix firmware update
# see https://reverseengineering.stackexchange.com/questions/22549/identifying-rom-segment-in-unknown-firmware-update-file
# Author: Igor Skochinsky
#
# Created: 16-11-2019
# Copyright: (c) Igor Skochinsky 2019
# Licence: MIT
import zipfile
import httpio
import sys
def usage():
print("httpzip.py <url> [filename]")
if len(sys.argv)>1:
url = sys.argv[1]
else:
@skochinsky
skochinsky / arm64_sysregs_ios.py
Created December 8, 2020 23:02 — forked from bazad/arm64_sysregs_ios.py
Label iOS arm64 system registers in IDA Pro
#
# arm64_sysregs_ios.py
# Brandon Azad
#
# Based on https://github.com/gdelugre/ida-arm-system-highlight by Guillaume Delugre.
#
import idautils
import idc
@skochinsky
skochinsky / shift_dfa.md
Created August 2, 2021 12:41 — forked from pervognsen/shift_dfa.md
Shift-based DFAs

A traditional table-based DFA implementation looks like this:

uint8_t table[NUM_STATES][256]

uint8_t run(const uint8_t *start, const uint8_t *end, uint8_t state) {
    for (const uint8_t *s = start; s != end; s++)
        state = table[state][*s];
    return state;
}
#!/usr/bin/env python3
# initial script by b1n4r1b01 but he deleted his repo
# https://gist.github.com/woachk/6092f9ae950455dcdf8428c3ce2d639e
# added python3 support
import sys
import struct
import os