Author: wolf.b
Posted: Thu Mar 10, 2016 5:56 pm (GMT -6)
This script correctly passes two zero-bytes in AddList:
Posted: Thu Mar 10, 2016 5:56 pm (GMT -6)
This script correctly passes two zero-bytes in AddList:
Code: |
#NoEnv ; don't check empty variables If Not (A_PtrSize = 4) { ; need 32bit Run, "%A_AhkPath%\..\AutoHotkeyA32.exe" "%A_ScriptFullPath%" ExitApp } DllFile := "D:\TotalCMD\Plugins\WCX\CHMDir\CHMDir.wcx" PackedFile := "R:\Bandaged Cubes\Bandaged Cubes.chm" oFileList := [ "" ] ; calculate required size for AddList and set capacity Size_AddList := 1 Loop, % oFileList.MaxIndex() Size_AddList += StrLen(oFileList[A_Index]) + 1 VarSetCapacity(AddList, Size_AddList, 0) ; fill wth zero-terminated strings Offset := 0 Loop, % oFileList.MaxIndex() StrPut(oFileList[A_Index], &AddList + Offset, "CP0") , Offset += StrLen(oFileList[A_Index]) + 1 ; call packer DLL DllCall(DllFile "\PackFiles", "UInt", &PackedFile, "UInt", &SubPath , "UInt", &SrcPath, "UInt", &AddList, "Int", 0) |