Skip to content

Instantly share code, notes, and snippets.

View murachue's full-sized avatar
🔟
binary

murachue

🔟
binary
View GitHub Profile
@murachue
murachue / dpy.s
Created August 12, 2023 17:07
PDP-7 light-pen cursor move test program
" light-pen cursor move test program
" $ doctorwkt/pdp7-unix/tools/as7 -f rim -o a.rim dpy.s
" $ open-simh/simh/BIN/.../pdp7
" sim> se g2out disa
" sim> se dpy ena
" sim> load a.rim 100
" sim> g 100
" press LMB (light-pen) around cursor and move slowly... fun!
@murachue
murachue / loaders__elf_rsp.py
Created April 5, 2020 02:27
Processor and loader modules for reading RSP objects in N64 SDK, for IDA Pro (<7)
# coding: utf-8
import idaapi
import struct
class Struct(object):
def __init__(self, endian):
self._fmt = endian + "".join([w for w,_ in self._struct])
self._size = struct.calcsize(self._fmt)
def read(self, li):
@murachue
murachue / mub.ksy
Last active August 10, 2019 17:29
describe openmucom88 binary format in kaitai struct
meta:
id: mub
title: openmucom88 binary format (supports only one song)
file-extension: mub
endian: le
doc-ref: https://github.com/onitama/mucom88/blob/99d0dad6d3234848876739b5775149ff0af3a782/src/cmucom.h#L118
seq:
- id: magic
contents: "MUC8"
- id: dataoff
@murachue
murachue / sh2.cspec
Created May 18, 2019 08:32
INCOMPLETE SH-2 Ghidra processor module
<?xml version="1.0" encoding="UTF-8"?>
<compiler_spec>
<global>
<range space="RAM"/>
</global>
<stackpointer register="r15" space="RAM" growth="negative"/>
<returnaddress>
<register name="pr"/>
</returnaddress>
@murachue
murachue / CopyBytes.java
Created April 8, 2019 12:12
copybytes Ghidra script
//copy the selected bytes into new address (you'll be prompted).
// note: you can copy small area by copy "Byte String" and paste. (this script is for large (>~150KB) area that can't copy-paste)
// note: this script does not support large area such as over 1GB.
// note: you can make "same view" by defining memory map "byte mapped". (this script is for "mutable" copy, emulating memcpy)
//@author murachue
//@category Memory
//@keybinding
//@menupath
//@toolbar
@murachue
murachue / 201902140007.txt
Created February 13, 2019 15:09
Hello world, no root.
kernel_text=0x800010b0 edata=0x8024f9f0 end=0x80260518 sp=0x80001070
mips_fixup_stubs: 4957 fixups done in 5187515 cycles
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017,
2018, 2019 The NetBSD Foundation, Inc. All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
The Regents of the University of California. All rights reserved.
NetBSD 8.0_STABLE (GENERIC) #43: Wed Feb 13 00:05:32 JST 2019
user@host:/home/user/netbsd_src/sys/arch/nintendo64/compile/obj/GENERIC
@murachue
murachue / 201902132353.txt
Created February 13, 2019 14:53
hello world!
kernel_text=0x800011f0 edata=0x8024fbd0 end=0x80260718 sp=0x800011b0
mips_fixup_stubs: 4957 fixups done in 5189168 cycles
pid 0(system): trap: cpu0, reserved instruction in kernel mode
status=0x20000002, cause=0x28, epc=0x80001164, vaddr=0xffffffff
tf=0x80001138 ksp=0x800011d8 ra=0x800012d4 ppl=0
panic: trap
System halted. Hit any key to reboot.
@murachue
murachue / 0shell.txt
Last active September 30, 2017 15:19
standalone rust-fuse hello example
$ cargo init --bin rust-fuse-hello
$ curl -Lv https://raw.githubusercontent.com/zargony/rust-fuse/0.3.0/examples/hello.rs -o rust-fuse-hello/src/main.rs
## note: newer version ( c9167ce06e8897fc3558a25b8f1685f39cd2dd98 or later ) may not compile with 0.3.0 due to https://github.com/zargony/rust-fuse/pull/84
$ cd rust-fuse-hello
$ $EDITOR Cargo.toml
## edit some...
$ cargo build
## target/debug/rust-fuse-hello is ready to run!
@murachue
murachue / mkpsxexe.c
Created December 3, 2016 15:37
Binary to PlayStation1 executable converter.
// mkpsxexe.c
// Copyright 2016 Murachue
// License: CC-BY
#include <stdio.h>
#include <unistd.h>
#include <inttypes.h>
#include <stdlib.h>
size_t fwriteu32(uint32_t val, FILE *fp) {
@murachue
murachue / mkpsximg.rs
Created December 3, 2016 15:36
CD-ROM image Mode1→Mode2 converter for PlayStation1 homebrew.
// mkpsximg.rs
// Copyright 2016 Murachue
// License: CC-BY
use std::fs::File;
use std::io;
use std::io::{Read, Write};
struct Edc {
edc_table: [u32; 256],