It is currently Sat Dec 16, 2017 7:45 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: How to make 1.exe extract main.exe and execute main.exe?
PostPosted: Mon Nov 20, 2017 8:20 am 
Offline
User
User

Joined: Mon Aug 31, 2009 2:11 pm
Posts: 34
I have a main.exe which need to have argument like following to execute.

Code:
C:\win\>main.exe www.client1.com licenseID1
osx$ ./main www.client1.com licenseID1


Is there anyway to make another 1.exe which holds main.exe. And when 1.exe is executed it extract the main.exe from it and pass the arguments?

_________________
-----
Registered PureBasic Coder.


Top
 Profile  
Reply with quote  
 Post subject: Re: How to make 1.exe extract main.exe and execute main.exe?
PostPosted: Mon Nov 20, 2017 10:08 am 
Offline
User
User

Joined: Mon Apr 10, 2017 6:17 pm
Posts: 35
shamun wrote:
I have a main.exe which need to have argument like following to execute.

Code:
C:\win\>main.exe www.client1.com licenseID1
osx$ ./main www.client1.com licenseID1


Is there anyway to make another 1.exe which holds main.exe. And when 1.exe is executed it extract the main.exe from it and pass the arguments?


Include the main.exe (for example into a datasection), then write the included second exe to ${tmp}/main.exe and execute it with the passed arguments. Keywords are WriteData, DataSection, IncludeBinary, RunProgram and ExamineEnvironmentVariables. The Problem is that some trojans try the same and therefore antivirus software might pick that up - either due to behaviour (disguising a hidden executable/payload) or by disallowing execution from ${TMP} completely.

So this might create more problems than you want longterm. I wont go into a technical explanation of how this could be avoided on a public forum.


Top
 Profile  
Reply with quote  
 Post subject: Re: How to make 1.exe extract main.exe and execute main.exe?
PostPosted: Mon Nov 20, 2017 10:18 am 
Offline
Always Here
Always Here

Joined: Fri Oct 23, 2009 2:33 am
Posts: 5695
Location: Wales, UK
Windows 10 itself will intercept the executable. Why would you need to do this anyway?

_________________
IdeasVacuum
If it sounds simple, you have not grasped the complexity.


Top
 Profile  
Reply with quote  
 Post subject: Re: How to make 1.exe extract main.exe and execute main.exe?
PostPosted: Mon Nov 20, 2017 10:26 am 
Offline
Enthusiast
Enthusiast

Joined: Sat Mar 02, 2013 9:17 am
Posts: 692
Bitplazer wrote:
The Problem is that some trojans try the same...

Maybe you should explain exactly why you want to do that !
The construction of such things hurt PB

_________________
http://www.nachtoptik.de - The home of Bucketfill_advanced (BF) and QUICK_AES_256


Top
 Profile  
Reply with quote  
 Post subject: Re: How to make 1.exe extract main.exe and execute main.exe?
PostPosted: Mon Nov 20, 2017 11:18 am 
Offline
Addict
Addict

Joined: Mon Feb 16, 2015 2:49 pm
Posts: 1038
As mentioned, running exes from %TEMP% will probably get your app flagged by anti-virus apps, but lots of legit products do exactly that from %TEMP% anyway, so it's hard to say for sure. Is there any reason your app can't just have the other exe in the same folder as the main app, and run it from there? Or just extract and run it from there, instead of %TEMP%.


Top
 Profile  
Reply with quote  
 Post subject: Re: How to make 1.exe extract main.exe and execute main.exe?
PostPosted: Mon Nov 20, 2017 2:19 pm 
Offline
User
User

Joined: Mon Aug 31, 2009 2:11 pm
Posts: 34
Automatically at midnight PB compiler in server (Windows, OSX) compiles executable file per client (in database lets say i have 500 client, 500 times compiles, and it creates 500 .exe files) where clients are unlimited.

To minimise that logic, i wanted to make main.exe and use a wrapper 1.exe. Where 1.exe will be only released per client which will have small footprint and main.exe wont be compiled anymore which is large in size and code complex involved.

FYI.

- AGENT1 in call center is connected with a client over telephone (PSTN/ISDN/VOIP)
- CLIENT ask and grant the AGENT1. Can you see my desktop, what am i doing wrong?
- AGENT1 says sure, go to our: https://www.government.site.gov/AGENT1

- AGENT1 shared link has a PureBasic midnight compiled .exe and .dmg file available
- CLIENT execute that link and open the PureBasic compiled executable file

- AGENT1 now see the screen of CLIENT. PureBasic compiled execute file exit after 15 seconds and kills itself

- Session ends

(My project goal is: i need to minimise that above process with 1.exe holding main.exe inside 1.exe)

_________________
-----
Registered PureBasic Coder.


Top
 Profile  
Reply with quote  
 Post subject: Re: How to make 1.exe extract main.exe and execute main.exe?
PostPosted: Mon Nov 20, 2017 5:34 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sun Sep 11, 2016 2:17 pm
Posts: 134
Why not just rewrite 'main.exe' and add some basic configuration (file) capabilities ?
Or just have uniq request links for each client...


Top
 Profile  
Reply with quote  
 Post subject: Re: How to make 1.exe extract main.exe and execute main.exe?
PostPosted: Tue Nov 21, 2017 10:40 am 
Offline
User
User

Joined: Mon Aug 31, 2009 2:11 pm
Posts: 34
What do you mean by unique request URL?

- Suppose i have 500 rows, i make 500 .exe in server (disk space reserved)? Currently i am doing this because i had no choice
- Or you mean get argument via URL and then compile main.exe (one time only and distribute it, instead of keeping it 500 times) ?

_________________
-----
Registered PureBasic Coder.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 15 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye