automatizar el proceso
Publicado: 05 May 2014, 07:38
				
				Hola a todos acabo de terminar el siguiente codigo / cliente en autoit 
el problema es que quiero crear el stub pero meter el siguiente codigo :
y luego me guarde un archivo nuevo ejemplo: trabajo.exe con el codigo de arriba del stub ...
ojala me ayan entendido es todo y gracias
			Código: Seleccionar todo
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Process Protect By zero", 331, 90, -1, -1)
$Button1 = GUICtrlCreateButton("Buscar", 224, 32, 99, 25)
$Input1 = GUICtrlCreateInput("- -", 8, 8, 313, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_CENTER))
$Button2 = GUICtrlCreateButton("Protejer", 224, 56, 99, 25)
$Label1 = GUICtrlCreateLabel("Creditos: zero (Nonkillable process)", 8, 32, 209, 20)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit
		case $Button1
			GUICtrlSetData($Input1, FileOpenDialog('Eliga el archivo a protejer!', @ScriptDir, 'EXE (*.exe)'))
		case $Button2
			Local $nStub = FileRead('Stub.exe')
			Local $nOpen = FileOpen(Guictrlread($Input1))
			Local $nRead = FileRead($nOpen)
			FileClose($nOpen)
			Local $nDelimiter = 'Process//Protect'
			Local $nNew = FileOpen('prueba.exe', 17)
			FileWrite($nNew, $nStub)
			FileWrite($nNew, $nDelimiter)
			FileWrite($nNew, $nRead)
			FileClose($nNew)
			MsgBox(64, 'Listo!', 'Ejecutable protejido con exito!')
	EndSwitch
WEnd
Código: Seleccionar todo
Func sNonKillableProcess()
Local $sProcessHandle , $sSignedvalue , $ProcessIoPriority , $sProcessInformationLength , $sStruct
If Not @Compiled Then Exit
$sProcessHandle = DllCall("kernel32.dll", "handle", "GetCurrentProcess")
$sSignedvalue = 0x8000F129 ;0xFFFFFFFF (BSOD not work on Win7 x86 )
$ProcessIoPriority = 0x21
$sProcessInformationLength = 0x4
$sStruct = DLLStructCreate("Byte[4]")
DllStructSetData($sStruct, 1, $sSignedvalue)
$sRet = DllCall ("ntdll.dll" , "none" , "ZwSetInformationProcess" , "int" , $sProcessHandle[0] , "int" , _
$ProcessIoPriority , "int" , DllStructGetPtr($sStruct) , "int" , $sProcessInformationLength)
EndFuncojala me ayan entendido es todo y gracias