Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/09/2014 in all areas

  1. There was a thread in general support forum the other day about possibility of compiled executable to verify binary integrity of itself when run. I can't find the topic now to link it, but meh never mind. Logical solution is to calculate checksum of the exe and save it somewhere. Later when the executable is run the checksum is calculated again and compared to the saved value. If they match, all is ok, and if they don't the exe was altered and verification fails. The obvious problem is how and where to store the hash value. Alternate data stream seems the simplest solution. That way the hash is bound to the exe only and the risks of unwanted manipulations are relatively low. The problem could be if the exe is saved and run from non-NTFS file systems. Another problem is that any read/write action on exe file usually ends up with ADS being deleted. The other solution is registry writing, but that bounds exe and hash to the system. For another system (or even user) the checking wouldn't be valid. Third solution is using some sort of ini file. But that means ini has to go everywhere exe goes, otherwise again the check wouldn't make sense. And it would be too simple for someone to manipulate data, to the level the check wouldn't make sense. So, this is kind of fourth option. CheckSumVerify2.a3x script below is include file that will calculate the hash of the executable on the first run, save it directly inside that executable using special technique and recheck the hash on every new run. If the new hash wouldn't match the saved one, the script will show message box saying that and further execution will be aborted. CheckSumVerify2.a3x Just to say that I haven't done any complicated tests to see if it would work in outer space, or even on all supported systems. However my guess is it should work. Don't UPX the compiled executables, because I'm calculating checksum of the image on disk and not the one in memory. Here's small example of usage: #include "CheckSumVerify2.a3x" If @Compiled Then MsgBox(64 + 262144, "Aha!", "This is an example exe that does nothing except showing this message." & @CRLF & @CRLF & _ "But if you change the binary of me I will show error message and won't allow further execution." & @CRLF & _ $cmdlineraw) Else MsgBox(64 + 262144, "Hey", "This is an example script that does nothing except showing this message." & @CRLF & @CRLF & _ "But if you compile me I will check binary integrity of the compiled executable every time its run.") EndIf If something wouldn't work, or if you have any questions - simply post here. I'll do my best to answer.
    1 point
  2. A simple example of listing installed applications using ObjCreateInterface. Update. 10/09/2014 ;Danyfirex 06/09/2014 #include <Array.au3> Opt("MustDeclareVars", 1) Global Const $sTagAppInfoData = "UINT cbSize;UINT dwMask;ptr pszDisplayName;ptr pszVersion;ptr pszPublisher;ptr pszProductID;" & _ "ptr pszRegisteredOwner;ptr pszRegisteredCompany;ptr pszLanguage;ptr pszSupportUrl;ptr pszSupportTelephone;" & _ "ptr pszHelpLink;ptr pszInstallLocation;ptr pszInstallSource;ptr pszInstallDate;ptr pszContact;ptr pszComments;" & _ "ptr pszImage;ptr pszReadmeUrl;ptr pszUpdateInfoUrl" Global Const $sCLSID_EnumInstalledApps = "{0B124F8F-91F0-11D1-B8B5-006008059382}" Global Const $sIID_IEnumInstalledApps = "{1BC752E1-9046-11D1-B8B3-006008059382}" Global Const $sTagIEnumInstalledApps = "Next hresult(ptr*);Reset hresult();" Global Const $sIID_IShellApp = "{A3E14960-935F-11D1-B8B8-006008059382}" Global Const $sShellApp = "GetAppInfoData hresult(ptr);" Global Const $AIM_DISPLAYNAME = 0x00000001 Global Const $AIM_VERSION = 0x00000002 Global Const $AIM_PUBLISHER = 0x00000004 Global Const $AIM_PRODUCTID = 0x00000008 Global Const $AIM_REGISTEREDOWNER = 0x00000010 Global Const $AIM_REGISTEREDCOMPANY = 0x00000020 Global Const $AIM_LANGUAGE = 0x00000040 Global Const $AIM_SUPPORTURL = 0x00000080 Global Const $AIM_SUPPORTTELEPHONE = 0x00000100 Global Const $AIM_HELPLINK = 0x00000200 Global Const $AIM_INSTALLLOCATION = 0x00000400 Global Const $AIM_INSTALLSOURCE = 0x00000800 Global Const $AIM_INSTALLDATE = 0x00001000 Global Const $AIM_CONTACT = 0x00004000 Global Const $AIM_COMMENTS = 0x00008000 Global Const $AIM_IMAGE = 0x00020000 Global Const $AIM_READMEURL = 0x00040000 Global Const $AIM_UPDATEINFOURL = 0x00080000 Local $aArray = GetInstalledApps(BitOR($AIM_DISPLAYNAME, $AIM_INSTALLDATE)) _ArrayDisplay($aArray, "GetInstalledApps", Default, Default, Default, "NAME|INSTALLDATE") $aArray = GetInstalledApps(BitOR($AIM_DISPLAYNAME, $AIM_UPDATEINFOURL)) _ArrayDisplay($aArray, "GetInstalledApps", Default, Default, Default, "DISPLAYNAME|UPDATEINFOURL") $aArray = GetInstalledApps(BitOR($AIM_DISPLAYNAME, $AIM_INSTALLDATE, $AIM_INSTALLLOCATION)) _ArrayDisplay($aArray, "GetInstalledApps", Default, Default, Default, "DISPLAYNAME|INSTALLLOCATION|INSTALLDATE") Func GetInstalledApps($iMask = $AIM_DISPLAYNAME) Local $oEnumInstalledApps = ObjCreateInterface($sCLSID_EnumInstalledApps, $sIID_IEnumInstalledApps, $sTagIEnumInstalledApps) If @error Then Return 0 Local $pShellApp = 0 Local $oShellApp = 0 Local $AppInfoData = DllStructCreate($sTagAppInfoData) Local $pAppInfoData = DllStructGetPtr($AppInfoData) Local $i = 0 Local $aArray[0][0] Local $iF = 1 Local $tData = 0 Local $sData = "" Local $aMax = nCol($iMask) While $oEnumInstalledApps.Next($pShellApp) = 0 And $pShellApp <> 0 $oShellApp = ObjCreateInterface($pShellApp, $sIID_IShellApp, $sShellApp) If @error Then Return 0 DllStructSetData($AppInfoData, "cbSize", DllStructGetSize($AppInfoData)) DllStructSetData($AppInfoData, "dwMask", $iMask) $oShellApp.GetAppInfoData($pAppInfoData) ReDim $aArray[$iF][UBound($aMax)] For $i = 0 To UBound($aMax) - 1 $tData = DllStructCreate("wchar[260]", DllStructGetData($AppInfoData, $aMax[$i] + 2)) $sData = DllStructGetData($tData, 1) If $aMax[$i] = 13 Then $sData = StringMid($sData, 7, 2) & "/" & StringMid($sData, 5, 2) & "/" & StringMid($sData, 1, 4) $aArray[$iF - 1][$i] = ($sData = "0") ? "" : $sData DllStructSetData($tData, 1, "") Next $oShellApp = Null $iF += 1 WEnd $oEnumInstalledApps = Null Return $aArray EndFunc ;==>GetInstalledApps Func nCol($iMask) Local $aFlag[18] = [$AIM_DISPLAYNAME, $AIM_VERSION, $AIM_PUBLISHER, $AIM_PRODUCTID, $AIM_REGISTEREDOWNER, $AIM_REGISTEREDCOMPANY, _ $AIM_LANGUAGE, $AIM_SUPPORTURL, $AIM_SUPPORTTELEPHONE, $AIM_HELPLINK, $AIM_INSTALLLOCATION, $AIM_INSTALLSOURCE, _ $AIM_INSTALLDATE, $AIM_CONTACT, $AIM_COMMENTS, $AIM_IMAGE, $AIM_READMEURL, $AIM_UPDATEINFOURL] Local $iCol = 0 Local $x = 0 Local $aCol[18] For $i = 0 To UBound($aFlag) - 1 If BitAND($iMask, $aFlag[$i]) Then $aCol[$x] = $i + 1 $x += 1 EndIf Next ReDim $aCol[$x] Return $aCol EndFunc ;==>nCol Saludos
    1 point
  3. Melba23

    Image Search?

    Pan69Stefan, Welcome to the AutoIt forums. Which game are you botting? M23
    1 point
  4. Read through the change log from 3.3.8.0. Each function you see what has changed, make a note of them all, search it in your scripts and make the changes, if any needed. Do this after backing up all of your scripts somewhere. Upgrade version run scripts on test material, until you have all kinks worked ot. Don't forget, you're computer will probably not explode, and you can always revert back to 3.3.8.0 with backed up scripts if it all goes tit's up. Plus the wonderful AutoIt gang will help you out if you get into difficulty.
    1 point
  5. I tried a couple of tests against compiled EXE's only. I compiled using your msgbox text and added the, #include "CheckSumVerify.au3", to one of my scripts. In both cases, I used a hex editor and made a one byte change to each EXE. When running, both modified EXE's., I got the expected results, a message box, "Binary integrity can't be verified. Exiting...". I like the fact, all you have to do is add, #include "CheckSumVerify.au3", to include it in your script and this could be done after all the testing and debugging is complete and right before distributing. I like this better than doing a hash compare and the user knows to go get the file again. However, I can see a possible issue. You had stated, do not use UPX. I would assume, a similar issue would occur if you then added code signing to the EXE. Overall, I like it. Thanks, Edit: I am using the latest AutoIt and Beta and spelling edit.
    1 point
  6. Probably knock an hour off by getting rid of the console writes.
    1 point
  7. Because it's a bug.Snippet from the other guy isn't relevant. When you use {ASC ...} with HotkeySet() then you will always register letter A regardless of the key specified. That's because "ASC" starts with letter "A". ;... HotKeySet("{ASC 0x0042}", "Whatever") ; press A, which is not {ASC 0x0042} in any case Func Whatever() MsgBox(32 + 262144, Default, "What hotkey was pressed?", 3) EndFunc ;...
    1 point
  8. 2014-Sep-06, Changelog v8 > v9 Added - Duplicates Search "Hash-Cache" functionality (optional), calculated hashes are cached and re-used in next search run to improve duplicate search speed Fixed - Option to Auto-update Folder Treeview sometimes crashed (e.g. new drives added) Report - Added memory check function, if more than 90% of memory is in use, do not create any more icons / thumbnail previews Report - Added option to change report icon size with CTRL+MouseWheel Updated - Lots of other bug fixes and style changes Updated - SQLite Dll to 3.8.6 Updated - MediaInfo Dll to 0.7.70 Updated - TrID Definitions to version 2014 Aug 23 Source and Executable are available at http://www.funk.eu Best Regards Updated first Post... Enjoy ...
    1 point
×
×
  • Create New...