Skip to content

Instantly share code, notes, and snippets.

@sekkr1
sekkr1 / android_gdb.md
Created August 12, 2019 15:27
Attaching GDB to Android apps' native libraries

How to GDB android native libraries

[1] Install NDK from android studio

[2] Push appropriate gdb-server to phone

adb push ~/android-sdk-linux/ndk-bundle/prebuilt/android-<arch>/gdbserver/gdbserver /data/local/tmp
adb shell "chmod 777 /data/local/tmp/gdbserver"
adb shell "ls -l /data/local/tmp/gdbserver"

[4] Forward ports

adb forward tcp:1337 tcp:1337

@GregLando113
GregLando113 / SteamAntiAntiDebug.h
Created October 22, 2017 02:21
Steam Anti Anti Debug - Load this into game at launch to be able to breakpoint and catch exceptions for 64-bit games using steam
#pragma once
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
// At least 12 bytes required for this jump
void* Detour64(void* source, void* destination, DWORD64 length) {
DWORD dwOld;
//mov rax,0xABABABABABABABAB
//jmp rax
@sorny
sorny / MinimalPdf.java
Last active March 27, 2024 12:46
Minimal PDF byte array in Java
/**
* A minimal hello world PDF
*
* Based on the handwritten minimal.pdf: https://brendanzagaeski.appspot.com/0004.html
*/
public class MinimalPdf {
public static final byte[] data = new byte[] { 37, 80, 68, 70, 45, 49, 46, 49, 10, 37, -62, -91, -62, -79, -61,
-85, 10, 10, 49, 32, 48, 32, 111, 98, 106, 10, 32, 32, 60, 60, 32, 47, 84, 121, 112, 101, 32, 47, 67, 97, 116,
97, 108, 111, 103, 10, 32, 32, 32, 32, 32, 47, 80, 97, 103, 101, 115, 32, 50, 32, 48, 32, 82, 10, 32, 32, 62,
// An example of how to bind a C++ class in four scripting languages: lua, squirrel, mruby, and angelscript.
// Written by James S Urquhart ( http://www.cuppadev.co.uk/ ). Feel free to experiment!
#include <stdarg.h>
#include <stdio.h>
#include <assert.h>
// Lua includes
extern "C"
{
anonymous
anonymous / gist:5432586
Created April 22, 2013 05:21
tic tac toe
##This tic tac toe game was written by Ted Maldonado
import random
#Game board
board=[0,1,2,
3,4,5,
6,7,8]
def show():