Generating a file with a particular CRC value - crc

I have no idea where to start and even all mighty Google didn't find an answer.
Any web application or C#\Python\C\C++ would be grate as well.
Thanks.

My spoof.c code tells you how to modify a file to get the desired CRC.

Related

Nifi: ReplaceTextWithMapping doesnt work as expected

I have been trying out examples in nifi and has been trying out the ReplaceTextWithMapping processor. The processor config as given below.
The mapping file is shown below.And I have used tab space between key and value.
I have followed this article here. And there is a lots of ID in the input file to the processor.There is no error on the logs. Can someone help me understand the problem.
The only workaround I could find was giving the values directly like (ID|POS). This does work. But still don't know why regex is not working.

Generating Adio Fingerprint with GraceNote SDK

I am having some trouble understanding the samples included in the gnsdk download. All I need to do is to be able to generate an audio fingerprint from a wav. file. My plan is then to hand it off the the web api to query the database. I am much more experienced in web languages so once I can get the fingerprint I shoudl be good to go. Unfortunately my C/C++ is a bit shaky.
I am trying to figure out the exact function I need to call and how to pass a wave file to it. If anybody has any tips or clues on how to just generate the finger print I would be forever grateful.
Please refer to the sample source code under 'samples/musicid_lookup_album_fpx'.
In the main.c file look for the following functions.
APIs for generating finger prints from PCM.
gnsdk_musicid_query_fingerprint_begin()
gnsdk_musicid_query_fingerprint_write()
gnsdk_musicid_query_fingerprint_end()
API for saving finger print to a string buffer.
gnsdk_musicid_query_get_fp_data()

How to read a .shd file in C++?

I am creating a project in c++ for getting JobSettings of a job in a queue from .shd file.Can anyone please suggest me which API is used for reading .shd file?
If you're talking about the shadow file from the Windows spooler, take a look at this site and code accordingly - http://www.undocprint.org/formats/winspool/shd
Please note that this format is undocumented and so could change ever so often.

How to calculate the MasterChecksum and DataForkChecksum on a dmg file

I try to change some information on a dmg files,
It works well but when i tried to open the dmg i have the error message
checksum invalid
So i get the header of my dmg file, and i get all the information that i need .
I have a DataForkChecksum and a MasterChecksum but I don't know how to calculate them .
does anyone knows how to do this ?
The master checksums is a checksum of checksums. It is computed as the CRC-32 checksum (polynomial=0xedb88320) computed on the concatenated binary values of all the checksums of the BLKX blocks present in the DMG. It's quite painful to compute.
libdmg contains GPL code that does this. In particular have a look at the calculateMasterChecksum() function in http://shanemcc.co.uk/libdmg/libdmg-hfsplus/dmg/dmglib.c
If you don’t know a lot about Checksums I recommend taking a quick look at the Wikipedia entry. Essentially they are used to check the integrity of a file to make sure that it has not been changed or interfered with in anyway. I believe this is especially important in the open source community, as the code uploaded to sharing websites could have been interfered with by someone other than it original provider.
(Also take a quick look at MD5 on Wikipedia, one read of this and you will quickly appreciate the difficulty of the problem and proposed solutions. )
By including a Checksum the provider is not guaranteeing the quality of the code (they may well do separately) but they are giving you the ability to ensure that what you are downloading is exactly what they provided. A change to a single byte will change the Checksum.
In your case by modifying the DMG you are changing the Checksum. Without knowing the specifics it’s hard to advise you how to get around it. If your setup is communicating with the original DMG provider in some way to compare the checksums then it will be very difficult to fix. You also have no way of knowing what their checksum is.
If it is comparing it with a locally stored file then you have a chance. The simplest way will be to get one of the free tools for creating Checksums and replace them both.
However all this brings up a question. Why are you modifying an externally provided DMG? If you want your computer to preform additional actions when you click on it I believe there are much simpler ways

File Signature Validation

I Have used a utility written by Mark Russinovich, it is used to validate the file signature.
Any one have ideas how this can be done, i know it is not a simple code, but just i need some hints, APIs, steps, A guide map, Just to go in the correct direction.
I read too much a bout the cryptAPIs, then I read too much about the certAPIs, but i cannot get any thing useful to simply link a given file with the (unknown to me) data stored in the windows.
if any can help me in this issue please help, thanks a lot.
You should read about Authenticode.