Skip to content

Instantly share code, notes, and snippets.

@mewmew
mewmew / d1_1775_funcs.txt
Last active February 8, 2021 20:25
List of 1,775 functions (91% complete)
0000002A -> GetErr
000000CE -> GetDDErr
00000831 -> GetDSErr
0000093A -> GetLastErr
00000947 -> TermMsg
00000975 -> MsgBox
000009C7 -> FreeDlg
00000A30 -> DrawDlg
00000A65 -> DDErrDlg
00000A88 -> DSErrDlg
@mewmew
mewmew / ll.bnf
Last active January 16, 2024 15:38
A BNF grammar for LLVM IR assembly
// ### [ Lexical part ] ########################################################
_ascii_letter_upper
: 'A' - 'Z'
;
_ascii_letter_lower
: 'a' - 'z'
;
@mewmew
mewmew / lldb-basics.md
Created April 22, 2018 19:12 — forked from youfoundron/lldb-basics.md
lldb basics

#LLDB Basics A basic overview of lldb for personal reference.
Official documentation can be found here here.

##Command Structure General syntax

<noun> <verb> [-options [option-value]] [argument [argument...]]
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <time.h>
#include <unistd.h>
#include <pthread.h>
void * f(void *data) {
struct timespec start;
clock_gettime(CLOCK_REALTIME, &start);
@mewmew
mewmew / d.h
Created July 20, 2018 05:39
Type, variable and function declarations of DIABPSX.SYM (SLPS-01416).
typedef int bool;
enum _0fake {
MQ_BUTCHER = 1,
MQ_GARBUD = 2,
MQ_ZHAR = 4,
MQ_LTBANNER = 8,
MQ_VEIL = 16,
MQ_WARLORD = 32,
MQ_SKELKING = 64,
/*
* LD_PRELOAD shim which applies two patches necesary to get the game
* Divinity: Original Sin Enhanded Edition for Linux to work with Mesa (12+)
*
* Build with: gcc -s -O2 -shared -fPIC -o divos-hack.{so,c} -ldl
*/
/* for RTLD_NEXT */
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
@mewmew
mewmew / git-extract-file.markdown
Created November 2, 2018 14:45 — forked from ssp/git-extract-file.markdown
Extract a single file from a git repository

How to extract a single file with its history from a git repository

These steps show two less common interactions with git to extract a single file which is inside a subfolder from a git repository. These steps essentially reduce the repository to just the desired files and should performed on a copy of the original repository (1.).

First the repository is reduced to just the subfolder containing the files in question using git filter-branch --subdirectory-filter (2.) which is a useful step by itself if just a subfolder needs to be extracted. This step moves the desired files to the top level of the repository.

Finally all remaining files are listed using git ls, the files to keep are removed from that using grep -v and the resulting list is passed to git rm which is invoked by git filter-branch --index-filter (3.). A bit convoluted but it does the trick.

1. copy the repository to extract the file from and go to the desired branch

diff --git a/asm/global.go b/asm/global.go
index 5a1f04c..fc73db6 100644
--- a/asm/global.go
+++ b/asm/global.go
@@ -2,6 +2,7 @@ package asm
import (
"fmt"
+ "sync"
@mewmew
mewmew / gist:039e36dc8fd7b1d924aed7c9ef764813
Created December 20, 2018 19:17 — forked from debasishg/gist:8172796
A collection of links for streaming algorithms and data structures
  1. General Background and Overview
#include <iostream>
using std::cout;
using std::endl;
// Typedef for the function pointer
typedef void (*_PVFV)(void);
// Our various functions/classes that are going to log the application startup/exit
struct TestClass
{