Jump to content

Exe Binder


nocow
 Share

Recommended Posts

Hi this is my first post of source that i made, i hope you like it, but remember its a beta and i haven't got the time for error finding.

Q. What does this do?

A. Take diffence files(plain text aswells as binary) and save the information in the end of the file.

FX, take 'hello.txt' and 'foo.txt' intro the exectute will make at the end this code

hello.txt|15|text from hellofoo.txt|13|text from foo¥""""here some numbers""""

The simply thing it does is to find the last 7 chars in the, then check the first one if its ascii(190) and if its so then it take the last 6, that is the zero for the file when it got made the normaly end of the file and the program go find that, then it start see that there is a hello.txt and there is 15bytes to write to it and they are "text from hello" next it find foo.txt etc etc etc

I know many of ya guys will say this is some shit to make becuase it can use to a exe infecter, but it can also be used as a good thing, i wanted to make a Install shell, i know it wont be very good when its a high lvl language but it will still be fun...

Now im asking YOU! :) how could I improve this, i know there is many things there could be done in a more easy way, but im n00bie and still learning.

Soz for my bad english.

Regards

EDIT: Remove button does not work yet

exebinder.au3

Edited by nocow
Link to comment
Share on other sites

Nope when the file is compiled you can run it and then include files after, with no need for Autoit or for see the source code. I will inbuild some small scripting so you can say if its shall automatic install a place, or summat will be like a when you use InstallShell or Winrar/winzip to make your files join one executeable and then it can unpack them

Link to comment
Share on other sites

  • Moderators

70views and one reply? that suck nobody like my program?, i guess nobody dont even hate the code :)

I think most of us are still wondering what it does "Exactly".

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Hi,

me, too. I tried it. Prints out success, but running the exe - nothing happens. Maybe I have to look a bit closer to the source to get what it shall do.

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

Hmm.. seems like a way to embed (though not (yet) encrypt, nor hide) files inside an excecutable...

; By NoCow (a few bits by mu)
#include <GUIConstants.au3>
#Include <GuiList.au3>

;$file = Fileopen(@autoitexe,0)
;$filesize = FileGetSize(@autoitexe)
;
$file = FileOpenDialog("Pick an exe to inject files into",-1,"Executable files(*.exe)",1)
$filesize = FileGetSize($file)
fileread($file,$filesize - 7)
$Thedata = fileRead($file,7)
FileClose($file)

if stringleft($Thedata,1) = chr(190) then
    $Thedata = Number(stringright($Thedata,6))
    ;$file = Fileopen(@autoitexe,0)
    $file = FileOpen($file ,0)
    Fileread($file,$thedata)
    $folder = FileSelectFolder("Save All Files To What Folder?",@scriptdir)
    $TheData = FileRead($file,$filesize - $thedata - 7)

    while stringlen($TheData) > 1
        $len = _StringFindUntil($TheData,"|")
        $temp = FileOpen($folder & "/" & StringLeft($TheData,$len),1)
        $TheData = StringTrimLeft($TheData,$len + 1)
        $lentowrite = stringleft($TheData,_StringFindUntil($TheData,"|"))
        $TheData = StringTrimLeft($TheData,StringLen($lentowrite) + 1)
        FileWrite($temp,stringleft($TheData,number($lentowrite)))
        $TheData = StringTrimLeft($TheData,number($lentowrite))
        FileClose($temp)
    wend
