Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Include virtually any file in a script (exe/zip/dll/etc....)


  • Please log in to reply
49 replies to this topic
noname
  • Members
  • 650 posts
  • Last active:
  • Joined: 12 Nov 2011

This is the code i am using from Robert Eding:

SetBatchLines -1
#NoEnv
;Created by Robert Eding: [email protected]
;Current version 2.6

Loop
{
	FileSelectFile, From_File,,, Select file to convert.
	
	IfNotExist, %From_File%
	{
		MsgBox, 1,, Error! invalid file.
		IfMsgBox Ok
		{
			From_File := "" 
			Continue
		}
		IfMsgBox Cancel
			ExitApp
	} else
		Break
}

InputBox, T_Function_Name, Please enter a name for the recreate function.
If (T_Function_Name = "")
	ExitApp
Extract_%T_Function_Name% = If you see this you entered a invalid function name.

E := Convert_File(From_File, T_Function_Name)

If (E)
	MsgBox Error converting file: %E%


Convert_File(_From_File, _Function_Name, _SplitLength = 16000)
{
	ST1 := A_TickCount
	, Ptr := A_IsUnicode ? "Ptr" : "UInt"
	, H := DllCall("CreateFile", Ptr, &_From_File, "UInt", 0x80000000, "UInt", 3, "UInt", 0, "UInt", 3, "UInt", 0, "UInt", 0)
	, VarSetCapacity(FileSize, 8, 0)
	, DllCall("GetFileSizeEx", Ptr, H, "Int64*", FileSize)
	, DllCall("CloseHandle", Ptr, H)
	, FileSize := FileSize = -1 ? 0 : FileSize
	
	If (!FileSize)
		Return -1
	If (_SplitLength < 65)
		_SplitLength := 65
	
	SplitPath, _From_File, F_Name, F_Directory, F_Extension
	
	Needed_Capacity := Ceil((FileSize * 1.38) + (((FileSize * 1.38) / _SplitLength) * 15) + (5 * 1024))
	, VarSetCapacity(Bin_D, A_IsUnicode ? Needed_Capacity * 2 : Needed_Capacity)
	
	, Bin_D .= _Function_Name "_Get(_What)`r`n"
	, Bin_D .= "{`r`n"
	, Bin_D .= A_Tab "Static Size = " FileSize ", Name = """ F_Name """, Extension = """ F_Extension """, Directory = """ F_Directory """`r`n"
	, Bin_D .= A_Tab ", Options = ""Size,Name,Extension,Directory""`r`n"
	, Bin_D .= A_Tab ";This function returns the size(in bytes), name, filename, extension or directory of the file stored depending on what you ask for.`r`n"
	, Bin_D .= A_Tab "If (InStr("","" Options "","", "","" _What "",""))`r`n"
	, Bin_D .= A_Tab A_Tab "Return %_What%`r`n}`r`n"
	, Bin_D .= "`r`n"
	, Bin_D .= "Extract_" _Function_Name "(_Filename, _DumpData = 0)`r`n"
	, Bin_D .= "{`r`n"
	
	, H := DllCall("CreateFile", Ptr, &_From_File, "UInt", 0x80000000, "UInt", 3, "UInt", 0, "UInt", 3, "UInt", 0, "UInt", 0)
	, VarSetCapacity(InData, FileSize, 0)
	, DllCall("ReadFile", Ptr, H, Ptr, &InData, "UInt", FileSize, "UInt*", 0, "UInt", 0)
	, DllCall("Crypt32.dll\CryptBinaryToString" (A_IsUnicode ? "W" : "A"), Ptr, &InData, UInt, FileSize, UInt, 1, UInt, 0, UIntP, Bytes, "CDECL Int")
	, VarSetCapacity(OutData, Bytes *= (A_IsUnicode ? 2 : 1))
	, DllCall("Crypt32.dll\CryptBinaryToString" (A_IsUnicode ? "W" : "A"), Ptr, &InData, UInt, FileSize, UInt, 1, Str, OutData, UIntP, Bytes, "CDECL Int")
	, ET1 := A_TickCount
	, NumPut(0, OutData, VarSetCapacity(OutData) - (A_IsUnicode ? 6 : 4), (A_IsUnicode ? "UShort" : "UChar")) ;Removes the final "`r`n" that gets auto added to the string
	, VarSetCapacity(InData, FileSize, 0)
	, VarSetCapacity(InData, 0)
	
	, Bin_D .= A_Tab ";This function ""extracts"" the file to the location+name you pass to it.`r`n"
	, Bin_D .= A_Tab "Static HasData = 1, Out_Data, Ptr, ExtractedData`r`n"
	, N := 1, I := 0
	, Bin_D .= A_Tab "Static " N ++ " = """
	
	Loop, Parse, OutData, `n, `r
		If (I + 64 > _SplitLength)
			Bin_D .= """`r`n	Static " N ++ " = """, I := 0
			, Bin_D .= A_LoopField, I += 64
		Else
			Bin_D .= A_LoopField, I += 64
	
	If (I != 0)
		Bin_D .= """`r`n"
	If (N != 1)
		N --
	
	Bin_D .= A_Tab "`r`n"
	, Bin_D .= A_Tab "If (!HasData)`r`n"
	, Bin_D .= A_Tab A_Tab "Return -1`r`n"
	, Bin_D .= A_Tab "`r`n"
	, Bin_D .= A_Tab "If (!ExtractedData){`r`n"
	, Bin_D .= A_Tab A_Tab "ExtractedData := True`r`n"
	, Bin_D .= A_Tab A_Tab ", Ptr := A_IsUnicode ? ""Ptr"" : ""UInt""`r`n"
	, Bin_D .= A_Tab A_Tab ", VarSetCapacity(TD, " Ceil(FileSize * 1.37) " * (A_IsUnicode ? 2 : 1))`r`n"
	, Bin_D .= A_Tab A_Tab "`r`n"
	, Bin_D .= A_Tab A_Tab "Loop, " N "`r`n"
	, Bin_D .= A_Tab A_Tab A_Tab "TD .= %A_Index%, "
	If (_SplitLength < 4096)
		Bin_D .= "VarSetCapacity(%A_Index%, 0)`r`n"
	Else
		Bin_D .= "%A_Index% := """"`r`n"
	, Bin_D .= A_Tab A_Tab "`r`n"
	, Bin_D .= A_Tab A_Tab "VarSetCapacity(Out_Data, Bytes := " FileSize ", 0)`r`n"
	, Bin_D .= A_Tab A_Tab ", DllCall(""Crypt32.dll\CryptStringToBinary"" (A_IsUnicode ? ""W"" : ""A""), Ptr, &TD, ""UInt"", 0, ""UInt"", 1, Ptr, &Out_Data, A_IsUnicode ? ""UIntP"" : ""UInt*"", Bytes, ""Int"", 0, ""Int"", 0, ""CDECL Int"")`r`n"
	, Bin_D .= A_Tab A_Tab ", TD := """"`r`n"
	, Bin_D .= A_Tab "}`r`n"
	, Bin_D .= A_Tab "`r`n"
	, Bin_D .= A_Tab "IfExist, %_Filename%`r`n"
	, Bin_D .= A_Tab A_Tab "FileDelete, %_Filename%`r`n"
	, Bin_D .= A_Tab "`r`n"
	, Bin_D .= A_Tab "h := DllCall(""CreateFile"", Ptr, &_Filename, ""Uint"", 0x40000000, ""Uint"", 0, ""UInt"", 0, ""UInt"", 4, ""Uint"", 0, ""UInt"", 0)`r`n"
	, Bin_D .= A_Tab ", DllCall(""WriteFile"", Ptr, h, Ptr, &Out_Data, ""UInt"", " FileSize ", ""UInt"", 0, ""UInt"", 0)`r`n"
	, Bin_D .= A_Tab ", DllCall(""CloseHandle"", Ptr, h)`r`n"
	, Bin_D .= A_Tab "`r`n"
	, Bin_D .= A_Tab "If (_DumpData)`r`n"
	, Bin_D .= A_Tab A_Tab "VarSetCapacity(Out_Data, " FileSize ", 0)`r`n"
	, Bin_D .= A_Tab A_Tab ", VarSetCapacity(Out_Data, 0)`r`n"
	, Bin_D .= A_Tab A_Tab ", HasData := 0`r`n"
	, Bin_D .= "}`r`n"
	, ET2 := A_TickCount
	
	MsgBox, 0x4, Conversion Finished, % "Conversion Finished.`n`nTook " Round((ET1 - ST1)/1000, 3) " seconds to convert the file and " Round((ET2 - ET1)/1000, 3) " seconds to format the functions.`n`nWould you like to save the functions as " Function_Name ".ahk in the scripts current directory?"
	IfMsgBox, Yes
	{
		IfExist, %A_ScriptDir%\%_Function_Name%.ahk
		{
			FileExists := 1
			Msgbox, 0x4, File Already Exists,Error! %A_ScriptDir%\%_Function_Name%.ahk`n`nFile already exists. Do you want to overwrite it?
			IfMsgBox, Yes
			{
				FileDelete, %A_ScriptDir%\%_Function_Name%.ahk
				FileExists := 0
			}
		}
		
		If (!FileExists)
		{
			If A_IsUnicode
				FileAppend, %Bin_D%, *%A_ScriptDir%\%_Function_Name%.ahk, UTF-8
			Else
				FileAppend, %Bin_D%, *%A_ScriptDir%\%_Function_Name%.ahk
		}
	}
	MsgBox, 0x4, Conversion Finished, % "Conversion Finished.`n`nTook " Round((ET1 - ST1)/1000, 3) " seconds to convert the file and " Round((ET2 - ET1)/1000, 3) " seconds to format the function.`n`nWould you like to copy the functions to the clipboard?"
	IfMsgBox, Yes
		Clipboard := Bin_D
}

winXP  and ahk unicode


Rseding91
  • Members
  • 703 posts
  • Last active: Apr 02 2016 05:05 AM
  • Joined: 07 Jun 2010

Sorry about that... I fixed the download link. I apparently pointed it at another one of my scripts.



Skrell
  • Members
  • 384 posts
  • Last active: Jul 07 2016 05:03 PM
  • Joined: 23 Aug 2011

Thanks everyone for this scripts excellent source code and for Rseding for making it! :)



Sam.
  • Members
  • 107 posts
  • Last active: Jul 15 2017 04:06 PM
  • Joined: 14 Nov 2008

There is a bug in the v2.6 version (linked to in the 1st post) of this script when run with AHK_L ANSI. Here is how to reproduce:

  • Download the AHK header logo PNG at the top of this forum: ahk_logo_ipb.png
  • Download "Include file.ahk" v2.6 linked to in the 1st post.
  • Run this script using the latest version of AHK_L ANSI, and select the PNG from step 1.
  • When prompted, choose to "save the functions as .ahk in the scripts current directory".
  • Repeat steps 3 and 4, except this time run the script using a Unicode version of AHK_L (either Unicode or x64).
  • Compare the two files, and note that they are different at the very end of Static 1 (the ANSI version is missing a "=").

When these extraction functions are called, regardless of which version of AHK_L is used to run them (ANSI, Unicode, or x64), the version created in steps 3 and 4 (using ANSI) results in a very corrupted file, whereas the version created in step 5 (using Unicode or x64) results in a file identical to the original. This scenario is the same for all input files I have tried.

For reference, there is the function created using AHK_L ANSI:

logo_Get(_What)
{
	Static Size = 7372, Name = "ahk_logo_ipb.png", Extension = "png", Directory = "C:\Users\user\Desktop\Delete Me\Include Virtually Any File in a Script (testing)"
	, Options = "Size,Name,Extension,Directory"
	;This function returns the size(in bytes), name, filename, extension or directory of the file stored depending on what you ask for.
	If (InStr("," Options ",", "," _What ","))
		Return %_What%
}

Extract_logo(_Filename, _DumpData = 0)
{
	;This function "extracts" the file to the location+name you pass to it.
	Static HasData = 1, Out_Data, Ptr, ExtractedData
	Static 1 = "iVBORw0KGgoAAAANSUhEUgAAAK8AAABACAYAAABsgCciAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNui8sowAABxGSURBVHic7Z1rkGRHld9/J++9VdVd1Y95aWY0I0ajFwgWAWZBko3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Y8ajUap0+mYHq5nRKZ97sSB3neFTmCYTLNiXBCEyejoSFyr1X5xz1e/+nWnehCA8y9xOvXLVHkv/ieGuZMhc48K/iD0CWAMnzldel6DxNbG8eexyOxNv1+BBGgDC0ADaGXXqPZvIZY9V4Yc+aEBDYECMAmM4rllS3T5MnJ225mlsiyGSdv1/E6AOp5rC+gAARBrj6ZI+QKYvCTiyP0GL9MyMI7n3MtzI8kUulwtnlsNz7eRXa+qCWRp/X/zTxwH/zrmudGQmUMxndoMdqEKNlUOE1EYMwQFyIIARJZrjGceeefQA1UlrjtcomBiojGLUSWugeso/gH047JrE7ZfHnD0MZibTrCNDrYe4tkYTDGkMCpIKN1OaQ3lOYynGLBtR9z0y4emEBONWmzTkdR93MZAF6f1Z5HX/0FCqRRy7PEOrUZMUm9AO2vwAVElJCiBGEHdxpCpoMRNJek4wBKNJUjgsDWwTeiRaV8OAznvMtj7GwGzvzQ8910Y222IRoTmSYMmrIvSLgVBKUwKIxM+eiMsOmxHmf2V0q4mwKA8+2/f+QrY+Q9CDn1HaMwI2y4V4obQWTBekKyt0i4FdRCEyuh5QlBIfU3iaM06qoeVxG/tWIqrvOI6KO4x1J8PePrbUBgXytsMzTnBdjLbbePINBwRRncIqMOEik2U6mFL44TDj6T55X0ZJPTY3wFYKW9XXEeIG47KTmH75ULjhHbz8m0AoQaBEoxAbUqpTvkqbb/Uwiq9IkcPItfdmnDwy97d0JyF83/doM7SrqatdAPwVAfFiic086TSrgJGKZYdUQWNlw8O14PfAHAysU+JG4awBIhjz1VC84T6LeP99ua6wRjFRJC0lJknQWPBRBabDO2ITivV0zmcw0bARtjmew7ncFo4p7znsGnx/wDFx+UXCwd6sAAAAABJRU5ErkJggg="
	
	If (!HasData)
		Return -1
	
	If (!ExtractedData){
		ExtractedData := True
		, Ptr := A_IsUnicode ? "Ptr" : "UInt"
		, VarSetCapacity(TD, 10100 * (A_IsUnicode ? 2 : 1))
		
		Loop, 1
			TD .= %A_Index%, %A_Index% := ""
		
		VarSetCapacity(Out_Data, Bytes := 7372, 0)
		, DllCall("Crypt32.dll\CryptStringToBinary" (A_IsUnicode ? "W" : "A"), Ptr, &TD, "UInt", 0, "UInt", 1, Ptr, &Out_Data, A_IsUnicode ? "UIntP" : "UInt*", Bytes, "Int", 0, "Int", 0, "CDECL Int")
		, TD := ""
	}
	
	IfExist, %_Filename%
		FileDelete, %_Filename%
	
	h := DllCall("CreateFile", Ptr, &_Filename, "Uint", 0x40000000, "Uint", 0, "UInt", 0, "UInt", 4, "Uint", 0, "UInt", 0)
	, DllCall("WriteFile", Ptr, h, Ptr, &Out_Data, "UInt", 7372, "UInt", 0, "UInt", 0)
	, DllCall("CloseHandle", Ptr, h)
	
	If (_DumpData)
		VarSetCapacity(Out_Data, 7372, 0)
		, VarSetCapacity(Out_Data, 0)
		, HasData := 0
}

And the function created using AHK_L Unicode and x64:

logo_Get(_What)
{
	Static Size = 7372, Name = "ahk_logo_ipb.png", Extension = "png", Directory = "C:\Users\user\Desktop\Delete Me\Include Virtually Any File in a Script (testing)"
	, Options = "Size,Name,Extension,Directory"
	;This function returns the size(in bytes), name, filename, extension or directory of the file stored depending on what you ask for.
	If (InStr("," Options ",", "," _What ","))
		Return %_What%
}

Extract_logo(_Filename, _DumpData = 0)
{
	;This function "extracts" the file to the location+name you pass to it.
	Static HasData = 1, Out_Data, Ptr, ExtractedData
	Static 1 = "iVBORw0KGgoAAAANSUhEUgAAAK8AAABACAYAAABsgCciAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNui8sowAABxGSURBVHic7Z1rkGRHld9/J++9VdVd1Y95aWY0I0ajFwgWAWZBko3wLjaEkcSGzWsxtgChXWGvdw0RXi+P2I3wJwMbGzgCOcIrB16EFwmQhPCygcTaYPRc3hIMGoQWVhqN1NOaR3dPV9f73szjD3nvrUdXP2Y06sd4/hHV3VV9b1b+7zmZefLkyZOiqpz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Y9V4Yc+aEBDYECMAmM4rllS3T5MnJ225mlsiyGSdv1/E6AOp5rC+gAARBrj6ZI+QKYvCTiyP0GL9MyMI7n3MtzI8kUulwtnlsNz7eRXa+qCWRp/X/zTxwH/zrmudGQmUMxndoMdqEKNlUOE1EYMwQFyIIARJZrjGceeefQA1UlrjtcomBiojGLUSWugeso/gH047JrE7ZfHnD0MZibTrCNDrYe4tkYTDGkMCpIKN1OaQ3lOYynGLBtR9z0y4emEBONWmzTkdR93MZAF6f1Z5HX/0FCqRRy7PEOrUZMUm9AO2vwAVElJCiBGEHdxpCpoMRNJek4wBKNJUjgsDWwTeiRaV8OAznvMtj7GwGzvzQ8910Y222IRoTmSYMmrIvSLgVBKUwKIxM+eiMsOmxHmf2V0q4mwKA8+2/f+QrY+Q9CDn1HaMwI2y4V4obQWTBekKyt0i4FdRCEyuh5QlBIfU3iaM06qoeVxG/tWIqrvOI6KO4x1J8PePrbUBgXytsMzTnBdjLbbePINBwRRncIqMOEik2U6mFL44TDj6T55X0ZJPTY3wFYKW9XXEeIG47KTmH75ULjhHbz8m0AoQaBEoxAbUqpTvkqbb/Uwiq9IkcPItfdmnDwy97d0JyF83/doM7SrqatdAPwVAfFiic086TSrgJGKZYdUQWNlw8O14PfAHAysU+JG4awBIhjz1VC84T6LeP99ua6wRjFRJC0lJknQWPBRBabDO2ITivV0zmcw0bARtjmew7ncFo4p7znsGnx/wDFx+UXCwd6sAAAAABJRU5ErkJggg=="
	
	If (!HasData)
		Return -1
	
	If (!ExtractedData){
		ExtractedData := True
		, Ptr := A_IsUnicode ? "Ptr" : "UInt"
		, VarSetCapacity(TD, 10100 * (A_IsUnicode ? 2 : 1))
		
		Loop, 1
			TD .= %A_Index%, %A_Index% := ""
		
		VarSetCapacity(Out_Data, Bytes := 7372, 0)
		, DllCall("Crypt32.dll\CryptStringToBinary" (A_IsUnicode ? "W" : "A"), Ptr, &TD, "UInt", 0, "UInt", 1, Ptr, &Out_Data, A_IsUnicode ? "UIntP" : "UInt*", Bytes, "Int", 0, "Int", 0, "CDECL Int")
		, TD := ""
	}
	
	IfExist, %_Filename%
		FileDelete, %_Filename%
	
	h := DllCall("CreateFile", Ptr, &_Filename, "Uint", 0x40000000, "Uint", 0, "UInt", 0, "UInt", 4, "Uint", 0, "UInt", 0)
	, DllCall("WriteFile", Ptr, h, Ptr, &Out_Data, "UInt", 7372, "UInt", 0, "UInt", 0)
	, DllCall("CloseHandle", Ptr, h)
	
	If (_DumpData)
		VarSetCapacity(Out_Data, 7372, 0)
		, VarSetCapacity(Out_Data, 0)
		, HasData := 0
}

Note I am using AHK_L v1.1.22.02



Adam1WA
  • Members
  • 3 posts
  • Last active: Feb 02 2016 08:50 PM
  • Joined: 03 Jan 2014

Great Script!!!    One question: How do you extract multiple files into one EXE/Application??  For example:

 

f2::
SplashTextOn 200, 200, Extracting, Please Wait...
Extract_Toolkit( A_ScriptDir "\Toolkitdd.exe" )
Extract_Hellow( A_ScriptDir "\Toolkitdd.exe" )

;while !FileExist( A_ScriptDir "\Hellow.ahk" )
;while !FileExist( A_ScriptDir "\Toolkit.ahk" )

    Sleep 100
Sleep 1000
ControlSetText Static1, Done!, Extracting
Sleep 1000
SplashTextOff
ExitApp
return

 

The function overwrites the existing file with Toolkit.  I want to combine both programs into one. Please help!!!