"will I be able to convert Hex to Characters?"
Yes. After your program reads in the literal characters that represent Hex digits -- for example, '5' and 'A', the program can turn that into the hex value 0x5a, which is decimal 90, and then print that value out as a character (which prints as "Z"). Pretty much every other conceivable way of converting characters to hex and vice versa is pretty easy in C.
How to correctly convert a Hex String to Byte Array in C? Printing char buffer in hex array Convert array of bytes to hexadecimal string in plain old C
I am not clear on what you are asking in the rest of your question. Are you asking:
"I have this binary PFS file; can I write a C program that, when the program is run, reads that file into RAM, and if so, is a char array (char[]) a good container?"
Yes. When C programs read raw binary file data into memory, they typically store that data into a char array, and they keep track of the length separately (because, unlike char arrays that represent C strings, your binary data is likely to have the occasional zero byte). You may want to look at the standard memory library functions (memcmp(), memchr(), etc. )
"I have an ASCII text file that is a hex dump of a PFS file; can I write a C program that, when the program is run, reads that ASCII text file into RAM, and if so, is a char array (char[]) a good container?"
Yes. When C programs read text files into memory, they typically store that data in a char array. You don't need to keep track of the length separately, because ASCII text files never include a zero byte, so the normal end-of-string zero byte works normally. You may want to look at the standard string library functions ( strchr(), strstr(), etc.).
"I have this PFS file; can I write a C program that, before the program is ever run, the complete contents of that file are embedded into the executable code of my program?"
In principle, yes, you could convert a raw binary file into a text file full of hex digits that you can include in your source code.
This is rarely done, and is a bigger hassle than simply loading the program in at run time, but occasionally people do it when they want a single self-contained executable:
- How to embed a file into an executable?
- https://gist.github.com/valenok/4714740
- http://www.daniweb.com/software-development/c/threads/352381/how-to-define-hex-character-array-in-c
- http://www.massmind.org/techref/datafile/charset/extractor/charset_extractor.htm
- How to embed a file into an executable file?
- Embedding resources in executable using GCC
- http://www.linuxjournal.com/content/embedding-file-executable-aka-hello-world-version-5967
p.s.: Is your PFS file from an Amiga or a Playstation or something else?