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> | |
typedef unsigned __int128 uint128; | |
/* printing 128-bit value isn't official support yet | |
so here's implementation of converting 128-bit value into string */ | |
char *str_uint128(uint128 n) | |
{ | |
/* got confused about arithmetic operation with '0'? read more about ascii :) */ | |
static char buf[1000] = {0}, *buft = buf; |
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
/* | |
DISABLE ASLR & NX THROUGH COMPILATION: | |
$ echo 0 | sudo tee /proc/sys/kernel/randomize_va_space # disable ASLR | |
$ gcc -fno-stack-protector -z execstack -o format_string format_string.c -g # compile with NX (DEP protection) disabled | |
############# | |
# CODE POC | |
############# |
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> | |
// function prototype | |
LRESULT CALLBACK wndProcedure(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); | |
// constant | |
LPCTSTR NAME = "My Window"; | |
/** | |
* |
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 <iostream> | |
#include <vector> | |
#include <algorithm> | |
using namespace std; | |
class heap { | |
private: |
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
''' | |
Using Z3 to check if the number is prime | |
Original reference: https://stackoverflow.com/a/35653749/1768052 | |
''' | |
from z3 import * | |
def isPrime(x): | |
y, z = Ints("y z") |
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
#======================================================================== | |
# Conky-Serdar | |
#---------------------------------------------------------------------- | |
#sudo apt-get install conky | |
#extract the zip file and move files to .conky in your home folder | |
#---------------------------------------------------------------------- | |
#Run(Terminal): | |
# conky -c ~/.conky/conkyrc | |
#---------------------------------------------------------------------- | |
#Autostart(Openbox): |
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 <iostream> | |
using namespace std; | |
int SIZE_STRUCT; | |
int choose_process(struct process Process[], int running[], int size_running); | |
int get_total_burst_time(struct process Process[]); | |
int check_if_exist(int running[], int size_running, int check); | |
void add_running_process(struct process Process[], int running[], int &size_running, int i); |
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
import sys | |
import itertools | |
from z3 import * | |
# | |
# Original puzzle | |
# | |
''' | |
Five friends have their gardens next to one another, where they grow three kinds of crops: |
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
import struct | |
buf = b'A' * 132 | |
# | |
# virtualProtect() for rwx (msvcr71.dll – v7.10.3052.4) | |
# url: https://www.corelan.be/index.php/security/corelan-ropdb/#msvcr71dll_v71030524 | |
# | |
rop_gadgets = [ |
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 z3 import * | |
import struct | |
a = [BitVec("a{}".format(i), 8) for i in range(5)] | |
s = Solver() | |
def is_valid(x): | |
return Or( | |
And(x >= ord('1'), x <= ord('9')), | |
And(x >= ord('a'), x <= ord('z')), |