Skip to content

Instantly share code, notes, and snippets.

(function () {
var $ = document.querySelector.bind(document);
var original = document.body.innerHTML;
var outHTML = $('article.markdown-body').outerHTML;
document.body.innerHTML = outHTML;
window.print();
document.body.innerHTML = original;
})();
@storycraft
storycraft / sheriff_poc.c
Last active March 16, 2021 08:12
HDD Sheriff 9 bootrom.bin password patch generator
#include <stdio.h>
#include <string.h>
long long int setPassword(char *password, int pwdLength) {
if (pwdLength <= 0) return 0xFFFFFFFFLL;
unsigned int result = -1;
unsigned short encryptShifter;
unsigned short encryptedChar;
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef unsigned char BYTE;
struct CryptoStateStore {
int first;
int sec;
int last;
@storycraft
storycraft / vox.md
Last active March 16, 2021 10:04
KakaoTalk voip control protocol

KakaoTalk voip control protocol

Base: TLS 1.0

Packet structure

Endian: little

name offset size
random (i32) 0 4
zero padding (i16) 4 2
@storycraft
storycraft / uuid-to-nbt-uuid.js
Last active February 6, 2024 02:17
Convert uuid string to minecraft nbt uuid (int array)
function toNBTUUID(uuid) {
return `[I;${uuid.replace(/-/g, '').match(/.{8}/g).map(str => Number.parseInt(str, 16)).map(num => num & 0x80000000 ? num - 0xffffffff - 1 : num).join(',')}]`;
}
// toNBTUUID('0e9b65dd-3dce-4a3f-8a13-3299a91ceac7');
// -> [I;245065181,1036929599,-1978453351,-1457722681]
@storycraft
storycraft / dmca-takedown-kakao.txt
Last active March 7, 2023 05:28
DMCA Takedown Notice [ref:00DA0000000K0A8.5004w000026Fag0:ref]
DMCA Takedown Notice
== Copyright owner: Kakao Corp.
== Name: An Chisu
== Company: Kakao Corp.
== Job title: IP Manager
== Email address: trademark@kakaocorp.com
== Address: 7F N, H-Square, 235
== City: Pangyoyeok-ro, Bundang-gu, Seongnam-si
@storycraft
storycraft / find_main_window.c
Last active June 17, 2021 07:10
Find main window of given process id
#include <windows.h>
HWND FindMainWindow(DWORD pid) {
HANDLE threadSnap = INVALID_HANDLE_VALUE;
threadSnap = CreateToolhelp32Snapshot(TH32CS_SNAPTHREAD, pid);
if(threadSnap == INVALID_HANDLE_VALUE) return NULL;
THREADENTRY32 entry = { sizeof(THREADENTRY32) };
HWND win = NULL;
@storycraft
storycraft / iat_eat_hook.cc
Created June 21, 2021 07:09
IAT, EAT address finder function utils
#include <windows.h>
PDWORD getExportRvaAddr(HMODULE mod, LPCSTR funcName) {
UINT_PTR modAddr = (UINT_PTR)mod;
PIMAGE_DOS_HEADER dosHeader = (PIMAGE_DOS_HEADER) mod;
PIMAGE_NT_HEADERS header = (PIMAGE_NT_HEADERS) (modAddr + dosHeader->e_lfanew);
DWORD eatOffset = header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT].VirtualAddress;
PIMAGE_EXPORT_DIRECTORY exportDir = (PIMAGE_EXPORT_DIRECTORY) (modAddr + eatOffset);