Skip to content

Instantly share code, notes, and snippets.

import sys
import struct
import binascii
from collections import Counter
def u16(b):
return struct.unpack('<H', b)[0]
def p16(x):
return struct.pack('<H', x)
def p32(x):
@joepie91
joepie91 / foundation-engine-package-format.txt
Last active October 7, 2022 23:37
Format of the engine.package / game.package file for Foundation
FORMAT DOCUMENTATION
====================
All numeric values are in little-endian.
Overall division:
[file header] [index] [data section]
12 bytes variable length variable length
File header:
@TheCompez
TheCompez / data.json
Last active September 1, 2023 17:33
How to parse JSON inside C++ and QML
{
"model": [
{
"id": 1,
"name": "Kambiz",
"family": "Asadzadeh"
},
{
"id": 2,
"name": "Hamed",
@liclac
liclac / hewwo.pl
Last active October 1, 2023 11:48
Hewwo? (Based on leafysweetsgarden's OWO extension)
#!/usr/bin/env -S perl -p
tr/rlRL/wwWW/; s/([nN])([aeiou])/\1y\2/g; s/(N)([AEIOU])/\1Y\2/g; s/ove/uv/g;
s/\!+/" ".("(・`ω´・)",";;w;;","owo","UwU",">w<","^w^")[rand(6)]." "/eg;
@kaychaks
kaychaks / configuration.nix
Last active March 10, 2022 16:00
matrix-jitsi-nixos
# accompanying blog - https://kaushikc.org/posts/matrix-jitsi-nixos.html
# /etc/nixos/configuration.nix
imports =
let
nur-no-pkgs =
import (
builtins.fetchTarball
"https://github.com/nix-community/NUR/archive/master.tar.gz"
@FeodorFitsner
FeodorFitsner / vcvars-powershell.ps1
Created March 29, 2018 16:15
Calling vcvars from PowerShell
if ($env:APPVEYOR_BUILD_WORKER_IMAGE -eq "Visual Studio 2015") {
cmd.exe /c "call `"C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd`" /x64 && call `"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat`" x86_amd64 && set > %temp%\vcvars.txt"
} else {
cmd.exe /c "call `"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat`" && set > %temp%\vcvars.txt"
}
Get-Content "$env:temp\vcvars.txt" | Foreach-Object {
if ($_ -match "^(.*?)=(.*)$") {
Set-Content "env:\$($matches[1])" $matches[2]
}
@Neo23x0
Neo23x0 / nmap-cmdline
Last active March 19, 2020 17:10
Nmap Scan Params for CVE-2017-0143 MS17-010 Scanning
# Scan for CVE-2017-0143 MS17-010
# The vulnerability used by WannaCry Ransomware
#
# 1. Use @calderpwn's script
# http://seclists.org/nmap-dev/2017/q2/79
#
# 2. Save it to Nmap NSE script directory
# Linux - /usr/share/nmap/scripts/ or /usr/local/share/nmap/scripts/
# OSX - /opt/local/share/nmap/scripts/
#
#include <Windows.h>
#include "../../API/RainmeterAPI.h"
struct ACCENTPOLICY {
int nAccentState;
int nFlags;
int nColor;
int nAnimationId;
};
struct WINCOMPATTRDATA {
@rverton
rverton / cowroot.c
Created October 21, 2016 14:06
CVE-2016-5195 (DirtyCow) Local Root PoC
/*
* (un)comment correct payload first (x86 or x64)!
*
* $ gcc cowroot.c -o cowroot -pthread
* $ ./cowroot
* DirtyCow root privilege escalation
* Backing up /usr/bin/passwd.. to /tmp/bak
* Size of binary: 57048
* Racing, this may take a while..
* /usr/bin/passwd overwritten
@shicky
shicky / ld_preload_hook.c
Last active June 27, 2024 12:25
LD_PRELOAD linux function hook example
# helloworld.c
# gcc helloworld.c -o helloworld
#include <stdio.h>
#include <unistd.h>
int main() {
puts("Hello world!\n");
return 0;
}