Skip to content

Instantly share code, notes, and snippets.

@bmaia
bmaia / find_cheat.lua
Created August 15, 2022 11:20
BizHawk Lua Script to automatically find cheat codes
console.clear()
st1 = 'save_stage1'
st2 = 'save_stage2'
st3 = 'save_stage3'
-- initial memory lookup method [increase, decrease, diff]
lookup_method = 'increase'
-- joystick definitions
#!/usr/bin/python3
import sys
#
# NBA Jam/Midway IMG format parser
# https://github.com/historicalsource/nba-jam
#
if __name__ == '__main__':
1078 write(1<socket:[4448]>, "Hi. Mail me if u want: routerbots@_____.__\n", 44) = 44
1078 socket(AF_LOCAL, SOCK_STREAM, 0) = 7<socket:[22218]>
1078 bind(7<socket:[22218]>, {sa_family=AF_LOCAL, sun_path=@"bbot_mutex_202613"}, 110) = 0
1078 clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xc6048) = 1079
1078 exit_group(0) = ?
1078 +++ exited with 0 +++
1079 setsid() = 1079
1079 clone( <unfinished ...>
(...)
1080 gettimeofday({500, 278384}, NULL) = 0
@bmaia
bmaia / anonabox-build
Created April 7, 2015 07:07
Anonabox (partially) Reproducible Build
# download files from https://github.com/lbthomsen/anonabox
~/anonabox $ ls -lha | grep mtd | grep -v extracted
-rw-r--r-- 1 bernardomr bernardomr 128K Abr 7 01:15 mtd0
-rw-r--r-- 1 bernardomr bernardomr 1,1M Abr 7 01:15 mtd1
-rw-r--r-- 1 bernardomr bernardomr 15M Abr 7 01:15 mtd2
-rw-r--r-- 1 bernardomr bernardomr 13M Abr 7 01:15 mtd3
-rw-r--r-- 1 bernardomr bernardomr 64K Abr 7 01:15 mtd4
-rw-r--r-- 1 bernardomr bernardomr 48K Abr 7 01:15 mtd5
# unpack firmware using binwalk
python binwally.py squashfs-root squashfs-root-TheMoon
pmemsave 0 0xFFFFFFF memory.raw
apt-get install strace
strace -o /root/strace.txt -e trace=open,read,write,readv,writev,recv,recvfrom,send,sendto,network chroot . ./tmp/EXr.pdf
mount --bind /dev /mnt/squashfs-root/dev
mount --bind /proc /mnt/squashfs-root/proc
mount --bind /sys /mnt/squashfs-root/sys
mount --bind /dev/pts /mnt/squashfs-root/dev/pts
cp /etc/resolv.conf /mnt/squashfs-root/tmp/resolv.conf
wget http://downloads.linksys.com/downloads/firmware/FW_E2500_1.0.07.001_US_20121129.bin
binwalk -Me FW_E2500_1.0.07.001_US_20121129.bin
tar -cpvzf e2500.tar.gz squashfs-root/
udhcpc -i br-lan
echo nameserver 8.8.8.8 > /etc/resolv.conf