This file contains hidden or 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
source_list = open("$SOURCE_LIST_FILE", "w") | |
lines = gdb.execute('info sources', to_string=True).split('\n') | |
for line in lines: | |
line = line.strip() | |
if not line.startswith('/'): | |
continue | |
parts = line.split(',') | |
for part in parts: | |
source_list.write(part.strip() + '\n') | |
source_list.close() |
This file contains hidden or 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
get_win_path() { | |
P=${PWD/\/usr\/lib/\/windows\/system32} | |
P=${P/\/usr\/bin/\/program files} | |
P=${P/$HOME/\/Documents and Settings\/$USER} | |
P=$(echo ${P//\//\\} | tr '[:lower:]' '[:upper:]') | |
echo "C:$P" | |
} | |
export PS1="\$(get_win_path)>" |
This file contains hidden or 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
function AsyncRateLimiter() { | |
/* Operation is in progress */ | |
this.doingThing = false; | |
/* Next operation to do after this one */ | |
this.nextFn = false; | |
} | |
AsyncRateLimiter.prototype.submit = function(fn) { |
This file contains hidden or 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 <stdint.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <unistd.h> | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <signal.h> | |
#include <stdbool.h> | |
#include <time.h> |
This file contains hidden or 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
#define DEF_WRAPPER(ret,name,...) typedef ret (*wrapped_##name##_t)(__VA_ARGS__); \ | |
static wrapped_##name##_t wrapped_##name = NULL; \ | |
ret name(__VA_ARGS__) | |
#define CALL_INNER(name, ...) (wrapped_##name ? wrapped_##name : (wrapped_##name = ((wrapped_##name##_t)dlsym(RTLD_NEXT,#name))))(__VA_ARGS__) | |
// Example: | |
// | |
//DEF_WRAPPER(ssize_t,send,int socket, const void *buffer, size_t length, int flags) |
This file contains hidden or 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
#!/bin/bash | |
# Usage: | |
# fake_dns 12.23.45.67 fakedomain.com <program> [args...] | |
set -e | |
IP=$1 | |
HOST=$2 | |
shift 2 |
This file contains hidden or 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 <stdint.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <unistd.h> | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <fcntl.h> | |
#include <signal.h> |
This file contains hidden or 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 <stdlib.h> | |
#include <stdint.h> | |
#include <assert.h> | |
#include <memory.h> | |
uint8_t get_bits(uint8_t *in_base, size_t start_bit, size_t n_bits) | |
{ | |
size_t split = start_bit % 8; | |
uint8_t *base = &in_base[start_bit/8]; |
This file contains hidden or 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 <stdlib.h> | |
#include <unistd.h> | |
#include <memory.h> | |
void step(char *state, size_t len, char rule) | |
{ | |
/* Buffer large enough to hold all bits */ | |
char state_copy[len]; |
This file contains hidden or 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
// void print_hex(unsigned char num); | |
.data | |
buff: | |
.ascii "0x00\n" | |
.global print_hex | |
.text | |
print_hex: | |
mov %rdi,%rax |