Skip to content

Instantly share code, notes, and snippets.

View rofl0r's full-sized avatar

rofl0r

View GitHub Profile
Finished parsing, now tinkering...
sdk/text/Format.ooc:253:34 INFO Score of info fieldwidth += (p@ - 48) = -100000 (Int vs Char)
info fieldwidth += (p@ - 0x30)
~~~~
sdk/text/Format.ooc:270:37 INFO Score of info precision += (p@ - 48) = -100000 (Int vs Char)
info precision += (p@ - 0x30)
~~~~
sdk/text/Format.ooc:293:37 INFO Score of info precision += (p@ - 48) = -100000 (Int vs Char)
info precision += (p@ - 0x30)
~~~~
Program received signal SIGSEGV, Segmentation fault.
0x0000000000489925 in rock_middle_Module__Module_addUse_impl (this=0x23509a0, uze=0x195cd00) at source/rock/middle/Module.ooc:175
175 for(imp in uze useDef imports) {
(gdb) bt
#0 0x0000000000489925 in rock_middle_Module__Module_addUse_impl (this=0x23509a0, uze=0x195cd00) at source/rock/middle/Module.ooc:175
#1 0x000000000048aff2 in rock_middle_Module__Module_addUse (this=0x23509a0, uze=0x195cd00) at source/rock/middle/Module.ooc:139
use oocurses
/* curses binding for OOC
* initial 10 lines by tsion
* D bindings (C) 2007 from Dejan Lekic, http://dejan.lekic.org
* dejan.lekic @ (gmail.com || kcl.ac.uk)
* converted to OOC by rofl0r via htooc
* then improved manually by rofl0r
* This source code is licensed under the BSD license.
*/
// /**
// use like this: xstr_append(str1, str2, str3, NULL);
void xstr_append(xstr* self, ...) {
assert(self != NULL);
xuint totalsize = self->size;
xstr* candidate = NULL;
va_list ap;
va_start(ap, self);
while(1) {
candidate = va_arg(ap, xstr*);
@rofl0r
rofl0r / gist:674914
Created November 12, 2010 23:50
mayday-unified.diff
diff -r -u '--exclude=language*' '--exclude=interface.txt' -w -B -E df_linux//data/init/colors.txt dfg16//data/init/colors.txt
--- df_linux//data/init/colors.txt 2010-10-04 14:40:33.000000000 +0200
+++ dfg16//data/init/colors.txt 2010-06-05 00:55:14.000000000 +0200
@@ -3,24 +3,31 @@
[BLACK_R:0]
[BLACK_G:0]
[BLACK_B:0]
-[BLUE_R:0]
-[BLUE_G:0]
-[BLUE_B:128]
@rofl0r
rofl0r / mayday-unified.diff
Created November 12, 2010 23:50
mayday-unified.diff
diff -r -u '--exclude=language*' '--exclude=interface.txt' -w -B -E df_linux//data/init/colors.txt dfg16//data/init/colors.txt
--- df_linux//data/init/colors.txt 2010-10-04 14:40:33.000000000 +0200
+++ dfg16//data/init/colors.txt 2010-06-05 00:55:14.000000000 +0200
@@ -3,24 +3,31 @@
[BLACK_R:0]
[BLACK_G:0]
[BLACK_B:0]
-[BLUE_R:0]
-[BLUE_G:0]
-[BLUE_B:128]
@rofl0r
rofl0r / BufferFile.ooc
Created December 7, 2010 21:28
extension to write to a file / read it with a single statement
extend Buffer {
/**
reads a whole file into buffer, binary mode
*/
fromFile: func (fileName: String) -> Bool {
STEP_SIZE : const SizeT = 4096
file := FStream open(fileName, "rb")
if (!file || file error()) return false
len := file getSize()
("filesize=" + len toString()) println()
@rofl0r
rofl0r / gist:1073739
Created July 9, 2011 16:53 — forked from angavrilov/gist:926972
mmap injection on linux (emulation of VirtualAllocEx)
/* Support for executing system calls in the context of the game process. */
static const int injection_size = 4;
static const char nop_code_bytes[injection_size] = {
/* This is the byte pattern used to pad function
addresses to multiples of 16 bytes. It consists
of RET and a sequence of NOPs. The NOPs are not
supposed to be used, so they can be overwritten. */
0xC3, 0x90, 0x90, 0x90
@rofl0r
rofl0r / sleep.c
Created March 13, 2012 03:04
gnu compatible sleep tool.
#define _POSIX_C_SOURCE 200809L
#include <sys/time.h>
#include <time.h>
#include <stdlib.h>
int main(int argc, char** argv) {
int i;
char* end;
int times;
for(i = 1; i < argc; i++) {
@rofl0r
rofl0r / mkcabundle.pl
Created April 10, 2012 01:15
SSL certificate download script
#!/usr/bin/perl -w
#
# Used to regenerate ca-bundle.crt from the Mozilla certdata.txt.
# Run as ./mkcabundle.pl > ca-bundle.crt
#
my $cvsroot = ':pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot';
my $certdata = 'mozilla/security/nss/lib/ckfw/builtins/certdata.txt';
open(IN, "cvs -d $cvsroot co -p $certdata|")