Skip to content

Instantly share code, notes, and snippets.

[quote="reprep"]Hi,
can you please summarize your tweets about 3DS CFW here too? People like me are interested in those but we can't understand because of language barrier. Thanks.[/quote]
It's very easy.
I just want to make better CFW.
Relocatable ELF (Plugin) loader, Better signature check of CIA (support both enrypted and decrypted one), Allowing kernel access from homebrews, enabling exception display for debugging, debugger plugin(ctrlink?), screenshot plugin...
When I say such a hope, Japanese PSP developers also dream of that.
But, there is no source code. We must reverse it.
Why don't they release their source code?
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
void tea_decrypt (uint32_t *v, uint32_t *k) {
uint32_t v0=0, v1=0, sum=0;
uint32_t delta=0x61C88647;
uint32_t k0=k[0], k1=k[1], k2=k[2], k3=k[3];
do {
sum -= delta;
@173210
173210 / firm.c
Last active August 29, 2015 14:17
FIRM Loader
#include <errno.h>
#include <stdint.h>
#include <stdio.h>
typedef struct {
long offset;
void *p;
size_t size;
uint8_t hash[32];
} firmSectHdr;
versions = [
["0004001000020000", 0xA],
["0004001000021000", 9],
["0004001000022000", 9],
["0004001000026000", 3],
["0004001000027000", 6],
["0004001000028000", 3],
["0004003000008202", 0x1B],
["0004003000008802", 9],
["0004003000008A02", 7],
#!/usr/bin/env python2
import sys
if len(sys.argv) != 3:
print("xor.py <file> <xorpad>")
sys.exit()
encfile = open(sys.argv[1], "rb")
xorpad = open(sys.argv[2], "rb")
outfile = open("%s.out" % sys.argv[1], "wb")
@ihaveamac
ihaveamac / 3ds-to-cia-quick.sh
Last active June 15, 2016 10:45
convert .3ds to .cia with just an exheader xorpad (old crappy method)
# Manual and DLPChild for some reason don't work.
# it must be a make_cia issue since I tried using makerom and hex editing and it worked fine
if [ ! -f "$1" ]; then
echo "no"
exit 1
fi
rm 0.cxi ncch.header exheader.bin exefs.bin romfs.bin logo.bcma.lz plain.bin converted.cia
EXHXOR=$(python2 get-exh-xorpad.py "$1")
3dstool -xvt012f cci orig.cxi manual.cfa dlpchild.cfa "$1"
3dstool -xvtf cxi orig.cxi --header ncch.header --exh exheader.bin --exh-xor $EXHXOR --exefs exefs.bin --romfs romfs.bin --logo logo.bcma.lz --plain plain.bin
#!/usr/bin/env python2
import sys, binascii
if len(sys.argv) < 2:
print "usage: parse_seeddb_list.py seeddb_list.txt [--includeseed]"
print "- a seeddb.bin file will be generated in the current working directory"
print "- --includeseed will include the game's seed in the table"
print "- seeddb list could be obtained from http://pastebin.com/zNM8zYwa"
sys.exit()
#!/usr/bin/env python2
import sys, binascii, math
if len(sys.argv) != 2:
print("only need one CIA file")
sys.exit()
f = open(sys.argv[1], "rb")
# Archive Header Size
f.seek(0x0)
#!/usr/bin/env python2
#####
#ncchinfo.bin format
#
#4 bytes = 0xFFFFFFFF Meant to prevent previous versions of padgen from using these new files
#4 bytes ncchinfo.bin version or'd with 0xF0000000, to prevent previous versions of padgen from using these new files
#4 bytes Number of entries
#4 bytes Reserved
#
Screen.waitVblankStart()
Screen.refresh()
Screen.debugPrint(5, 5, "Hello world!", Color.new(255, 255, 255), TOP_SCREEN)
Screen.debugPrint(5, 5, "Here's a random number: "..math.random(1, 100), Color.new(255, 0, 0), BOTTOM_SCREEN)
Screen.flip()
while true do
if Controls.check(Controls.read(), KEY_B) then