else
    $Form1 = GUICreate("Application Injector", 297, 180, 199, 117)
    $Compile = GUICtrlCreateButton("Compile Application", 16, 136, 265, 33)
    $TheFileList = GUICtrlCreateList("", 16, 8, 265, 97)
    $Add = GUICtrlCreateButton("Add files", 152, 112, 129, 17)
    $Remove = GUICtrlCreateButton("Remove Selected", 16, 112, 129, 17)

    GUISetState(@SW_SHOW)

        while 1
        $msg = GuiGetMsg()

        select
            case $msg = $Add
                $temp = FileOpenDialog("Add file",-1,"All files(*.*)",1)
                GUICtrlSetData($TheFileList,$temp)

            case $msg = $GUI_EVENT_CLOSE
                exitloop

            case $msg = $Compile
                $newfile = FileSaveDialog("Where to save EXE file?",-1,"exe files (*.exe)", 16, "injected.exe")
                FileDelete($newfile)
                ;FileCopy(@AutoitExe,$newfile)
                FileCopy($file,$newfile)
                $file = FileOpen($newfile,1)
                for $i = 0 to  _GUICtrlListCount($TheFileList) -1
                    $temp = _GUICtrlListGetText ($TheFileList,$i)
                    $temp1 = FileOpen($temp,0)
                    $Thedata = FileRead($temp1,FileGetSize($temp))
                    FileClose($temp1)
                    $temp2 = StringSplit($Temp,"\")
                    FileWrite($file,$temp2[ubound($temp2)-1] & "|" & Stringlen($thedata) & "|" & $thedata)
                next
                FileWrite($file,chr(190) & $filesize)
                Fileclose($file)
                msgbox(0,0,"Finish")
            
            case $msg = $remove ; remove an item from a single selection list..
                $selected_array = _GUICtrlListGetSelItemsText($TheFileList)
                if not IsArray($selected_array) then continueloop
                _GUICtrlListDeleteItem($TheFileList, _GUICtrlListFindString($TheFileList, $selected_array[1]))
        endselect
    wend
    exit
endif


func _StringFindUntil($thestr,$too)
    for $i = 1 to StringLen($thestr)
        if Stringmid($thestr,$i,StringLen($too)) = $too then return $i -1
    next
    return 0
endfunc

This is rather cool, nocow, though I still haven't thought of any really useful applications yet, I did embed two hardcore gay pornographic images and a copy of Main Kampf into Disney Paint Studio, so the code is certainly worthwhile.

I switched the fixed app reference to a dialog (and fixed them up a bit), so you can choose which exe to inject files into. I also filled in the missing remove function while I was at it, probably lowered the case of keywords, I have a macro somewhere that just does that :)

I'll use this code again.

Perhaps inject some Linux kernel code into a copy of explorer.exe, just for fun.

-mu

Link to comment
Share on other sites

Ah! Thanks for supplying the source code.

It is for injecting data into an exe.

You can extract the data from the exe using this application.

No use I can see except for filestorage.

#)

Link to comment
Share on other sites

Soz for the long reply i have some troubles in Real Life,

The app is simple first check if some are bound to the end of the files, if yes it takes the information and do what it there stand, if nothing are bound to the end it make a option that you can add data(in this case files) to the end of the file for later it will execute them. Like a Installshell, it can simple be made to exe infector i will work on that when i got time but i got big troubles in Real life so i dont have a computer to work on.

How this work?

@1 Compile the code(not run but compile)

@2 Start it choose files you want to append to the bound of the new file

@3 choose the name of the new execute able file

@4 Start the new program and it ask you where to install the files

This is a SIMPLE way to store multiply files in one single file.

I hope i explained okay this time, im bad at explain in english even through i can read it.

Regards

Link to comment
Share on other sites

Soz for the long reply i have some troubles in Real Life,

Like a Installshell, it can simple be made to exe infector i will work on that when i got time but i got big troubles in Real life so i dont have a computer to work on.

It really sounds like you are making a file infector. This is not something that is popular in my neck of the woods. :)

Save you some work: read the Help file about the FileInstall facility - it probably does what you are describing. You'll save your parole officer some heartburn and they will let you near a computer some time soon!

Link to comment
Share on other sites

lol its not like FileInstall it compile the file with it self when it is executed like a compiler. DUH so hard to explain, it can be used to a exeinfector yes, but also to a new scripting language, or a installshell to have multiply files in WHEN IT HAVE BEEN COMPILE

Link to comment
Share on other sites

Okay, here is what I got from this: the program can write/read data to the end of an exe. This could come in handy if you wrote and compiled a script that would store settings inside itself (instead of an INI) so even if you stopped running the program the settings would still be there. Nice!

EDIT:

I just tried mu's modification, now working on my own...

Edited by erifash
Link to comment
Share on other sites

So now we're into self modifying executable files are we? See how long that would last in any self respecting anti-virus environment that fingerprints executable files - oh yeah, about a nanosecond...

Bad, bad idea.

Link to comment
Share on other sites

I hadn't thought of that. But then again, there are no stupid people using this computer, so I've never had need of an anti-virus.

Modern firewalls do a similar thing; fingerprinting executables; but they generally ask the user about any changes they find. Mine also has a "changes often" option, surely most do, otherwise developing network applications would be a real pain in the ass, wouldn't it?

The idea is good (I'm not even sure there's such a thing as a "bad idea").

It's the implementation that matters.

-mu

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

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