Sign in to follow this  
Followers 0
CoffeeCone

Best way to embed HTML inside a compiled .EXE?

3 posts in this topic

I'm trying to create a web server and I'm basing it off of The twist is, I want to make it so that the error pages (404, 401, etc) are embedded into the program itself as opposed to being external. What is the best way to achieve this? As of currently I have 2 options:

1. (This is my preferred method.) Bas64 encode the HTML error messages then store them as variables inside the program. Then when there's a need to show them to the end-user, The contents will just be bas64 decoded from the variable.

2. Write to an external file and load from there.

I already have the server up and running. The only thing left is implementing this tweak. What performance hits will I get if I go via method 1? Which is the better way and why?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Do you have a html error page which I can embed?

#include <IE.au3>

Local $oIE = _IECreate()
Local $oBody = _IETagNameGetCollection($oIE, "body", 0)
_IEDocInsertHTML($oBody, BinaryToString(_Website(True)) , "afterbegin")
;~ ShellExecute(@ScriptDir & "AutoItScript - AutoItScript Website.htm")


;Code below was generated by: File to Base64 String Code Generator v1.09 Build 2012-08-19

Func _Website($bSaveBinary = False)
    Local $Website
    $Website &= 'GbcAPCFET0NUWVAARSBodG1sIFAAVUJMSUMgIi0ALy9XM0MvL0QAVEQgWEhUTUwAIDEuMCBUcmEAbnNpdGlvbmEAbC8vRU4iICIAaHR0cDovL3cAd3cudzMub3JAZy9UUi94AZYxEwF4BBQtdAhyLmR0EGQiPjwBMAp4bRBsbnM9EEUxOTkCOQM8IiBkaXI9ACJsdHIiIGxhAG5nPSJlbi1VAlMBQWVhZApwciBvZmlsZQZDZ20EcGcCQXhmbi8xAjEAJmxpbmsKcgBlbD0ic3R5bABlc2hlZXQiIAh0eXAANHRleHQAL2NzcyIgaHIEZWYGImF1dDEuAQACb2l0LWNkbiAuY29tLwBfZS8Ad3AtY29udGUAbnQvdzN0Yy8AbWluLzlhM2QANi9kZWZhdWwAdC5pbmNsdWQAZS4wMWU3YzkCLoAtPzZhMDVhADEiIG1lZGlhED0iYWyAaS8+PEBzY3JpcHQJRGoIYXZhgwoiIHNyCmMJRzI8RzQyYmEQMGQuaoZGPjwvA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MAPSJodHRwOi9AL2F1dDEugABvQGl0LWNkbuBhbYIvoEplL3dwLWEfAWBXL3czdGMvbQBpbi85YTNkNgAvZGVmYXVsdAAuaW5jbHVkZQAtZm9vdGVyLgAzY2FkMGMuagBzPzZhMDVhMQYiQBFlFS9ib2R5AcAAaHRtbD4NCgA8IS0tIFBlcgBmb3JtYW5jZQIgwY5taXplZCAAYnkgVzMgVG8AdGFsIENhY2hAZS4gTGVhYCFtIG9yZTogpBZ3dwB3LnczLWVkZxplIhZ3oCeALXNzLQBwbHVnaW5zLwANCg0KTWluaQRmaYAKdXNpbmeAIGFwYw0KUACgJwILIQLoAkRhIDxhcwFnAzIzLzQwIHEBoDlpZXMgaW4gADAuMDE3IHNlKaAiZHNJB0PDJCBECGVsacBYeSBOZcJ0ABJrIHZpgJHvKyFBE1NlcnYAE2Zy8G9tOiChGUME4yWBBAAgQCAyMDEyLQAwOC0yNSAxMAA6MDg6MTggLQAtPg=='
    $Website = _Base64Decode($Website)
    Local $tSource = DllStructCreate('byte[' & BinaryLen($Website) & ']')
    DllStructSetData($tSource, 1, $Website)
    Local $tDecompress
    _WinAPI_LZNTDecompress($tSource, $tDecompress)
    $tSource = 0
    Local $bString = Binary(DllStructGetData($tDecompress, 1))
    If $bSaveBinary Then
        Local $hFile = FileOpen(@ScriptDir & "AutoItScript - AutoItScript Website.htm", 18)
        FileWrite($hFile, $bString)
        FileClose($hFile)
    EndIf
    Return  $bString
