Compile .cpp from .exe on any computer

Oct 28, 2010 at 4:33am
closed account (NAXz3TCk)
Hey guys,

I am trying to run a program that will generate another program. I know a fair amount of c++, so please do not be mean. Anyway, I am thinking that I could use something like this...

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include <iostream>
using namespace std;
#include <windows.h>


void createFile();

int main()
{
	createFile();

	system("To Compile the program");

	return 0;
}

void createFile()
{
	FILE *OUTPUT_FILE = fopen("other.cpp", "a+");

		fprintf( OUTPUT_FILE, "All of the code of the file, but replacing the user input." );
		fclose(OUTPUT_FILE);

}


I am not sure how I would make sure that the client had all of the correct libraries and compilers and stuff. Is there another way of making the .exe? Although I am not promoting keylogging, there is a program called Ardamax Keylogger that creates a custom .exe. I am really curious as to how I would be able to accomplish that kind of program.

Thank you guys in advanced!
Freddie

P.S. If the admin of the website read this, THANK YOU SO MUCH. This site has been my lifeline in my c++ course at school. It is organized and very detailed. Thank you!
Oct 28, 2010 at 5:37am
whoops, hehe sorry bout thte lack of a link.

Yay.

Also depending on what you want to keylog, and how, contact me and I maaaaay help. If you satisfy me that your reasoning is good and you won't get into any mischief and you won't go spreading my code around.
Last edited on Oct 29, 2010 at 6:37pm
Oct 28, 2010 at 9:31am
What compiler are you using?
Oct 28, 2010 at 12:54pm
closed account (NAXz3TCk)
@kbw

I am using the c++ visual studio 2010

@ultifinitus

Thank you for the offer, I will PM you.
Oct 28, 2010 at 12:56pm
closed account (NAXz3TCk)
@ultifinitus
Actually, I guess I cannot PM you. Do you have an email?
Oct 28, 2010 at 6:58pm
pretty easy: ultifinitus@gmail.com
Oct 30, 2010 at 12:38am
He's not trying to write a keylogger nor is his compiler of any relevance. He's trying to write a program which will transliterate C++ code into byte-code which is what a compiler does.

With all due respect, I think this project is too difficult for you and I'd recommend picking up an easier project. That being said, if you want to continue with this, here's a link:

http://www.penguin.cz/~literakl/intel/intel.html
Oct 30, 2010 at 2:38am
closed account (S6k9GNh0)
I know a fair amount of c++, so please do not be mean. Anyway, I am thinking that I could use something like this...

system("To Compile the program");


good game
Oct 30, 2010 at 4:37am
Make a sub program (the one that should be generated). Then make another program (the main program) and add the sub program as a resource.


I hope that helps.
Oct 30, 2010 at 4:58am
Kiana
He's not trying to write a keylogger


He was, actually. However that's beside the point and he's actually talking about the linking phase.
Oct 31, 2010 at 4:46am
The keylogger was his example - he wanted to mimic how it could spawn separate programs.
Oct 31, 2010 at 5:35am
He emailed me.
Oct 31, 2010 at 8:25am
Haha, you win.
Topic archived. No new replies allowed.