好吧其實我已經把一些精力放在試圖做到這一點,這時候:)Perl的 - 從某個偏移量十六進制提取數據
我有這樣的代碼:
#! /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);
我不知道,如果你可以看到我想要做什麼,但我試圖尋求抵消0x760 ,然後從偏移量0x760讀取,然後從file1.bin中讀取一大塊字節(0x400),並將該字節塊打印到file2.bin
所以我想這是我想要做的流程:
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
希望你明白我要完成的:)任何輸入將是教育:)
謝謝你,這讓我的頭腦燃燒起來,現在我已經讀了兩天了,而我的OP是我最好的破解版,大聲笑 – james28909