Skip to content

Instantly share code, notes, and snippets.

View DavideGalilei's full-sized avatar
🐝

Davide Galilei DavideGalilei

🐝
View GitHub Profile
@rexim
rexim / main.rs
Last active October 31, 2024 20:32
The Most Memory Safe Buffer Overflow in Rust!
// The Most Memory Safe Buffer Overflow in Rust!
//
// Consider all the code below under Public Domain
//
// How to build:
// $ rustc main.rs
//
// Wrong password:
// $ printf "hello\n" | ./main
//
@moyix
moyix / killbutmakeitlooklikeanaccident.sh
Created February 5, 2022 22:51
Script to inject an exit(0) syscall into a running process. NB: only x86_64 for now!
#!/bin/bash
gdb -p "$1" -batch -ex 'set {short}$rip = 0x050f' -ex 'set $rax=231' -ex 'set $rdi=0' -ex 'cont'
// Bad example
interface IRemoteData<T> {
result?: T
error?: string
isLoading: boolean
isLoaded: boolean
}
// Same on OOP
# Useful pam_exec program to do quick local sudo-auth.
# eg. add the following to /etc/pam.d/system-auth:
# auth sufficient pam_exec.so quiet stdout /usr/local/sbin/extra_sudo_auth
# Intention:
# Exit with 0 if right control & shift are held down simultaneously
# Fail immediately if left control or left shift are pressed
# Fail after a timeout
import asyncfile
@p4bl0-
p4bl0- / 00_readme.md
Last active December 1, 2025 16:13
A complete compiler for a simple language (in less than 150 LoC)

This project is a tiny compiler for a very simple language consisting of boolean expression.

The language has two constants: 1 for true and 0 for false, and 4 logic gates: ! (not), & (and), | (or), and ^ (xor).

It can also use parentheses to manage priorities.

Here is its grammar in BNF format:

expr ::= "0" | "1"

@painor
painor / README.MD
Last active October 23, 2025 19:54
Convert TDesktop tdata folders to GramJS sessions.

tdata converter

Converts tdata folder to a GramJS session for usage in a userbot.

Usage

Usage is simple. the main() function accepts a folder path (absolute or relative) and will return and print the session string if it found one.

Limitation

@rexim
rexim / 0001-Make-it-possible-to-include-files-over-https.patch
Last active September 22, 2024 12:24
TCC patch that enables including files via HTTPS using CURL
From 84c42091cbae3735c52e895221f3f95a87155756 Mon Sep 17 00:00:00 2001
From: rexim <[email protected]>
Date: Wed, 30 Jun 2021 20:43:47 +0700
Subject: [PATCH] Make it possible to include files over https
---
Makefile | 2 +-
tcc.c | 5 +++++
tccpp.c | 43 +++++++++++++++++++++++++++++++++++++++++++
3 files changed, 49 insertions(+), 1 deletion(-)
@Wirtos
Wirtos / libtguy_python.py
Last active January 19, 2022 19:49
short example on how you can use libtguy from python while retaining the "pythonic" style
import sys
from ctypes import c_void_p, c_char_p, c_size_t, c_uint, POINTER, CDLL, create_string_buffer, Structure
from typing import Sequence, Union
# ###########TYPES#####################################################
class TGStrView(Structure):
_fields_ = [('str', c_char_p), ('len', c_size_t)]
def __repr__(self):
@FreddieOliveira
FreddieOliveira / docker.md
Last active December 20, 2025 05:10
This tutorial shows how to run docker natively on Android, without VMs and chroot.

Docker on Android 🐋📱

Edit 🎉

All packages, except for Tini have been added to termux-root. To install them, simply pkg install root-repo && pkg install docker. This will install the whole docker suite, left only Tini to be compiled manually.


Summary

@CustomIcon
CustomIcon / recover.py
Last active May 16, 2025 02:47
Recover your Voip or Test number after you loose it (if you have session string). Pyrogram and Telethon Only!
# for those who uses heroku or AUTH key they can recover their account back after loosing test number or Voip. (specially for iraninan friends)
#
# DISCLAIMER: IF YOU USE THIS SNIPPET AGAINST TELEGRAM TOS YOU WILL BE BANNED FROM USING MY SERVICES
#
# STEPS:
# 0. fill in your api_id and api_hash variables
# 1. try to make telegram send you the login code from your official client
# 2. run the script in machine (requires pyrogram==1.0.7 and telethon==1.17.5)
from telethon import sync, sessions