This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import sys | |
import os.path | |
import clang.cindex as ci | |
declarations = set() | |
references = set() | |
def traverse(node, path, decls): | |
for child in node.get_children(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* mkpsxiso | |
* | |
* Converts an ISO to a .bin/.cue of a Playstation disk | |
*/ | |
#include <stdio.h> | |
#include <string.h> | |
char iso2raw_sec[16]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import struct | |
import sys | |
import re | |
def read_chunk(f): | |
size, = struct.unpack('<I', f.read(4)) | |
return f.read(size) | |
for filename in sys.argv[1:]: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stdio.h> | |
#include <unistd.h> | |
#include <sys/socket.h> | |
#include <netinet/in.h> | |
int main() | |
{ | |
int listening_fd = socket(AF_INET, SOCK_STREAM, 0); | |
if (listening_fd == -1) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print "Hello, world!" | |
-- Example: Change starting level of NTSC-U Crash 2 to Ruination | |
write8(0x800117E4, 0xF) | |
-- Example: Print a message on every NTSC-U Crash 2 GOOL RNG instruction | |
trapexec(0x8003A368, function() | |
print("RNG(" .. v0 .. ", " .. v1 .. ")") | |
end) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdint.h> | |
const unsigned char data[128] = { | |
0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# fixes strange issue when using mingw-generated import libs in msvc | |
# | |
# issue only appears if using multiple mingw-generated import libs | |
# simultaneously; the MSVC linker runs OK but produces a binary which | |
# pulls all of its import symbols from a single DLL and doesn't appear | |
# to pull anything from the other linked DLL's | |
# | |
# issue appears to stem from the usage of non-unique object names across | |
# multiple import libs (they are generated with a sequential id of some | |
# kind) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
long test_short( | |
long a0, | |
long a1) | |
{ | |
printf("a0: %lX\n", a0); | |
printf("a1: %lX\n", a1); | |
return 0xDEADDEADDEADDEAD; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.text | |
.globl dyncall | |
dyncall: | |
pushq %rbp | |
movq %rsp, %rbp | |
pushq %rdx | |
movl %edi, %ecx | |
movl %ecx, %eax |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template <typename T,typename R,typename... Args,R (T::*f)(Args...)> | |
static void connect_signal( | |
GtkWidget *widget, | |
const char *signal, | |
T *t) | |
{ | |
g_signal_connect( | |
widget, | |
signal, | |
[](Args... args,gpointer user_data) -> R { |
NewerOlder