Jump to content

Binding two files together...


Recommended Posts

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]

Link to comment
Share on other sites

$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]

Link to comment
Share on other sites

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]

Link to comment
Share on other sites

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]

Link to comment
Share on other sites

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]

Link to comment
Share on other sites

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]

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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]

Link to comment
Share on other sites

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]

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...