Instantly share code, notes, and snippets.

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 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 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();
View Dockerfile
FROM ubuntu
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install -y wget apt-transport-https
RUN echo deb https://pkg.tox.chat/debian nightly stretch | tee /etc/apt/sources.list.d/tox.list
RUN wget -qO - https://pkg.tox.chat/debian/pkg.gpg.key | apt-key add -
RUN apt-get update
RUN apt-get install -y toxic
View noman
#!/bin/sh
PATH="$(npm bin):$PATH"
for a in readme ansimd ; do
type $a > /dev/null || npm install $a
done
readme "$1" | ansimd /dev/stdin | less -R
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:f0e26fbfeba327729e2778c9ca08d40a
# ejecutar asi: r2 -qi calls.py /bin/ls
import r2pipe
r2 = r2pipe.open()
r2.cmd('s $S @ entry0') # ir al principio de la seccion de codigo
# direccion minima y maxima de la seccion de codigo
addr = int(r2.cmd('?v $S'), 16)
addr_end = int(r2.cmd('?v $S + $SS'), 16)
View gist:9403b4fb103b1b589387
# Template file for 'swift'
pkgname=swift
version=2.2
revision=1
build_style=cmake
hostmakedepends="cmake pkg-config"
makedepends="ninja cmake icu swig clang python perl"
short_desc=" The Swift Programming Language"
maintainer="pancake <pancake@nopcode.org>"
license="Apache-2.0"
View gist:2cbdddfb0f23f0663357
[pancake@koega radare2]$ rustc -vV
rustc 1.2.0-dev
binary: rustc
commit-hash: unknown
commit-date: unknown
host: x86_64-unknown-linux-gnu
release: 1.2.0-dev
[pancake@koega radare2]$ rustc -vV^C
[pancake@koega radare2]$ cargo -vV
cargo 0.4.0 (built 2015-08-17)