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
#pragma once | |
#include <functional> | |
#include <vector> | |
template<class... arguments__> | |
class Event | |
{ | |
protected: | |
std::vector<std::function<bool(arguments__...)>> callables; |
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 <malloc.h> | |
#include <tchar.h> | |
#include <string> | |
#include <cstring> | |
#include <memory.h> | |
#include <cstdlib> | |
inline LPWSTR char2wchar(const char *str) | |
{ |
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> | |
#if 0 | |
void __attribute__((naked)) stackcorrupt(void) | |
{ | |
// Push EAX to the stack (some random value in eax) | |
__asm__ __volatile__("pushl %eax"); | |
// return, corrupted stack returns to garbage and program crashes. | |
__asm__ __volatile__("ret"); |
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
; Compile with nasm -f elf64 test.asm | |
BITS 64 | |
SECTION .text | |
global _start | |
_start: | |
sub rsp, 8 ; Align the stack pointer for a function call | |
mov rax, 0x14 ; Move syscall number 14 to rax (sys_getpid) | |
int 0x80 ; Call system call | |
push rax ; push rax to the stack | |
mov rbx, rax ; move rax to rbx |
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
unsigned long int LinuxWrite(unsigned fd, const char *str, unsigned long len) | |
{ | |
unsigned long ret = -1; | |
__asm__ __volatile__("int $0x80" : "=a" (ret) : "a" (4), "b" (fd), "c" (str), "d" (len)); | |
return ret; | |
} | |
void LinuxExit(int code) | |
{ | |
__asm__ __volatile__ ("int $0x80" :: "a" (1), "b" (code)); |
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
CC=clang | |
CFLAGS=-Wall | |
LDFLAGS=-lfl | |
all: | |
bison -d calculator.y | |
flex calculator.l | |
$(CC) $(CFLAGS) -c scanner.c -o scanner.o |
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
from twisted.internet.protocol import Protocol, Factory | |
from twisted.internet import reactor, protocol | |
from twisted.protocols.basic import LineReceiver | |
from twisted.python import log | |
import sys, time | |
class Channel(): | |
def __init__(self, name, ctime, modes): | |
self.name = name |
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 file is public domain although credit would be nice :) */ | |
#include <unistd.h> | |
#include <cstdio> | |
#include <iostream> | |
#include <cstdlib> | |
#include <string> | |
#include <dlfcn.h> | |
#include <cassert> |
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
void HandleEvents(HWND hwnd, UINT message, WPARAM wParam, LPARAM lparam) | |
{ | |
switch (LOWORD(wParam)) | |
{ | |
case 1: // "Scan" button | |
{ | |
//MessageBox(NULL, L"Scan button", L"You clicked scan", MB_OK); | |
// Disable the window, get the text from it, then start the scan threads. | |
HWND txtbox = GetDlgItem(hwnd, 8); | |
Edit_Enable(txtbox, FALSE); |
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 <cstdio> | |
#include <iostream> | |
#include <string> | |
#include <cstring> | |
#include <unistd.h> | |
#include <cstdlib> | |
#include <vector> | |
#include <chrono> | |
bool AquaConstTimeCMP(const std::string &str1, const std::string &str2) |
OlderNewer