Function at 0x40f470
Capabilities:
Check os version

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x36c
mov eax, dword [0x4ad1bc]
xor eax, esp
mov dword [esp + 0x368], eax
mov eax, dword [ebp + 8]
mov edx, dword [ebp + 0xc]
mov ecx, dword [ebp + 0x10]
mov dword [esp + 0x28], eax
mov eax, dword [ebp + 0x18]
mov dword [esp + 0x20], eax
push ebx
mov dword [esp + 0x1c], edx
mov dword [esp + 0xc], edx
mov edx, dword [ebp + 0x14]
mov eax, edx
and eax, 8
mov dword [esp + 0x28], ecx
push esi
push edi
mov dword [esp + 0x18], eax
mov edi, edx
mov ebx, edx
mov dword [ecx + 8], 0xffffffff
mov eax, edx
xor esi, esi
and eax, 2
and edi, 0x10
and ebx, 4
mov dword [esp + 0x20], eax
cmp dword [esp + 0x24], esi
jne 0x40f4fa
lea edx, [esp + 0x268]
call fcn.0040f190
test eax, eax
jne 0x40f7dc
lea eax, [esp + 0x268]
mov dword [esp + 0x14], eax
mov eax, dword [0x4b0760]
test eax, eax
jne 0x40f526
lea eax, [esp + 0x38]
mov dword [esp + 0x38], 0x114
push eax
call dword [sym.imp.KERNEL32.dll_GetVersionExW]
xor eax, eax
cmp dword [esp + 0x48], 2
sete al
inc eax
mov dword [0x4b0760], eax
mov ecx, dword [esp + 0x14]
cmp eax, 2
jne 0x40f53c
call fcn.0040d8d0
mov edx, eax
mov dword [esp + 0x10], edx
jmp 0x40f547
call fcn.0040da90
mov edx, eax
mov dword [esp + 0x10], eax
test edx, edx
jne 0x40f563
lea eax, [edx + 7]
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x368]
xor ecx, esp
call fcn.0047137e
mov esp, ebp
pop ebp
ret
cmp dword [esp + 0x20], esi
mov eax, SysReAllocString
mov ecx, 0xc0000000
cmovne eax, ecx
mov dword [esp + 0x28], eax
test edi, edi
je 0x40f587
mov edi, 1
mov dword [esp + 0x1c], edi
jmp 0x40f597
xor ecx, ecx
test ebx, ebx
setne cl
add ecx, 3
mov dword [esp + 0x1c], ecx
mov edi, ecx
cmp dword [esp + 0x18], esi
mov eax, 0x4000102
mov ecx, 0x80
cmovne ecx, eax
mov eax, dword [0x4b0760]
mov dword [esp + 0x18], ecx
test eax, eax
jne 0x40f5e9
lea eax, [esp + 0x150]
mov dword [esp + 0x150], 0x114
push eax
call dword [sym.imp.KERNEL32.dll_GetVersionExW]
mov edx, dword [esp + 0x10]
xor eax, eax
cmp dword [esp + 0x160], 2
mov ecx, dword [esp + 0x18]
sete al
inc eax
mov dword [0x4b0760], eax
cmp eax, 2
jne 0x40f64e
mov ebx, dword [sym.imp.KERNEL32.dll_CreateFileW]
push 0
push ecx
push edi
push 0
push 3
push dword [esp + 0x3c]
push edx
call ebx
mov edi, eax
cmp edi, 0xffffffff
jne 0x40f6a6
cmp esi, dword [0x4ae684]
jge 0x40f6a6
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 5
je 0x40f62f
cmp eax, 0x21
je 0x40f62f
cmp eax, 0x20
jne 0x40f6a6
inc esi
mov eax, esi
imul eax, dword [0x4ae680]
push eax
call dword [sym.imp.KERNEL32.dll_Sleep]
mov edi, dword [esp + 0x1c]
mov edx, dword [esp + 0x10]
mov ecx, dword [esp + 0x18]
jmp 0x40f5f4
mov ebx, dword [sym.imp.KERNEL32.dll_CreateFileA]
push 0
push ecx
push edi
push 0
push 3
push dword [esp + 0x3c]
push edx
call ebx
mov edi, eax
cmp edi, 0xffffffff
jne 0x40f6a6
cmp esi, dword [0x4ae684]
jge 0x40f6a6
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 5
je 0x40f687
cmp eax, 0x21
je 0x40f687
cmp eax, 0x20
jne 0x40f6a6
inc esi
mov eax, esi
imul eax, dword [0x4ae680]
push eax
call dword [sym.imp.KERNEL32.dll_Sleep]
mov edi, dword [esp + 0x1c]
mov edx, dword [esp + 0x10]
mov ecx, dword [esp + 0x18]
jmp 0x40f654
test esi, esi
je 0x40f6cc
lea eax, [esi + 1]
imul eax, dword [0x4ae680]
imul eax, esi
cdq
sub eax, edx
sar eax, 1
push eax
push str.delayed__dms_for_lock_sharing_conflict
push 0xa
call fcn.0040b9d0
add esp, 0xc
cmp edi, 0xffffffff
jne 0x40f776
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, dword [esp + 0x30]
mov edx, str.winOpen
push 0x857c
push dword [esp + 0x18]
mov ecx, 0xe
mov dword [esi + 0x14], eax
call fcn.0040dc60
push dword [esp + 0x18]
call fcn.004793e5
add esp, 0xc
cmp dword [esp + 0x20], 0
je 0x40f743
mov eax, dword [ebp + 0x14]
mov ecx, dword [esp + 0x2c]
and eax, 0xfffffff9
push ecx
mov ecx, dword [esp + 0x38]
or eax, 1
push eax
push esi
push dword [esp + 0x30]
push ecx
call fcn.0040f470
add esp, 0x14
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x368]
xor ecx, esp
call fcn.0047137e
mov esp, ebp
pop ebp
ret
push 0x4a3b88
push 0x8582
push str.cannot_open_file_at_line__d_of___.10s_
push 0xe
call fcn.0040b9d0
add esp, 0x10
mov eax, 0xe
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x368]
xor ecx, esp
call fcn.0047137e
mov esp, ebp
pop ebp
ret
mov ecx, dword [esp + 0x2c]
test ecx, ecx
je 0x40f78a
xor eax, eax
cmp dword [esp + 0x20], eax
setne al
inc eax
mov dword [ecx], eax
mov ebx, dword [esp + 0x30]
xorps xmm0, xmm0
mov ecx, dword [esp + 0x34]
mov eax, dword [esp + 0x24]
mov edx, dword [esp + 0x14]
movups xmmword [ebx], xmm0
movups xmmword [ebx + 0x10], xmm0
movq qword [ebx + 0x20], xmm0
mov dword [ebx], 0x49f4a0
mov dword [ebx + 8], edi
mov dword [ebx + 0x14], 0
mov dword [ebx + 4], ecx
mov dword [ebx + 0x1c], 0
mov dword [ebx + 0x20], eax
call fcn.0040fdd0
push dword [esp + 0x10]
mov dword [ebx + 0x18], eax
call fcn.004793e5
add esp, 4
xor eax, eax
mov ecx, dword [esp + 0x374]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.0047137e
mov esp, ebp
pop ebp
ret