Skip to content

Instantly share code, notes, and snippets.

View ashquarky's full-sized avatar
🦊
???

Ash ashquarky

🦊
???
View GitHub Profile
@ashquarky
ashquarky / iosuaccess.c
Last active August 5, 2016 02:23
My reverse-engineering of a certain ELF thrown at me
void (*mystery_func)(int a, int b); //Pointer, OSDynLoad?
void (*mystery_func2)(void*)
void another_mystery(void* a, void* b, int c, int d); //Built in to app
void possible_init_func(...); //Built in, a few bits missing
void yet_another_func(int possibly_not_used);
int ret, var1, var2, var3, var4; //var3 and var2 have not been set in this function before they are used, var4 isn't actually in memory
var1 = 0; //var1 might be global
@ashquarky
ashquarky / OSScreenSetBufferEx.c
Created August 9, 2016 23:01
Quick reverse-engineering of OSScreenSetBufferEx. 5.5.1.
int globalVar; //This could be anything, likely a struct?
//Feels like a stack pointer.
//unk_10098EB4
void OSScreenSetBufferEx(int bufferNum, void* address) {
int r0 = bufferNum << 6; //32-Bit left shift
int* r11 = globalVar + r0;
int r12 = *(r11 + 0x2C);
*(r11 + 0x38) = address;
@ashquarky
ashquarky / SwkbdCreate.cpp
Created August 29, 2016 04:52
A horribly unfinished reverse-engineering of SwkbdCreate, let us never speak of this until I finish it
namespace Rpl {
#define MYSTERY_DATA_LOC (unsigned char*)0x10049E38
#define MUTEX_LOC (unknown datatype*)0x1004D294
#define FIBER_LOC (unknown datatype*)0x10054CBC
void SwkbdCreate(unsigned char* a, nn::swkbd::RegionType b, unsigned int c, FSClient* d) {
OSThread* thread = OSGetCurrentThread();
int stackSize = ADDZE(SRAWI(thread->stackEnd - thread->stackBase, 0xA)); //Doesn't really matter anyway
@ashquarky
ashquarky / concept.nqpp.c
Created September 14, 2016 22:55
A concept for Not Quite PowerPC; a C-style language to help people learn PowerPC Assembly
#global main
/*int main(int argc, char** argv)*/
main:
//save link register
r0 = lr;
*8(r1) = r0;
compare(lw, r3, 0); //r3 = argc; comparing a logical word (lw)
ifgt { // if r3 > 0...
r3 = *2(r4); //load memory at argv+2 into r3
@ashquarky
ashquarky / OurLoader.c
Last active September 23, 2016 09:11
[Code Golf] OurLoader (region free Wii U game loader) in 178 bytes
#define d(x) ((a(*)())*((a*)0x801500+x))(
typedef int a;a e(a b,a(*c)()){d(0)"sysapp",&b);d(1)b,0,"_SYSLaunchTitleByPathFromLauncher",&c);c("/vol/storage_odd03",18,0);return -3;}
@ashquarky
ashquarky / MasterAgent_ProcessPacket.c
Last active September 23, 2016 23:57
Reverse-engineering of the important bits of MasterAgent_ProcessPacket. By important, I mean gdb_query and *nothing else*.
struct _globals {
unsigned int isDebuggerPresent;
unsigned short word_100D1378; //referenced in start()
unsigned int dword_100523D8; //referenced in start()
unsigned int tickStorage; //dword_100523D0, also referenced in start()
char* stringStorage; //dword_1004F964
}
struct _globals globals;
void nn::hai::launch::PrepareLaunch(unsigned int* out, void* buffer, unsigned int val) {
nn::hai::error::Error errorInstance; //stack
nn::hai::error::Init(&errorInstance);
if (errorInstance) goto quit; //will skip StopIfRequired call
if (!buffer) {
//much nn::hai::error::Error handling ensues; "Invalid buffer"
goto quit;
}
@ashquarky
ashquarky / keybase.md
Created June 26, 2017 06:22
Keybase proof

Keybase proof

I hereby claim:

  • I am quarktheawesome on github.
  • I am quarktheawesome (https://keybase.io/quarktheawesome) on keybase.
  • I have a public key ASC0-Lch-SJQTW_dfqlSbdjxZlRx62438lT6BzNjlaFTuQo

To claim this, I am signing this object:

@ashquarky
ashquarky / WaraWara-Annotated.xml
Created September 30, 2017 00:47
WaraWara Plaza's EUR XML file; with data stripped out and annotated.
<!--
Australian (EUR) console; signed in as native NNID
http[s]://olveu.cdn.nintendo.net/xml/warawara/L1/eu/all/teen.xml
No special auth needed; works in a web browser
HTTP/1.1 200 OK
Server: Apache
ETag: "421c904409fa4953470148a9144389ad:1504573890"
Last-Modified: Tue, 05 Sep 2017 01:11:30 GMT
Accept-Ranges: bytes
unsigned int devbsp_msgqueue[0x40]; //.bss:E6047000 - E60470FC inclusive
unsigned int devbsp_msgqueue_id; //.bss:E6047100
unsigned int devbsp_msgqueue_fdtable[0x40]; //.bss:E6047104 - E6047200 inclusive
unsigned int dword_E6042000 = 0xFFFFFFFF; //.data:E6042000
/* http://wiiubrew.org/wiki/IOSU#IPC */
struct ipc_msg {
/* 1:open, 2:close, 3:read, 4:write, 5:seek, 6:ioctl, 7:ioctlv */
unsigned int cmd;
unsigned int client_reply;