Function at 0x412040
Capabilities:
Check os version

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x36c
mov eax, dword [0x4a93dc]
xor eax, esp
mov dword [esp + 0x368], eax
mov eax, dword [ebp + 8]
mov edx, dword [ebp + 0x18]
mov ecx, dword [ebp + 0xc]
mov dword [esp + 0x1c], edx
mov dword [esp + 0x20], eax
mov eax, dword [ebp + 0x14]
mov edx, eax
and edx, 0x10
mov dword [esp + 0x14], edx
mov edx, eax
and edx, 8
push ebx
mov dword [esp + 0x2c], edx
mov edx, eax
push esi
mov esi, dword [ebp + 0x10]
and edx, 4
and eax, 2
mov ebx, ecx
push edi
mov dword [esp + 0x30], ecx
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x10], 0
mov dword [esp + 0x18], edx
mov dword [esp + 0x24], eax
mov dword [esi + 8], 0xffffffff
test ecx, ecx
jne 0x4120cf
lea edi, [esp + 0x268]
call fcn.00411d70
test eax, eax
jne 0x4123ad
mov eax, edi
mov dword [esp + 0x1c], eax
mov ebx, eax
mov eax, dword [0x4aca34]
mov edi, dword [sym.imp.KERNEL32.dll_GetVersionExW]
test eax, eax
jne 0x4120fd
lea ecx, [esp + 0x38]
push ecx
mov dword [esp + 0x3c], 0x114
call edi
xor eax, eax
cmp dword [esp + 0x48], 2
sete al
inc eax
mov dword [0x4aca34], eax
cmp eax, 2
jne 0x412109
call fcn.00410490
jmp 0x41210e
call fcn.00410630
mov dword [esp + 0x14], eax
test eax, eax
jne 0x412130
mov eax, 7
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x368]
xor ecx, esp
call fcn.0048014c
mov esp, ebp
pop ebp
ret
mov ebx, dword [esp + 0x24]
neg ebx
sbb ebx, ebx
and ebx, 0x40000000
add ebx, 0x80000000
cmp dword [esp + 0x20], 0
je 0x412155
mov dword [esp + 0x18], 1
jmp 0x412165
xor edx, edx
cmp dword [esp + 0x18], edx
setne dl
add edx, 3
mov dword [esp + 0x18], edx
mov eax, dword [esp + 0x34]
neg eax
sbb eax, eax
and eax, 0x4000082
sub eax, 0xffffff80
mov dword [esp + 0x20], eax
mov eax, dword [0x4aca34]
test eax, eax
jne 0x4121aa
lea eax, [esp + 0x150]
push eax
mov dword [esp + 0x154], 0x114
call edi
xor eax, eax
cmp dword [esp + 0x160], 2
sete al
inc eax
mov dword [0x4aca34], eax
cmp eax, 2
jne 0x412220
nop
mov ecx, dword [esp + 0x20]
mov edx, dword [esp + 0x18]
mov eax, dword [esp + 0x14]
push 0
push ecx
push edx
push 0
push 3
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
cmp edi, 0xffffffff
jne 0x41227f
mov ecx, dword [esp + 0x10]
cmp ecx, dword [0x4aa928]
jge 0x41227f
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 5
je 0x412200
cmp eax, 0x21
je 0x412200
cmp eax, 0x20
jne 0x41227f
mov edi, dword [esp + 0x10]
inc edi
mov edx, edi
imul edx, dword [0x4aa92c]
push edx
call dword [sym.imp.KERNEL32.dll_Sleep]
mov dword [esp + 0x10], edi
jmp 0x4121b0
mov eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x18]
mov edx, dword [esp + 0x14]
push 0
push eax
push ecx
push 0
push 3
push ebx
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
jne 0x41227f
mov eax, dword [esp + 0x10]
cmp eax, dword [0x4aa928]
jge 0x41227f
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 5
je 0x412264
cmp eax, 0x21
je 0x412264
cmp eax, 0x20
jne 0x41227f
mov edi, dword [esp + 0x10]
inc edi
mov ecx, edi
imul ecx, dword [0x4aa92c]
push ecx
call dword [sym.imp.KERNEL32.dll_Sleep]
mov dword [esp + 0x10], edi
jmp 0x412220
mov ecx, dword [esp + 0x10]
xor ebx, ebx
cmp ecx, ebx
je 0x4122ab
lea eax, [ecx + 1]
imul eax, dword [0x4aa92c]
imul eax, ecx
cdq
sub eax, edx
sar eax, 1
push eax
push str.delayed__dms_for_lock_sharing_conflict
push 0xa
call fcn.0040e570
add esp, 0xc
cmp edi, 0xffffffff
jne 0x41234f
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [esp + 0x1c]
push 0x857c
push 0xe
mov edi, str.winOpen
mov dword [esi + 0x14], eax
call fcn.004107f0
mov edx, dword [esp + 0x1c]
push edx
call fcn.00480812
add esp, 0xc
cmp dword [esp + 0x24], ebx
je 0x41231c
mov eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x30]
mov edx, dword [esp + 0x2c]
push eax
mov eax, dword [ebp + 0x14]
and eax, 0xfffffff9
or eax, 1
push eax
push esi
push ecx
push edx
call fcn.00412040
add esp, 0x14
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x368]
xor ecx, esp
call fcn.0048014c
mov esp, ebp
pop ebp
ret
push 0x4a3a6c
push 0x8582
push str.cannot_open_file_at_line__d_of___.10s_
push 0xe
call fcn.0040e570
add esp, 0x10
mov eax, 0xe
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x368]
xor ecx, esp
call fcn.0048014c
mov esp, ebp
pop ebp
ret
mov eax, dword [esp + 0x28]
cmp eax, ebx
je 0x412363
xor ecx, ecx
cmp dword [esp + 0x24], ebx
setne cl
inc ecx
mov dword [eax], ecx
mov edx, dword [esp + 0x30]
mov ecx, dword [esp + 0x1c]
xor eax, eax
mov dword [esi + 0xc], eax
mov dword [esi + 0x10], eax
mov dword [esi + 0x18], eax
mov dword [esi + 0x24], eax
mov eax, dword [esp + 0x2c]
push eax
mov dword [esi], 0x49d568
mov dword [esi + 8], edi
mov dword [esi + 0x14], ebx
mov dword [esi + 4], eax
mov dword [esi + 0x1c], ebx
mov dword [esi + 0x20], edx
call fcn.004129c0
mov dword [esi + 0x18], eax
mov eax, dword [esp + 0x18]
add esp, 4
push eax
call fcn.00480812
add esp, 4
xor eax, eax
mov ecx, dword [esp + 0x374]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.0048014c
mov esp, ebp
pop ebp
ret