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
### Keybase proof | |
I hereby claim: | |
* I am fergusinlondon on github. | |
* I am fergusinlondon (https://keybase.io/fergusinlondon) on keybase. | |
* I have a public key ASAZUkUuHB0BhpbpaL2yBsfar2Rj2ATeaS2RfjJMaiFkpQo | |
To claim this, I am signing this object: |
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
/** | |
* snoopy.c - Snoop on another tasks memory. | |
* Fergus In London <[email protected]> | |
* | |
* This is a pretty basic demo of the process_vm_readv syscall, a syscall which | |
* provides a nicer interface than ptrace for accessing memory used by another | |
* task. | |
* | |
* To play with simply use `ps` to get a PID for the process you'd like to snoop | |
* on, and `pmap` for the relevant memory address. |
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
/* filesnooper.c - Fergus In London <[email protected]> | |
* | |
* Similar to snoopy.c, wrote to scratch an itch and demonstrate how LD_PRELOAD | |
* can be used for injecting code and/or hooking/wrapping around function calls. | |
* | |
* This is actually a good example, because if you try and use it with different | |
* ways of writing files, you'll see that to actually do this effectively you'd | |
* need to examine the target binary with strace, and potentially implement | |
* signatures from other libraries. (i.e a binary calling fprintf() may not be | |
* be effected by this.) |
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
/** | |
* shuffle(array[]) - Shuffles an array via a simplistic | |
* algo, not too dissimilar to Fisher-Yates. | |
* | |
* Ignore the -ahem- "clever" variable swapping one-liner, | |
* that's all it does. | |
* | |
* @param array | |
* @return array | |
*/ |
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> | |
#define FIRST_SIX_INDEX (buf[0] & 0xfc) >> 2 | |
#define SECOND_SIX_INDEX ((buf[0] & 0x03) << 4) + ((buf[1] & 0xf0) >> 4) | |
#define THIRD_SIX_INDEX ((buf[1] & 0x0f) << 2) + ((buf[2] & 0xc0) >> 6) | |
#define FOURTH_SIX_INDEX buf[2] & 0x3f | |
char base64_map[]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; |
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
/** | |
* Simple little event registry built around the worlds most simplistic | |
* linked list implementation. Allows you to register a function (void()) | |
* against a integer value, and provides a mechanism for triggering the | |
* associated functions for an integer. | |
* | |
* Not a great deal of use beyond those fun little weekend Arduino type | |
* projects. | |
* | |
* @see example.c |
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
/* Fergus In London - https://fergus.london - <[email protected]> | |
* | |
* Simple little function for calculating rolling averages, both simple and | |
* weighted. Example can be found on the GitHub Gist, or on my website. | |
* | |
* Do as you please, no rights reserved and no warranties provided. :) | |
*/ | |
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
/* Fergus In London - https://fergus.london - <[email protected]> | |
* | |
* Simple little function for calculating rolling averages, both simple and | |
* weighted. Example can be found on the GitHub Gist, or on my website. | |
* | |
* Do as you please, no rights reserved and no warranties provided. :) | |
*/ | |
/** |
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
# Fergus In London - https://fergus.london <[email protected]> | |
# | |
# Uses the org.freedesktop.problems dbus channel to read out reported problems. | |
# | |
# Requires pydbus from pip. | |
# Requires python-gobject and glib installed on your distro. | |
# | |
import sys | |
import argparse | |
from pydbus import SystemBus |
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> // memcpy | |
#include <stdlib.h> // | |
/** | |
* | |
* | |
*/ | |
typedef struct { | |
uint8_t object_count, iteration_counter, max_count; | |
uint8_t *indices_in_use; |
OlderNewer