Function at 0x4031e0
Capabilities:
Check if file exists
Check os version
Get file attributes

Disassembly:
push ebx
push esi
push edi
push ebp
add esp, 0xfffff004
mov byte [0x40f4d8], 0x52
mov byte [0x40f4ec], 0x50
mov ebx, 0x40f567
push eax
add esp, 0xfffff63c
mov dword [esp], eax
xor ebp, ebp
mov edi, dword [ebp*4 + 0x40f430]
test edi, edi
je 0x403862
push edi
lea eax, [esp + 0x20]
push eax
call fcn.004066d0
add esp, 8
push 0x2e
lea edx, [edi + 1]
push edx
call fcn.00406789
add esp, 8
mov edi, eax
test eax, eax
je 0x40324c
push 0x2e
lea edx, [esp + 0x21]
push edx
call fcn.00406789
add esp, 8
mov byte [eax], 0
lea ecx, [esp + 0x1c]
push ecx
lea eax, [ebx + 0x545]
push eax
lea edx, [esp + 0x58]
push edx
call fcn.004089dc
add esp, 0xc
cmp ebp, 1
sete cl
and ecx, 1
test ebp, ebp
sete al
and eax, 1
mov byte [esp + 4], cl
mov byte [esp + 5], al
mov edx, dword [esp]
cmp byte [edx + ebp], 0
je 0x4035f5
lea eax, [esp + 0x1c]
call fcn.00402460
test al, al
jne 0x4033de
lea edx, [esp + 0x450]
push edx
lea ecx, [ebx + 4]
push ecx
push pe_nt_image_headers32
lea ecx, [ebx + 4]
lea edx, [esp + 0x28]
mov eax, 0x80000000
call fcn.004021f0
lea eax, [esp + 0x650]
push eax
lea edx, [ebx + 4]
push edx
push pe_nt_image_headers32
lea ecx, [ebx + 0x551]
lea edx, [esp + 0x28]
mov eax, 0x80000000
call fcn.004021f0
lea ecx, [esp + 0x850]
push ecx
lea eax, [ebx + 4]
push eax
push 0x400
lea ecx, [ebx + 0x55e]
lea edx, [esp + 0x5c]
mov eax, 0x80000000
call fcn.004021f0
lea edx, [esp + 8]
push edx
lea ecx, [ebx + 4]
push ecx
push 0xa
lea ecx, [ebx + 0x567]
lea edx, [esp + 0x5c]
mov eax, 0x80000000
call fcn.004021f0
mov byte [esp + 0x12], al
lea eax, [esp + 0x1c]
push eax
lea edx, [ebx + 0x69]
push edx
lea ecx, [esp + 0xc58]
push ecx
call fcn.004089dc
add esp, 0xc
mov eax, 0x80000000
lea edx, [esp + 0x1c]
call fcn.00402394
xor ecx, ecx
mov cl, al
lea edx, [ebx + 0x570]
lea eax, [esp + 0xc50]
call fcn.0040216c
lea ecx, [esp + 0x450]
lea edx, [ebx + 0x559]
lea eax, [esp + 0xc50]
call fcn.00402124
lea ecx, [esp + 0x650]
lea edx, [ebx + 0x576]
lea eax, [esp + 0xc50]
call fcn.00402124
cmp byte [esp + 0x850], 0
jne 0x4033c5
cmp byte [esp + 0x12], 0
je 0x4033c5
lea ecx, [ebx + 0x57e]
lea edx, [ebx + 0x548]
lea eax, [esp + 0xc50]
call fcn.00402124
jmp 0x4033de
lea ecx, [esp + 0x850]
lea edx, [ebx + 0x548]
lea eax, [esp + 0xc50]
call fcn.00402124
cmp byte [esp + 4], 0
je 0x4033ed
lea ecx, [ebx + 0x580]
jmp 0x4033f3
lea ecx, [ebx + 0x1c2]
push ecx
lea ecx, [ebx + 4]
lea edx, [esp + 0x20]
mov eax, 0x80000000
call fcn.00402134
lea ecx, [ebx + 0x551]
lea edx, [esp + 0x1c]
mov eax, 0x80000000
call fcn.00402310
cmp byte [esp + 5], 0
je 0x403492
call fcn.0040490c
test eax, eax
je 0x403430
mov eax, 0x1e
jmp 0x403435
mov eax, 0x64
mov dword [esp + 0x14], eax
xor esi, esi
cmp esi, dword [esp + 0x14]
jge 0x403492
push esi
lea eax, [ebx + 0x58b]
push eax
lea edx, [esp + 0xca8]
push edx
call fcn.004089dc
add esp, 0xc
lea ecx, [ebx + 0x1c2]
push ecx
lea ecx, [ebx + 4]
lea edx, [esp + 0xca4]
mov eax, 0x80000000
call fcn.00402134
lea ecx, [ebx + 0x551]
lea edx, [esp + 0xca0]
mov eax, 0x80000000
call fcn.00402310
inc esi
cmp esi, dword [esp + 0x14]
jl 0x403441
mov eax, dword [esp]
cmp byte [eax + 0x17], 0
je 0x40385a
cmp byte [esp + 4], 0
jne 0x4034b1
cmp byte [esp + 5], 0
je 0x40385a
lea edx, [esp + 0x50]
mov eax, 0x80000000
call fcn.004022e4
mov dword [esp + 0xcc0], 0x94
lea edx, [esp + 0xcc0]
push edx
call sub.KERNEL32.DLL_GetVersionExA
cmp dword [esp + 0xcc4], 4
ja 0x4034ef
cmp dword [esp + 0xcc8], 0xa
jbe 0x4035ae
push 0x400
lea ecx, [esp + 0xd58]
push ecx
push 0
call sub.KERNEL32.DLL_GetModuleFileNameA
cmp byte [esp + 5], 0
je 0x403512
lea eax, [ebx + 0x592]
jmp 0x403518
lea eax, [ebx + 0x59d]
push eax
lea eax, [esp + 0xd58]
call fcn.00403e8c
push eax
call fcn.004066d0
add esp, 8
lea edx, [esp + 0xd54]
push edx
call sub.KERNEL32.DLL_GetFileAttributesA
cmp eax, 0xffffffff
jne 0x40358d
lea ecx, [ebx + 0x5a8]
push ecx
lea eax, [esp + 0xd58]
push eax
call fcn.00408070
add esp, 8
mov esi, eax
cmp byte [esp + 5], 0
je 0x403574
push esi
push 0x14
push 1
push 0x40f4d8
call fcn.004082b8
add esp, 0x10
jmp 0x403586
push esi
push 0x16
push 1
push 0x40f4ec
call fcn.004082b8
add esp, 0x10
push esi
call fcn.00407bfc
pop ecx
lea eax, [esp + 0xd54]
lea ecx, [ebx + 0x55e]
push eax
mov eax, 0x80000000
lea edx, [esp + 0x54]
call fcn.00402134
jmp 0x40385a
cmp byte [esp + 5], 0
je 0x4035d5
push 0x40f4d8
push 0x14
lea ecx, [ebx + 0x5ab]
lea edx, [esp + 0x58]
mov eax, 0x80000000
call fcn.004021a8
jmp 0x40385a
push 0x40f4ec
push 0x16
lea ecx, [ebx + 0x5ab]
lea edx, [esp + 0x58]
mov eax, 0x80000000
call fcn.004021a8
jmp 0x40385a
lea edx, [esp + 0x1c]
push edx
lea ecx, [ebx + 0x69]
push ecx
lea eax, [esp + 0x115c]
push eax
call fcn.004089dc
add esp, 0xc
lea eax, [esp + 0x1c]
call fcn.00402460
test al, al
je 0x40385a
lea edx, [ebx + 0x570]
lea eax, [esp + 0x1154]
mov ecx, 1
call fcn.004022a8
test eax, eax
setne dl
and edx, 1
mov byte [esp + 0x18], dl
lea eax, [ebx + 4]
push eax
push pe_nt_image_headers32
lea ecx, [esp + 0x11ac]
lea edx, [ebx + 0x559]
lea eax, [esp + 0x115c]
call fcn.004021d4
lea edx, [ebx + 0x1c2]
push edx
lea ecx, [esp + 0x11a8]
push ecx
call fcn.00406848
add esp, 8
test eax, eax
je 0x40369a
lea eax, [ebx + 0x580]
push eax
lea edx, [esp + 0x11a8]
push edx
call fcn.00406848
add esp, 8
test eax, eax
jne 0x4036a2
mov byte [esp + 0x11a4], 0
lea ecx, [ebx + 4]
push ecx
push pe_nt_image_headers32
lea ecx, [esp + 0x13ac]
lea edx, [ebx + 0x576]
lea eax, [esp + 0x115c]
call fcn.004021d4
cmp byte [esp + 0x18], 0
je 0x4037a6
lea eax, [esp + 0x11a4]
lea ecx, [ebx + 4]
push eax
mov eax, 0x80000000
lea edx, [esp + 0x20]
call fcn.00402134
cmp byte [esp + 0x13a4], 0
je 0x403710
lea edx, [esp + 0x13a4]
lea ecx, [ebx + 0x551]
push edx
lea edx, [esp + 0x20]
mov eax, 0x80000000
call fcn.00402134
jmp 0x403724
lea ecx, [ebx + 0x551]
lea edx, [esp + 0x1c]
mov eax, 0x80000000
call fcn.00402310
lea ecx, [ebx + 4]
push ecx
push 0x400
lea ecx, [esp + 0x15ac]
lea edx, [ebx + 0x548]
lea eax, [esp + 0x115c]
call fcn.004021d4
lea ecx, [ebx + 0x55e]
lea edx, [esp + 0x50]
mov eax, 0x80000000
call fcn.00402310
mov al, byte [esp + 0x15a4]
test al, al
je 0x4037c2
xor edx, edx
mov dl, al
cmp edx, 0x2a
jne 0x403788
lea ecx, [ebx + 4]
mov eax, 0x80000000
push ecx
lea ecx, [ebx + 0x567]
lea edx, [esp + 0x54]
call fcn.00402134
jmp 0x4037c2
lea eax, [esp + 0x15a4]
lea ecx, [ebx + 0x55e]
push eax
mov eax, 0x80000000
lea edx, [esp + 0x54]
call fcn.00402134
jmp 0x4037c2
lea edx, [esp + 0x50]
mov eax, 0x80000000
call fcn.004022e4
lea edx, [esp + 0x1c]
mov eax, 0x80000000
call fcn.004022e4
cmp byte [esp + 5], 0
je 0x40385a
xor esi, esi
push esi
lea eax, [ebx + 0x58b]
push eax
lea edx, [esp + 0x19ac]
push edx
call fcn.004089dc
add esp, 0xc
cmp byte [esp + 0x18], 0
je 0x40383f
cmp byte [esp + 0x11a4], 0
je 0x40383f
lea ecx, [esp + 0x11a4]
mov eax, 0x80000000
push ecx
lea ecx, [ebx + 4]
lea edx, [esp + 0x19a8]
call fcn.00402134
cmp byte [esp + 0x13a4], 0
je 0x403850
lea eax, [esp + 0x13a4]
lea ecx, [ebx + 0x551]
push eax
mov eax, 0x80000000
lea edx, [esp + 0x19a8]
call fcn.00402134
jmp 0x403850
lea edx, [esp + 0x19a4]
mov eax, 0x80000000
call fcn.004022e4
inc esi
cmp esi, 0x64
jl 0x4037cf
test edi, edi
jne 0x403218
inc ebp
cmp ebp, 0xc
jl 0x403209
add esp, 0x19c4
pop ebp
pop edi
pop esi
pop ebx
ret