Skip to content

Instantly share code, notes, and snippets.

@shepgoba
shepgoba / decomp.py
Created April 10, 2024 07:24
Batch script to decompile an extracted dyld_shared_cache with IDA Pro
import os
from multiprocessing.pool import ThreadPool
IDA_DIR_PATH = "C:/Users/user/Desktop/ida77"
FILES_PATH = "C:/Users/user/Desktop/dsc_extract_16.6.1"
class Context:
def __init__(self, command, dir):
self.command = command
self.dir = dir
@shepgoba
shepgoba / main.c
Last active September 28, 2022 05:16
Using heap memory as the stack in C (little experiment on amd64 in C)
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
__attribute__((noinline))
void _main() {
int troll;
printf("sussy, %p\n", &troll);
}
@shepgoba
shepgoba / main.c
Created June 18, 2022 04:15
Small implementation of cat on linux (with minimal assembly)
#define stdin 0
#define stdout 1
#define stderr 2
#define O_READ 0
#define BUF_SIZE 2097152
typedef unsigned char u8;
typedef unsigned short u16;
@shepgoba
shepgoba / election_bot.py
Created November 5, 2020 05:50
Election Bot for US 2020 election (late af)
import os
import discord
import requests
import asyncio
from datetime import datetime
# bot token
TOKEN = "<your token>"
# desired post channel id
@shepgoba
shepgoba / main.s
Created October 23, 2020 04:04
Substrate tweak in arm64 assembly
.extern _objc_getClass
.extern _sel_registerName
.extern _MSHookMessageEx
.section __TEXT,__text,regular,pure_instructions
.align 16
_init:
stp x29, x30, [sp, #-16]!
@shepgoba
shepgoba / yeet.c
Last active July 13, 2023 14:06
actual battery health algorithm as of ios 13.3
//requires: com.apple.private.iokit.batterydata entitlement
extern "C"
CFArrayRef IOPSCopyPowerSourcesByType(int type);
int healthPercent;
NSArray *sources = (__bridge NSArray *)IOPSCopyPowerSourcesByType(1);
NSDictionary *batteryDict = sources[0];
if (sources && sources.count && batteryDict[@"Maximum Capacity Percent"]) {
@shepgoba
shepgoba / chip8_disasm.c
Created June 6, 2020 06:36
A Simple CHIP-8 Disassembler
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
char *get_instruction_string(uint16_t opcode) {
char *result = malloc(sizeof(char) * 32);
uint8_t add_newline = 0;
@shepgoba
shepgoba / SBIconListView.m
Last active May 12, 2020 00:53
Incomplete SBIconListView reversal. iOS 13.3
#import "SBIconListView.h"
typedef struct SBIconListPredictedVisibleColumn {
unsigned long long column;
double confidence;
} SBIconListPredictedVisibleColumn;
typedef struct SBIconCoordinate {
NSInteger row;
NSInteger col;
} SBIconCoordinate;