Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- unsigned char data[24] = {
- 0x18, 0x00, 0x04, 0x01,
- 0x00, 0x00, 0x00, 0x00,
- 0x5E, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00
- };
- struct UpdateFileHeader
- {
- UINT16 HdrSize; // always 0x0018
- BYTE override; // 0x01 => override with new file; 0x04 => update file (bsdiff)
- BYTE version; // always 0x04
- UINT32 unknown3;
- UINT32 OldFileSize; // file size before the update (uncompressed)
- UINT32 NewFileSize; // size of the entire file after the update is applied (uncompressed)
- UINT32 unknown6; // always 0
- UINT32 unknown7; // always 0
- };
- Hardcoded values work:
- const char* output = reinterpret_cast<const char*>(data);
- OutFile.write(output, 24)
- Trying to use structure to write variable data:
- OutFile.write(reinterpret_cast<const char*>(test.HdrSize), sizeof(UINT16));
- OutFile.write(reinterpret_cast<const char*>(test.override), sizeof(BYTE));
- OutFile.write(reinterpret_cast<const char*>(test.version), sizeof(BYTE));
- OutFile.write(reinterpret_cast<const char*>(test.unknown3), sizeof(UINT32));
- OutFile.write(reinterpret_cast<const char*>(test.OldFileSize), sizeof(UINT32));
- OutFile.write(reinterpret_cast<const char*>(test.NewFileSize), sizeof(UINT32));
- OutFile.write(reinterpret_cast<const char*>(test.unknown6), sizeof(UINT32));
- OutFile.write(reinterpret_cast<const char*>(test.unknown7), sizeof(UINT32));
Advertisement
Add Comment
Please, Sign In to add comment