Skip to content

Instantly share code, notes, and snippets.

@GrayedFox
GrayedFox / extract-jpg
Last active June 17, 2024 02:05
Extract JPG image from binary data
#!/usr/bin/env python
# please ensure python means python3 on your system
# the file can be any binary file that contains a JPG image
# note that it's hungry and doesn't chunk the read so careful with large files
# usage: extract-jpg file_name
import sys
@robindegen
robindegen / gist:c96fcd3ab393c887889f
Created January 30, 2015 06:39
Reading raw data from a physical drive in windows
#define _CRT_SECURE_NO_WARNINGS
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <stdio.h>
int main(int argc, char *argv[])
{
HANDLE handle = CreateFile(
"\\\\.\\PhysicalDrive0",
GENERIC_READ,