Function at 0x405044
Capabilities:
Check if file exists
Create process on windows
Get file size

Disassembly:
push ebp
mov ebp, esp
mov ecx, 8
push 0
push 0
dec ecx
jne 0x40504c
push ecx
mov dword [ebp - 0xc], edx
mov dword [ebp - 8], eax
xor eax, eax
push ebp
push 0x4054ea
push dword fs:[eax]
mov dword fs:[eax], esp
xor eax, eax
mov dword [ebp - 4], eax
cmp dword [ebp - 0xc], 1
jne 0x4050a3
lea eax, [ebp - 0x18]
call fcn.00404fe4
push dword [ebp - 0x18]
lea eax, [ebp - 0x1c]
mov edx, dword [0x406318]
call fcn.00403a0c
push dword [ebp - 0x1c]
push 0x4054fc
lea eax, [ebp - 0x10]
mov edx, 3
call fcn.00403b04
jmp 0x4050d7
cmp dword [ebp - 0xc], 2
jne 0x4050d7
lea eax, [ebp - 0x20]
call fcn.00404fe4
push dword [ebp - 0x20]
lea eax, [ebp - 0x24]
mov edx, dword [0x406318]
call fcn.00403a0c
push dword [ebp - 0x24]
push 0x405514
lea eax, [ebp - 0x10]
mov edx, 3
call fcn.00403b04
mov eax, dword [ebp - 0x10]
call fcn.00403a80
call fcn.00404e10
test al, al
jne 0x4050fe
lea edx, [ebp - 0x28]
mov eax, dword [ebp - 0x10]
call fcn.00404ef0
mov edx, dword [ebp - 0x28]
lea eax, [ebp - 0x10]
call fcn.00403954
push 0
push 0x82
push 3
push 0
push 0
push 0xc0000000
mov eax, dword [ebp - 0x10]
call fcn.00403a80
push eax
call sub.KERNEL32.DLL_CreateFileW
mov dword [0x407674], eax
cmp dword [0x407674], 0xffffffff
je 0x40538a
xor eax, eax
push ebp
push 0x405383
push dword fs:[eax]
mov dword fs:[eax], esp
push 0
push 0
push 0
push 4
push 0
mov eax, dword [0x407674]
push eax
call sub.KERNEL32.DLL_CreateFileMappingA
mov dword [0x407678], eax
cmp dword [0x407678], 0
je 0x40536a
xor eax, eax
push ebp
push 0x405363
push dword fs:[eax]
mov dword fs:[eax], esp
push 0
push 0
push 0
push 2
mov eax, dword [0x407678]
push eax
call sub.KERNEL32.DLL_MapViewOfFile
mov dword [0x40767c], eax
cmp dword [0x40767c], 0
je 0x40534a
xor eax, eax
push ebp
push 0x405343
push dword fs:[eax]
mov dword fs:[eax], esp
push 0
mov eax, dword [0x407674]
push eax
call sub.KERNEL32.DLL_GetFileSize
mov dword [0x407680], eax
cmp dword [ebp - 0xc], 1
jne 0x4052f8
push 0xffffffffffffffff
push dword [0x407680]
push 0xb
push 0x4060c4
push 0x4060b8
push 0x4060ac
push 0x4060a0
push dword [0x40767c]
call fcn.00404c58
or dword [ebp - 4], eax
push 1
push dword [0x407680]
push 0xf
push 0x406100
push 0x4060f0
push 0x4060e0
push 0x4060d0
push dword [0x40767c]
call fcn.00404c58
or dword [ebp - 4], eax
push 0xffffffffffffffff
push dword [0x407680]
push 0x13
push 0x40614c
push 0x406138
push 0x406124
push 0x406110
push dword [0x40767c]
call fcn.00404c58
or dword [ebp - 4], eax
push 0xffffffffffffffff
push dword [0x407680]
push 0x18
push 0x4061a8
push 0x406190
push 0x406178
push 0x406160
push dword [0x40767c]
call fcn.00404c58
or dword [ebp - 4], eax
push 1
push dword [0x407680]
push 0x14
push 0x4061fc
push 0x4061e8
push 0x4061d4
push 0x4061c0
push dword [0x40767c]
call fcn.00404c58
or dword [ebp - 4], eax
push 1
push dword [0x407680]
push 0xd
push 0x406240
push 0x406230
push 0x406220
push 0x406210
push dword [0x40767c]
call fcn.00404c58
or dword [ebp - 4], eax
push 0xffffffffffffffff
push dword [0x407680]
push 0x1c
push 0x4062a4
push 0x406288
push 0x40626c
push 0x406250
push dword [0x40767c]
call fcn.00404c58
or dword [ebp - 4], eax
jmp 0x40532a
cmp dword [ebp - 0xc], 2
jne 0x40532a
push 1
push dword [0x407680]
push 0x14
push 0x4062fc
push 0x4062e8
push 0x4062d4
push 0x4062c0
push dword [0x40767c]
call fcn.00404c58
or dword [ebp - 4], eax
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x40534a
mov eax, dword [0x40767c]
push eax
call sub.KERNEL32.DLL_UnmapViewOfFile
ret
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x40536a
mov eax, dword [0x407678]
push eax
call sub.KERNEL32.DLL_CloseHandle
ret
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x40538a
mov eax, dword [0x407674]
push eax
call sub.KERNEL32.DLL_CloseHandle
ret
mov eax, dword [0x407674]
xor edx, edx
cmp edx, 0xffffffff
jne 0x405399
cmp eax, 0xffffffff
je 0x4053b1
cmp dword [0x407678], 0
je 0x4053b1
cmp dword [0x40767c], 0
jne 0x40547f
call sub.KERNEL32.DLL_GetLastError
mov dword [0x407684], eax
cmp dword [0x407684], 2
jne 0x4053d2
lea eax, [ebp - 0x14]
mov edx, dword [0x40631c]
call fcn.00403560
cmp dword [0x407684], 0x20
jne 0x4053e9
lea eax, [ebp - 0x14]
mov edx, dword [0x406328]
call fcn.00403560
push 0x40010
push 0x405530
lea edx, [ebp - 0x30]
mov eax, dword [ebp - 0x10]
call fcn.00404ef0
push dword [ebp - 0x30]
push 0x405554
lea edx, [ebp - 0x38]
mov eax, dword [0x407684]
call fcn.004049c0
mov edx, dword [ebp - 0x38]
lea eax, [ebp - 0x34]
call fcn.00403a70
push dword [ebp - 0x34]
push 0x40556c
lea edx, [ebp - 0x40]
mov eax, dword [0x407684]
call fcn.00404f98
mov edx, dword [ebp - 0x40]
lea eax, [ebp - 0x3c]
call fcn.00403a70
push dword [ebp - 0x3c]
lea eax, [ebp - 0x44]
mov edx, dword [ebp - 0x14]
call fcn.00403a70
push dword [ebp - 0x44]
lea eax, [ebp - 0x2c]
mov edx, 6
call fcn.00403b04
mov eax, dword [ebp - 0x2c]
call fcn.00403a80
push eax
mov eax, dword [ebp - 8]
push eax
call sub.user32.dll_MessageBoxW
push 0
push 0
push 0x10
mov eax, dword [ebp - 8]
push eax
call sub.user32.dll_SendMessageA
jmp 0x40549f
cmp dword [ebp - 0xc], 1
jne 0x40549f
push 1
push 0
push 0
mov eax, dword [ebp - 0x10]
call fcn.00403a80
push eax
push 0
mov eax, dword [ebp - 8]
push eax
call sub.shell32.dll_ShellExecuteW
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x4054f1
lea eax, [ebp - 0x44]
call fcn.004038f4
lea eax, [ebp - 0x40]
call fcn.004033a4
lea eax, [ebp - 0x3c]
call fcn.004038f4
lea eax, [ebp - 0x38]
call fcn.004033a4
lea eax, [ebp - 0x34]
mov edx, 8
call fcn.0040390c
lea eax, [ebp - 0x14]
call fcn.004033a4
lea eax, [ebp - 0x10]
call fcn.004038f4
ret