EndFunc   ;==>_Website

Func _Base64Decode($sB64String)
    Local $struct = DllStructCreate("int")
    Local $a_Call = DllCall("Crypt32.dll", "int", "CryptStringToBinary", "str", $sB64String, "int", 0, "int", 1, "ptr", 0, "ptr", DllStructGetPtr($struct, 1), "ptr", 0, "ptr", 0)
    If @error Or Not $a_Call[0] Then Return SetError(1, 0, "")
    Local $a = DllStructCreate("byte[" & DllStructGetData($struct, 1) & "]")
    $a_Call = DllCall("Crypt32.dll", "int", "CryptStringToBinary", "str", $sB64String, "int", 0, "int", 1, "ptr", DllStructGetPtr($a), "ptr", DllStructGetPtr($struct, 1), "ptr", 0, "ptr", 0)
    If @error Or Not $a_Call[0] Then Return SetError(2, 0, "")
    Return DllStructGetData($a, 1)
EndFunc   ;==>_Base64Decode

Func _WinAPI_LZNTDecompress(ByRef $tInput, ByRef $tOutput, $iBufferSize = 0x800000)
    Local $tBuffer, $Ret
    $tOutput = 0
    $tBuffer = DllStructCreate('byte[' & $iBufferSize & ']')
    If @error Then Return SetError(1, 0, 0)
    $Ret = DllCall('ntdll.dll', 'uint', 'RtlDecompressBuffer', 'ushort', 0x0002, 'ptr', DllStructGetPtr($tBuffer), 'ulong', $iBufferSize, 'ptr', DllStructGetPtr($tInput), 'ulong', DllStructGetSize($tInput), 'ulong*', 0)
    If @error Then Return SetError(2, 0, 0)
    If $Ret[0] Then Return SetError(3, $Ret[0], 0)
    $tOutput = DllStructCreate('byte[' & $Ret[6] & ']')
    If Not _WinAPI_MoveMemory(DllStructGetPtr($tOutput), DllStructGetPtr($tBuffer), $Ret[6]) Then
        $tOutput = 0
        Return SetError(4, 0, 0)
    EndIf
    Return $Ret[6]
EndFunc   ;==>_WinAPI_LZNTDecompress

Func _WinAPI_MoveMemory($pDestination, $pSource, $iLenght)
    DllCall('ntdll.dll', 'none', 'RtlMoveMemory', 'ptr', $pDestination, 'ptr', $pSource, 'ulong_ptr', $iLenght)
    If @error Then Return SetError(5, 0, 0)
    Return 1
EndFunc   ;==>_WinAPI_MoveMemory

Br,

UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

I'm not sure if this information could help you but here it is.

It's form resource_test_ie.au3 in my Resources UDF

It's example (not using my Resources UDF) for embedding/using HTML directly from compiled EXE

#AutoIt3Wrapper_Res_File_Add=test_1.htm, rt_html, TEST_HTML_1
#AutoIt3Wrapper_Res_File_Add=test_1.gif, rt_html, TEST_GIF_1

$oIE = ObjCreate("Shell.Explorer.2")
$gui = GUICreate("HTML from resources example",500,400)
$ie_ctrl = GUICtrlCreateObj ($oIE, 0, 0 , 500, 400)
GUISetState(@SW_SHOW)

; image from resource (all HTML supported types)
$oIE.navigate("res://" & @AutoItExe & "/test_gif_1")
Sleep(3000)
; html from resource (with embeded image from resources)
$oIE.navigate("res://" & @AutoItExe & "/test_html_1")

While 1
    If GUIGetMsg() = -3 Then Exit
WEnd

Share this post


Link to post
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
Sign in to follow this  
Followers 0