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 <unistd.h> | |
#include <string.h> | |
#include <fcntl.h> | |
#include <time.h> | |
#include <sys/stat.h> | |
#include <sys/time.h> |
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 <stdint.h> | |
#include <time.h> | |
#include <openssl/hmac.h> | |
int powi[] = { 1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000 }; | |
// RFC 4226 HTOP: An HMAC-Based One-Time Password Algorithm | |
uint32_t |
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
/* Copyright (c) 2001-2003 Allan Saddi <[email protected]> | |
* Copyright (c) 2023 Rob Casey <[email protected]> | |
* All rights reserved. | |
* | |
* Redistribution and use in source and binary forms, with or without | |
* modification, are permitted provided that the following conditions | |
* are met: | |
* 1. Redistributions of source code must retain the above copyright | |
* notice, this list of conditions and the following disclaimer. | |
* 2. Redistributions in binary form must reproduce the above copyright |
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 <string.h> | |
#include <limits.h> | |
#include <dirent.h> | |
#include <errno.h> | |
#include <sys/stat.h> | |
#include <sys/types.h> | |
/* See https://gist.github.com/61131/a4d5846dd2fb4aaa22ecf9e05a3b34a1 */ |
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 <string.h> | |
size_t | |
strlcat(char *dst, const char *src, size_t dsize) { | |
const char *odst = dst; | |
const char *osrc = src; | |
size_t count = dsize; | |
size_t length; | |
if ((dst == NULL) || |
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
#ifndef _BINNOT_H | |
#define _BITNOT_H | |
#include <stdint.h> | |
/* | |
This macro provides the ability to use binary notation within C source. For | |
example - _B(10000001) = 129 | |
*/ |
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
/* Load through LD_PRELOAD to force listening operations to localhost */ | |
/* cc -Wall -g -fPIC -shared -Wl,-init,init bind.c -o libbind.so -ldl */ | |
/* $ LD_PRELOAD=./libbind.so nc -l 1234 */ | |
#define _GNU_SOURCE | |
#include <stddef.h> | |
#include <string.h> | |
#include <unistd.h> | |
#include <fcntl.h> |
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 <string.h> | |
#include <ctype.h> | |
#include <assert.h> | |
#include "sstr.h" | |
static void * __salloc (size_t n); |
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
#ifndef _MACROS_H | |
#define _MACROS_H | |
#include <stdint.h> | |
#include <stdarg.h> | |
/* | |
The following macros are used to prepend the number of arguments for | |
variadic functions. | |
*/ |
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 <string.h> | |
#include <regex.h> | |
#include <assert.h> | |
size_t | |
strlcpy(char * Destination, const char * Source, size_t Size) { | |
size_t uLength; |