in reply to Re^5: dynamic extractor based off static references in file (perl)
in thread dynamic extractor based off static references in file (perl)

$buffer stores the reference to where the actual data is in the file.
so it will look like this:
my $buffer = ''; sysseek $file, 0x15, 0; sysread $file, $buffer, 0x03; syswrite $outfile, $buffer;
And 0x15 is the reference to the actual data in this file. this code will get that reference and store it in $buffer.
What I want to be able to do is use $buffer in sysseek like this:
sysseek $file, $buffer, 0;
as opposed to:
sysseek $file, 0x400, 0;

Replies are listed 'Best First'.
Re^7: dynamic extractor based off static references in file (perl)
by james289o9 (Acolyte) on Dec 06, 2013 at 09:29 UTC
    This is what i got from data::dumper
    $VAR1 = ' ♦└';

    So I guess it is not a numerical value. I need to get "' ♦└'" into its binary form
Re^7: dynamic extractor based off static references in file (perl)
by james289o9 (Acolyte) on Dec 06, 2013 at 09:31 UTC
    This is what i got from data::dumper
    $VAR1 = ' ♦└';

    So I guess it is not a numerical value. I need to get "' ♦└'" into its binary form. I already have the endianess worked out.

      $VAR1 = ' ♦└';

      Is that the same as  " \4\xC0" (actual dd-output of whatever perlmonks mangled of your Dumper output)?

      I already have the endianess worked out.

      Funny, what is the endianess? What do the bytes represent? (don't say a number in binary form -- there are a million of those, we need to know which one)

        I have figured out what i needed to do convert the character string into a hex string. Now i can put that into the variable $buffer and print Dumper($buffer)returns the correct value of 04C0.
        The problem still is, I still cannot use $buffer (04C0) in sysseek either because its a non numerical value.