Skip to content

Instantly share code, notes, and snippets.

@radare
radare / void-android.sh
Created Nov 13, 2013
script to install voidlinux on android/firefoxos devices via adb
View void-android.sh
#!/bin/sh
# TODO
# - check free disk
# - check return values for every command
V=/data/void
DNS=8.8.8.8
URL=http://xbps.nopcode.org/rootfs/
ROOTFS=void-raspberrypi-rootfs-20130811.tar.xz
View foo.v
struct Toxml {
mut:
str string
stack []string
}
fn toxml_new() &Toxml {
x := &Toxml{}
x.str = ''
@radare
radare / assnam.py
Created Oct 23, 2019
radare2 script to autoname functions by taking it from the assert calls
View assnam.py
#!/usr/bin/env python3
import r2pipe
r2 = r2pipe.open()
a = r2.cmd('ii~__assert_rtn[1]').strip()
if not a:
print('[assnam] Cannot find assert_rtn import')
exit(1)
if int(r2.cmd('aflc')) == 0:
@radare
radare / rsoc2019.md
Created Apr 2, 2019
Radare Summer of Code 2019 Selection Results
View rsoc2019.md

Radare2 Summer of Code 2019 Selection Results

As you might remember radare2 organization was a part of Google Summer of Code for many years already. Sadly this year we weren't selected for participation, thus decided to open our own Radare2 Summer of Code season one more time (we did a few time already too). We want to thank NowSecure and KeenLab of Tencent one more time for helping us to make it happen.

The rules and requirements for the RSoC'19 were very similar to GSoC one, with a slightly shifted schedule, so people would give RSoC selection results before the GSoC deadline, to be able apply to GSoC in case of RSoC rejection. Back to the business, this year we accepted two students:

View gist:3a798ce5f34a11dd6320c372248769a5
╭────────────────────╮ ╭────────────────────╮ ╭────────────────────╮ ╭────────────────────╮
│ entry0 │ │ sym.___muloti4 │ │ sym.___umoddi3 │ │ sym.___umodti3 │
╰────────────────────╯ ╰────────────────────╯ ╰────────────────────╯ ╰────────────────────╯
t t t t t
│ │ │ │ │
│ │ ╰────────╮ │ │
│ ╭────────────╯ │ │ │
│ │ │
View zig-make.log
[ 16%] Built target embedded_lld_lib
[ 63%] Built target embedded_softfloat
[ 69%] Built target embedded_lld_coff
[ 70%] Built target embedded_lld_mingw
[ 86%] Built target embedded_lld_elf
[ 90%] Built target embedded_lld_wasm
[ 91%] Built target zig_cpp
[ 92%] Linking CXX executable zig
Undefined symbols for architecture x86_64:
"_LLVMABIAlignmentOfType", referenced from:
View swift-demangler
1) spawning is slow, so spawning for each symbol is killing the process
2) you can quickly detect which symbols are mangled by just checking the first 2 chars of the symbol, this reduces the time A LOT
3) swift-demangle can be used to demangle more than one symbol at the time
4) swift is opensource, there's no need to spawn anything
5) the swift demangling apis are accessible (not in last release, but yes in git)
6) there's a swift reimplemenation of the c++ one, just google for it
7) i wrote my own demangler in C (totally incomplete, but enough for most needs)
8) spawning is a process that can be done in paralel. but that's something only Node developers know (ssssh!)
9) python is slow
10) opening any real application with this script will kill your machine
View gist:0427ff4b2abc215b7bf39d556f646188
[pancake@koega radare2]$ r2 /bin/ls
-- Set 'e bin.dbginfo=true' to load debug information at startup.
[0x000050b0]> #!python
*** Error in `r2': malloc(): memory corruption: 0x00005591fd72aae0 ***
======= Backtrace: =========
/usr/lib/libc.so.6(+0x704fb)[0x7fb3dd8ca4fb]
/usr/lib/libc.so.6(+0x76976)[0x7fb3dd8d0976]
/usr/lib/libc.so.6(+0x78949)[0x7fb3dd8d2949]
/usr/lib/libc.so.6(__libc_calloc+0x27b)[0x7fb3dd8d506b]
/usr/lib/python2.7/lib-dynload/_hashlib.so(init_hashlib+0x27d)[0x7fb3d8cf1f3d]
View voidstrap.sh
#!/bin/sh
# voidstrap - bootstrap xbps from any *nix
# author: pancake - 2013
if [ -z "$1" ]; then
echo "Usage: voidstrap.sh /path/to/new/root"
exit 1
fi
VOIDROOT="$1"
VOIDPKG=base-chroot
@radare
radare / test-afl.js
Created Feb 5, 2017
radare2 + nodejs function list (1m15s on ntdll.dll)
View test-afl.js
const r2pipe = require("r2pipe");
r2pipe.open('Downloads/ntdll/ntdll.dll', (err, r2) => {
r2.cmd('aa', (err) => {
r2.cmdj('aflj', (err, res) => {
let total = res.length;
for(let f of res) {
r2.cmdj('pdrj @ ' + f.name, (err, res) => {
if (--total < 1) {
r2.quit();