Skip to content

Instantly share code, notes, and snippets.

@gdbinit
gdbinit / gist:8282fe8c6b9bc7addb53470615e870ff
Created November 1, 2018 00:31
Xcode Command Line tools template with /usr/local folders in search paths
Copy folder Xcode.app/Contents/Developer/Library/Xcode/Templates/Project Templates/Mac/Application/Command Line Tool.xctemplate folder
to ~/Library/Developer/Xcode/Templates/Custom/
Modifity the plist to the following. Scroll down when choosing new project template and should be there in Custom area.
The trick is this:
<key>Project</key>
<dict>
<key>SharedSettings</key>
<dict>
This is a collection of NFO templates from various PSP Crack / Warez Groups
--- 4Fun
▄▀ ▄▄█▓▄ ____________________ __________ ▄▓█▄▄ ▀▄
▐█ ███▀██▓▄ / | \_ _____/ | \ \@TiLK ▄▓██▀███ █▌
▓██▀ ░▐█▓▓ / | || __) | | / | \ ▓▓█▌░ ▀██▓
▀█▓ ░▐█▓▌ / ^ / \ | | / | \ ▐▓█▌░ ▓█▀
▀▀ ▄██▓ \____ |\___ / |______/\____|__ / ▓██▄ ▀▀
▄██▓▀ ▄▀ |__| \/ \/ ▀▄ ▀▓██▄
/**
* Fuzzing arbitrary functions in ELF binaries, using LIEF and LibFuzzer
*
* Full article on https://blahcat.github.io/
* @_hugsy_
*
*/
#include <dlfcn.h>
#include <stdio.h>
#include <stdlib.h>
@gdbinit
gdbinit / gist:3c2022907af5ca476173985492d6ec6e
Created January 23, 2018 19:16
Retrieve IDA stack variables cross references from IDA C SDK
/* retrieve the current function information - we need this to extract the stack frame */
func_t *current_function = get_func(current_addr);
/* retrieve the stack frame for this function - IDA encapsulates it as struc_t */
struc_t *frame = get_frame(current_function);
/* now each variable is a member of the structure - Chris Eagle book shows how to iterate over this */
for (int i = 0; i < frame->memqty; i++)
{
/* so each variable is a member - we can retrieve its netnode id via the .id field - in case of structures/stack variables
* this is an address starting by 0xFF but it's still a netnode like everything else in IDA
*/
@LiveOverflow
LiveOverflow / fsec_solve.py
Created October 4, 2017 10:42
Fsec2017 z3 solution
from z3 import *
import struct
# calculate e,f,d for a given input password
def calc(m):
e = 0
f = 0
d = 0
for i in xrange(0, len(m)):
c = ord(m[i])
@staaldraad
staaldraad / oauthServer.go
Last active August 11, 2024 20:38
A mini OAuth server for Azure
package main
import (
"crypto/tls"
"fmt"
"io/ioutil"
"net/http"
"net/url"
"strings"
)
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <signal.h>
#include <pty.h>
#include <fcntl.h>
#include <time.h>
#include <sys/wait.h>
// gcc cook3.c -lutil -o cook3 -Wall
@amtal
amtal / rappel.py
Last active June 23, 2023 04:03
Rappel.py is a pretty janky assembly REPL. It works by using keystone for R, and GDB for EPL.
""" Assembly REPL in gdb / possible sketchy binary patcher.
Usage:
gdb -q ./target
-x rappel.py adds 'rappel' command
[-write] patches binary on disk, sometimes!
"""
import gdb, tempfile, keystone as ks
class Rappel(gdb.Command):
@gvanrossum
gvanrossum / expander.py
Last active October 7, 2023 23:15
Expand variadic type variables
LIMIT = 5
BOUND = 'object'
def prelude(limit: int, bound: str) -> None:
print('from typing import Callable, Iterable, Iterator, Tuple, TypeVar, overload')
print('Ts = TypeVar(\'Ts\', bound={bound})'.format(bound=bound))
print('R = TypeVar(\'R\')')
for i in range(LIMIT):
print('T{i} = TypeVar(\'T{i}\', bound={bound})'.format(i=i+1, bound=bound))
@hugsy
hugsy / armpwn-exploit.py
Last active March 24, 2021 06:08
ARMpwn challenge exploit
#!/usr/bin/env python2
#
# ARMpwn challenge exploit (kudos & thx to 5aelo)
#
# writeup: https://blahcat.github.io/2016/06/13/armpwn-challenge/
#
# @_hugsy_
#
from pwn import *