Read an executable and write the data to a file.
-
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?
Please be clear what you are asking.
ALLERSLIT wrote:
i can read the data of a file so i can paste it to another file?
cmd.exe is not a file to be read from, it's an executable.
I know the language. I've read a book. - _Madmatt
-
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?
I believe we are going to need more details about what you want to do...till now it sounds like you either want to read file data to the clipboard to paste it somewhere OR you need a filecopy method (like copy in a dos prompt).
> The problem with computers is that they do what you tell them to do and not what you want them to do. < > "It doesn't work, fix it" does not qualify as a bug report. < > Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <
-
Please be clear what you are asking.
ALLERSLIT wrote:
i can read the data of a file so i can paste it to another file?
cmd.exe is not a file to be read from, it's an executable.
I know the language. I've read a book. - _Madmatt
-
I believe we are going to need more details about what you want to do...till now it sounds like you either want to read file data to the clipboard to paste it somewhere OR you need a filecopy method (like copy in a dos prompt).
> The problem with computers is that they do what you tell them to do and not what you want them to do. < > "It doesn't work, fix it" does not qualify as a bug report. < > Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <
-
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?
Are you asking how to find executable code inside a program and copy it to another file, in order to run it? If so, you have to learn the structure of the program.
-
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?
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....
-
and an ice cube is water. What's your point?
I know the language. I've read a book. - _Madmatt
-
and an ice cube is water. What's your point?
I know the language. I've read a book. - _Madmatt
-
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?
You already asked this question (although in a slightly different way) here[^]. Reading the contents of an executable file and writing it somewhere else is the same as reading and writing any file; files are composed of bytes and bytes are bytes are bytes. In either case your objective is not clear, try rewording your question to clarify what problem you are actually trying to solve.
It's time for a new signature.
-
I want to create a program out of a program. We all have a cmd.exe in our windows folder, how would i be able to create the cmd.exe out of my own program?
What would your program do?
> The problem with computers is that they do what you tell them to do and not what you want them to do. < > "It doesn't work, fix it" does not qualify as a bug report. < > Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <