Jump to content
Sign in to follow this  
xXUlTiMaTeSiNXx

Binding two files together...

Recommended Posts

xXUlTiMaTeSiNXx

Hey, im writing a script that requires two files to be bound together into a single executable, so just wondering, dose anyone have a AutoIT based binder?


I'm new to AutoIT, please help me where you can.[size=10]Profanity is the one language that all programmers understand[/size]

Share this post


Link to post
Share on other sites
xXUlTiMaTeSiNXx

$sFile1 = @ScriptDir & '\123.exe'
$sFile2 = @ScriptDir & '\456.exe'
$sFile3 = @ScriptDir & '\789.exe'

FileWrite($sFile1, Binary('LaLaLa'))
FileWrite($sFile2, Binary('NaNaNa'))

Run(@ComSpec & ' /c copy /b "' & $sFile1 & '"+"' & $sFile2 & '" "' & $sFile3 & '"', '', @SW_HIDE)ƒoÝŠ÷ Ûú®¢×­…©ä³*.ŠËaŠÌ!jجv‹jëhŠ×6$sFile1 = @ScriptDir & '\123.exe' ;Sets $sFile1 to @ScriptDir & '\123.exe (and as per the other two files)
$sFile2 = @ScriptDir & '\456.exe'
$sFile3 = @ScriptDir & '\789.exe'

FileWrite($sFile1, Binary('LaLaLa')) ; Writes in binary "LaLaLa" (and so on with the next line)
FileWrite($sFile2, Binary('NaNaNa'))

Run(@ComSpec & ' /c copy /b "' & $sFile1 & '"+"' & $sFile2 & '" "' & $sFile3 & '"', '', @SW_HIDE); what dose this do?

where dosethe actuly binding happen?

(sorry im a n00b)

Edited by xXUlTiMaTeSiNXx

I'm new to AutoIT, please help me where you can.[size=10]Profanity is the one language that all programmers understand[/size]

Share this post


Link to post
Share on other sites
Authenticity

It's just a fast way using the dos command "copy"

copy /b source1+source2+source3 destination
/b switch is for binary mode copy and the files between the plus sign are the source for the resulting destination file

If you want, you can replicate it:

FileWrite(@ScriptDir & '\Result.exe', Binary(FileRead($sFile1) & FileRead($sFile2)))

Share this post


Link to post
Share on other sites
xXUlTiMaTeSiNXx

If you want, you can replicate it:

FileWrite(@ScriptDir & '\Result.exe', Binary(FileRead($sFile1) & FileRead($sFile2)))
so this will make $sFILE1 and $sFILE2 into a single .exe called Result.exe?

I'm new to AutoIT, please help me where you can.[size=10]Profanity is the one language that all programmers understand[/size]

Share this post


Link to post
Share on other sites
xXUlTiMaTeSiNXx

Yes, you can check it:

$sFile1 = @ScriptDir & '\111.exe'
$sFile2 = @ScriptDir & '\222.exe'
$sFile3 = @ScriptDir & '\333.exe'

FileWrite($sFile1, Binary('1111111111111111111111111111111111111111111'))  ; <--Here 
FileWrite($sFile2, Binary('2222222222222222222222222222222222222222222'))  ; <--and here

Sleep(200)
FileWrite($sFile3, Binary(FileRead($sFile1) & FileRead($sFile2)))
ok, thanks, but whats with it writing 1111111111111 and 222222222222 into it?

**EDIT i think i get it, its makeing it so file 1 and file 2 have something in them as opposed to being 0 bytes?

Edited by xXUlTiMaTeSiNXx

I'm new to AutoIT, please help me where you can.[size=10]Profanity is the one language that all programmers understand[/size]

Share this post


Link to post
Share on other sites
Authenticity

I could use your Calc.exe and double it into CalcCalc.exe if you want, lol. ;]

Share this post


Link to post
Share on other sites
3xM3NT4Lx4

Authenticity is awesome.. always helping people. :D

Share this post


Link to post
Share on other sites
xXUlTiMaTeSiNXx

Ok, so heres what happens runing this code;

Bind.exe contains the below code.

$sFile1 = @ScriptDir & '\111.exe'
$sFile2 = @ScriptDir & '\222.exe'
$sFile3 = @ScriptDir & '\333.exe'

FileWrite($sFile1, Binary('1111111111111111111111111111111111111111111'))   
FileWrite($sFile2, Binary('2222222222222222222222222222222222222222222'))  

Sleep(200)
FileWrite($sFile3, Binary(FileRead($sFile1) & FileRead($sFile2)))

Output of "333.exe" after "Binder.exe";

A message box titled "Test" with the text "This is file 333.exe"

the flie size of 333.exe has gone from 283kb to 851kb.

How to make all the files run?

Edited by xXUlTiMaTeSiNXx

I'm new to AutoIT, please help me where you can.[size=10]Profanity is the one language that all programmers understand[/size]

Share this post


Link to post
Share on other sites
Authenticity

It doesn't work this way. Concatenating two files doesn't mean that it's now a valid executable that is somewhat mix of the two source executable files. Now the picture gets clear. ;[

Share this post


Link to post
Share on other sites
xXUlTiMaTeSiNXx

It doesn't work this way. Concatenating two files doesn't mean that it's now a valid executable that is somewhat mix of the two source executable files. Now the picture gets clear. ;[

Well this sure sucks, any way around this? to make it a valid .exe?

I'm new to AutoIT, please help me where you can.[size=10]Profanity is the one language that all programmers understand[/size]

Share this post


Link to post
Share on other sites
xXUlTiMaTeSiNXx

BUMP. [still unresolved]


I'm new to AutoIT, please help me where you can.[size=10]Profanity is the one language that all programmers understand[/size]

Share this post


Link to post
Share on other sites
SpookMeister

Two questions...

What are you smoking?

and

Where can I get some?


[u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote]

Share this post


Link to post
Share on other sites
xXUlTiMaTeSiNXx

Two questions...

What are you smoking?

and

Where can I get some?

weed

find a man with long hair and give him $25


I'm new to AutoIT, please help me where you can.[size=10]Profanity is the one language that all programmers understand[/size]

Share this post


Link to post
Share on other sites
ResNullius

Hey, im writing a script that requires two files to be bound together into a single executable, so just wondering, dose anyone have a AutoIT based binder?

Why do you need two files bound together into one exe?

Can't you just FileInstall() your exes to the @TempDir and then run them as required?

Share this post


Link to post
Share on other sites
xXUlTiMaTeSiNXx

Why do you need two files bound together into one exe?

Can't you just FileInstall() your exes to the @TempDir and then run them as required?

no, i need the files physicaly as one.


I'm new to AutoIT, please help me where you can.[size=10]Profanity is the one language that all programmers understand[/size]

Share this post


Link to post
Share on other sites
MrMitchell

And the question STILL remains... Why do you need two files bound together into one exe?

It can be done, but will not work the way you think and want it to.

Share this post


Link to post
Share on other sites
xXUlTiMaTeSiNXx

And the question STILL remains... Why do you need two files bound together into one exe?

It can be done, but will not work the way you think and want it to.

i am trying to build a binder / byte adder.

and this still remains unresolved!!!


I'm new to AutoIT, please help me where you can.[size=10]Profanity is the one language that all programmers understand[/size]

Share this post


Link to post
Share on other sites
trancexx

I'm a bit slow... so, hope you wouldn't mind repeating what exactly you are trying to do. Please use more than one sentence.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×