wakillon

BinaryToAu3Kompressor v1.0.5.4 Update of 10 Oct 2014

70 posts in this topic




#2 ·  Posted (edited)

Nice script! What I have done in the past is instead of writing to a @Temp File, is using (again by ProgAndy!) to load into Memory and then access this way. Just adding my 2cents! :x

Edited by guinness

_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

Nice script! What I have done in the past is instead of writing to a @Temp File, is using (again by ProgAndy!) to load into Memory and then access this way. Just adding my 2cents! :x

Thanks guinness ! Posted Image

I' ve seen ProgAndy's post you say but I think it 's only for image...

May be soon for all filetypes...


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

@AZJIO

I was talking about load into Memory...


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

You may look at my Resource UDF

Result is the same.

Result is the same, but use of ressouces in memory is a bit more complicated !


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

Very nice script!

I used it a lot.

I also like the skin of the app, I would to use it for a app of my own I’ve you all right with it?

Is There a way to get rid of the blue shirt when you hover above the exit button?

Share this post


Link to post
Share on other sites

Very nice script!

I used it a lot.

I also like the skin of the app, I would to use it for a app of my own I’ve you all right with it?

Is There a way to get rid of the blue shirt when you hover above the exit button?

Thanks ! Posted Image

Skins and dll are from a chinese site named SkinSharp and i don't know how remove the blue shirt...

but some others have been found on some chinese forums by googling or baiduling...Posted Image


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

Thanks ! Posted Image

Skins and dll are from a chinese site named SkinSharp and i don't know how remove the blue shirt...

but some others have been found on some chinese forums by googling or baiduling...Posted Image

Thanks for the reply.

I will look at the site voor the skins.

Share this post


Link to post
Share on other sites

Updated.


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

Updated

Kompressions are now available.


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

Looks super cool!  Dumb question...is kompression equivalent to compression?

 

Thanks, and yes in German !

it was a wink to UEZ  :D


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

Seems to be that I stole your idea and put it to File to Base64 String Code Generator  :whistle: 

Should rename it to File to Base64 String Code Générateur ...  ;) 

Anyway, forgot to say nice and useful tool!  :thumbsup:

Br,

UEZ  o:)


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

Thanks UEZ, glad you like it !

Ideas must evolve, and a constructive "competition" is always welcome... :thumbsup:

Next Round is for you... ;)


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

I'd like to give this a shot... however you really really shouldn't be trying to write stuff to @WindowsDir. It fails silently when UAC is enabled, and it's bad manners. If you need to write files to disk, you should do it all in @ScriptDir or @TempDir and delete the files on exit.

Share this post


Link to post
Share on other sites

I LOVE THIS!

Share this post


Link to post
Share on other sites

I'd like to give this a shot... however you really really shouldn't be trying to write stuff to @WindowsDir. It fails silently when UAC is enabled, and it's bad manners. If you need to write files to disk, you should do it all in @ScriptDir or @TempDir and delete the files on exit.

 

I don't use UAC, but if it cause problem i will set dll and other files to temp dir.

Thanks.


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

I LOVE THIS!

