Custom File Type Help
Posted: Fri Jan 29, 2016 5:11 pm
I'm trying to create a custom file type for an encrypted file container. There is no static file header, but there is a footer.. kind of.
64 bytes before the end of the file we print the text MD5E, then print a bunch of zeros, and finally an md5sum value.
here is an example, this is the END of a file, the 'first' 3 lines are static, the last line will change as it's an md5sum of the file itself.
0003dd40 01 4d 44 35 45 00 00 00 00 00 00 00 00 00 00 00 |.MD5E...........| **STATIC**
0003dd50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| *STATIC**
0003dd60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| **STATIC**
0003dd70 08 82 54 31 80 9f be ed 6e fb 05 89 bd 35 e0 f7 |..T1....n....5..| *VARIABLE DATA**
so if i did this right here is my xml file, i defined an offset of 64 bytes for my end of file. If my understanding is right this tells the program to look 64 bytes back from the end of the file for the end of file signature? then the included signature is only be 48 bytes, as the last 16 bytes will be variable data.
<?xml version="1.0" encoding="UTF-8"?>
<FileTypeList version="2.0">
<FileType id="50001" group="DCM FILES" description="PFILE" features="" extension="C0W">
<Begin combine="OR"/>
<End combine="AND">
<Signature offset="64">\x01MD5E\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00</Signature>
</End>
</FileType>
</FileTypeList>
This isn't working and is not finding anything. So i must be doing soething wrong.
64 bytes before the end of the file we print the text MD5E, then print a bunch of zeros, and finally an md5sum value.
here is an example, this is the END of a file, the 'first' 3 lines are static, the last line will change as it's an md5sum of the file itself.
0003dd40 01 4d 44 35 45 00 00 00 00 00 00 00 00 00 00 00 |.MD5E...........| **STATIC**
0003dd50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| *STATIC**
0003dd60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| **STATIC**
0003dd70 08 82 54 31 80 9f be ed 6e fb 05 89 bd 35 e0 f7 |..T1....n....5..| *VARIABLE DATA**
so if i did this right here is my xml file, i defined an offset of 64 bytes for my end of file. If my understanding is right this tells the program to look 64 bytes back from the end of the file for the end of file signature? then the included signature is only be 48 bytes, as the last 16 bytes will be variable data.
<?xml version="1.0" encoding="UTF-8"?>
<FileTypeList version="2.0">
<FileType id="50001" group="DCM FILES" description="PFILE" features="" extension="C0W">
<Begin combine="OR"/>
<End combine="AND">
<Signature offset="64">\x01MD5E\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00</Signature>
</End>
</FileType>
</FileTypeList>
This isn't working and is not finding anything. So i must be doing soething wrong.