Last active
December 11, 2023 23:20
-
-
Save terremoth/117e375885c236d896d635718f34781c to your computer and use it in GitHub Desktop.
Simple DD like tool made in PHP, just change the disk you want to read and dump
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
<?php | |
echo "Disk size: ".disk_total_space("D:").PHP_EOL; | |
$disk = fopen('\\\\.\\D:', 'rb+'); //escaping the escape | |
$chunk_size = 4096; | |
while (!feof($disk)) { | |
$bin_data = fread($disk, 4096); | |
file_put_contents("dump.bin", $bin_data, FILE_APPEND); | |
} | |
fclose($disk); | |
echo PHP_EOL."100% completed. Done."; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment