sshock / AFFLIBv3

AFF is an open and extensible file format to store disk images and associated metadata.
Other
77 stars 20 forks source link

Convert stream data to aff #25

Closed sspring closed 7 years ago

sspring commented 7 years ago

How can I convert a stream data to an aff file. Is there a function (such as update as below) can be invoked once or multiple times to write spacifiec data to aff file?

For example: // do something to initialize aff context or do somethings else char buffer[100] = “Today is a nice day”; update(buffer,strlen(buffer)); // update can be invoked once or multiple times. // close file or do something else

sshock commented 7 years ago

Yes, after calling af_open() to create the aff and get an AFFLIB*, and then call af_enable_compression() if you want compression, then you can call af_write() one or more times to write any data you want, e.g.,

af_write(aff, buffer, strlen(buffer));

sspring commented 7 years ago

Ok. It works. Thank you. and I find total size to be written must be the times of 512 bytes,otherwise the output aff file can't be opened correctly with FTK Imager.

sshock commented 7 years ago

Glad to hear it all worked out for you.