Skip to content

Instantly share code, notes, and snippets.

'''
@withargs(1)
def myfunc(x):
code
--
myfunc = withargs(1)(myfunc)
=============
api design talk
https://www.youtube.com/watch?v=heh4OeB9A-c
- key ideas
- when in doubt, leave it out
- don't make client do anything the module could do
--
- why is api design important
for each in `ls llvm-* clang* opt*`; do ln -sv $PWD/$each $PWD/$each-3.8; done
spacemacs learning
ctrlp -- spc p f
nerdtree -- spc d t
spc b b
https://dannysu.com/2014/12/14/spacemacs/
minx to minc
ssa in decompilers -> http://espace.library.uq.edu.au/view/UQ:158682
@offlinemark
offlinemark / gist:b2d0ce97705a6849d65700da6c087a68
Created April 11, 2016 00:29
cool way to typedef struct union mmr, from mplab code config
// bitfield definitions
typedef union {
struct {
unsigned ADON :1;
unsigned GO_nDONE :1;
unsigned CHS :5;
};
struct {
unsigned :1;
unsigned ADGO :1;
opt-3.7 -load ./Ubouch.so -mypass test.bc -o out.bc
[+] Checking func
> Uninitialized read of `x` ; %1 = load i32, i32* %x, align 4
; ModuleID = 'test.bc'
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
; Function Attrs: nounwind uwtable
define void @func() #0 {
%x = alloca i32, align 4
@offlinemark
offlinemark / llvm stuff
Last active May 16, 2016 17:55
llvm stuff
i'm trying to install llvm, documenting it here
ubuntu 14.04
http://llvm.org/docs/GettingStarted.html
http://clang.llvm.org/get_started.html
http://llvm.org/docs/GettingStarted.html#requirements
install svn, cmake
cd where-you-want-llvm-to-live
void print_byte(char c) {
if (c >= ' ' && c <= '~') {
printf("%c", c);
} else {
printf(".");
}
}
void print_ascii(size_t off, size_t len, const unsigned char *hex) {
for (size_t i = 0; i < len; i++) {
#include <stdio.h>
int main() {
int x = 1;
char *y = (char*) &x;
if (*y == 1) {
puts("little endian");
} else {
puts("big endian");
}
}