Function at 0x40c540
Capabilities:
Accept command line arguments
Set current directory

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x834
mov eax, dword [0x5053a4]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
push esi
mov dword [ebp - 0x834], eax
lea eax, [ebp - 0x82c]
push edi
push eax
call dword [sym.imp.KERNEL32.dll_GetCommandLineW]
push eax
call dword [sym.imp.SHELL32.dll_CommandLineToArgvW]
mov edi, eax
call fcn.00408990
mov ecx, eax
test ecx, ecx
je 0x40c8c7
mov eax, dword [ecx]
call dword [eax + 0xc]
cmp dword [ebp - 0x82c], 1
lea esi, [eax + 0x10]
mov dword [ebp - 0x828], esi
jle 0x40c5d2
mov edx, dword [edi + 4]
test edx, edx
jne 0x40c5a6
xor ecx, ecx
jmp 0x40c5bf
mov ecx, edx
lea esi, [ecx + 2]
nop dword [eax + eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40c5b0
sub ecx, esi
sar ecx, 1
push ecx
push edx
lea ecx, [ebp - 0x828]
call fcn.004085d0
mov esi, dword [ebp - 0x828]
push edi
call dword [sym.imp.KERNEL32.dll_LocalFree]
push ecx
mov ecx, esp
push 0x4f5814
call fcn.00408680
push ecx
mov ecx, esp
push 0x4f579c
call fcn.00408680
call fcn.0040ef70
add esp, 8
or ebx, 0xffffffff
test al, al
jne 0x40c89d
push 0x208
lea eax, [ebp - 0x20c]
push 0
push eax
call fcn.004a7a60
add esp, 0xc
lea eax, [ebp - 0x20c]
push 0x104
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
push 0x208
lea eax, [ebp - 0x824]
push 0
push eax
call fcn.004a7a60
push 0
lea eax, [ebp - 0x824]
push eax
push 0
lea eax, [ebp - 0x20c]
push 0
push eax
call fcn.004aef64
lea eax, [ebp - 0x824]
push eax
push 0x4f66ac
push 0x508bd0
call fcn.00407520
add esp, 0x2c
lea eax, [ebp - 0x20c]
push eax
call dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecW]
lea eax, [ebp - 0x20c]
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
lea ecx, [ebp - 0x830]
call fcn.0040eb40
push eax
mov ecx, 0x508bd4
call fcn.00406b20
mov edx, dword [ebp - 0x830]
mov eax, ebx
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x40c6c2
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
lea ecx, [ebp - 0x830]
call fcn.0040ec70
push eax
mov ecx, 0x508bd8
call fcn.00406b20
mov edx, dword [ebp - 0x830]
mov eax, ebx
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x40c6f5
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov edx, dword [0x508bd0]
mov edi, 1
mov eax, edi
sub eax, dword [edx - 4]
or eax, dword [edx - 8]
jge 0x40c71c
push 0
mov ecx, 0x508bd0
call fcn.00408460
mov edx, dword [0x508bd0]
lea ecx, [ebp - 0x830]
call fcn.0040d0f0
push eax
mov ecx, 0x508bdc
call fcn.00406b20
mov edx, dword [ebp - 0x830]
mov eax, ebx
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x40c74f
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov ebx, dword [ebp - 0x834]
lea eax, [ebp - 0x414]
push 0x208
push 0
push eax
mov dword [0x508b98], ebx
call fcn.004a7a60
push 0x208
lea eax, [ebp - 0x61c]
push 0
push eax
call fcn.004a7a60
lea eax, [ebp - 0x61c]
mov ecx, ebx
push eax
lea edx, [ebp - 0x414]
call fcn.0040d550
lea ecx, [ebp - 0x414]
add esp, 0x1c
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40c7a1
sub ecx, edx
lea eax, [ebp - 0x414]
sar ecx, 1
push ecx
push eax
mov ecx, 0x508bc8
call fcn.004085d0
lea ecx, [ebp - 0x61c]
lea edx, [ecx + 2]
nop dword [eax + eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40c7d0
sub ecx, edx
lea eax, [ebp - 0x61c]
sar ecx, 1
push ecx
push eax
mov ecx, 0x508bcc
call fcn.004085d0
mov eax, edi
sub eax, dword [esi - 4]
or eax, dword [esi - 8]
jge 0x40c80e
push 0
lea ecx, [ebp - 0x828]
call fcn.00408460
mov esi, dword [ebp - 0x828]
mov ebx, dword [0x508bd8]
mov eax, edi
sub eax, dword [ebx - 4]
or eax, dword [ebx - 8]
jge 0x40c830
push 0
mov ecx, 0x508bd8
call fcn.00408460
mov ebx, dword [0x508bd8]
mov edx, dword [0x508bc8]
mov eax, edi
mov dword [ebp - 0x828], edx
sub eax, dword [edx - 4]
or eax, dword [edx - 8]
jge 0x40c85d
push 0
mov ecx, 0x508bc8
call fcn.00408460
mov eax, dword [0x508bc8]
mov dword [ebp - 0x828], eax
mov ecx, dword [0x508bd0]
sub edi, dword [ecx - 4]
or edi, dword [ecx - 8]
jge 0x40c87d
push 0
mov ecx, 0x508bd0
call fcn.00408460
mov ecx, dword [0x508bd0]
mov edx, dword [ebp - 0x828]
push esi
push ebx
call fcn.0040c8e0
mov ecx, dword [ebp - 0x834]
add esp, 8
mov dl, al
call fcn.0040d3d0
or ebx, 0xffffffff
add esi, 0xfffffff0
lock xadd dword [esi + 0xc], ebx
dec ebx
test ebx, ebx
jg 0x40c8b2
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
mov ecx, dword [ebp - 4]
xor eax, eax
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004a4bf6
mov esp, ebp
pop ebp
ret 0x10
push 0x80004005
call fcn.00408740
int3