LebGeeks

A community for technology geeks in Lebanon.

You are not logged in.

#1 January 15 2015

Johnaudi
Member

An automated compiling system

Hey guys,

I've recently purchased a Cloud Windows Server (2012) for a commercial reason, and I am wondering if I will be able to do the following with just simple actions:

I have a C# project on VS2013, what I'm opting to do is take that project and set it on the server (with a compiler).
There will be a listener app in the background, checking if someone purchased something on the website, and this will save a text file containing a string (or more).

Now this is what I'm trying to do, am I able to make a program that will auto-compile the code with a different string (the string saved in the file) automatically? In other words, am I able to send a cmd-like command to compile my custom-edited code into a EXE?

After the EXE will be generated, it will reply back with an email giving him a link to download that EXE for the next 48 hours before it gets deleted. (seems easy to do)

I don't want raw code, I just want to know the method I can create such an automated system in C#.

Thanks in advance.

Offline

#2 January 15 2015

Johnaudi
Member

Re: An automated compiling system

Note: I am trying to avoid using a keyboard/mouse macro to do this, as it isn't precise at all and may cause failures.

Offline

#3 January 15 2015

NoReGreT
Member

Re: An automated compiling system

You can do whatever you want. The .NET compilers are usually command line applications, you can find them at

%windir%\Microsoft.NET\FrameWork\<framework version>

e.g

%windir%\Microsoft.NET\FrameWork\v4.0.30319\csc.exe

For .NET 4

But I do not understand the idea behind it, why do you want to hard code a certain string in an executable? why not put it in a config file for example...

Offline

#4 January 15 2015

Johnaudi
Member

Re: An automated compiling system

It's for Computer-Identification purposes, as well as a serial integration and other reasons as well. The code will be obfuscated so they don't decode it and change that string easily.

Maybe I would be able to change that string my altering the Form.cs and then compile it?

Offline

#5 January 15 2015

NoReGreT
Member

Re: An automated compiling system

Well, if your executable will be the same and just have a different string, you can patch the binary on the fly and write the new string and replace it with the default one. Assuming it is allocated on the stack of course. Your idea will work too, but you should consider its security implications.

Offline

#6 January 16 2015

BashLogic
Member

Re: An automated compiling system

Why dont you stitch instead of compiling?

Offline

#7 January 16 2015

xterm
Moderator

Re: An automated compiling system

You need to rephrase your question. You'd get a better answer if you tell us what you're trying to do instead of how you're trying to do it.

Otherwise, NoReGreT gave you the right answer, you can use the command line tools to compile your application.

Offline

#8 January 16 2015

Johnaudi
Member

Re: An automated compiling system

Here's what I am currently selling: http://www.elitepvpers.com/forum/dayz-t … cuter.html

This is being compiled individually with every person's UID/Machine name to prevent the Anti-Cheat to detect it (it creates a random hash), and I'm also obfuscating the code with ExConfuser so will not be able to decompile it and steal its source.

Since I've been having lots of requests on Skype (more than 200) it is being way too time consuming for me, so I purchased a Windows Server to compile it, obfuscate it, and then send it to the client.
Didn't want to share at first glance though.

Offline

#9 January 16 2015

Joe
Member

Re: An automated compiling system

You may want to read this stackoverflow thread

Offline

#10 January 16 2015

Johnaudi
Member

Re: An automated compiling system

Joe wrote:

You may want to read this stackoverflow thread

Even though it's a good idea, but this is not exactly what I'm opting for. Looking if we can find a solution, and I will test the way the first post has suggested soon enough.

Offline

Board footer