#include <fstream>
#include <iostream>
using namespace std;
char * buffer;
long size;
int main () {
ifstream infile ("d2gfx.dll",ifstream::in);
ofstream outfile ("d2gfx.dll",ofstream::out);
infile.seekg(0xBD30,ifstream::beg);
size=infile.tellg();
infile.seekg(0xBD30);
buffer = new char [size];
infile.read (buffer,size);
cout << buffer << "\n";
system("pause");
outfile.seekp(0xBD30,ifstream::beg);
size=outfile.tellp();
outfile.seekp(0xBD30);
outfile.write ("D2Mad.dll",10);
delete[] buffer;
outfile.close();
infile.close();
return 0;
}
for the better part of today I've been trying to statically modify a dll using the above code(and variations thereof), but to no avail, I'm hoping someone can give me some insight into what I'm doing wrong/ a better way to do this
thanks