mirror of
https://github.com/ksherlock/profuse.git
synced 2026-04-19 23:16:30 +00:00
cleaner disk copy/ 2mg support
git-svn-id: https://profuse.googlecode.com/svn/trunk@12 aa027e90-d47c-11dd-86d7-074df07e0730
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* UniversalDiskImage.cpp
|
||||
* profuse
|
||||
*
|
||||
* Created by Kelvin Sherlock on 1/6/09.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "UniversalDiskImage.h"
|
||||
|
||||
#include "common.h"
|
||||
#include <string.h>
|
||||
|
||||
bool UniversalDiskImage::Load(const uint8_t *buffer)
|
||||
{
|
||||
if (strncmp((const char *)buffer, "2IMG", 4) != 0) return false;
|
||||
|
||||
// all numbers little-endian.
|
||||
|
||||
magic_word = load32(&buffer[0]);
|
||||
|
||||
creator = load32(&buffer[0x04]);
|
||||
|
||||
header_size = load16(&buffer[0x08]);
|
||||
|
||||
version = load16(&buffer[0x0a]);
|
||||
|
||||
image_format = load32(&buffer[0x0c]);
|
||||
|
||||
flags = load32(&buffer[0x10]);
|
||||
|
||||
data_blocks = load32(&buffer[0x14]);
|
||||
|
||||
data_offset = load32(&buffer[0x18]);
|
||||
data_size = load32(&buffer[0x1c]);
|
||||
|
||||
|
||||
comment_offset = load32(&buffer[0x20]);
|
||||
comment_size = load32(&buffer[0x24]);
|
||||
|
||||
|
||||
|
||||
creator_data_offset = load32(&buffer[0x28]);
|
||||
creator_data_size = load32(&buffer[0x2c]);
|
||||
|
||||
// 16 bytes reserved.
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
Reference in New Issue
Block a user