Thanks.


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

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

  • Similar Content

    • am632
      binary to octal
      By am632
      Hi,
      I have a binary string that I want to convert to octal, The string I want to convert is,
      10001001010100000100111001000111000011010000101000011010
       
      The String is read from a .txt file
      Once its converted it should read this,
      4   2   2   5   0   1   1   6   2   1   6   0   6   4   1   2   0   6   10
      which I want written to the .txt file to overwrite the original binary string.
      The 10 at the end should be ignored as there are not 3 digits to convert.
      I'm thinking it should read the string from left to right to get the next 3 digits before converting them to its oct value. would this be the best way to do this or is there a better way?
      If i'm on the right track can anyone give me an example of how to write this script please?
      I've looked at the StringLeft function & StringReplace but I'm not sure how to use them the correct way to accomplish what I'm trying to do.
      Thanks
       
    • Beege
      Embed Full Compressed Directorys in Script using LZF and Base64
      By Beege
      This is a small UDF I put together just for fun that will embed and extract complete directory's in and from your script. It only has two functions, _EmbeddedDirectory_Create() and _EmbeddedDirectory_Extract(). The udf uses Wards machine code functions so they have pretty good speed. The example I set up packs all files located in Autoit Include directory. Both compression and decompression of the directory was less than 500ms on my pc which I was happy with. Let me if you have any problems or questions. Thanks
       
      Example:
       
      #include "EmbedDir.au3" ;Check location of autoit includes Global $sIncludeDir = 'C:\Program Files\AutoIt3\Include\' If Not FileExists($sIncludeDir) Then $sIncludeDir = 'C:\Program Files (x86)\AutoIt3\Include\' If Not FileExists($sIncludeDir) Then Exit (MsgBox(0, 'Directory Not Found', 'Unable to locate Includes Directory')) ;Create embedded directory function Global $sCompressed_Includes = _EmbeddedDirectory_Create($sIncludeDir, '_Extract_Includes') Global $iTime = (@extended / 1000) & ' ms' ;create example file and write extract function to it Global $hExtractExample = FileOpen(@ScriptDir & 'Extract_Example.au3', 2) FileWrite($hExtractExample, '#include "EmbedDir.au3"' & @LF & @LF & _ '$sExt = _Extract_Includes()' & @LF & _ '_EmbeddedDirectory_Extract($sExt, @ScriptDir & "AutoIt_Extracted")' & @LF & _ 'ConsoleWrite("Extract Time = " & @extended/1000 & "ms" & @LF)' & @LF & @LF & _ $sCompressed_Includes) FileClose($hExtractExample) ;Show stats of the directory we just embeded $aSize = DirGetSize($sIncludeDir,1) If IsArray($aSize) Then Msgbox(0,"Directory Details", _ "Size = " & Int($aSize[0]/1024) & 'KB' & @LF & _ "Files = " & $aSize[1] & @LF & _ "Dirs = " & $aSize[2] & @LF & _ "Compression time = " & $iTime & @LF & @LF & _ "Open Extract_Example.au3 to extract") EndIf  
      UDF:
      EmbedDir.zip
    • toasterking
      Parsing binary data frames from an asynchronous source
      By toasterking
      I was just working on a project that involved decoding a stream of binary data from a serial port in AutoIt.  It took me a few hours to figure out how to process the data efficiently in AutoIt and I did not find any helpful examples on how to do so, so I thought I would share my core example and maybe save someone else some time.  There may be a more efficient way to do this, but this works well for me.
       
      #cs Author: ToasterKing This is an example of a way to parse streaming binary data that follows a strict format with a header and footer. In this example, each frame is 5 bytes with a 2-byte header of 0xD5AA and a 1-byte footer of 0xAD. The _BinaryParse() function accumulates incoming data in a buffer. Once a footer is found, it searches backward for the header, and if it is in the right position, it extracts the remaining 2 bytes in the middle, then moves on to looking for the next frame. #ce ; The data source might be something asynchronous like serial or TCP, but since this is just an example, I'm just putting the data in a variable. Local $fSomeData $fSomeData = Binary("0xD5AA24B1") ; Binary data constituting almost a complete frame. _BinaryParse($fSomeData) ; Call the function with the received data. It isn't a complete frame, so it is just stored in the buffer until more data is received. $fSomeData = Binary("0xAD62D5AA92E7AD") ; Remainder of the previous frame, one garbage byte (0x62) which should be skipped, and a complete additional frame. _BinaryParse($fSomeData) ; The function should be able to parse both frames now. Func _BinaryParse($fNewData) Local Static $fBinaryReceived = Binary("") ; Buffer for received data ConsoleWrite("Hey, the function is called!" & @CRLF) ; Add new data to the buffer. ; This ridiculous monstrosity is the only way I could find to append binary data to binary data in AutoIt. It must be converted to strings first. ; Both, one, or no substrings will begin with "0x" depending on whether they contained binary data. To be converted back to binary properly, only one instance ; of "0x" must exist at the beginning of the string. $fBinaryReceived = Binary("0x" & StringReplace(String($fBinaryReceived) & String($fNewData),"0x","")) ConsoleWrite("Data in the buffer: " & String($fBinaryReceived) & @CRLF) Local $iLength = BinaryLen($fBinaryReceived) ; Count the bytes in the data If $iLength > 0 Then Local $fBinaryReceivedTemp = $fBinaryReceived ; Create temporary copy to work on Local $fByte1,$fByte2 For $i = 1 To $iLength If BinaryMid($fBinaryReceivedTemp,$i,1) = 0xAD Then ; If the 1-byte footer found ConsoleWrite("Footer found at end of " & $i & " of " & $iLength & " bytes!" & @CRLF) If BinaryMid($fBinaryReceivedTemp,$i - 4,1) = 0xD5 And BinaryMid($fBinaryReceivedTemp,$i - 3,1) = 0xAA Then ; and the 2-byte header is found 4 bytes before that ConsoleWrite("Header found before the footer!" & @CRLF) $fByte1 = BinaryMid($fBinaryReceivedTemp,$i - 2,1) ; Get 1st byte in the body (between header and footer) $fByte2 = BinaryMid($fBinaryReceivedTemp,$i - 1,1) ; Get 2nd byte in the body (between header and footer) ConsoleWrite("Here is the critical data: " & String($fByte1) & " " & String($fByte2) & @CRLF) ; Just display the 2 bytes for demonstration purposes. Normally, you'd do something more useful with it here. EndIf $fBinaryReceived = BinaryMid($fBinaryReceivedTemp,$i + 1) ; Truncate the original data to remove all of the bytes just processed, then continue processing $fBinaryReceivedTemp EndIf Next EndIf EndFunc  
    • wakillon
      Bitmap2Svg
      By wakillon
      Do not expect a SVG file as Sodipodi, Inkscape or Adobe Illustrator can generate.
      This "converter" doesn't actually trace or convert the image to vector. 
      It just embed the bitmap image within an SVG container.
      #Region ;************ Includes ************ #Include <GDIPlus.au3> #Include <Memory.au3> #EndRegion ;************ Includes ************ Global $_B64E_CodeBuffer, $_B64E_CodeBufferMemory, $_B64E_Init, $_B64E_EncodeData, $_B64E_EncodeEnd Global $sFile, $hImage, $iW, $iH, $sType, $hFile, $sBase64String, $sFileRead, $sSvgPath, $sString _GDIPlus_Startup() $sFile = FileOpenDialog ( 'Select an Image', @DesktopDir, 'Images (*.jpg;*.png;*.gif;*.bmp)', 1+2 ) If @error Then Exit $sType = _FileGetType ( $sFile ) If @error Then ConsoleWrite ( '! File Type not supported, error : ' & @error & @Crlf ) Else $hFile = FileOpen ( $sFile, 16 ) If $hFile=-1 Then Exit MsgBox ( 262144+4096+16, 'Error', 'Can not Access this file.', 4 ) $hImage = _GDIPlus_ImageLoadFromFile ( $sFile ) $iW = _GDIPlus_ImageGetWidth ( $hImage ) $iH = _GDIPlus_ImageGetHeight ( $hImage ) _GDIPlus_ImageDispose ( $hImage ) $sFileRead = FileRead ( $hFile ) FileClose ( $hFile ) $sBase64String = _Base64Encode ( $sFileRead, 4000 ) $sString = '<svg' & @CRLF & _ ' version="1.1"' & @CRLF & _ ' xmlns="http://www.w3.org/2000/svg"' & @CRLF & _ ' xmlns:xlink="http://www.w3.org/1999/xlink"' & @CRLF & _ ' width="' & $iW & 'px" height="' & $iH & 'px"' & @CRLF & _ ' viewBox="0 0 ' & $iW & ' ' & $iH & '" preserveAspectRatio="none">' & @CRLF & _ ' <g>' & @CRLF & _ '<image width="' & $iW & '" height="' & $iH & '" xlink:href="data:image/' & $sType & ';base64,' & @CRLF & _ $sBase64String & @CRLF & _ '"/>' & @CRLF & _ ' </g>' & @CRLF & _ '</svg>' & @CRLF $sSvgPath = @TempDir & '\' & @HOUR & @MIN & @SEC & @MSEC & '-' & $iW & 'x' & $iH & '.svg' $hFile = FileOpen ( $sSvgPath, 1+2+8 ) If $hFile = -1 Then MsgBox ( 262144+4096+16, '', 'An error occurred whilst writing the temporary file.' ) Else FileWrite ( $hFile, $sString ) FileClose ( $hFile ) ShellExecute ( 'iexplore.exe', $sSvgPath ) EndIf EndIf _GDIPlus_Shutdown() Exit Func _FileGetType ( $sFilePath ) If Not FileExists ( $sFilePath ) Then Return SetError ( -1 ) If FileGetSize ( $sFilePath ) = 0 Then Return SetError ( 1, 0, 0 ) Local $hFile, $Binary, $Ret $hFile = FileOpen ( $sFilePath, 16 ) If $hFile = -1 Then Return SetError ( 3, 0, 0 ) $Binary = FileRead ( $hFile ) FileClose ( $hFile ) Local $sString = StringTrimLeft ( $Binary, 2 ) Local $sStringLeft = StringReplace ( StringTrimLeft ( StringLeft ( $Binary, 14 ), 2 ), '00', '' ) Local $sStringLeft12 = StringLeft ( $sStringLeft, 12 ) Local $sStringLeft8 = StringLeft ( $sStringLeft, 8 ) Local $sStringLeft4 = StringLeft ( $sStringLeft, 4 ) Select Case $sStringLeft12 = '474946383961' Or $sStringLeft12 = '474946383761' $Ret = 'GIF' Case $sStringLeft4 = 'FFD8' $Ret = 'JPG' Case $sStringLeft4 = '424D' $Ret = 'BMP' Case $sStringLeft8 = '89504E47' $Ret = 'PNG' Case Else Return SetError ( 2, 0, '' ) EndSelect If $Ret = 'GIF' Then StringReplace ( $sString, '0021F904', '0021F904' ) If @extended > 1 Then Return SetError ( 3, 0, '' ) ; animated gif. EndIf Return $Ret EndFunc ;==> _FileGetType() Func _Base64E_Exit() ; by Ward $_B64E_CodeBuffer = 0 _MemVirtualFree ( $_B64E_CodeBufferMemory, 0, $MEM_RELEASE ) EndFunc ;==> _Base64E_Exit() Func _Base64Encode ( $Data, $LineBreak=76 ) ; by Ward Local $State = _Base64EncodeInit ( $LineBreak ) Return _Base64EncodeData ( $State, $Data ) & _Base64EncodeEnd ( $State ) EndFunc ;==> _Base64Encode() Func _Base64EncodeData ( ByRef $State, $Data ) ; by Ward If Not IsDllStruct ( $_B64E_CodeBuffer ) Or Not IsDllStruct ( $State ) Then Return SetError ( 1, 0, '' ) $Data = Binary ( $Data ) Local $InputLen = BinaryLen ( $Data ) Local $Input = DllStructCreate ( 'byte[' & $InputLen & ']' ) DllStructSetData ( $Input, 1, $Data ) Local $OputputLen = Ceiling ( BinaryLen ( $Data )*1.4 )+3 Local $Output = DllStructCreate ( 'char[' & $OputputLen & ']' ) DllCall ( 'user32.dll', 'int', 'CallWindowProc', 'ptr', DllStructGetPtr ( $_B64E_CodeBuffer )+$_B64E_EncodeData, 'ptr', DllStructGetPtr ( $Input ), 'uint', $InputLen, 'ptr', DllStructGetPtr ( $Output ), 'ptr', DllStructGetPtr ( $State ) ) Return DllStructGetData ( $Output, 1 ) EndFunc ;==> _Base64EncodeData() Func _Base64EncodeEnd ( ByRef $State ) ; by Ward If Not IsDllStruct ( $_B64E_CodeBuffer ) Or Not IsDllStruct ( $State ) Then Return SetError ( 1, 0, '' ) Local $Output = DllStructCreate ( 'char[5]' ) DllCall ( 'user32.dll', 'int', 'CallWindowProc', 'ptr', DllStructGetPtr ( $_B64E_CodeBuffer ) + $_B64E_EncodeEnd, 'ptr', DllStructGetPtr ( $Output ), 'ptr', DllStructGetPtr ( $State ), 'int', 0, 'int', 0 ) Return DllStructGetData ( $Output, 1 ) EndFunc ;==> _Base64EncodeEnd() Func _Base64EncodeInit ( $LineBreak=76 ) ; by Ward If Not IsDllStruct ( $_B64E_CodeBuffer ) Then If @AutoItX64 Then Local $Opcode = '0x89C08D42034883EC0885D2C70100000000C64104000F49C2C7410800000000C1F80283E20389410C740683C00189410C4883C408C389C94883EC3848895C242848897424304889CB8B0A83F901742083F9024889D87444C6000A4883C001488B74243029D8488B5C24284883C438C30FB67204E803020000BA3D0000004080FE3F7F08480FBEF60FB614308813C643013D488D4303C643023DEBBC0FB67204E8D7010000BA3D0000004080FE3F7F08480FBEF60FB614308813C643013D488D4302EB9489DB4883EC68418B014863D248895C242848897424304C89C348897C24384C896424484C89CE83F80148896C24404C896C24504C897424584C897C24604C8D2411410FB6790474434D89C64989CD0F82F700000083F8024C89C5747B31C0488B5C2428488B742430488B7C2438488B6C24404C8B6424484C8B6C24504C8B7424584C8B7C24604883C468C34C89C54989CF4D39E70F840B010000450FBE374D8D6F014489F025F0000000C1F80409C7E8040100004080FF3FBA3D0000007F08480FBEFF0FB614384489F78855004883C50183E70FC1E7024D39E50F84B2000000450FB675004983C5014489F025C0000000C1F80609C7E8BD0000004080FF3FBA3D0000007F08480FBEFF0FB61438BF3F0000008855004421F74C8D7502E896000000480FBED70FB604108845018B460883C0013B460C89460875104C8D7503C645020AC7460800000000904D39E5742E410FBE7D004D8D7D01498D6E01E8560000004889FA83E70348C1EA02C1E70483E23F0FB60410418806E913FFFFFF4489F040887E04C7060000000029D8E9CCFEFFFF89E840887E04C7060200000029D8E9B9FEFFFF89E840887E04C7060100000029D8E9A6FEFFFFE8400000004142434445464748494A4B4C4D4E4F505152535455565758595A6162636465666768696A6B6C6D6E6F707172737475767778797A303132333435363738392B2F58C3' Else Local $Opcode = '0x89C08B4C24088B44240489CAC1FA1FC1EA1E01CAC1FA0283E103C70000000000C6400400C740080000000089500C740683C20189500CC2100089C983EC0C8B4C2414895C24048B5C2410897424088B1183FA01741D83FA0289D87443C6000A83C0018B74240829D88B5C240483C40CC210000FB67104E80C020000BA3D00000089F180F93F7F0989F20FBEF20FB6143088138D4303C643013DC643023DEBBD0FB67104E8DF010000BA3D00000089F180F93F7F0989F20FBEF20FB6143088138D4302C643013DEB9489DB83EC3C895C242C8B5C244C896C24388B542440897424308B6C2444897C24348B030FB6730401D583F801742D8B4C24488954241C0F820101000083F80289CF747D31C08B5C242C8B7424308B7C24348B6C243883C43CC210008B4C244889D739EF0F84400100008D57010FBE3F89542418894C241489F825F0000000C1F80409C6897C241CE8330100008B542418C644240C3D8B4C241489C789F03C3F7F0B0FBEF00FB604378844240C0FB644240C8D790188018B74241C83E60FC1E60239EA0F84CB0000000FB60A83C2018954241C89C825C0000000C1F80609C6884C2414E8D8000000BA3D0000000FB64C24148944240C89F03C3F7F0B0FBEF08B44240C0FB6143083E13F881789CEE8AD00000089F10FBED18D4F020FB604108847018B430883C0013B430C894308750EC647020A8D4F03C7430800000000396C241C743A8B44241C8B7C241C0FBE30894C241483C701E8650000008B4C241489F283E60381E2FC000000C1EA02C1E6040FB60410880183C101E9E4FEFFFF89F088430489C8C703000000002B442448E9B2FEFFFF89F189F8884B04C703020000002B442448E99CFEFFFF89F088430489C8C703010000002B442448E986FEFFFFE8400000004142434445464748494A4B4C4D4E4F505152535455565758595A6162636465666768696A6B6C6D6E6F707172737475767778797A303132333435363738392B2F58C3' EndIf $_B64E_Init = ( StringInStr ( $Opcode, '89C0' )-3 ) / 2 $_B64E_EncodeData = ( StringInStr ( $Opcode, '89DB' )-3 ) / 2 $_B64E_EncodeEnd = ( StringInStr ( $Opcode, '89C9' )-3 ) / 2 $Opcode = Binary ( $Opcode ) $_B64E_CodeBufferMemory = _MemVirtualAlloc ( 0, BinaryLen ( $Opcode ), $MEM_COMMIT, $PAGE_EXECUTE_READWRITE ) $_B64E_CodeBuffer = DllStructCreate ( 'byte[' & BinaryLen ( $Opcode ) & ']', $_B64E_CodeBufferMemory ) DllStructSetData ( $_B64E_CodeBuffer, 1, $Opcode ) OnAutoItExitRegister ( '_Base64E_Exit' ) EndIf Local $State = DllStructCreate ( 'byte[16]' ) DllCall ( 'user32.dll', 'none', 'CallWindowProc', 'ptr', DllStructGetPtr ( $_B64E_CodeBuffer )+$_B64E_Init, 'ptr', DllStructGetPtr ( $State ), 'uint', $LineBreak, 'int', 0, 'int', 0 ) Return $State EndFunc ;==> _Base64EncodeInit() Thanks to Ward for his Base64 functions.
    • TheDcoder
      Help with inserting Null in a Base64 string
      By TheDcoder
      I am really having a headache with this one...
      ; #FUNCTION# ==================================================================================================================== ; Name ..........: _Base64_Encode ; Description ...: Encode the $vData in Base64 ; Syntax ........: _Base64_Encode($vData) ; Parameters ....: $vData - $vData to Encode. ; Return values .: Success: Base64 encoded $vData in the form of a string. ; Failure: False and @error set to: ; 1 - If "error calculating the length of the buffer needed" ; 2 - If "error encoding" ; Author ........: trancexx ; Modified ......: Damon Harris (TheDcoder) ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _Base64_Encode($vData) $vData = Binary($vData) Local $tByteStruct = DllStructCreate("byte[" & BinaryLen($vData) & "]") DllStructSetData($tByteStruct, 1, $vData) Local $tIntStruct = DllStructCreate("int") Local $aDllCall = DllCall("Crypt32.dll", "int", "CryptBinaryToString", _ "ptr", DllStructGetPtr($tByteStruct), _ "int", DllStructGetSize($tByteStruct), _ "int", 1, _ "ptr", 0, _ "ptr", DllStructGetPtr($tIntStruct)) If @error Or Not $aDllCall[0] Then Return SetError(1, 0, False) ; error calculating the length of the buffer needed EndIf Local $tCharStruct = DllStructCreate("char[" & DllStructGetData($tIntStruct, 1) & "]") $aDllCall = DllCall("Crypt32.dll", "int", "CryptBinaryToString", _ "ptr", DllStructGetPtr($tByteStruct), _ "int", DllStructGetSize($tByteStruct), _ "int", 1, _ "ptr", DllStructGetPtr($tCharStruct), _ "ptr", DllStructGetPtr($tIntStruct)) If @error Or Not $aDllCall[0] Then Return SetError(2, 0, False) ; error encoding EndIf Return DllStructGetData($tCharStruct, 1) EndFunc ConsoleWrite(_Base64_Encode("jilles" & Null & "jilles" & Null & "sesame")) ; It should be "amlsbGVzAGppbGxlcwBzZXNhbWU=" Sleep(1000)
       
      Thanks in Advance, TD.