|
Post by mchobo on Feb 12, 2014 7:17:15 GMT -5
Satoh, are you suggesting I build some sort of genetic hex injection application? While I can't make any promises, I'll see what I can do. Please specify which features are most necessary. (I must note, it would be a console application)
Also, I saw your art thread - you seem to be talented in model development. Have you been able to find any model data from MML1 or 2? I've found a bit of such data, but I wouldn't want to share something that's old news to you.
(About the code above, it's MML PC specific. Also, it needs further development.)
|
|
|
Post by satoh on Feb 12, 2014 14:20:42 GMT -5
I was mostly just mumbling to myself on the injector thing, but you're welcome to write one if you like. The models are somewhat known. Chiz and I worked on them for a while and made some good progress (In MML2). NPC models are stored per map, and player characters (Which include Roll, Matilda, Geetz, Tron, Bon, Glyde and Trigger) are stored in files in the COMMON folder (IIRC).
The data in the PSP and PSX versions are compressed via a method I don't know how to get around, however, the data in the PC version is not. (Also some files in the PSX version are raw, and are the same format as the PC)
EDIT: As for features of an injector, I'd basically just want to copy data from File A from a specified hexadecimal offset, into File B at a specified hexadecimal offset. (Overwriting the data)
|
|
|
Post by mchobo on Feb 12, 2014 22:02:49 GMT -5
This is the code you requested. (Maybe I should put this in a new thread?)
Feel free to ask for additional features. Just keep in mind that there will be no GUI.
If you have any questions about how to use it, do let me know.
EDIT: I'd like to note that I didn't add any checking features to prevent you from accidentally breaking any files, or making mistakes. (So back-up destination file before hexing.)Also, numeric input isn't hexadecimal, just standard decimal. Careful selecting an offset that goes beyond either file's size, I didn't add a feature to prevent that (Nor did I test to see the effects of going beyond the file size). Also, careful choosing a file path that needs special privileges - it wont open if that's the case. Keep in mind that \'s in file paths need to be doubled (such as C:\\Folder). Lastly, this code is written in C++, and needs to be compiled.
/************************************************************************************ * Title : Hexa-Injectagon * * Author : mchobo/hobomchobo * * Email : hobomchobo@yahoo.com * * Version : 0.01b * * Date : 02/12/2014 * * Description : This program is a genric hex injector. It currently has limited * *features, but I have some more features in mind. * ************************************************************************************ * NOTE :I realize my code is in major need of optimization, I hope to clean* * it up as time goes on - It is something I just put together. * ************************************************************************************ * NOTE2 :If you desire to use my code, and modify it - you may do so as long* * as you share your modification with the community. Moreover, please * * give credit where credit is due. * ************************************************************************************ * Version -v0.01 (02/12/2014) - Inital release. * * History -v0.01b(02/12/2014) - Changed input to hexdecimal * ************************************************************************************/
#include <iostream> #include <fstream>
using namespace std;
//Function used to check if file opened void CHECK_OPEN(fstream &file){ if(!file) cout << "Error opening file" << endl; else cout << "File sucessfully opened" << endl;
}
int main() { //Variable and Object declaraction fstream source, destination; char* dataArray = nullptr; int sourceOffset = 0, destOffset = 0, dataSize = 0; //Open files source.open("FileA.txt", ios::in | ios::out | ios::binary); destination.open("FileB.txt", ios::in |ios::out | ios::binary);
//Check if files opened CHECK_OPEN(source); CHECK_OPEN(destination);
//Input sourceOffset cout << "Enter Source files's offset: "; cin >> hex >> sourceOffset;
//Input destOffset cout << "Enter destination files's offset: "; cin >> hex >> destOffset;
//Input amount of bytes to copy cout << "How many bytes to copy? "; cin >> hex >> dataSize;
//allocate memory dataArray = new char[dataSize];
//set offset source.seekg(sourceOffset); destination.seekg(destOffset);
cout << "Copying, Please wait..." << endl;
//Read/write data source.read(dataArray, dataSize); destination.write(dataArray, dataSize);
//close files. source.close(); destination.close();
//release memory delete dataArray;
cout << "Replacement complete!" << endl; system("pause"); return 0; }
|
|
|
Post by satoh on Feb 13, 2014 18:13:45 GMT -5
Well that's cool. I'll have to play with it later. Thanks. I'm sure this will be of use in the future.
Cool palette swaps on Trigger btw. I always wanted to see him in red.
|
|
|
Post by mchobo on Feb 13, 2014 21:56:29 GMT -5
I'll try working on giving it a GUI. I can't seem to get QT working. Also, I'll try to add more features and fix the problems described above.
|
|