Copy and replace Visual C++

hi guys, i am new to c++ and i really need some help. I am going to make a patcher for photoshop cs 5.1..... For testing only. So what i have is a dll file which i am going to replace with a file in the adobe directory. I have made it like this

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <iostream>
#include <stdlib.h>
#include <fstream>
#include <cstdlib>


int main() {
	

		std::ifstream ifs("amtlib.dll", std::ios::binary);
std::ofstream ofs("C:\Program Files (x86)\Adobe\Adobe Photoshop CS5.1\amtlib.dll", std::ios::binary);

ofs << ifs.rdbuf();

std::cout <<"Patched successfully" << std::endl;
	system("pause");
		return(0);
}











i cant find the problem

can you guys plz help me????????????????+





cheers
\ is used for escape characters so to write \ in a string you need to write two \.
"C:\\Program Files (x86)\\Adobe\\Adobe Photoshop CS5.1\\amtlib.dll"
or you can use forward slash.
"C:/Program Files (x86)/Adobe/Adobe Photoshop CS5.1/amtlib.dll"
Last edited on
Wait a second. You mean that this is all the code for a .dll replacement ? O.o Oh my God!
Yeah, its all for a dll replacement. Peter78 that didn't do it :-(.




I would love to just change the whole code to something else........... so come with solutions :-)
You need to run your program as administrator to see any changes.
Better use CopyFile() or SHFileOperation() API function.
OK i runs just fine now, it worked to run as admin
thx to modoran and peter87 for solutions.......
CHEERS
Last edited on
Topic archived. No new replies allowed.