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

What is $buffer in actuality? use ddumperBasic debugging checklist Basic debugging checklist item 4

What does it represent in terms of bits bytes and endianess (datatype)?

perlpacktut

  • Comment on Re^5: dynamic extractor based off static references in file (perl)

Replies are listed 'Best First'.
Re^6: dynamic extractor based off static references in file (perl)
by james289o9 (Acolyte) on Dec 06, 2013 at 09:15 UTC
    $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;
      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)

      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