Skip to content

Instantly share code, notes, and snippets.

View yifanlu's full-sized avatar

Yifan Lu yifanlu

View GitHub Profile
public class Stopwatch {
public static void main(String[] args){
long startingTime = System.currentTimeMillis();
long currentTime;
long deltaTime = 0;
long stopTime = 60 * 1000; // 60 seconds in miliseconds
while((currentTime = System.currentTimeMillis()) <= startingTime + stopTime){
deltaTime = currentTime - startingTime;
System.out.printf("%d miliseconds passed\n", deltaTime);
}
<!DOCTYPE plist PUBLIC -//Apple Computer//DTD PLIST 1.0//EN http://www.apple.com/DTDs/PropertyList-1.0.dtd >
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.yifanlu.sshtunnel</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/ssh</string>
<string>-T</string>
<string>-D</string>
@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
@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__

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 / 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
@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 / 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: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:e0787ca48473cdf992f8
Created March 24, 2015 01:17
GetAccountStatus 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><GetAccountStatusResponse xmlns="urn:ecs.wsapi.broadon.com"><Version>2.0</Version><DeviceId>20117171042</DeviceId><MessageId>EC-20117171042-121712521</MessageId><TimeStamp>1427134562983</TimeStamp><ErrorCode>0</ErrorCode><ServiceStandbyMode>false</ServiceStandbyMode><AccountStatus>R</AccountStatus><ServiceURLs><Name>ContentPrefixURL</Name><URI>http://ccs.cdn.c.shop.nintendowifi.net/ccs/download</URI></ServiceURLs><ServiceURLs><Name>UncachedContentPrefixURL</Name><URI>https://ccs.c.shop.nintendowifi.net/ccs/download</URI></ServiceURLs><ServiceURLs><Name>SystemContentPrefixURL</Name><URI>http://nus.cdn.c.shop.nintendowifi.net/ccs/download</URI></ServiceURLs><ServiceURLs><Name>SystemUncachedContentPrefixURL</Name><URI>https://ccs.c.shop.nintendowifi.net/ccs/download</URI></ServiceURLs><Ser