Skip to content

Instantly share code, notes, and snippets.

View yifanlu's full-sized avatar

Yifan Lu yifanlu

View GitHub Profile
@yifanlu
yifanlu / code.bin
Created June 9, 2015 18:54
3DS region system transfer patches for O3DS
/*
* uvloader.c - Userland Vita Loader entry point
* Copyright 2012 Yifan Lu
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@yifanlu
yifanlu / firm.pem
Created April 20, 2016 17:25
3DS FIRM header RSA public key
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA3s+2/D0z6VX9rJDoiBew
A6FrmqtycHkyoqCMuzNvsHaWLsTpLtiPksAtTUEP3kUbJTy+N2tFgiHmTbEjgYK2
gWK3MPRgS8f38BcMtXWId5NSY3DwC8ZzQ0Hu5PBx7MjBMsTcqZkdMbikft0ZBA8C
qBqvs0iaKSleSYTglBHRfquywER+oRtenQ0a+QKaLlMDLUiWfCym16zx7SsYuwHL
E7mspu5VADd8aWFiiQFUd58HXSY0OqlJpa/yXgZRtxzg3tpcC5+YwhX9utipmQCr
pI5KFp1mKuhWZLK2wJOvTTigFlzkvWLCRmvJWllKclj9ssw2hzCF6KEEW+AXm9Ds
mwIDAQAB
-----END PUBLIC KEY-----
@yifanlu
yifanlu / gist:a589c9655e05acbd30dc
Created March 24, 2015 02:39
GetSystemUpdate Response (9.2.0-20U complete)
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><GetSystemUpdateResponse xmlns="urn:nus.wsapi.broadon.com"><Version>1.0</Version><DeviceId>21384193388</DeviceId><MessageId>1</MessageId><TimeStamp>1414627502761</TimeStamp><ErrorCode>0</ErrorCode><ContentPrefixURL>http://nus.cdn.c.shop.nintendowifi.net/ccs/download</ContentPrefixURL><UncachedContentPrefixURL>https://ccs.c.shop.nintendowifi.net/ccs/download</UncachedContentPrefixURL><TitleVersion><TitleId>0004001000021200</TitleId><Version>2064</Version><FsSize>2408448</FsSize><TicketSize>848</TicketSize><TMDSize>4708</TMDSize></TitleVersion><TitleVersion><TitleId>0004001000021500</TitleId><Version>3088</Version><FsSize>5324800</FsSize><TicketSize>848</TicketSize><TMDSize>4708</TMDSize></TitleVersion><TitleVersion><TitleId>0004001000021700</TitleId><Version>2055</Version><FsSize>5537792
@yifanlu
yifanlu / gist:bdcd22073cb5096942bb
Created March 24, 2015 01:12
GetSystemUpdate Response (9.2.0-20J)
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><GetSystemUpdateResponse xmlns="urn:nus.wsapi.broadon.com"><Version>1.0</Version><DeviceId>20117171042</DeviceId><MessageId>1</MessageId><TimeStamp>1412957103965</TimeStamp><ErrorCode>0</ErrorCode><ContentPrefixURL>http://nus.cdn.c.shop.nintendowifi.net/ccs/download</ContentPrefixURL><UncachedContentPrefixURL>https://ccs.c.shop.nintendowifi.net/ccs/download</UncachedContentPrefixURL><TitleVersion><TitleId>0004001000020000</TitleId><Version>9224</Version><FsSize>3047424</FsSize><TicketSize>848</TicketSize><TMDSize>4708</TMDSize></TitleVersion><TitleVersion><TitleId>0004001000020100</TitleId><Version>3072</Version><FsSize>999424</FsSize><TicketSize>848</TicketSize><TMDSize>4708</TMDSize></TitleVersion><TitleVersion><TitleId>0004001000020400</TitleId><Version>4097</Version><FsSize>7110656<
@yifanlu
yifanlu / gist:3a6fab2ea14a2b2f081f
Created March 23, 2015 09:30
GetSystemTitleHash Response
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><GetSystemTitleHashResponse xmlns="urn:nus.wsapi.broadon.com"><Version>1.0</Version><DeviceId>xxx</DeviceId><MessageId>1</MessageId><TimeStamp>1427102859413</TimeStamp><ErrorCode>0</ErrorCode><TitleHash>62380B4ADF540AED099D9ABFF05D71BD</TitleHash></GetSystemTitleHashResponse></soapenv:Body></soapenv:Envelope>
@yifanlu
yifanlu / gist:d1e13ef8f094294121ef
Created March 22, 2015 23:59
N3DS USA 9.2.0-20U title+version
System Applications
0004001000021000 8203
0004001000021100 3073
0004001000021200 2064
0004001020021300 1
0004001000021400 4097
0004001000021500 3088
0004001000021700 2055
0004001000021800 5136
0004001000021900 13320
@yifanlu
yifanlu / spider_rop.s
Created January 23, 2015 18:16
regionthree as 9.x Spider ROP
.nds
.create "spider_rop.bin",0x0
;define constants
DLPLAY_CODE_LOC_VA equ 0x00192800
DLPLAY_CODE_LOC equ (DLPLAY_CODE_LOC_VA-0x00100000+0x03F50000+0x14000000)
DLPLAY_HOOK_LOC equ (0x03FF3500+0x14000000)
DLPLAY_NSSHANDLE_LOC_VA equ 0x001A5200

Keybase proof

I hereby claim:

  • I am yifanlu on github.
  • I am yifanlu (https://keybase.io/yifanlu) on keybase.
  • I have a public key whose fingerprint is 26F4 BFC6 F86D D87C E5B4 2E2C 14ED BDB7 8106 7076

To claim this, I am signing this object:

@yifanlu
yifanlu / pathtest.c
Created August 6, 2012 21:57
Vita possible exploit testing
//
// main.c
//
// Created by Yifan Lu on 8/6/12.
//
#define G_DIR_SEPARATOR '/'
// I don't know if __native_client__ is defined on the Vita or not, so
// you can try it both ways.
#define __native_client__
@yifanlu
yifanlu / TetrisGame.java
Created May 13, 2012 05:43
Java programming guide by example
/*
This purpose of this Tetris demo is to demostrate three things:
1) Structure of a game
We have a game loop, a clock, an update method, and a draw method
*) The clock calculates the number of seconds since the last loop.
This allows us to move the game at a constant pace even if the CPU fluctuates.
*) The update method does the logic of the game, including collision checks, random character generation, etc.
The update method delegates the task, so each object is responsible for updating itself
*) The draw method does the rendering of stuff to screen, and just like the update method, each object draws itself