in reply to dynamic extractor based off static references in file (perl)

So, instead of sketching why don't you draw an outline? Something like:

use strict; use warnings; my $fileName = "sample.dat"; open my $inFile, '<:raw', $fileName or die "Can't open '$fileName': $! +\n"; my $loc = 23; my $len = 20; my $bytes; seek $inFile, $loc, 0; read $inFile, $bytes, $len; ...
True laziness is hard work

Replies are listed 'Best First'.
Re^2: dynamic extractor based off static references in file (perl)
by james289o9 (Acolyte) on Dec 06, 2013 at 17:54 UTC
    The main reason i cant do it like this is because i cannot put "04C0" into $loc and then call $loc in seek. This is where i have been stuck at for a while now. i want to put a hex reference "0x04C0" into $loc. but that doesnt work because it has a letter in it.