Not a complete solution but got the approach from this site: https://blog.systoolsgroup.com/detect-file-type-without-extension/
The file information does appear in the hex string in the two I tested (PDF and RTF). That being said, probably better to use a third party software that does the heavy lifting for you,
File Signature
Identifying Files that don’t have an Extension
If a file does not have an extension, it still has a file signature. You can identify the format of that file from its file signature. All file types have a standard and unique signature and this data is stored in the file itself. There are programs that can read this signature and determine the file format even if the extension is missing from the file name. All you have to do is get a freeware hex editor that can represent the hexadecimal structure of the file. The first set of bytes in a file represents a signature, which, in most cases, is 2-4 bytes long. If you are capable enough to identify it on your own well and good, otherwise, there is always Google one click away.
#include <String.au3>
$aFile=FileOpen(@DesktopDir&"\test",0)
if @error then MsgBox(0,'ERROR',@error)
local $firstLine=filereadline($aFile)
$hexData=_HexToString ( $firstLine )
ConsoleWrite(@crlf&$hexData)