First of all, only test this stuff on spare, unimportant partitions. I warned you!!!
Perl's not really suited to low-level stuff, except maybe for the regexing of the binary data you pump out. I know an old trick to read a bios is to use dd (on linux)
dd if=/dev/mem bs=32k skip=31 count=1 | strings -n 10 | grep -i bios
You probably can use this same technique on raw disks, like
dd if=/dev/hdb0 | strings -n 10 | grep -i secretkey
To put it in Perl, you probably can run it thru a piped open, and regex the output
my $pid = open(FH, " dd if=/dev/hdb0 | ") or die "$!\n";
while( my $rrv = sysread( FH, my $buf, 1012 ) ){
#regex your $buf here for whatever
#of course you will have to worry about missing full strings
#on your chunk boundaries, so you may need to save a few
#hunderd bytes of each $buf to add to the next one
}
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.