Function at 0x405040
Capabilities:
Check os version
Resolve function by parsing pe exports

Disassembly:
push 0xffffffffffffffff
push 0x42f641
mov eax, dword fs:[0]
push eax
sub esp, 0x9c
mov eax, dword [0x43cd4c]
xor eax, esp
mov dword [esp + 0x98], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x43cd4c]
xor eax, esp
push eax
lea eax, [esp + 0xb0]
mov dword fs:[0], eax
mov ebp, dword [esp + 0xc0]
mov eax, dword [esp + 0xc4]
xor ebx, ebx
mov esi, ecx
mov dword [esp + 0x30], esi
mov dword [esp + 0x14], eax
mov dword [esp + 0x70], 0xf
mov dword [esp + 0x6c], ebx
mov byte [esp + 0x5c], bl
mov dword [esp + 0xb8], ebx
mov dword [esp + 0x24], ebx
mov dword [esp + 0x28], ebx
call fcn.0040777c
xor ecx, ecx
cmp eax, ebx
setne cl
cmp ecx, ebx
jne 0x4050ce
push 0x80004005
call fcn.00401eb0
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [esp + 0x18], eax
mov eax, 0xf
mov dword [esp + 0xa8], eax
mov dword [esp + 0xa4], ebx
mov byte [esp + 0x94], bl
mov dword [esp + 0x8c], eax
mov dword [esp + 0x88], ebx
mov byte [esp + 0x78], bl
mov dword [esp + 0x54], eax
mov dword [esp + 0x50], ebx
mov byte [esp + 0x40], bl
push ebx
mov byte [esp + 0xbc], 4
call fcn.00417b69
mov edi, ebp
add esp, 4
shl edi, 4
mov dword [esp + 0x24], eax
mov dword [esp + 0x28], edx
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x2c], edi
mov dword [esp + 0x20], ebx
mov ecx, dword [esi + 0x18]
cmp ecx, ebx
je 0x405153
mov eax, dword [esi + 0x1c]
sub eax, ecx
sar eax, 4
cmp ebp, eax
jb 0x405158
call fcn.004172e0
mov eax, dword [esi + 0x18]
mov edx, dword [eax + edi + 4]
add eax, edi
cmp edx, ebx
jne 0x405169
xor eax, eax
jmp 0x405181
mov ecx, dword [eax + 8]
sub ecx, edx
mov eax, 0x92492493
imul ecx
add edx, ecx
sar edx, 4
mov eax, edx
shr eax, 0x1f
add eax, edx
cmp dword [esp + 0x1c], eax
jge 0x4054c6
mov ecx, dword [esi + 0x18]
cmp ecx, ebx
je 0x40519e
mov eax, dword [esi + 0x1c]
sub eax, ecx
sar eax, 4
cmp ebp, eax
jb 0x4051a3
call fcn.004172e0
mov esi, dword [esi + 0x18]
mov eax, dword [esi + edi + 4]
add esi, edi
cmp eax, ebx
je 0x4051ce
mov ecx, dword [esi + 8]
sub ecx, eax
mov eax, 0x92492493
imul ecx
add edx, ecx
sar edx, 4
mov eax, edx
shr eax, 0x1f
add eax, edx
cmp dword [esp + 0x1c], eax
jb 0x4051d3
call fcn.004172e0
mov esi, dword [esi + 4]
add esi, dword [esp + 0x20]
cmp dword [esi + 0x18], 0x10
jb 0x4051e5
mov esi, dword [esi + 4]
jmp 0x4051e8
add esi, 4
mov eax, esi
lea edx, [eax + 1]
lea ecx, [ecx]
mov cl, byte [eax]
add eax, 1
cmp cl, bl
jne 0x4051f0
sub eax, edx
push eax
push esi
lea ecx, [esp + 0x60]
call fcn.00401670
mov edi, dword [esp + 0x70]
cmp edi, 0x10
mov ebp, dword [esp + 0x5c]
mov eax, ebp
jae 0x405219
lea eax, [esp + 0x5c]
cmp byte [eax], 0x3c
jne 0x405234
push 0xffffffffffffffff
push ebx
lea ecx, [esp + 0x60]
push ecx
mov ecx, dword [esp + 0x20]
call fcn.00401980
jmp 0x4054a8
mov esi, dword [esp + 0x6c]
cmp esi, 5
mov eax, esi
jb 0x405244
mov eax, 5
cmp edi, 0x10
mov edx, ebp
jae 0x40524f
lea edx, [esp + 0x5c]
mov ecx, str.VINNo
call fcn.00403ae0
cmp eax, ebx
jne 0x405289
cmp esi, 5
jb 0x405289
xor eax, eax
cmp esi, 5
setne al
cmp eax, ebx
jne 0x405289
push 0x11
push str.JN1AJ0HRXBM123456
lea ecx, [esp + 0x44]
call fcn.00401670
push ebx
lea edx, [esp + 0x40]
push edx
jmp 0x40549c
cmp esi, 7
mov eax, esi
jb 0x405295
mov eax, 7
cmp edi, 0x10
mov edx, ebp
jae 0x4052a0
lea edx, [esp + 0x5c]
mov ecx, str.TORISHI
call fcn.00403ae0
cmp eax, ebx
jne 0x4052cf
cmp esi, 7
jb 0x4052cf
xor eax, eax
cmp esi, 7
setne al
cmp eax, ebx
jne 0x4052cf
mov eax, dword [esp + 0x14]
push 3
call fcn.00401580
jmp 0x4054a8
cmp esi, 0x11
mov eax, esi
jb 0x4052db
mov eax, 0x11
cmp edi, 0x10
mov edx, ebp
jae 0x4052e6
lea edx, [esp + 0x5c]
mov ecx, str.CertificationCode
call fcn.00403ae0
cmp eax, ebx
jne 0x40531e
cmp esi, 0x11
jb 0x40531e
xor eax, eax
cmp esi, 0x11
setne al
cmp eax, ebx
jne 0x40531e
push 0xa
push str.TEST_PRINT
lea ecx, [esp + 0x44]
call fcn.00401670
lea eax, [esp + 0x3c]
jmp 0x40549a
cmp esi, 9
mov eax, esi
jb 0x40532a
mov eax, 9
cmp edi, 0x10
mov edx, ebp
jae 0x405335
lea edx, [esp + 0x5c]
mov ecx, str.PrintDate
call fcn.00403ae0
cmp eax, ebx
jne 0x4053f5
cmp esi, 9
jb 0x4053f5
xor eax, eax
cmp esi, 9
setne al
cmp eax, ebx
jne 0x4053f5
lea ecx, [esp + 0x24]
push ecx
mov esi, str._Y_m_d
lea edi, [esp + 0x38]
call fcn.00407690
push eax
lea ecx, [esp + 0x1c]
mov byte [esp + 0xbc], 5
call fcn.00402540
mov byte [esp + 0xb8], 4
mov eax, dword [esp + 0x34]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x4053ad
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov edx, dword [esp + 0x18]
lea ecx, [esp + 0x3c]
push ecx
push edx
call fcn.004011d0
cmp dword [esp + 0x54], 0x10
mov edx, dword [esp + 0x40]
jae 0x4053cb
lea edx, [esp + 0x40]
mov eax, edx
lea esi, [eax + 1]
mov cl, byte [eax]
add eax, 1
cmp cl, bl
jne 0x4053d0
sub eax, esi
push eax
push edx
lea ecx, [esp + 0x98]
call fcn.00401670
lea eax, [esp + 0x90]
jmp 0x40549a
mov ecx, str.PrintTime
lea edi, [esp + 0x58]
call fcn.00405750
test eax, eax
jne 0x4054a8
lea ecx, [esp + 0x24]
push ecx
mov esi, str._H_M
lea edi, [esp + 0x3c]
call fcn.00407690
push eax
lea ecx, [esp + 0x1c]
mov byte [esp + 0xbc], 6
call fcn.00402540
mov byte [esp + 0xb8], 4
mov eax, dword [esp + 0x38]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x405458
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov edx, dword [esp + 0x18]
lea ecx, [esp + 0x3c]
push ecx
push edx
call fcn.004011d0
cmp dword [esp + 0x54], 0x10
mov edx, dword [esp + 0x40]
jae 0x405476
lea edx, [esp + 0x40]
mov eax, edx
lea esi, [eax + 1]
jmp 0x405480
mov cl, byte [eax]
add eax, 1
cmp cl, bl
jne 0x405480
sub eax, esi
push eax
push edx
lea ecx, [esp + 0x7c]
call fcn.00401670
lea eax, [esp + 0x74]
push ebx
push eax
mov esi, dword [esp + 0x1c]
or eax, 0xffffffff
call fcn.00401890
add dword [esp + 0x1c], 1
add dword [esp + 0x20], 0x1c
mov edi, dword [esp + 0x2c]
mov esi, dword [esp + 0x30]
mov ebp, dword [esp + 0xc0]
jmp 0x405140
cmp dword [esp + 0x54], 0x10
jb 0x4054da
mov ecx, dword [esp + 0x40]
push ecx
call fcn.00407777
add esp, 4
cmp dword [esp + 0x8c], 0x10
mov dword [esp + 0x54], 0xf
mov dword [esp + 0x50], ebx
mov byte [esp + 0x40], bl
jb 0x405501
mov edx, dword [esp + 0x78]
push edx
call fcn.00407777
add esp, 4
cmp dword [esp + 0xa8], 0x10
mov dword [esp + 0x8c], 0xf
mov dword [esp + 0x88], ebx
mov byte [esp + 0x78], bl
jb 0x405531
mov eax, dword [esp + 0x94]
push eax
call fcn.00407777
add esp, 4
mov byte [esp + 0xb8], bl
mov eax, dword [esp + 0x18]
add eax, 0xfffffff0
mov dword [esp + 0xa8], 0xf
mov dword [esp + 0xa4], ebx
mov byte [esp + 0x94], bl
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x405571
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
cmp dword [esp + 0x70], 0x10
jb 0x405585
mov ecx, dword [esp + 0x5c]
push ecx
call fcn.00407777
add esp, 4
mov ecx, dword [esp + 0xb0]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x98]
xor ecx, esp
call fcn.0041779c
add esp, 0xa8
ret 8