Skip to content

Instantly share code, notes, and snippets.

// ==UserScript==
// @name bionify
// @namespace http://tampermonkey.net/
// @version 0.1
// @description yet another bionifier
// @author dkw72n
// @match *://*/*
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant none
// @license MIT
/* --------------------------------- ABOUT -------------------------------------
Original Author: Adam Yaxley
Website: https://github.com/adamyaxley
License: See end of file
Obfuscate
Guaranteed compile-time string literal obfuscation library for C++14
Usage:
@dkw72n
dkw72n / lua53-md5-golf.lua
Last active March 29, 2022 07:51
codegolf of md5 in lua5.3
local md5=function(E) local z,A,B,C,D,p=0xffffffff,0x67452301,0xefcdab89,0x98badcfe,0x10325476,string local uk,R,Q,q,v,P=p.unpack,function(a,b,c,d,x,s,ac) a=a+((b&c)|((~b)&d))+x+ac a=(((a&z)<<s)|((a&z)>>32-s))+b return a&z end,function(a,b,c,d,x,s,ac) a=a+((b&d)|(c&(~d)))+x+ac a=(((a&z)<<s)|((a&z)>>32-s))+b return a&z end,function(a,b,c,d,x,s,ac) a=a+(b~c~d)+x+ac a=(((a&z)<<s)|((a&z)>>32-s))+b return a&z end,function(a,b,c,d,x,s,ac) a=a+(c~(b|(~d)))+x+ac a=(((a&z)<<s)|((a&z)>>32-s))+b return a&z end,function(s) local N=s:len() local Z=N*8 % 512 local fS=(448-Z)//8 if Z>448 then fS=(960-Z)//8 end local K={} local bI=1 for i=1,N do local X=(i-1)//4+1 K[X]=K[X] or 0 K[X]=K[X]|(s:byte(i)<<(bI-1)*8) bI=bI+1 if bI==5 then bI=1 end end local Y=false local U=#K if bI~=1 then K[U]=K[U]|0x80<<(bI-1)*8 Y=true end for i=1,fS//4 do if not Y and i==1 then K[U+i]=0x80 else K[U+i]=0x0 end end local O=N*8 U=#K K[U+1]=O&z K[U+2]=O>>32 return K end return(function(s) local w=P(s) local V={A,B,C,D} local x=function(f,g) return t
@dkw72n
dkw72n / mtrace.c
Created August 11, 2020 16:55
heap allocation trace with LD_PRELOAD
/*
Copyright (c) 2020 dkw72n
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
furnished to do so, subject to the following conditions:
// analyzer.cpp : This file contains the 'main' function. Program execution begins and ends there.
// compile:
// https://stackoverflow.com/questions/35116327/when-g-static-link-pthread-cause-segmentation-fault-why
// g++ analyzer.cpp --std=c++17 -lstdc++fs -O3 -o analyzer -g -static -lrt -pthread -Wl,--whole-archive -lpthread -Wl,--no-whole-archive
//
#include "httplib.h"
#include <assert.h>
#include <iostream>
#include <fstream>
@dkw72n
dkw72n / cross-compile-openssl-windows.sh
Last active January 16, 2020 03:20 — forked from artynet/cross-compile-openssl-windows.sh
Cross compile OpenSSL for mingw32-w64
#!/bin/bash
set -e
set -x
WORKSPACE=/home/arturo/Programmi/win32-cross
sed -i 's/:.dll.a/ -Wl,--export-all -shared:.dll.a/g' Configure
sed -i 's,.*target already defined.*,$target=$_;,g' Configure
#./Configure mingw shared --cross-compile-prefix=i686-w64-mingw32- --prefix=${WORKSPACE}
@dkw72n
dkw72n / DoNotReboot.py
Created July 11, 2019 14:33
stop windows from performing automatic restarts after installing updates by constantly setting the active hours
import ctypes
import ctypes.wintypes
import locale
import sys
import threading
import uuid
import os
RegisterWindowMessage = ctypes.windll.user32.RegisterWindowMessageA
LoadCursor = ctypes.windll.user32.LoadCursorA
@dkw72n
dkw72n / pywinj.py
Created April 3, 2019 08:02
[windows] inject dll at process start
"""
MIT License
Copyright (c) 2019 dkw72n.
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
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
@dkw72n
dkw72n / subprocess_reaver.py
Created April 3, 2019 04:15
[windows] ensure all child processes killed when main process exit
"""
MIT License
Copyright (c) 2019 dkw72n.
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
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
@dkw72n
dkw72n / win_process_tree.py
Last active January 8, 2019 09:02
Get/Kill all child process in python 3 on windows
"""
MIT License
Copyright (c) 2019 dkw72n.
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