Read bytes from binary file

rainbow-girl

Member
Joined
Jul 27, 2024
Messages
12
Programming Experience
Beginner
Hi

I'm opening a binary file in a HEX editor. In this file I want so save the first 8 bytes to another destination file.
I want to read this binary file by using C# code and save the first 8 bytes of the file to a destination binary file (that will contain only those 8 bytes), all by using C# code.

Can somebody please give me a code example that can do this?

Thanks so much!!!
Lisa
 
In that case, you do have the source code and the documentation. It was all part of that .ZIP file you had previously sent me.
 
Yes but it's source code I don't understand
I hope you want to help again because I will never find anybody else who will! The problem is reduced to the code of 1 tool (the encrypt and decrypt is ready because you explained it)
:(
 
If you present the C struct here, that will pretty much inform us of how that file header is constructed and what lives in those "non-string data spread across more bytes".
 
Last edited by a moderator:
hI

here is all source code


I want to understand how the TVF and ZIP files are stored in a THF file

Here is a THF file: Internet Archive: View Archive

Download the file MENU/TL09.THF


Download the THF tool:


Download the THF tool source code:


You can run the tool THF.EXE on the file TL09.THF to see the content (you need DOSBox because it's a 16 bit MS-DOS EXE). It's this content I want to know: where and how a TVF and ZIP file is stored inside, so I can extract them using C# code. Indicated is the first ZIP file inside the THF file.
The encyption/decryption of TVF and ZIP files is completely known by me, because you explained me this the previous time.
I only need to know how I know where a TVF and ZIP file are inside the THF file and what C# code I need to extract the files. I then can decrypt them once I have the encrypted file extracted from the THF file.


So to summarize: I want to make C# code that takes a THF file and extracts all TVF and ZIP files from it (in encrypted state) and saves them to my hard drive, like the tool THF.exe is showing the contents: the example below saves 20 files of which are 2 TVF files and 18 ZIP files.
Then I can decrypt the encrypted files myself because I already have C# code for that.
I would be happy to get pseudo-code for C# or an algorithm how to do this, based on the code of the tool THF.exe. I have no C knowledge and can't find how they do it.

1722360335213.png
 
Last edited:

Latest posts

Back
Top Bottom