Function at 0x4015c0
Capabilities:
Allocate or change rwx memory
Check if file exists
Create process on windows
Create process suspended
Execute shellcode via indirect call
Get common file path
Get file attributes
Get file size
Move file
Parse pe header
Read file on windows
Resume thread
Suspend thread
Terminate process
Use process replacement

Disassembly:
mov eax, dword fs:[0]
push 0xffffffffffffffff
push 0x408db1
push eax
mov dword fs:[0], esp
sub esp, 0xa24
push ebx
push ebp
push esi
push edi
push 0x104
push 0x40bf90
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
test eax, eax
mov ebx, 1
je 0x401696
push 0x40bf90
push str.System_Directory:__s_n
call fcn.004024e0
mov edi, str.drvmgt.dll
or ecx, 0xffffffff
xor eax, eax
add esp, 8
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
push 0x40bf90
mov esi, edi
mov edx, ecx
mov edi, 0x40bf90
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x401696
push str..disable
push 0x40bf90
lea eax, [esp + 0x3a0]
push str._s_s
push eax
call fcn.00402ce2
add esp, 0x10
lea ecx, [esp + 0x398]
push ecx
push 0x40bf90
call dword [sym.imp.KERNEL32.dll_MoveFileA]
test eax, eax
jne 0x401690
push str.Unable_to_disable_SafeDiscShim__r_n
call fcn.004010b0
add esp, 4
jmp 0x401696
mov dword [0x40c09c], ebx
mov dword [0x40bf8c], 0x40b049
call fcn.00401470
mov ecx, 0x41
xor eax, eax
lea edi, [esp + 0xb0]
xor ebp, ebp
rep stosd dword es:[edi], eax
mov eax, dword [esp + 0xa44]
mov dword [esp + 0x10], ebp
cmp eax, 2
jge 0x4018b8
push 0x40b518
push 0x40b504
call fcn.00403007
mov esi, eax
add esp, 8
cmp esi, ebp
je 0x40178e
push esi
lea edx, [esp + 0xb4]
push 0x104
push edx
call fcn.004031d0
push esi
call fcn.00402e87
lea edi, [esp + 0xc0]
or ecx, 0xffffffff
xor eax, eax
add esp, 0x10
repne scasb al, byte es:[edi]
not ecx
dec ecx
je 0x40178e
lea eax, [esp + 0xb0]
push 0x40b500
push eax
call fcn.00403150
add esp, 8
test eax, eax
je 0x401747
lea ecx, [esp + 0xb0]
push 0x40b500
push ecx
call fcn.00403150
add esp, 8
mov byte [eax], 0
lea edx, [esp + 0xb0]
push 0x40b4fc
push edx
call fcn.00403150
add esp, 8
test eax, eax
je 0x401778
lea eax, [esp + 0xb0]
push 0x40b4fc
push eax
call fcn.00403150
add esp, 8
mov byte [eax], 0
lea edx, [esp + 0xb0]
lea ecx, [esp + 0xb0]
test edx, edx
mov dword [esp + 0x10], ecx
jne 0x401808
mov ecx, 0x12
xor eax, eax
lea edi, [esp + 0x68]
rep stosd dword es:[edi], eax
lea ecx, [esp + 0x64]
lea eax, [esp + 0xb0]
push ecx
mov dword [esp + 0x68], 0x4c
mov dword [esp + 0x6c], ebp
mov dword [esp + 0x84], eax
mov dword [esp + 0x88], 0x104
mov dword [esp + 0x74], str.Executables__.exe_
mov dword [esp + 0x80], ebx
mov dword [esp + 0x8c], ebp
mov dword [esp + 0x90], ebp
mov dword [esp + 0x94], ebp
mov dword [esp + 0x9c], 0x1800
call sub.comdlg32.dll_GetOpenFileNameA
cmp eax, ebx
jne 0x401808
lea edx, [esp + 0xb0]
mov dword [esp + 0x10], edx
mov ebx, dword [esp + 0x10]
push ebx
push str.szPath:__s_n
call fcn.004024e0
mov al, byte [esp + 0x18]
xor edx, edx
xor esi, esi
add esp, 8
mov dword [esp + 0x44], ebx
mov byte [esp + 0x14], al
mov dword [esp + 0x18], edx
mov dword [esp + 0x1c], ebp
mov dword [esp + 0x20], esi
mov cl, byte [esp + 0x10]
mov dword [esp + 0xa3c], ebp
mov byte [esp + 0x24], cl
mov dword [esp + 0x28], ebp
mov dword [esp + 0x2c], ebp
mov dword [esp + 0x30], ebp
cmp ebx, ebp
mov byte [esp + 0xa3c], 1
je 0x401a32
mov edi, ebx
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov ebp, ecx
cmp ebp, 0xfffffffd
jbe 0x4019d9
call fcn.004027f1
mov edx, dword [esp + 0x18]
test edx, edx
je 0x4019d5
mov al, byte [edx - 1]
test al, al
je 0x4019d5
cmp al, 0xff
je 0x4019d5
test ebp, ebp
jne 0x4019fe
dec al
push ebp
lea ecx, [esp + 0x18]
mov byte [edx - 1], al
call fcn.00402180
jmp 0x401a2c
cmp eax, ebx
jle 0x4019c5
mov eax, dword [esp + 0xa48]
lea ebp, [eax + 4]
mov ecx, dword [ebp]
push 0x40b4c8
push ecx
call fcn.00403150
add esp, 8
lea edx, [esp + 0xb0]
test eax, eax
je 0x40194b
mov edi, 0x40b4c4
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
lea edx, [esp + 0xb0]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, dword [ebp]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
lea edx, [esp + 0xb0]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, 0x40b4c4
jmp 0x40194e
mov edi, dword [ebp]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov eax, dword [esp + 0xa44]
mov ecx, edx
and ecx, 3
dec eax
cmp ebx, eax
rep movsb byte es:[edi], byte [esi]
je 0x4019b0
mov edi, 0x40b4c8
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0xb0]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, dword [esp + 0xa44]
inc ebx
add ebp, 4
cmp ebx, eax
jl 0x4018ca
xor ebp, ebp
lea ebx, [esp + 0xb0]
mov dword [esp + 0x10], ebx
jmp 0x40180c
mov esi, dword [esp + 0x20]
test ebp, ebp
jne 0x4019ea
push 1
lea ecx, [esp + 0x18]
call fcn.00402180
jmp 0x401a2c
cmp esi, 0x1f
ja 0x4019f3
cmp esi, ebp
jae 0x401a0c
push 1
lea ecx, [esp + 0x18]
call fcn.00402180
push ebp
lea ecx, [esp + 0x18]
call fcn.00402320
mov edx, dword [esp + 0x18]
mov ecx, ebp
mov edi, edx
mov edx, ecx
mov esi, ebx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, dword [esp + 0x18]
mov dword [esp + 0x1c], ebp
mov byte [eax + ebp], 0
mov edx, dword [esp + 0x18]
xor ebp, ebp
mov esi, dword [esp + 0x1c]
mov dword [esp + 0xa3c], 2
cmp esi, ebp
je 0x401b38
cmp esi, ebp
jb 0x401adb
test edx, edx
je 0x401adb
mov al, byte [edx - 1]
test al, al
je 0x401ac6
cmp al, 0xff
je 0x401ac6
lea ecx, [esp + 0x14]
call fcn.00402310
cmp eax, esi
jae 0x401a76
call fcn.004027f1
mov edx, dword [esp + 0x18]
test edx, edx
je 0x401a9e
mov al, byte [edx - 1]
test al, al
je 0x401a9e
cmp al, 0xff
je 0x401a9e
test esi, esi
jne 0x401ab8
dec al
push esi
lea ecx, [esp + 0x18]
mov byte [edx - 1], al
call fcn.00402180
jmp 0x401ac2
test esi, esi
jne 0x401ab2
test edx, edx
je 0x401ad2
push esi
lea ecx, [esp + 0x18]
call fcn.004021d0
jmp 0x401ac2
cmp dword [esp + 0x20], esi
jae 0x401ac6
push esi
lea ecx, [esp + 0x18]
call fcn.00402320
mov edx, dword [esp + 0x18]
test edx, edx
je 0x401ad2
mov byte [edx - 1], 0xff
mov edx, dword [esp + 0x18]
mov esi, dword [esp + 0x1c]
lea edi, [edx + ebp]
jmp 0x401ae0
mov edi, 0x409140
cmp esi, ebp
jb 0x401b14
test edx, edx
je 0x401b14
mov al, byte [edx - 1]
test al, al
je 0x401b03
cmp al, 0xff
je 0x401b03
push 0
push esi
lea ecx, [esp + 0x1c]
call fcn.004021f0
mov edx, dword [esp + 0x18]
test edx, edx
je 0x401b0f
mov byte [edx - 1], 0xff
mov edx, dword [esp + 0x18]
lea esi, [edx + ebp]
jmp 0x401b19
mov esi, 0x409140
movsx ecx, byte [edi]
push ecx
call fcn.00403076
add esp, 4
mov byte [esi], al
mov esi, dword [esp + 0x1c]
mov edx, dword [esp + 0x18]
inc ebp
cmp ebp, esi
jne 0x401a49
test edx, edx
jne 0x401b41
mov edx, 0x409140
push 0x40b4bc
push edx
call fcn.00403150
add esp, 8
test eax, eax
je 0x401baa
mov ecx, dword [esp + 0x18]
test ecx, ecx
jne 0x401b60
mov ecx, 0x409140
mov ebx, dword [esp + 0x10]
sub eax, ecx
mov esi, eax
cmp esi, 0xffffffff
je 0x401bae
push ebx
call fcn.00408d56
mov ebp, eax
add esp, 4
mov byte [esi + ebp + 4], 0
mov al, byte [ebp]
cmp al, 0x22
jne 0x401b85
inc ebp
mov edi, ebp
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
cmp byte [ecx + ebp - 1], 0x22
jne 0x401bb2
mov edi, ebp
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov byte [ecx + ebp - 1], al
jmp 0x401bb2
mov ebx, dword [esp + 0x10]
mov ebp, dword [esp + 0x44]
push ebx
call fcn.00401590
add esp, 4
lea edx, [esp + 0x294]
push edx
push 0x104
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
test eax, eax
je 0x401be7
lea eax, [esp + 0x294]
push eax
push str.Current_Directory:__s_n
call fcn.004024e0
add esp, 8
push 0
push 0x80
push 3
push 0
push 3
push 0x80000000
push ebp
call dword [sym.imp.KERNEL32.dll_CreateFileA]
push ebp
push str.szExePath:__s_n
mov esi, eax
call fcn.004024e0
add esp, 8
cmp esi, 0xffffffff
jne 0x401c2a
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push ebp
push str.Could_not_open_file:__s_r_n_ErrCode:__d__n
call fcn.004010b0
add esp, 0xc
push 0
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ebp, eax
push 4
push 0x1000
lea ecx, [ebp + 0x10000]
and ecx, 0x3fff0000
push ecx
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov edi, eax
test edi, edi
mov dword [0x40bf84], edi
jne 0x401c6a
push str.Cannot_allocate_memory_n
call fcn.004010b0
add esp, 4
lea edx, [esp + 0x4c]
push 0
push edx
push ebp
push edi
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [esp + 0x4c], ebp
je 0x401c94
push str.Could_not_read_entire_file_n
call fcn.004010b0
add esp, 4
lea eax, [esp + 0x60]
lea ecx, [esp + 0x54]
push eax
mov eax, dword [esp + 0x50]
lea edx, [esp + 0x5c]
push ecx
push edx
push eax
push edi
call fcn.00402690
add esp, 0x14
test eax, eax
je 0x401cdf
cmp dword [esp + 0x58], 2
jne 0x401cdf
mov eax, dword [esp + 0x54]
cmp eax, 0x5a
jae 0x401cdf
cmp eax, 0x46
jb 0x401cdf
push str.SafeDisc_Version_2.7_or_2.8__Doing_our_own_loader__n
call fcn.004024e0
push 0
push ebx
call fcn.00401320
add esp, 0xc
mov esi, dword [0x40bf84]
cmp word [esi], 0x5a4d
lea ebp, [esi + ebp*4 - 0x10]
je 0x401cfb
push 1
push ebx
call fcn.00401320
add esp, 8
add esi, dword [esi + 0x3c]
cmp esi, ebp
jbe 0x401d0d
push 1
push ebx
call fcn.00401320
add esp, 8
cmp dword [esi], 0x4550
je 0x401d20
push 1
push ebx
call fcn.00401320
add esp, 8
mov eax, dword [esi + 0x34]
mov ecx, 0x10
mov dword [0x40bf88], eax
mov esi, dword [esi + 0x28]
add esi, eax
xor eax, eax
lea edi, [esp + 0x1b8]
push ebx
rep stosd dword es:[edi], eax
xor ecx, ecx
push str.lpApplicationName:__s_n
mov dword [esp + 0x40], ecx
mov dword [esp + 0x3c], eax
mov dword [esp + 0x44], ecx
mov dword [esp + 0x1bc], 0x44
mov dword [esp + 0x48], ecx
call fcn.004024e0
add esp, 8
lea edx, [esp + 0x34]
lea eax, [esp + 0x1b4]
push edx
push eax
push 0
push 0
push 4
push 0
push 0
push 0
push ebx
push 0
call dword [sym.imp.KERNEL32.dll_CreateProcessA]
test eax, eax
jne 0x401da3
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push ebx
push str.Failed_to_CreateProcess:__s_r_n_ErrCode:__d__n
call fcn.004010b0
add esp, 0xc
mov eax, dword [esp + 0x34]
mov ebp, dword [sym.imp.KERNEL32.dll_ReadProcessMemory]
push 0
lea ecx, [esp + 0x4c]
push 4
lea edx, [esi - 4]
push ecx
push edx
push eax
mov dword [0x40bf80], eax
call ebp
mov eax, dword [esp + 0x48]
mov edi, dword [sym.imp.KERNEL32.dll_TerminateProcess]
cmp eax, 0x70797274
je 0x401de8
mov eax, dword [0x40bf80]
push 0xffffffffffffffff
push eax
call edi
push 1
push ebx
call fcn.00401320
add esp, 8
mov eax, dword [0x40bf80]
push 0
lea ecx, [esp + 0x4c]
push 4
lea edx, [esi + 0xbb]
push ecx
push edx
push eax
call ebp
mov cl, byte [esp + 0x48]
mov al, 0xe9
cmp cl, al
je 0x401e30
cmp byte [esp + 0x4a], al
je 0x401e26
mov ecx, dword [0x40bf80]
push 0xffffffffffffffff
push ecx
call edi
push 1
push ebx
call fcn.00401320
add esp, 8
mov dword [0x40b0dc], 0xbd
mov dl, byte [0x40b0dc]
push 1
push 1
push 0
push 0
push edx
call fcn.004013f0
mov eax, dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov ecx, 0x26
mov dword [0x40b0d7], eax
xor eax, eax
lea edi, [esp + 0x20d]
mov byte [esp + 0x20c], 0
rep stosd dword es:[edi], eax
mov ecx, dword [esp + 0x50]
push ecx
stosw word es:[edi], ax
call fcn.00401150
mov edx, dword [esp + 0x54]
push edx
call fcn.00402700
mov ecx, dword [esp + 0x50]
add esp, 0x1c
lea eax, [esp + 0x5c]
push eax
push 0x40
push 0x9b
push esi
push ecx
call dword [sym.imp.KERNEL32.dll_VirtualProtectEx]
mov eax, dword [esp + 0x34]
push 0
lea edx, [esp + 0x1fc]
push 0x9b
push edx
push esi
push eax
call ebp
mov ecx, dword [esp + 0x34]
mov ebx, dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
push 0
push 0x9b
push 0x40b040
push esi
push ecx
call ebx
test eax, eax
jne 0x401ed9
push str.Unable_to_write_to_process_memory_n
call fcn.004010b0
add esp, 4
mov edx, dword [esp + 0x38]
push edx
call dword [sym.imp.KERNEL32.dll_ResumeThread]
test eax, eax
jne 0x401ef5
push str.Unable_to_resume_exe_n
call fcn.004010b0
add esp, 4
mov ecx, 0xb2
xor eax, eax
lea edi, [esp + 0x4a0]
rep stosd dword es:[edi], eax
mov edi, dword [sym.imp.KERNEL32.dll_Sleep]
mov dword [esp + 0x49c], 0x1003f
mov ecx, dword [esp + 0x38]
lea eax, [esp + 0x49c]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_GetThreadContext]
test eax, eax
jne 0x401f3a
push str.Could_not_GetThreadContext_1_n
call fcn.004010b0
add esp, 4
cmp dword [esp + 0x554], esi
je 0x401f49
push 0x10
call edi
jmp 0x401f16
mov edx, dword [esp + 0x38]
push edx
call dword [sym.imp.KERNEL32.dll_SuspendThread]
mov edx, dword [esp + 0x34]
push 0
lea eax, [esp + 0x54]
push 4
lea ecx, [esi + 0x97]
push eax
push ecx
push edx
call ebp
mov eax, dword [esp + 0x50]
test eax, eax
je 0x402046
mov ecx, dword [0x40bf80]
push 0
lea eax, [esp + 0x1fc]
push 0x9b
push eax
push esi
push ecx
call ebx
mov edx, dword [0x40b0dc]
mov ecx, dword [0x40bf80]
push 0
lea eax, [esp + 0x48]
add esi, edx
push 2
push eax
push esi
push ecx
mov byte [esp + 0x24], 0xeb
mov byte [esp + 0x25], 0xfe
call ebp
mov eax, dword [0x40bf80]
push 0
lea edx, [esp + 0x14]
push 2
push edx
push esi
push eax
call ebx
mov ecx, dword [esp + 0x38]
push ecx
call dword [sym.imp.KERNEL32.dll_ResumeThread]
xor ebp, ebp
mov ecx, 0xb2
xor eax, eax
lea edi, [esp + 0x76c]
lea edx, [esp + 0x768]
rep stosd dword es:[edi], eax
mov eax, dword [esp + 0x38]
push edx
push eax
mov dword [esp + 0x770], 0x1003f
call dword [sym.imp.KERNEL32.dll_GetThreadContext]
cmp dword [esp + 0x820], esi
je 0x40201b
push 0x64
call dword [sym.imp.KERNEL32.dll_Sleep]
inc ebp
cmp ebp, 0x1e
jne 0x401fd4
jmp 0x402046
mov ecx, dword [esp + 0x38]
push ecx
call dword [sym.imp.KERNEL32.dll_SuspendThread]
mov eax, dword [esp + 0x34]
push 0
lea edx, [esp + 0x48]
push 2
push edx
push esi
push eax
call ebx
mov ecx, dword [esp + 0x38]
push ecx
call dword [sym.imp.KERNEL32.dll_ResumeThread]
test eax, eax
jne 0x402053
push str.Failed_to_start_at_OEP__n
call fcn.004010b0
add esp, 4
call fcn.00401050
mov ecx, dword [esp + 0x28]
xor esi, esi
cmp ecx, esi
je 0x402080
mov al, byte [ecx - 1]
test al, al
je 0x402074
cmp al, 0xff
je 0x402074
dec al
mov byte [ecx - 1], al
jmp 0x402080
add ecx, 0xfffffffe
push ecx
call fcn.004027e6
add esp, 4
mov ecx, dword [esp + 0x18]
mov dword [esp + 0x28], esi
mov dword [esp + 0x2c], esi
mov dword [esp + 0x30], esi
pop edi
cmp ecx, esi
pop esi
pop ebp
pop ebx
je 0x4020c9
mov al, byte [ecx - 1]
test al, al
je 0x4020bf
cmp al, 0xff
je 0x4020bf
dec al
mov byte [ecx - 1], al
xor eax, eax
mov ecx, dword [esp + 0xa24]
mov dword fs:[0], ecx
add esp, 0xa30
ret
dec ecx
push ecx
call fcn.004027e6
add esp, 4
mov ecx, dword [esp + 0xa24]
xor eax, eax
mov dword fs:[0], ecx
add esp, 0xa30
ret