读取二进制文件(File1.bin),并创建新的二进制文件(newFile1.bin) [英] Reading a binary file (File1.bin), and create new binary file(newFile1.bin)

查看:139
本文介绍了读取二进制文件(File1.bin),并创建新的二进制文件(newFile1.bin)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

文件包括标题,单独压缩的存档文件,文件表之类的结构.
File1.bin
[

File consists structure like header, archive files which are individually compressed, File Table.
File1.bin
[

struct FileHeader
{
crc---crc of file1.bin
headersize--size of File1.bin
Version-version File1.bin
FileCount--number of files FilesArchived
tableoffset---byte offset FielTable
Julian Date--databse begindate

}


已存档的文件--- .pdf和.bmp(单独压缩)

FileTable-FilesArchived中文件的索引
Fileoffset-File1.bin中pdf文件的绝对偏移量
压缩的FileSize --- FileArchive中文件的压缩大小
OriginalFileSize ---存档中文件的未压缩大小
flag1
flag2

从File1.bin的以上结构开始

我必须从File1.bin中提取数据并创建newFile1.bin和结构,如下所述

newFile1.bin


FilesArchived--- .pdf and .bmp(individually compresed)

FileTable -- index of files in FilesArchived
Fileoffset--absolute offset of pdf file in File1.bin
compressed FileSize--- compressed size of file in FileArchive
OriginalFileSize ---uncompressed size of file in archive
flag1
flag2

From the above structure of the File1.bin

I have to extract the data from File1.bin and create the newFile1.bin and structure to be like mentioned below

newFile1.bin

structure newFileheader
{
 Size of header
numofFruits
fruitbinfilename
version
begindate
}


文件名(pdf文件)
Fileoffset
原始文件大小
压缩文件大小
标记1
标记2
水果文件名.

从上面newFile1.bin
我必须提取Fruitbinfilename(Fruit1.bin)

格式看起来像

Fruit1.bin .... Fruit2.bin…Fruit3.bin……..…. FruitN.bin
Pdf file1….. Pdf file1….Pdf file1………….Pdf fileN
Pdf file2….. Pdf file2…. Pdf file2…………..Pdf fileN
Pdf file3….. Pdf file3…. Pdf文件3………….. Pdf文件N
.. ..
..
..
..
..
Pdf fileN….. Pdf fileN…. Pdf fileN………….. Pdf fileN


在这里,我们从Fruit.dbf文件中获取了水果数据,该数据是元数据.


在Fruit.dbf文件中,将有关联映射到pdf文件名.</pre>



请告诉我如何用c ++或vc ++读写以从File1.bin


Filename(pdf files)
Fileoffset
Orginal file size
Compressedfile size
Flag1
Flag2
Fruitfilename.

From above newFile1.bin
I have to extract the Fruitbinfilename(Fruit1.bin)

Format looks like

Fruit1.bin .... Fruit2.bin… Fruit3.bin ……..…. FruitN.bin
Pdf file1 ….. Pdf file1 ….Pdf file1 …… …….Pdf fileN
Pdf file2….. Pdf file2 …. Pdf file2 …………..Pdf fileN
Pdf file3 ….. Pdf file3 …. Pdf file3………….. Pdf fileN
.. ..
..
..
..
..
Pdf fileN ….. Pdf fileN …. Pdf fileN………….. Pdf fileN


Here we get the fruit data from Fruit.dbf files which is meta data.


In the Fruit.dbf file there will be associate mapping to pdf filename in that.</pre>



please tell me how to read and write in c++ or vc++ to generate newFile1.bin->fruit.bin from File1.bin

推荐答案

Start
Start here[^] and check the entries for CreateFile(), ReadFile(), WriteFile() and SetFilePointer(). That should cover the basics of what you need.


这篇关于读取二进制文件(File1.bin),并创建新的二进制文件(newFile1.bin)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