ok i have actually put some effort into trying to accomplish this, this time 🙂
i have this code:
#! /usr/bin/perl
open(my $fin, '<', "./file1.bin") or die "Cannot open file1.bin: $!";
binmode($fin);
open(my $fout, '>>', "./file2.bin") or die "Cannot create file2.bin: $!";
binmode($fout);
seek($fin,0x760, SEEK_CUR);
read($fin, 0x400,)
print ("$fin, $fout);
close($fout);
i dont know if you can see what i am trying to do, but i am trying to seek to offset 0x760
then read from offset 0x760 then read a chunck of bytes(0x400) from file1.bin and print that chunck of bytes to file2.bin
so i guess this is the flow of what i am trying to do:
open file1.bin for reading in binmode
open file2.bin for writing in binmode
seek to offset 0x760 in file1.bin
read a chunk of data (0x400) from file1.bin
write the chunk of data (0x400) to file2.bin
hopefully you understand what i am trying to accomplish 🙂 and any input would be educational 🙂
There is a typo in your code:
should be replaced by (after the opening and bindmode)