Skip to content

Instantly share code, notes, and snippets.

'''Fix the checksum in ULI files.'''
import argparse
import binascii
import struct
BULLSHIT = [0, 2519730039, 744558318, 3125873049, 432303367, 2415159920, 900031465, 2744476830, 847829774, 2763578489, 518641120, 2295976599, 726447625, 3179065726, 120436967, 2434645904, 1678817053, 4062228586, 1215412723, 3728850564, 2111101466, 3957644653, 1370871028, 3347436419, 1452829715, 3232263012, 2063164157, 3972621706, 1331429652, 3647735395, 1664946170, 4111272077, 3357568571, 1578133836, 3829489877, 1920034722, 3521381180, 1205077067, 4253355474, 1807026853, 4205360437, 1821946434, 3603545051, 1090108588, 3815561266, 1969020741, 3473790684, 1497223595, 2888882470, 973135441, 2152847304, 375509183, 3052712993, 600093526, 2576726735, 262520248, 2662859304, 143131999, 3000569030, 619252657, 2273079087, 290220120, 2870829505, 1026385590, 2420235382, 108124929, 3156267672, 705746415, 2307240305, 532002310, 2783231903, 869578984, 2731083640, 888733711, 2393377174, 412618465, 3138218623, 759000328, 2540463249, 22832102
# Half-done definition for XGPro's ULI/UDC files.
# These let users add support for new flash chips, provided there is an
# existing "reference" chip that is similar enough.
# The XGPro software does not allow users to change the size of the chip, however.
# So, XGPro will not let you add chip that is bigger than everything else it supports.
# This is currently incomplete and cannot be used to create a definition from scratch.
meta:
id: xgpro_uli
file-extension: uli, udc
endian: le
@bsmt
bsmt / sly4_save.ksy
Last active October 16, 2024 15:09
meta:
id: sly4_save
title: Sly Cooper - Thieves In Time save file
file-extension: bin
endian: be
doc: |
Incomplete definition for Sly 4 save files.
Most of the basic cheating things are defined.
@bsmt
bsmt / XORRegions.java
Created February 15, 2020 05:17
Ghidra script to XOR two arbitrary size regions of memory together and write the resulting buffer somewhere. *dest = *src_1 ^ *src_2
// XOR two memory regions together and write result at a third location.
//@author bsmt
//@category Memory
//@keybinding
//@menupath
//@toolbar
import ghidra.app.script.GhidraScript;
import ghidra.program.model.util.*;
import ghidra.program.model.reloc.*;
@bsmt
bsmt / cxnepo.py
Created August 21, 2017 04:02
dump CAN message data from OpenXC VI firmware binaries.
import argparse
import struct
from capstone import *
from capstone.arm import *
dis = Cs(CS_ARCH_ARM, CS_MODE_LITTLE_ENDIAN + CS_MODE_THUMB + CS_MODE_MCLASS)
dis.detail = True
BASE = 0x10000
@bsmt
bsmt / Simplify3D.desktop
Created August 5, 2017 05:12
Simplify3D XDG Desktop file
#!/usr/bin/env xdg-open
[Desktop Entry]
Type=Application
Version=4.0
Name=Simplify3D
Comment=3D Printer Slicer
Icon=/opt/Simplify3D-4.0.0/icon.png
Exec=/opt/Simplify3D-4.0.0/LaunchScript.sh
Terminal=False
Path=/opt/Simplify3D-4.0.0
@bsmt
bsmt / infest.cy
Last active August 29, 2015 14:11
Dirty hack to enable using skype as a shell with something like "/echo testing"
//sudo cycript -p Skype
@import com.saurik.substrate.MS
var get = function(name)
{
func_ = dlsym(RTLD_DEFAULT, name)
func = function() { var types = 'v', args = [], count = arguments.length; for (var i = 0; i != count; ++i) { types += '@'; args.push(arguments[i]); } new Functor(func_, types).apply(null, args); };
return func
}
NSLog = get("NSLog");
@bsmt
bsmt / _.c
Created October 3, 2014 09:44
Probably the easiest but worst way to detect lldb.
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
int main()
{
char *underscore = getenv("_");
if (!strcmp(underscore, "/usr/bin/lldb"))
{
printf("lldb detected.\n");
@bsmt
bsmt / meh.py
Last active August 29, 2015 14:04
'''Demonstrates communicating with the Wunderlist 3 websocket API.
This example just sends a ping request of sorts.
First, you must add your client id, device id, and access token to this script.
An easy way to do that is to load Wunderlist in lldb and do this:
[lldb]$breakpoint set -n '-[SRWebSocket initWithURLRequest:]'
[lldb]$r
Process 602 stopped
-> 0x10039b82f: pushq %rbp
@bsmt
bsmt / autoexec.cfg
Last active August 29, 2015 14:04
DotA2 autoexec
// my autoexec.cfg
// along with setting up an autoexec, i add -novideo to arguments
// I also use dota2-clarity (https://github.com/iheartdisraptor/dota2-clarity)
// comment the next line if you don't use it.
//exec clarity/use_tutorials_and_aliases.cfg
say "hi"
///////// bindings