Click here to Skip to main content
15,895,011 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Read an executable and write the data to a file. Pin
harold aptroot23-Jun-10 5:31
harold aptroot23-Jun-10 5:31 
GeneralRe: Read an executable and write the data to a file. Pin
Not Active23-Jun-10 6:00
mentorNot Active23-Jun-10 6:00 
GeneralRe: Read an executable and write the data to a file. Pin
harold aptroot23-Jun-10 6:15
harold aptroot23-Jun-10 6:15 
AnswerRe: Read an executable and write the data to a file. Pin
Code-o-mat23-Jun-10 5:28
Code-o-mat23-Jun-10 5:28 
GeneralRe: Read an executable and write the data to a file. Pin
ALLERSLIT23-Jun-10 5:46
ALLERSLIT23-Jun-10 5:46 
GeneralRe: Read an executable and write the data to a file. Pin
Code-o-mat23-Jun-10 6:38
Code-o-mat23-Jun-10 6:38 
AnswerRe: Read an executable and write the data to a file. Pin
ant-damage23-Jun-10 5:48
ant-damage23-Jun-10 5:48 
AnswerRe: Read an executable and write the data to a file. Pin
El Corazon23-Jun-10 5:58
El Corazon23-Jun-10 5:58 
ALLERSLIT wrote:
Hey, i just wanted to ask if theres a way i can read the data of a file so i can paste it to another file?
Like i read the data of cmd.exe and paste it to whatever.exe?


back in the 1990's, all programs started at the same offset. This made chaining programs easy. In fact a tool called LzExe[^] would compress an executable code, replace the loader function, and chain to the offset starting block.

Now it is a little more difficult. Without knowing your intentions, few people here are likely to give you a step-by-step walk-through. The process is similar, but you will have to read the EXE header and still replace it, that much remains the same, chaining to the code is a little more difficult, but not impossible, but the act of which will cause any security product on the machine such as anti-virus software to halt your action.

If your intent is only to insert program code into a process there are other safer ways to do this without modifying an executable. Dlls offer the safest disk method of injecting code into programs. There are also active methods of inserting code into running processes.

So.... as others have asked, what exactly are you trying to do? modify an executable inserting your own code? for what reason? what are you trying to accomplish?
_________________________
John Andrew Holmes "It is well to remember that the entire universe, with one trifling exception, is composed of others."

Shhhhh.... I am not really here. I am a figment of your imagination.... I am still in my cave so this must be an illusion....

AnswerRe: Read an executable and write the data to a file. Pin
Richard MacCutchan23-Jun-10 6:35
mveRichard MacCutchan23-Jun-10 6:35 
QuestionArray Pin
Nikesh Jagtap23-Jun-10 2:11
Nikesh Jagtap23-Jun-10 2:11 
AnswerRe: Array Pin
CPallini23-Jun-10 2:18
mveCPallini23-Jun-10 2:18 
AnswerRe: Array Pin
Sakhalean23-Jun-10 2:18
Sakhalean23-Jun-10 2:18 
AnswerRe: Array PinPopular
Maximilien23-Jun-10 2:31
Maximilien23-Jun-10 2:31 
GeneralRe: Array Pin
Richard MacCutchan23-Jun-10 3:00
mveRichard MacCutchan23-Jun-10 3:00 
GeneralRe: Array Pin
Maximilien23-Jun-10 3:56
Maximilien23-Jun-10 3:56 
AnswerRe: Array Pin
Chris Losinger23-Jun-10 3:58
professionalChris Losinger23-Jun-10 3:58 
QuestionException Handling in C++ Pin
theCPkid23-Jun-10 2:04
theCPkid23-Jun-10 2:04 
AnswerRe: Exception Handling in C++ Pin
Richard MacCutchan23-Jun-10 3:02
mveRichard MacCutchan23-Jun-10 3:02 
AnswerRe: Exception Handling in C++ Pin
Emilio Garavaglia23-Jun-10 4:47
Emilio Garavaglia23-Jun-10 4:47 
AnswerRe: Exception Handling in C++ Pin
Aescleal23-Jun-10 7:10
Aescleal23-Jun-10 7:10 
GeneralRe: Exception Handling in C++ Pin
VeganFanatic25-Jun-10 16:11
VeganFanatic25-Jun-10 16:11 
GeneralRe: Exception Handling in C++ Pin
Aescleal25-Jun-10 20:17
Aescleal25-Jun-10 20:17 
GeneralRe: Exception Handling in C++ Pin
Stephen Hewitt27-Jun-10 18:13
Stephen Hewitt27-Jun-10 18:13 
GeneralRe: Exception Handling in C++ Pin
Aescleal28-Jun-10 6:09
Aescleal28-Jun-10 6:09 
GeneralRe: Exception Handling in C++ Pin
Stephen Hewitt28-Jun-10 15:00
Stephen Hewitt28-Jun-10 15:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.