Skip to content

Instantly share code, notes, and snippets.

View Theldus's full-sized avatar
🙃

Davidson Francis Theldus

🙃
View GitHub Profile
@Theldus
Theldus / RecOTool.py
Created November 15, 2021 02:22
Recursively finds dependencies in Mach-O binaries, output a tree-like structure or a graph file via Graphviz
# RecOTool.py -- Recursively finds dependencies in Mach-O binaries
#
# This is free and unencumbered software released into the public domain.
#
# Run with Python2... I don't know why do not works with 3....
#
# Usage
# python RecOTool.py /usr/bin/something -o deps.png (if Graphviz installed)
# python RecOTool.py /usr/bin/something -v (output only text, verbose mode
# enabled)
@Theldus
Theldus / index_files.sh
Last active August 14, 2021 05:18
Simple perceptual hash (dHash) implementation in C (with stb_image)
#!/usr/bin/env sh
#
# Usage:
# ./index_files.sh files*
# ./index_files.sh < files.txt
# cat files.txt | ./index_files.sh..... (you get it)
#
percep "$@" | tee index_files.txt
cut -d' ' -f1 < index_files.txt > hash_files.txt
@Theldus
Theldus / mingw-w64-x86_64.cmake
Created July 8, 2021 02:08 — forked from peterspackman/mingw-w64-x86_64.cmake
cmake toolchain file for mingw-w64 x86_64 builds on Ubuntu
# Sample toolchain file for building for Windows from an Ubuntu Linux system.
#
# Typical usage:
# *) install cross compiler: `sudo apt-get install mingw-w64`
# *) cd build
# *) cmake -DCMAKE_TOOLCHAIN_FILE=~/mingw-w64-x86_64.cmake ..
set(CMAKE_SYSTEM_NAME Windows)
set(TOOLCHAIN_PREFIX x86_64-w64-mingw32)
@Theldus
Theldus / median.c
Last active May 18, 2021 16:31
Tiny (yet fast) median stacking/blending filter, with minimal dependency (stb_image and/or libjpeg only!)
/*
* MIT License
*
* Copyright (c) 2021 Davidson Francis <davidsondfgl@gmail.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@Theldus
Theldus / nim.S
Last active January 8, 2021 01:12
Bootable, real mode, NIM game (also works on DOS)
#
# MIT License
#
# Copyright (c) 2021 Davidson Francis <davidsondfgl@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
@Theldus
Theldus / disksize.c
Created December 2, 2020 05:52
'fdisk-like' tool tha lists all the 4 partitions in the MBR scheme for a given file/device
/*
* Public domain, do whatever you want with this.
*
* Build: gcc disksize.c -o disksize -std=c99 -pedantic -Wall -Wextra
* Usage: ./disksize /dev/sdX
*/
#include <stdio.h>
#include <inttypes.h>
#include <assert.h>
@Theldus
Theldus / vlc_recent_files.patch
Created October 20, 2020 17:38
Increase maximum recent files on VLC
# Increase maximum recent files on VLC, by Theldus
#
# First of all, this is not an official patch!, apply at your
# own risk, nonetheless, it should be safe =).
#
# Second of all, it's so much easy to increase this limit, why on earth VLC
# uses a hardcoded number? 10 at the moment. VLC already saves more than 10
# items on the ~/.config/vlc/vlc-qt-interface.conf, so why not makes use of
# such thing? I really dont know. Anyway, apply this and be happy.
#
@Theldus
Theldus / bytecode.patch
Last active May 7, 2020 22:59
Makes javap more objdump-like =), enjoy
# Victorique de Blois byte patch v3.0 =), by Theldus
#
# This patch edits the javap source code so that when using the '-c' option, in
# addition to the instruction, the bytes related to it are also emmited, something
# similar to what objdump does. An example of output follows below:
#
# Compiled from "hello.java" (Victorique de Blois, byte dump patch v3.0 by Theldus)
# public class hello {
# public hello();
# Code:
@Theldus
Theldus / libs.s
Created April 23, 2020 02:38
Dynamic library from scratch =)
; ------------------------------
; nasm -f bin -o libs.so libs.S
; ------------------------------
BITS 64
org 0
ADDR equ 0x200000
; Elf header constants
ET_DIN equ 3

Keybase proof

I hereby claim:

  • I am theldus on github.
  • I am davidsondfgl (https://keybase.io/davidsondfgl) on keybase.
  • I have a public key ASBT90W6Aw9bYqrJ1f-30Pa5TNBW6O3EpcpOCw9CbnKTZwo

To claim this, I am signing this object: