This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This PoC has been tested and worked on under Windows Server 2012 R2. | |
// I was in a hurry and did not want to bother with bypassing the modern security mechanisms provided on NT 10. | |
// Hence it was tested under Server 2012 R2 which is what I had at the moment. | |
// Feel free to play around with this and maybe get it working on NT 10 as well. | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <windows.h> | |
// ifndefs since TCC doesn't provide these definitions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <windows.h> | |
#include <winternl.h> | |
#pragma comment(lib, "ntdll.lib") | |
typedef struct SYSTEM_MODULE { | |
ULONG Reserved1; | |
ULONG Reserved2; | |
#ifdef _WIN64 | |
ULONG Reserved3; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <Windows.h> | |
VOID CALLBACK WinEventProcHook(HWINEVENTHOOK hWinEventHook, DWORD event, HWND hwnd, | |
LONG idObject, LONG idChild, DWORD idEventThread, DWORD dwmsEventTime) { | |
DWORD ProcessId = 0; | |
if (GetWindowThreadProcessId(hwnd, &ProcessId) != 0) { | |
HANDLE ProcessHandle = OpenProcess(PROCESS_QUERY_LIMITED_INFORMATION, FALSE, ProcessId); | |
if (ProcessHandle != (HANDLE)(-1)) { | |
char buffer[MAX_PATH] = {0}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
section .text | |
extern _Start | |
_Start: | |
mov rax, [gs:0x60] ; rax = Peb | |
mov rax, [rax + 0x18] ; rax = Peb->Ldr | |
mov rsi, [rax + 0x20] ; rsi = Peb->Ldr->InMemoryOrderModuleList | |
; The first module is the executable itself |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define WIN32_LEAN_AND_MEAN | |
#include <windows.h> | |
#include <stdio.h> | |
#include "native.h" | |
#include "random.h" | |
typedef struct _MATRIX { | |
double **matrix; | |
ULONG rows; | |
ULONG columns; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This was put in a hurry will be bad but the key idea is | |
# - we calculate the slope between every 2 point and take the median out of all those slopes | |
# - now using the median slope we calculate the value of the b intercept and take the median out of all those b intercepts | |
# the line formed is y = median_slope * x + median_intercept | |
# This is probably not the best way. I am open for suggestions. | |
import matplotlib.pyplot as plt | |
import random | |
random_slope = random.randint(1, 10) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdint.h> | |
#include <stdlib.h> | |
#include <stddef.h> | |
#include <string.h> | |
#include <stdbool.h> | |
#include <time.h> | |
#define random_between(min, max) (rand() % (max - min) + min) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <windows.h> | |
RECT gUsableAreaCoords = {0}; | |
RECT gCurrentPos = {0}; | |
INT gVelocityX = 5; | |
INT gVelocityY = 5; | |
DWORD gLast = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <SDL2/SDL.h> | |
#include <stdint.h> | |
#include <stddef.h> | |
#define STB_IMAGE_IMPLEMENTATION | |
#include "stb_image.h" | |
#define STB_IMAGE_RESIZE_IMPLEMENTATION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdint.h> | |
#include <stddef.h> | |
#include <stdlib.h> | |
#include <stdbool.h> | |
#include <time.h> | |
/* | |
uint8_t sudoku_input_board[81] = { | |
0, 0, 8, 0, 6, 1, 0, 0, 0, | |
6, 0, 4, 0, 0, 7, 5, 0, 0, |
NewerOlder