Skip to content

Instantly share code, notes, and snippets.

View kawaii-ghost's full-sized avatar
😐
Lost in the internet

<I°_°I> kawaii-ghost

😐
Lost in the internet
View GitHub Profile
@kawaii-ghost
kawaii-ghost / WoA.cpp
Last active June 15, 2025 00:34
NtWaitForAlertByThreadId demonstration
#include <cstdio>
#include <Veil.h>
NTSTATUS NTAPI print(PVOID arg);
#define NTHREAD 8
struct _THREAD_ARG {
LONG volatile g_Counter;
HANDLE ThreadId;
@kawaii-ghost
kawaii-ghost / keyedevent0.cpp
Last active June 15, 2025 00:36
Keyed Event demonstration
#include <cstdio>
#include <Veil.h>
NTSTATUS NTAPI print(PVOID arg);
#define NTHREAD 8
struct _THREAD_ARG {
LONG volatile g_Counter;
HANDLE KeyedEvent;
#include <stdint.h>
#include <threads.h>
#include <stdatomics.h>
#include <linux/futex.h> /* Definition of FUTEX_* constants */
#include <sys/syscall.h> /* Definition of SYS_* constants */
#include <unistd.h>
#include <errno.h>
static int futex(uint32_t *uaddr, int futex_op, uint32_t val, const struct timespec *timeout, uint32_t *uaddr2, uint32_t val3)
{
#include <stdint.h>
#include <linux/futex.h>
#include <sys/syscall.h>
#include <stdio.h>
#include <threads.h>
#include <unistd.h>
#include <stdbool.h>
#include <time.h>
#include <stdatomic.h>
#include <stdbool.h>
@kawaii-ghost
kawaii-ghost / wait_wakeonaddress.c
Last active May 20, 2025 00:16
Implement WaitOnAddress API on Linux (rev 2)
static bool WaitOnAddress(volatile void *Address, void *CompareAddress, size_t AddressSize, uint32_t Milliseconds) {
struct timespec ts;
struct timespec *timeout = NULL;
if (Milliseconds != UINT_MAX) {
ts.tv_sec = Milliseconds / 1000;
ts.tv_nsec = (Milliseconds % 1000) * 1000000;
timeout = &ts;
}
#include <liburing.h>
#include <stdio.h>
#include <unistd.h>
#include <wchar.h>
int main(void)
{
struct io_uring ring;
io_uring_queue_init(1, &ring, 0);
@kawaii-ghost
kawaii-ghost / .prospector.yaml
Created April 3, 2023 00:24 — forked from CTimmerman/.prospector.yaml
Out Of Memory (OOM) Killer to save your SSD and other processes.
pylint:
disable:
- line-too-long
- multiple-imports
- pointless-string-statement
- too-many-nested-blocks
@kawaii-ghost
kawaii-ghost / hello_win32O0.asm
Last active July 6, 2023 00:39
Hello world using Win32 on x64 Assembly unoptimized
extern WriteFile
extern ExitProcess
section .rdata
szText db `Hello, world!\n\0`
cbLength equ $szText-1
section .text
global start
start:
sub rsp, 40 ;
#include <windows.h>
int main(void)
{
// I don't realize this lmao until i see KernelBase.dll
WriteFile(UlongToHandle(STD_OUTPUT_HANDLE), "Hello, world!\n", 14, NULL, NULL);
/*
* NtWriteFile(NtCurrentPeb()->ProcessParameter->StandardOutput,
* NULL,
* NULL,
#include <iostream>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <format>
int main() {
std::ios_base::sync_with_stdio(false);
std::cout << "Irrashai, inputnya dipisah spasi ya ~ " << std::endl;
std::cout << "Maksimum 255 bilangan bulat positif rentang 1 <= 255" << std::endl;