Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/11/2012 in all areas

  1. Probably should be something like this: Func _NtOpenProcess($PID) Local $sOA = DllStructCreate($tagOBJECTATTRIBUTES) DllStructSetData($sOA, "Length", DllStructGetSize($sOA)) DllStructSetData($sOA, "RootDirectory", 0) DllStructSetData($sOA, "ObjectName", 0) DllStructSetData($sOA, "Attributes", $OBJ_CASE_INSENSITIVE) DllStructSetData($sOA, "SecurityDescriptor", 0) DllStructSetData($sOA, "SecurityQualityOfService", 0) Local $ClientID = DllStructCreate("dword_ptr UniqueProcessId;dword_ptr UniqueThreadId") DllStructSetData($ClientID, "UniqueProcessId", $PID) DllStructSetData($ClientID, "UniqueThreadId", 0) Local $aCall = DllCall("ntdll.dll", "hwnd", "NtOpenProcess", "handle*", 0, "dword", 0x001F0FFF, "struct*", $sOA, "struct*", $ClientID) If Not NT_SUCCESS($aCall[0]) Then ConsoleWrite("Error in NtOpenProcess: " & Hex($aCall[0], 8) & @CRLF) Return SetError(1, 0, $aCall[0]) Else Return $aCall[1] EndIf EndFunc
    1 point
  2. stormbreaker

    how to protect my work

    Read the AutoIt Wiki: http://www.autoitscript.com/wiki/FAQ#How_can_I_protect_my_code_from_decompilation.3F. Also, you must understand that the forum rules don't permit us to share counter-measures against decompilers.
    1 point
  3. corgano

    [s]Unzipping[/s] Zipping

    Thanks! That is almost perfect, but it needs to extract all files in the file to the output folder. I am working on modifying it. The UDF I am using now uses a DLL and is rather large. *EDIT* I was able to modify it to extract all files in the folder, and I removed a few of the things i didn't need. Very nice, a lot smaller than the one I was using (over 100 lines and a DLL to about 50 lines) Thank you all. here's the func _ExtractZip("C:\Users\David\Desktop\New folder\Maps1.zip", "C:\Users\David\Desktop\New folder\maps") ; #FUNCTION# ;=============================================================================== ; ; Name...........: _ExtractZip ; Description ...: Extracts file/folder from ZIP compressed file ; Syntax.........: _ExtractZip($sZipFile, $sDestinationFolder) ; Parameters ....: $sZipFile - full path to the ZIP file to process ; $sDestinationFolder - folder to extract to. Will be created if it does not exsist exist. ; Return values .: Success - Returns 1 ; - Sets @error to 0 ; Failure - Returns 0 sets @error: ; |1 - Shell Object creation failure ; |2 - Destination folder is unavailable ; |3 - Structure within ZIP file is wrong ; |4 - Specified file/folder to extract not existing ; Author ........: trancexx, modifyed by corgano ; ;========================================================================================== Func _ExtractZip($sZipFile, $sDestinationFolder, $sFolderStructure = "") Local $i Do $i += 1 $sTempZipFolder = @TempDir & "\Temporary Directory " & $i & " for " & StringRegExpReplace($sZipFile, ".*\\", "") Until Not FileExists($sTempZipFolder) ; this folder will be created during extraction Local $oShell = ObjCreate("Shell.Application") If Not IsObj($oShell) Then Return SetError(1, 0, 0) ; highly unlikely but could happen EndIf Local $oDestinationFolder = $oShell.NameSpace($sDestinationFolder) If Not IsObj($oDestinationFolder) Then DirCreate($sDestinationFolder) ;~ Return SetError(2, 0, 0) ; unavailable destionation location EndIf Local $oOriginFolder = $oShell.NameSpace($sZipFile & "\" & $sFolderStructure) ; FolderStructure is overstatement because of the available depth If Not IsObj($oOriginFolder) Then Return SetError(3, 0, 0) ; unavailable location EndIf Local $oOriginFile = $oOriginFolder.Items();get all items If Not IsObj($oOriginFile) Then Return SetError(4, 0, 0) ; no such file in ZIP file EndIf ; copy content of origin to destination $oDestinationFolder.CopyHere($oOriginFile, 20) ; 20 means 4 and 16, replaces files if asked DirRemove($sTempZipFolder, 1) ; clean temp dir Return 1 ; All OK! EndFunc
    1 point
×
×
  • Create New...