Skip to content

Instantly share code, notes, and snippets.

@maxdeliso
maxdeliso / libc test
Created November 8, 2011 04:14
a test to see whether the functionality in libc is available and whether it works
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <setjmp.h>
#define BYTE (1)
#define KILOBYTE (1024*(BYTE))
#define MEGABYTE (1024*(KILOBYTE))
#define GIGABYTE (1024*(MEGABYTE))
@maxdeliso
maxdeliso / hydra.c
Created November 28, 2011 22:46
Hydra - spawns a very annoying set of processes that can't be defeated without specialized tools
/*
* Max DeLiso <maxdeliso@gmail.com>
* Hydra.c
*/
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>
@maxdeliso
maxdeliso / atkin.c
Last active September 29, 2015 22:48
Sieve of Atkin
/*
* Max DeLiso <maxdeliso@gmail.com>
*
* Purpose: compute prime numbers using a Sieve of Atkin
*
* Runtime efficiency: O(N/log log N)
*
* Memory efficiency: N/8 bytes
*
* Input: Limiting value n, [1,n-1] will be computed and outputted.
@maxdeliso
maxdeliso / AUTHOR
Created February 7, 2012 18:11
Some 64 bit linux assembly for detecting and using specialized AES instructions.
Max DeLiso <maxdeliso@gmail.com>
@maxdeliso
maxdeliso / crttest.c
Created February 7, 2012 21:00
An examination of the CRT in windows.
#include <Windows.h>
#define BUFFER_SIZE 4096
DWORD write( HANDLE out, const char* buf );
DWORD read( HANDLE in, char* buf, int bufSize );
int CALLBACK WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow )
{
DWORD dwThreadID;
@maxdeliso
maxdeliso / .gitignore
Created February 21, 2012 04:55
environ_flood.c
*~ *.swp eflood
@maxdeliso
maxdeliso / epolltest.c
Created May 19, 2012 03:01
epolltest.c
/*
* author: Max DeLiso <maxdeliso@gmail.com>
* file: epolltest.c
* description: some experiments with polling
* stdin and signalfd on linux
*/
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
@maxdeliso
maxdeliso / probeFs.c
Created September 6, 2012 22:08
search filesystem for writable files
#define _CRT_SECURE_NO_WARNINGS
#include <Windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
void* fallibleMalloc(int n);
@maxdeliso
maxdeliso / makefile.mvc
Created October 12, 2012 21:43
win32 console mode hello, world in assembly
probe: probe.o makefile.mvc
link /nologo /entry:probe /out:probe.exe /subsystem:console kernel32.lib probe.obj /verbose:lib
probe.o: probe.asm makefile.mvc
nasm -fwin32 -o probe.obj probe.asm
clean:
erase /f /q probe.obj probe.exe