Skip to content

Instantly share code, notes, and snippets.

View pastcompute's full-sized avatar
💯

Andrew pastcompute

💯
View GitHub Profile
@pastcompute
pastcompute / gist:7bc8a3985ac74c9ef37b
Created May 16, 2014 12:55
raadre debugging scribbles
anal_mips.c:mips_op() <-- op.c:r_anal_op() <-- anal.c:r_core_anal_search()
anal.c:r_core_anal_search() --> if ( R_ANAL_OP_TYPE_CALL) r_core_anal_followptr(,at+i,ptr=op.jump,ref,TRUE,depth==0 (why?))
--> r_core_anal_followptr(): if (ptr==ref && code==TRUE) "ar ref at" else ard ref at (data)
if ptr != ref depends on depth; then an endian calculation(!)used in r_io_read_i then self recurse
But: ar reports xref.code.call.0x0060nnnn - so again seems to be up to mips_op() or maybe r_anal_op chain to add base address?
also report xref.code.call.0x0060nnnn=0 i,e, at is 0 (?) didnt find the dest?
@pastcompute
pastcompute / gist:8b3788b9263c515a3d97
Created June 19, 2014 11:41
Radare2 macro (work in progress) for string scanning a stripped / embedded MIPS binary for strings
# Assumes strings are referenced downwards from the top of a segment
# e.g - set
f string_end @ 0x80620000
# then addui a0,a0,-12288 <-- string is at 0x8061d000
# This used to add a comment with the text but that broke recently
# So now it adds a comment String_addressofstring
# It adds a xref mut I am still perfecting that
@pastcompute
pastcompute / gist:b32f65f82c7889cdfa86
Last active August 29, 2015 14:03
Script to make a SQL table definition from CSV
echo "create table raw_data ( `head -1 raw_data.csv | sed -e 's/\?//g' -e 's/ /_/g' -e 's/,/ text,/g' -e 's/$/ text'`);" > raw_data.table.sql
echo "copy raw_data from '`pwd`/raw_data.csv' csv header;
echo "grant all privileges on table raw_data to seeu";
psql mydb < raw_data.table.sql
What is the purpose of the configure script - is it specific to ccan or is it intended to be more like a typical ./configure script?
e.g. when run on a fresh VM it doesn't detect when you have not yet installed the SSL development package, so the first time you realise that SSL is missing is when make fails. Also it doesnt warn you have not yet installed valgrind then make fails not finding valgrind
Perhaps I am spoiled from working with larger projects long established with autoconf :-)
@pastcompute
pastcompute / gist:9b5c2855d9caa8e59f9c
Created September 23, 2014 10:56
Toy test for gcc & radare2 for issue #1857
// /scratch/develop/openwrt.bb/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/bin/mips-openwrt-linux-gcc -nostdlib example.c
// /scratch/develop/openwrt.bb/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/bin/mips-openwrt-linux-strip -s a.out -o a.stripped
// dd if=a.stripped skip=176 of=a.bare bs=1
// dd if=a.bare of=a.short bs=1 count=36
extern int C;
extern const char *A;
extern char B[101];
const char *A = "hello";
@pastcompute
pastcompute / gist:337cc244eff3201c6d38
Last active August 29, 2015 14:06
Results for radare2 analysis of https://github.com/radare/radare2/issues/1384 without -m option
$ radare2 -a mips -b 32 -e cfg.bigendian=true a.bare
-- Emulate the base address of a file with e file.baddr.
[0x00000000]> aa
[0x00000000]> afl
0x00000000 24 1 fcn.00000000
0x00000018 28 1 fcn.00000018
0x00000034 160 5 fcn.00000034
0x000000d4 148 1 fcn.000000d4
0x00000168 88 1 fcn.00000168
0x000001c0 188 1 fcn.000001c0
curl -sSL https://get.docker.com/gpg | sudo apt-key add -
curl -sSL https://get.docker.com/ | sh
sudo -E sh -c docker version
Client:
Version: 1.8.1
API version: 1.20
Go version: go1.4.2
Git commit: d12ea79
Built: Thu Aug 13 02:28:37 UTC 2015
OS/Arch: linux/amd64
@pastcompute
pastcompute / gist:ccd2e3a359e531b7f025
Last active January 30, 2016 11:31
MQTT visualisation links
https://github.com/ibm-messaging/iot-visualization/blob/master/public/js/realtime/realtime.js
http://jpmens.net/2013/03/10/visualizing-energy-consumption-with-mqtt/
http://mosquitto.org/2012/03/quick-start-guide-for-mqtt-with-pachube/
http://knolleary.net/2012/06/08/bridging-mqtt-from-rsmb-to-cosm/
http://jpmens.net/2012/08/23/how-much-are-those-graphics-in-the-window/
http://graphite.readthedocs.org/en/latest/install.html
https://www.flukso.net/content/mqtt-nicely-designed-gauges
https://www.npmjs.com/package/mqtt-ws
https://github.com/mchmarny/mqtt-bridge
https://github.com/jpmens/mqtt2graphite
#!/bin/bash
# --enable-udd-profiles
dochrome-linux () {
google-chrome --user-data-dir=$HOME/.config/google-chrome$1 "${@}" 2>&1 &
}
if [ ! -z "${1}" -a "${1#http}" == "$1" ]; then
profilename="-${1}"
shift
@pastcompute
pastcompute / gist:18e940f43241c6ad8538
Last active February 3, 2016 12:59
2016 Radare2 install notes