Skip to content

Instantly share code, notes, and snippets.

adaskar / main.cpp
Created Aug 9, 2019
View main.cpp
#include <Windows.h>
#include <Psapi.h>
HANDLE OpenProcessInject(const wchar_t *procname)
DWORD need;
DWORD pids[2048] = { 0 };
if (!EnumProcesses(pids, sizeof(pids), &need))
return NULL;
View dll.cpp
#include <windows.h>
#include "include/detours.h"
#pragma comment(lib, "detours.lib")
#define KEYWORD L"APIHook"
MS_ ile baslayan fonksiyonlar,
Microsoft'un kendi API cagrilarina gosterici
View dll.high.cpp
#define KEYWORD L"APIHook"
static BOOL WINAPI MY_DeleteFileW(_In_ LPCWSTR lpFileName)
// Dosya isminde KEYWORD(L"APIHook") var mi?
// Var ise, LastError'u ERROR_ACCESS_DENIED yap ve hata don.
if (wcsstr(lpFileName, KEYWORD)) {
return FALSE;
View lkm.c
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
#define DEVICENAME "LKMDevice"
#define bail_assert(s, label, fmt, ...) \
do { \
if (!(s)) { \
printk(KERN_ALERT DEVICENAME " " fmt "\n", ##__VA_ARGS__); \
View Makefile
obj-m += lkm.o
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
View makeout.txt
make -C /lib/modules/5.3.0-29-generic/build M=/home/guru/Desktop/lkm modules
make[1]: Entering directory '/usr/src/linux-headers-5.3.0-29-generic'
test -e include/generated/autoconf.h -a -e include/config/auto.conf || ( \
echo >&2; \
echo >&2 " ERROR: Kernel configuration is invalid."; \
echo >&2 " include/generated/autoconf.h or include/config/auto.conf are missing.";\
echo >&2 " Run 'make oldconfig && make prepare' on kernel src to fix it."; \
echo >&2 ; \
make -f ./scripts/ obj=/home/guru/Desktop/lkm need-modorder=1
View makeout.txt.gcc
View c_cpp_properties.json
"configurations": [
"name": "Linux",
"includePath": [
View main.swift
// main.swift
// AggregateAudioVolumeControl
// Created by Gurhan Polat on 20.12.2020.
import Foundation
import Cocoa
import AVFoundation