Skip to content

Instantly share code, notes, and snippets.

View storycraft's full-sized avatar
:octocat:

스도리 storycraft

:octocat:
View GitHub Profile
@storycraft
storycraft / rust-gui.md
Last active March 25, 2025 06:28
A high performance, ergonomic reactivity system with async and `Forget` trait

Rust language is the only compiled language without gc with guaranteed memory safety. Using new Forget(must drop) marker trait, I propose safe, performant, ergonomic event and fine grained reactivity system that solves these problems. Which only work in rust due to rust's unique properties.

Unforgettable types (or must drop types)

Forget or Leak trait is a marker trait for types cannot be forgotten (must run destructor). Rust doesn't have these traits now, but proposed as a solution for scoped task trilemma.

There is a good Forget marker trait RFC. Please read this before proceed.

@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);
@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 / 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: [email protected]
== Address: 7F N, H-Square, 235
== City: Pangyoyeok-ro, Bundang-gu, Seongnam-si
@storycraft
storycraft / uuid-to-nbt-uuid.js
Last active November 6, 2024 17:09
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 / 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
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef unsigned char BYTE;
struct CryptoStateStore {
int first;
int sec;
int last;
@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;
(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;
})();