https://www.autoitscript.com/forum/topic/188773-solved-read-file-hex-mode-help/
#include <FileConstants.au3>
ConsoleWrite(_ReadOffSet("1.txt",0,8) & @CRLF)
Func _ReadOffSet($sFilePath,$iOffset,$iLen=1)
Local $sRet=""
Local $hFile=FileOpen($sFilePath,$FO_BINARY)
FileSetPos($hFile,$iOffset,$FILE_BEGIN)
$sRet=FileRead($hFile,$iLen)
FileClose($hFile)
Return $sRet
EndFunc
原文有2个func,第一个如果档案太大好像会爆掉,我试成功的是第二个func,
读出来的值是0xD0CF11E0A1B11AE1,就代表是Microsoft Office document,
可能是 doc; dot; xls; xlt; xla; ppt; apr ;ppa; pps; pot; msi; sdw; db
参考
https://www.datadoctor.biz/data_recovery_programming_book_chapter14-page2.html
如果要确认是那种档案则还要配合Footer (Hex),目前还没搞定Footer (Hex)这段。
https://deurus.info/2017/10/list-of-file-signatures/
https://www.filesignatures.net/index.php?search=FFD8FFE1&mode=SIG
https://www.filesignatures.net/index.php?search=JPEG&mode=EXT
Extension Signature Description
JPG FF D8 FF E1 Digital camera JPG using
Exchangeable Image File Format (EXIF)
JPEG FF D8 FF E0 JPEG IMAGE
JPEG FF D8 FF E2 CANNON EOS JPEG FILE
JPEG FF D8 FF E3 SAMSUNG D500 JPEG FILE
PNG 89 50 4E 47 0D 0A 1A 0A PNG image