Skip to content

Instantly share code, notes, and snippets.

import socket
import os
def child(sock):
print 'child running! echo server starting'
while True:
ret = sock.recv(64)
if ret == '':
print 'child server exiting!'
# coding=utf-8
from nclib import *
import socket
import sys
import struct
class XXX(object):
REALOFFSET = 221040
INFOFFSET = 0x30cad
git config credential.helper store
mkdir /mnt/tmpram
mount -t tmpfs -o size=512m tmpfs /mnt/tmpram/
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
int main(int argc, const char *argv[])
{
unsigned long long a= 0xaaaaaaaaaaaaaaaa;
struct stat s = {
.st_dev = 0xffffffffffffffff,
.__pad1 = 0x41,
for arm, dbg
CC=arm-linux-gnueabi-gcc ../glibc-2.23/configure --prefix=/usr/arm-linux-gnueabi/ arm-linux-gnueabi --enable-debug
CC=arm-linux-gnueabi-gcc ../glibc-2.23/configure --prefix=/usr/arm-linux-gnueabi/ arm-linux-gnueabi
../glibc-2.23/configure --prefix=/lib/x86_64-linux-gnu
make -j `nproc`
qemu-arm -d mmu // show maps
-g 1234 // debug gdb
target remote :1234 // in gdb
file myfile // get symbols
@offlinemark
offlinemark / sss.c
Last active April 13, 2017 20:14
related to debugging manticore dynamic binary support bug
#include <stdio.h>
#include <string.h>
#include <err.h>
#include <sys/mman.h>
int main(int argc, const char *argv[])
{
char a[] = "libc.so.6";
char b[] = "ld-linux-x86-64.so.2";
/* char *ldbase = (char*)0x0007ffff7dd7000; */
if you want to pipe some data somewhere, but suppress the EOF at the end so you can still interactively type stuff in stdin, use cat
cat file - | thing_that_reads_Stdin
(echo "stuff" && cat) | thing_
How to chroot
sudo debootstrap xenial chroot1604
sudo chroot chroot1604
echo "deb http://archive.ubuntu.com/ubuntu xenial main universe restricted multiverse" > /etc/apt/sources.list