Leaderboard
Popular Content
Showing content with the highest reputation on 12/14/2014 in all areas
-
Hi. I know there are fantastic converters out there that run machine code etc but you cannot really modify those at the drop of a hat. I made my converter as a challenge to myself with the hope of using it to perhaps make serial key protection systems for possible future scripts. The benefit of my script is it is very easy to understand what is going on and make modifications to it if you want to use it for weird purposes. This is about the 5th version of my converter, I had so much failure that this last version is so much cleaner and faster than any of the old ones I came up with. It deals with files and strings. Strings can be taken in either ANSI or UTF-8 during both encode and decode (same must be used for both, obviously). UTF is a good over all for anything but if you know you don't need such exotic characters greater than single byte standard ones you can set it to ANSI (default is ansi already) I am attaching both my main program I am using for encoding and decoding AND the UDF I have made. Here are some usage examples: Encode a string ConsoleWrite( B64Encode('Hello World') & @CRLF ) Encode a UTF-8 string: ConsoleWrite( B64Encode('British people do not use the € (euro)', 1) & @CRLF ) Decode a string: $EncodedData = 'SSB0b3RhbGx5IGxvdmUgYXV0b2l0IGd1eXMuLi4=' ConsoleWrite( B64Decode($EncodedData) & @CRLF) Decode a UTF-8 string: $EncodedData = '4pagVEhF4oaVQkxPQ0vilqA=' ConsoleWrite( B64Decode($EncodedData, 1) & @CRLF) Encode a file: $FileEncoded = B64Encode(@DesktopDir & 'Test2.txt', 0, 64, 1) ; 0 for ANSI but is irrelevent because its a file and thus is ignored. ; 64 for the line length and 1 meaning its a file we are processing. FileWrite(@DesktopDir & 'Encoded.txt', $FileEncoded) Decode a file: $FileDecoded = B64Decode(@DesktopDir & 'Encoded.txt', 0, 1) ; 0 for ANSI but is irrelevent because its a file and thus is ignored. ; 1 meaning its a file we are processing. $FileSave = FileOpen(@DesktopDir & 'Decoded.txt', 18) ; 18 for overwrite old file and FORCE BINARY MODE (decoded FILE data is raw binary for the file with no en/decoding required.. FileWrite($FileSave, $FileDecoded) FileClose($FileSave) I am interested in seeing what you think about this. At least the code I have made can be edited and tweaked relatively easily compared to other UDF's for this I have seen out there. I also welcome any feedback on the techniques I am using. Here is the UDF so you can see it in the forum instead of having to download it: Local $__b64___B64_list[64] ; #FUNCTION# ==================================================================================================================== ; Name ..........: B64Decode ; Description ...: Decodes the provided base64 input. It strips @CR and @LF on its own. ; Syntax ........: B64Decode([$__b64_input = ''[, $__b64_mode = 0[, $__b64_isfile = 0]]]) ; Parameters ....: $__b64_input - [optional] Base64 data or path and name of file needing to be decoded. Leaving blank shows syntax messagebox. ; $__b64_mode - [optional] 1 = decoded data will be UTF-8 while 0 = decoded data will be ANSI. Default is 0. (not used for files) ; $__b64_isfile - [optional] 0 = input is a string of information. 1 = path and file name to file to be decoded. Default is 0. ; Return values .: Data decoded from base64 to the encoding given from the $__b64_mode variable. Decoded FILE data can be used or written to a file with the forced binary encoding... ; Author ........: Wesley G aka Morthawt ; Modified ......: ; Remarks .......: Decoded FILE data is in raw binary and should be written to a file with forced binary mode. No special encoding or decoding needed ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func B64Decode($__b64_input = '', $__b64_mode = 0, $__b64_isfile = 0) If $__b64_input = '' Then MsgBox(0, 'Hint', 'B64Decode($InputData, 0 = ANSI 1 = is UTF-8, 1 = is a file (filename)') __init_b64_dictionary() If $__b64_mode = 0 Then $__b64_mode = 1 Else $__b64_mode = 4 EndIf Local $__b64_TheBitStream, $__b64_4_SixBitChunks, $__b64_FinalOutput, $__b64_tempvalue If $__b64_isfile Then $__b64_openfile = FileOpen($__b64_input, 0) $__b64_input = FileRead($__b64_openfile) FileClose($__b64_openfile) EndIf $__b64_input = StringReplace($__b64_input, '=', '') $__b64_input = StringReplace($__b64_input, @CR, '') $__b64_input = StringReplace($__b64_input, @LF, '') $__b64_input = StringStripWS($__b64_input, 8) For $__b64_a = 1 To StringLen($__b64_input) $__b64_case = 'N' If StringIsUpper(StringMid($__b64_input, $__b64_a, 1)) Then $__b64_case = 'U' $__b64_TheBitStream &= __init_b64_SixBitBinary(Eval($__b64_case & StringMid($__b64_input, $__b64_a, 1))) Next For $__b64_a = 1 To (Floor(StringLen($__b64_TheBitStream) / 8) * 8) Step 8 $__b64_tempvalue &= Hex(String(__init_b64_FromEightBitBinary(StringMid($__b64_TheBitStream, $__b64_a, 8))), 2) Next If Not $__b64_isfile Then $__b64_FinalOutput = BinaryToString('0x' & $__b64_tempvalue, $__b64_mode) Else $__b64_FinalOutput = '0x' & $__b64_tempvalue EndIf Return $__b64_FinalOutput EndFunc ;==>B64Decode ; #FUNCTION# ==================================================================================================================== ; Name ..........: B64Encode ; Description ...: Encodes the provided input to Base64. ; Syntax ........: B64Encode([$__b64_input = ''[, $__b64_mode = 0[, $__b64_linebreak = 0[, $__b64_isfile = 0]]]]) ; Parameters ....: $__b64_input - [optional] Data or file path and name of a file needing to be encoded to base64. Leaving blank shows syntax messagebox. ; $__b64_mode [optional] 1 = decoded data will be UTF-8 while 0 = decoded data will be ANSI. Default is 0. (not used for files) ; $__b64_linebreak - [optional] Number of base64 characters per line. This should be between 0 and 76 to be standards complient. ; $__b64_isfile - [optional] 0 = input is a string of information. 1 = path and file name to file to be decoded. Default is 0. ; Return values .: Base64 encoded data from the input in the encoding dictated by $__b64_mode. Encoded file data can be used or written to a file. ; Author ........: Wesley G aka Morthawt ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func B64Encode($__b64_input = '', $__b64_mode = 0, $__b64_linebreak = 0, $__b64_isfile = 0) If $__b64_input = '' Then MsgBox(0, 'Hint', 'B64Encode($InputData, 0 = ANSI 1 = is UTF-8, 0-76 Linebreak, 1 = is a file (filename)') __init_b64_dictionary() If $__b64_linebreak > 76 Then MsgBox(0, 'Error', 'Base64 encode linebreak cannot exceed 76 characters.') Exit EndIf If $__b64_mode = 0 Then $__b64_mode = 1 Else $__b64_mode = 4 EndIf Local $__b64_TheBitStream, $__b64_4_SixBitChunks, $__b64_FinalOutput, $__b64_tempvalue, $__b64_FinalOutput2 If Not $__b64_isfile Then $__b64_o_UTF_8 = StringTrimLeft(StringToBinary($__b64_input, $__b64_mode), 2) Else $__b64_openfile = FileOpen($__b64_input, 16) $__b64_o_UTF_8 = StringTrimLeft(FileRead($__b64_openfile), 2) FileClose($__b64_openfile) EndIf For $__b64_a = 1 To StringLen($__b64_o_UTF_8) Step 2 $__b64_TheBitStream &= __init_b64_EightBitBinary('0x' & StringMid($__b64_o_UTF_8, $__b64_a, 2)) Next For $__b64_a = 1 To StringLen($__b64_TheBitStream) Step +6 $__b64_Number = __init_b64_FromSixBitBinary(StringMid($__b64_TheBitStream, $__b64_a, 6)) $__b64_FinalOutput &= $__b64___B64_list[$__b64_Number] Next While Floor(StringLen($__b64_FinalOutput) / 4) <> (StringLen($__b64_FinalOutput) / 4) $__b64_FinalOutput &= '=' WEnd If $__b64_linebreak > 0 Then For $__b64_a = 1 To StringLen($__b64_FinalOutput) Step $__b64_linebreak $__b64_FinalOutput2 &= StringMid($__b64_FinalOutput, $__b64_a, $__b64_linebreak) If $__b64_linebreak > 0 Then If StringLen(StringMid($__b64_FinalOutput, $__b64_a, $__b64_linebreak)) = $__b64_linebreak And $__b64_a <= (StringLen($__b64_FinalOutput) - $__b64_linebreak) Then $__b64_FinalOutput2 &= @CRLF EndIf Next Else $__b64_FinalOutput2 = $__b64_FinalOutput EndIf Return $__b64_FinalOutput2 EndFunc ;==>B64Encode ; #INTERNAL_USE_ONLY# =========================================================================================================== ; Name ..........: __init_b64_dictionary ; Description ...: Used to initialize the base64 dictionary used in conversions ; Syntax ........: __init_b64_dictionary() ; Parameters ....: None ; Return values .: None ; Author ........: Wesley G aka Morthawt ; Modified ......: ; Remarks .......: Creates an array with base64 dictionary. Also creates variables with direct names for easy and quick access while decoding letters to numbers. ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func __init_b64_dictionary() Global $__b64___B64_list[64] For $__b64_a = 0 To 63 Select Case $__b64_a < 26 $__b64___B64_list[$__b64_a] = ChrW(65 + $__b64_a) Assign('U' & ChrW(65 + $__b64_a), $__b64_a, 2) Case $__b64_a < 52 $__b64___B64_list[$__b64_a] = ChrW(71 + $__b64_a) Assign('N' & ChrW(71 + $__b64_a), $__b64_a, 2) Case $__b64_a < 62 $__b64___B64_list[$__b64_a] = ChrW($__b64_a - 4) Assign('N' & ChrW($__b64_a - 4), $__b64_a, 2) Case $__b64_a = 62 $__b64___B64_list[$__b64_a] = ChrW(43) Assign('N' & ChrW(43), $__b64_a, 2) Case $__b64_a = 63 $__b64___B64_list[$__b64_a] = ChrW(47) Assign('N' & ChrW(47), $__b64_a, 2) EndSelect Next EndFunc ;==>__init_b64_dictionary ; #INTERNAL_USE_ONLY# =========================================================================================================== ; Name ..........: __init_b64_EightBitBinary ; Description ...: Outputs an 8-bit binary string from an input integer between 0 and 255 ; Syntax ........: __init_b64_EightBitBinary([$__b64_input = 0]) ; Parameters ....: $__b64_input - [optional] Integer between 0 and 255 Default is 0. ; Return values .: 8-bit binary string representing the input integer ; Author ........: Wesley G aka Morthawt ; Modified ......: ; Remarks .......: An 8-bit binary string looks like 10101010 ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func __init_b64_EightBitBinary($__b64_input = 0) If $__b64_input < 256 Then $__b64_tmpbitstream = '' $__b64_start = 128 While $__b64_start >= 1 If Floor($__b64_input / $__b64_start) Then $__b64_tmpbitstream &= 1 $__b64_input -= ($__b64_start * Floor($__b64_input / $__b64_start)) Else $__b64_tmpbitstream &= 0 EndIf $__b64_start /= 2 WEnd Else $__b64_tmpbitstream = 0 EndIf Return $__b64_tmpbitstream EndFunc ;==>__init_b64_EightBitBinary ; #INTERNAL_USE_ONLY# =========================================================================================================== ; Name ..........: __init_b64_SixBitBinary ; Description ...: Outputs a 6-bit binary string from an input integer between 0 and 63 ; Syntax ........: __init_b64_SixBitBinary([$__b64_input = 0]) ; Parameters ....: $__b64_input - [optional] An integer between 0 and 63. Default is 0. ; Return values .: A 6-bit binary string representing the input integer ; Author ........: Wesley G aka Morthawt ; Modified ......: ; Remarks .......: A 6-bit binary string looke like 101010 ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func __init_b64_SixBitBinary($__b64_input = 0) If $__b64_input < 64 Then $__b64_tmpbitstream = '' $__b64_start = 32 While $__b64_start >= 1 If Floor($__b64_input / $__b64_start) Then $__b64_tmpbitstream &= 1 $__b64_input -= ($__b64_start * Floor($__b64_input / $__b64_start)) Else $__b64_tmpbitstream &= 0 EndIf $__b64_start /= 2 WEnd Else $__b64_tmpbitstream = 0 EndIf Return $__b64_tmpbitstream EndFunc ;==>__init_b64_SixBitBinary ; #INTERNAL_USE_ONLY# =========================================================================================================== ; Name ..........: __init_b64_FromSixBitBinary ; Description ...: Outputs an integer between 0 and 63 based on a 6-bit binary input. ; Syntax ........: __init_b64_FromSixBitBinary([$__b64_input = 0]) ; Parameters ....: $__b64_input - [optional] 6-bit binary input. Default is 0. ; Return values .: Integer between 0 and 63 ; Author ........: Wesley G aka Morthawt ; Modified ......: ; Remarks .......: A 6-bit binary string looke like 101010 ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func __init_b64_FromSixBitBinary($__b64_input = 0) $__b64_base = 32 $__b64_tempvalue = 0 For $__b64_a = 1 To 6 If StringMid($__b64_input, $__b64_a, 1) = 1 Then $__b64_tempvalue += $__b64_base EndIf $__b64_base /= 2 Next Return $__b64_tempvalue EndFunc ;==>__init_b64_FromSixBitBinary ; #INTERNAL_USE_ONLY# =========================================================================================================== ; Name ..........: __init_b64_FromEightBitBinary ; Description ...: Outputs an integer between 0 and 255 from an 8-bit binary input. ; Syntax ........: __init_b64_FromEightBitBinary([$__b64_input = 0]) ; Parameters ....: $__b64_input - [optional] An 8-bit binary string. Default is 0 ; Return values .: Integer between 0 and 255 ; Author ........: Wesley G aka Morthawt ; Modified ......: ; Remarks .......: An 8-bit binary string looks like 10101010 ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func __init_b64_FromEightBitBinary($__b64_input = 0) $__b64_base = 128 $__b64_tempvalue = 0 For $__b64_a = 1 To 8 If StringMid($__b64_input, $__b64_a, 1) = 1 Then $__b64_tempvalue += $__b64_base EndIf $__b64_base /= 2 Next Return $__b64_tempvalue EndFunc ;==>__init_b64_FromEightBitBinary Edit 01: Updated to also strip white space before decoding. Because I tried to decode someone's test on a "How base64 works" website and there were spaces at the end of each line of encoded base64. Once I decoded it, there was only a few words of the original text instead of the whole paragraph. Stripping all white space from the encoded information prior to attempting to decode prevents this issue. Base64 Perfect! FINAL!+15.au3 UDFB64.au31 point
-
Html-Imager Update of 17 Dec 2014
mesale0077 reacted to wakillon for a topic
A simple script for generate a Html file with Images and some few features. As usual external files and includes are embedded. Compatible with AutoIt Versions 3.3.8.1 to 3.3.13.19 ChangeLog v 1.0.1.3 You can now Add/Manage Prev/Next/Home/Top/Bottom Page Links from Gui Menu. Previous downloads : 111 Downloads available in the download section Hope this example can be useful to someone !1 point -
File to Base64 String Code Generator v1.20 Build 2020-06-05 (embed your files easily)
mesale0077 reacted to UEZ for a topic
Sure, try this: #include <Array.au3> #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <GuiImageList.au3> #include <GuiListView.au3> #include <ListViewConstants.au3> #include <WindowsConstants.au3> #include <GDIPlus.au3> Opt("GUIOnEventMode", 1) ;1=Enables OnEvent functions notifications / 0=Disable (Default) Global $MainGui, $MsgOk, $MainGuiRefresh, $MainGuiLabelInfo Global $MainGuiW = @DesktopWidth - 10, $MainGuiH = @DesktopHeight - 90 _GDIPlus_Startup() Global $hBmp = _GDIPlus_BitmapCreateFromMemory(ScanNew32x32(), True) ;GDI bitmap $MainGui = GUICreate("Test Sort", $MainGuiW, $MainGuiH, -1, -1, BitOR($GUI_SS_DEFAULT_GUI, $WS_CLIPSIBLINGS)) ; GUISetOnEvent($GUI_EVENT_CLOSE, "EventsCtrl") $MMenuLVAD = GUICtrlCreateListView("|Value 1|Value 2|Value 3|Value 4", 10, 82, 761, 321, -1, BitOR($LVS_EX_CHECKBOXES, $LVS_EX_FULLROWSELECT, $LVS_EX_HEADERDRAGDROP, $LVS_EX_GRIDLINES, $LVS_EX_DOUBLEBUFFER,$LVS_EX_SUBITEMIMAGES)) _GUICtrlListView_SetBkColor($MMenuLVAD, 0xf4ffff) GUICtrlSetOnEvent($MMenuLVAD, "_Setsort") _GUICtrlListView_RegisterSortCallBack($MMenuLVAD) ; Load images Global $hImage = _GUIImageList_Create(32, 32, 5, 3) _GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", -7) _GUIImageList_Add($hImage, $hBmp) _GUICtrlListView_SetImageList($MMenuLVAD, $hImage, 1) ; 1 - Image list with small icons GUISetState(@SW_SHOW) For $i = 0 To 100 _GUICtrlListView_AddItem($MMenuLVAD, "", 300) ;300 porque es un indice que no existe en el vector de iconos _GUICtrlListView_AddSubItem($MMenuLVAD, $i, "Computer" & Random(13467, 23452, 1), 1, 0) _GUICtrlListView_AddSubItem($MMenuLVAD, $i, "User" & Random(100, 500, 1), 2, 1) _GUICtrlListView_AddSubItem($MMenuLVAD, $i, Random(25, 5000, 1), 3,2) _GUICtrlListView_AddSubItem($MMenuLVAD, $i, Random(1, 800, 1), 4) Next _GDIPlus_Shutdown() While 1 Sleep(10) WEnd Func _Setsort() _GUICtrlListView_SortItems($MMenuLVAD, GUICtrlGetState($MMenuLVAD)) EndFunc ;==>_Setsort Func EventsCtrl() Local $Msg = @GUI_CtrlId Switch $Msg Case $GUI_EVENT_CLOSE _GUICtrlListView_UnRegisterSortCallBack($MMenuLVAD) _WinAPI_DeleteObject($hBmp) GUIDelete() Exit EndSwitch EndFunc ;==>EventsCtrl Func ScanNew32x32() Local $ScanNew32x32png $ScanNew32x32png &= 'iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3goUAQsnNhcJAQAACIhJREFUWMOtlklwHNUZx/+vt5lpzWg2SSNpLI0sC1k2XoSMwSCM7bCYShVlpTiQrTA4JLmEYCpJkVtcSVVOWZTKjUoAlUOASlIRwVV4iVFiULBiywvY1u4ZjUb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fBRD4uIQaAPvy9TMJOWS3NIR53Bnuwt2NX0JQCoIDQdQbw66WfWjxx3GGHsNkAwvKQZIoNsAj1ALv37ffB+AuAMsAlkZHTpg37wU6JerzmAh4TTT4OLQFIuCIB4QQeAURzUIQFAEEvTb8Hh1ekdTVB4KiUGPsEoAogOSn4QCgrVp5r2WXHGMZGe04xlbSaAvsQnvgUZStJBaUEaTVC1DMKQi6rnOGW/LZISLUUvPRkRPl/n37rwLo79+3nwEoAigAsFaXMtTMLM9ZnfmSYn8QWlDHUe/h4LgPwqTzyFb/huXqGCzLx4yMlaquOJeWM/M5oadrw/+KvQ3AOgCtAGIAqgAyAJIAFAAigFCsdR0rXy9fzDfo92qN/H2bdkjw8FOo2ENg7gLCdQqyJQ/yk0YhO2m8wUv2OQBUWFxcwNE3Zj4K1YfC4WBw9OXfDf2yf9/+hwF0AGgDsAbgOoAUgDOjIydyn7ECFj8ek5GYJzfzb+k7QSruETsnwiSyBN0wkV4uODOT9rWZ89pfi2k2VFi80Q3Jzv7+g4SIg5IoLrvgznwMSgOYBjA3OnKiWMtuyXsg3/+QuL37DvnBTd3CpmiYhAzLpQuL7sLktHX+wrj6fuoKPmnj/wG1Jc98TP5pLwAAAABJRU5ErkJggg==' Return Binary(_Base64Decode($ScanNew32x32png)) EndFunc ;==>_ScanNew32x32png Func _Base64Decode($input_string) Local $struct = DllStructCreate("int") Local $a_Call = DllCall("Crypt32.dll", "int", "CryptStringToBinary", "str", $input_string, "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", $input_string, "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 Br, UEZ1 point -
PincoPanco, Here is the majority of what you want implemented very easily - sort on header click and editable on double click (except column 0): #include <GUIConstantsEx.au3> #include <GuiListViewEx.au3> #include <Array.au3> Opt("GUIOnEventMode", 1) Global $My_Array[99][13] $Array_Edit = GUICreate("Array edit", 520, 280, -1, -1) $listview = GUICtrlCreateListView("ID|Janu|Febr|Marc|Apri|May |June|July|Augu|Sept|Octo|Nove|Dece", 10, 10, 500, 218) _GUICtrlListView_SetExtendedListViewStyle($listview, $LVS_EX_GRIDLINES) ; filling of array and ListView ---- Local $Row = "" For $x = 0 To 98 $My_Array[$x][0] = $x $Row = $My_Array[$x][0] & "|" For $y = 1 To 12 $My_Array[$x][$y] = Random(0, 1000, 1) $Row &= $My_Array[$x][$y] & "|" Next GUICtrlCreateListViewItem(StringTrimRight($Row, 1), $listview) Next Global $iLV_Index = _GUIListViewEx_Init($listview, $My_Array, 0, 0, False, 3, "1-12") ; create some buttons (only one used at the moment) GUICtrlCreateGroup("", 10, 230, 290, 42) ; $button1 = GUICtrlCreateButton("Show array", 20, 244, 70, 20) GUICtrlSetTip($button1, "Show current array status via _ArrayDisplay") GUICtrlSetOnEvent($button1, "_button1") ; GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit") GUISetState(@SW_SHOW) _GUIListViewEx_MsgRegister() While 1 Sleep(10) _GUIListViewEx_EditOnClick() WEnd Func _button1() $aTempArray = _GUIListViewEx_ReturnArray($iLV_Index) _ArrayDisplay($aTempArray, "current array status") EndFunc ;==>_button1 Func _Exit() $My_Array = _GUIListViewEx_ReturnArray($iLV_Index) _ArrayDisplay($My_Array, "This is the resulting array") Exit EndFunc ;==>_Exit The outstanding item is the non-sorting of the first column. This cannot be excluded from the overall sort as the process sorts all columns in the ListView. My current thought is to place these values in a second ListView and link the scrolling so that they are in sync - that should give me something to do this afternoon. M231 point
-
When putting this together I originally had in mind to use the functions for another script I have but then I noticed that the process of doing this would increase the file size slightly, so I abandoned the idea and made this instead. Thanks to Trancexx for the resource updating and almost everything else, all I did was put it together in a way that it would let me edit icons in exes. Also thanks to who ever made the _Res_Update() function in the autoit3wrapper since I also included that but didn't use it so the function is there if any one wants to play with this. I didn't spend too much time on this so I didn't do proper error checking and other things, but it works and If I were you I'd save a copy of any file you edit. Icon Edit .au3 New version, better UI and less buggy. Icon Changer Concept.au3 Take note! The script only replaces group icons (14), this can be changed of course, but like I said, I didn't spend enough time on it. This means that if you attempt to replace an index of a group icon, it will obviously replace the entire icon resource. Also, deleting resources just overwrites the resource with PADDINGXX bytes.1 point