Home of the Ultimate Xbox 360 Modding Tool, Horizon. XboxMB.com is a community of Xbox 360 gamers and modders who share Tutorials, News, Reviews, and other resources. Xbox Message Boards is free to sign up and use, so what are you waiting for? Register Now!
Now, here are the 2 functions I call(get_entry_by_id, and extract_entry):
Code:
XDBF::Entry* XDBF::get_entry_by_id(long long identifier)
{
Entry* entries = get_entries();
for(unsigned int i = 0; i < get_header()->entry_count; i++)
if(entries[i].identifier == identifier)
return &entries[i];
return NULL;
}
char *XDBF::extract_entry(Entry *entry)
{
if(openedFile == NULL)
return NULL;
unsigned int offset = get_offset(entry->offset_specifier, h);
fseek(openedFile, offset, SEEK_SET);
char *data = new char[entry->length];
unsigned int poophead = (unsigned int)data;
fread(data, entry->length, sizeof(char), openedFile);
return data;
}
Now once I get the char* from 'extract_entry', I write it to a file... It's really dumb because it reads the data incorrectly... I don't know how it's possible, but it gets the bytes:
Code:
89 50 4E 47 0A...
out of the file, while the real bytes are:
Code:
89 50 4E 47 0D...
The bytes that I posted first don't even exist in the GPD... I also look at the location that it seeks to before reading the entry in the 'extract_entry' function, and it's correct...
I am new the C++, so there is probably some stupid stuff I did in the code posted. Thanks for any help.