First of all I am not familiar with the EFS structure.
Is the header encrypted or not?
If the header is not encrypted, then reading it is the same as reading normal files. Look up for code that reads a bitmap file and extracts the header and image contents. It should be similar.
If the header in encrypted too, then you should decrypt it before trying anything else.
WolfPack
Postaholic
2,051 posts since Jun 2005
Reputation Points: 572
Solved Threads: 115
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
you'd read them the same as any other, and then pull them through some decryption system...
It's just bits and bytes after all, same as any other part of any other file.
jwenting
duckman
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
Well common file formats are listed here
http://www.wotsit.org/
Simply typing in say "jpg file format" into your favourite search engine would reveal as much.
Windows EFS on the other hand is proprietary for sure, deliberately kept secret (perhaps), and an altogether different prospect.
Perhaps this would help.
> My question is how I would read the file header
You allocate 'n' bytes.
You read 'n' bytes into the memory you allocated.
You examine each byte in turn, and using your knowledge of the file format, decide what that byte actually means.
Most file formats begin with some fixed sized header (this is your first 'n'). Within that header, there is usually something which tells you how big the variable sized data is going to be.
Salem
Posting Sage
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
"reading a .jpg file like a normal file does not give me the file header in any kind of format visible instead it comes out with a lot of random characters"
Hardly random. There's a definite structure there which is well defined in the JPEG file format specification.
Same for all other file formats. Of course the specification may not be public.
And of course there may be more information scattered across the rest of the file determining its makeup and layout, again well defined in the file format specification.
Your task is to find that specification some way and write some software to read it.
jwenting
duckman
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337