Skip to content

Instantly share code, notes, and snippets.

View thestr4ng3r's full-sized avatar
🐡
ENOTIME

Florian Märkl thestr4ng3r

🐡
ENOTIME
View GitHub Profile
@thestr4ng3r
thestr4ng3r / rzdb-migrate-rztype.py
Created April 6, 2021 12:32
Rizin Project Migration Script for commit 788fdb3d8ef98f50d61cdee72e0b57c74c814022 (RzType Module)
#!/usr/bin/env python3
# --
# Rizin Project Migration Script for commit 788fdb3d8ef98f50d61cdee72e0b57c74c814022 (RzType Module)
# --
# Move records like "addr.8000555.noreturn=true" from "/core/analysis/types" to their new namespace:
# /core/analysis/noreturn
# addr.8000500.noreturn=true
# addr.8000555.noreturn=true
# ...
@thestr4ng3r
thestr4ng3r / codestyle.md
Last active May 21, 2020 11:57
thestr4ng3r Code Style

thestr4ng3r Code Style

Indentation is done with tabs, not spaces. Tabs are 4 spaces wide.

Braces follow Allman-style with brace-less single-line statements being allowed and encouraged when it does not make things less readable:

There are no spaces between parenthesis and function names, if, for, etc.

Names can be either in UpperCamelCase or snake_case, but it should be consistent across the whole project.

@thestr4ng3r
thestr4ng3r / r2-x64trace-spvars.py
Created May 26, 2019 11:25
Annotate sp-based vars with offset from bp by importing x64dbg trace
import os
import x64trace
import r2pipe
r = r2pipe.open()
base_real = 0x70E00000 # base address used in the trace
base = r.cmdj("ij")["bin"]["baddr"]
import r2pipe
r = r2pipe.open()
ptr_size = int(r.cmd("e asm.bits").strip()) // 8
addr_stackptr = {}
blocks = r.cmdj("afbj")
@thestr4ng3r
thestr4ng3r / CMakeLists.txt
Last active January 24, 2020 17:52
radare2 CMake build system wrapping meson (for CLion)
cmake_minimum_required(VERSION 3.2)
project(radare2)
file(GLOB_RECURSE SOURCE_FILES
"${CMAKE_CURRENT_SOURCE_DIR}/*.h"
"${CMAKE_CURRENT_SOURCE_DIR}/*.c")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/libr/include")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/libr/asm/arch/include")
import r2pipe
import os
from subprocess import run
retdec_exec = "retdec-decompiler.sh"
r2 = r2pipe.open()
filepath = r2.cmdj("ij")["core"]["file"]
import Foundation
extension Array
{
func binaryRangeQuery(_ compare: (Element) -> ComparisonResult) -> [Element]
{
var min = 0
var max = count - 1
@thestr4ng3r
thestr4ng3r / FindFLACPP.cmake
Last active February 17, 2018 11:08
CMake find module for FLAC++
# - Find libFLAC++
#
# This module defines
# FLACPP_FOUND - True if libFLAC++ has been found.
# FLACPP_LIBRARIES - List of libraries when using libFLAC++.
# FLACPP_INCLUDE_DIRS - libFLAC++ include directories.
# Look for the header file.
find_path(FLACPP_INCLUDE_DIRS