Skip to content

Instantly share code, notes, and snippets.

@timlegge
timlegge / hexdump.c
Created November 14, 2023 18:17 — forked from mcnewton/example.out
hex dump C buffer
#include <stdio.h>
#include <string.h>
#include <assert.h>
int hexdump(FILE *fd, void const *ptr, size_t length, int linelen, int split);
int main(void)
{
FILE *fd;
char buffer[100] = "0123456789ABCDEFabcdef0123456789AAAABBBBCCCCDDDDHello World\rTest-line\n";
@timlegge
timlegge / decompress.ps1
Created January 6, 2019 03:00 — forked from vortexau/decompress.ps1
Powershell to decompress DEFLATE data
$base64data = "insert compressed and base64 data here"
$data = [System.Convert]::FromBase64String($base64data)
$ms = New-Object System.IO.MemoryStream
$ms.Write($data, 0, $data.Length)
$ms.Seek(0,0) | Out-Null
$sr = New-Object System.IO.StreamReader(New-Object System.IO.Compression.DeflateStream($ms, [System.IO.Compression.CompressionMode]::Decompress))
while ($line = $sr.ReadLine()) {