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

Disassembly:
push 0xffffffffffffffff
push 0x4e2be0
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x78
mov eax, dword [0x52a0ac]
push ebx
push ebp
push esi
push edi
mov esi, ecx
mov dword [esp + 0x14], eax
push 0x52c320
lea ecx, [esp + 0x18]
mov dword [esp + 0x94], 0
mov ebp, 2
call fcn.004d86a9
push 0x50f4e0
lea ecx, [esp + 0x28]
call fcn.004d858e
mov eax, dword [esp + 0x24]
mov edi, dword [esp + 0x98]
mov ebx, dword [sym.imp.GDI32.dll_GetTextExtentPoint32A]
lea edx, [esp + 0x30]
mov ecx, dword [eax - 8]
push edx
push ecx
push eax
mov eax, dword [edi + 8]
push eax
call ebx
lea ecx, [esp + 0x24]
call fcn.004d8520
cmp dword [esi], 3
jne 0x4091ed
push 0x50f1bc
lea ecx, [esp + 0x28]
call fcn.004d858e
mov eax, dword [esp + 0x24]
lea edx, [esp + 0x38]
push edx
mov ecx, dword [eax - 8]
push ecx
push eax
mov eax, dword [edi + 8]
push eax
call ebx
lea ecx, [esp + 0x24]
call fcn.004d8520
xor eax, eax
mov dword [esp + 0x10], 0
mov ax, word [esi + 0x8e]
cdq
idiv dword [esp + 0x34]
mov dword [esp + 0x28], eax
mov eax, dword [esi + 0x60]
test eax, eax
jne 0x40934c
mov eax, dword [esi + 0x3c]
mov edi, dword [eax + 8]
mov ecx, dword [eax]
test edi, edi
mov dword [esp + 0x24], ecx
mov dword [esp + 0x10], edi
je 0x4092f1
jmp 0x40923a
mov edi, dword [esp + 0x10]
mov ecx, dword [esp + 0x24]
mov ebx, dword [sym.imp.GDI32.dll_GetTextExtentPoint32A]
xor eax, eax
cmp ecx, eax
je 0x40924f
mov edx, dword [ecx]
mov ecx, dword [ecx + 8]
mov dword [esp + 0x24], edx
mov dword [esp + 0x10], ecx
jmp 0x409253
mov dword [esp + 0x10], eax
push 0x50f4dc
mov ecx, edi
mov dword [esp + 0x24], eax
call fcn.004d2b67
cmp eax, 0xffffffff
jle 0x409270
mov dword [esp + 0x20], 1
mov eax, dword [edi]
lea edx, [esp + 0x18]
push edx
mov ecx, dword [eax - 8]
push ecx
push eax
mov eax, dword [esp + 0xa4]
mov ecx, dword [eax + 8]
push ecx
call ebx
mov ebx, dword [esp + 0x18]
xor eax, eax
mov ax, word [esi + 0x8c]
lea edx, [ebx + ebp]
cmp edx, eax
jg 0x4092a5
mov eax, dword [esp + 0x20]
test eax, eax
je 0x4092d9
push ebp
push ecx
lea edx, [esp + 0x1c]
mov ecx, esp
mov dword [esp + 0x34], esp
push edx
call fcn.004d8295
mov eax, dword [esp + 0xa0]
mov ecx, esi
push eax
call fcn.00409910
push 0x52c320
lea ecx, [esp + 0x18]
mov ebp, 2
call fcn.004d86a9
push edi
lea ecx, [esp + 0x18]
call fcn.004d8938
mov eax, dword [esp + 0x10]
add ebp, ebx
test eax, eax
jne 0x40922c
mov eax, dword [esp + 0x14]
mov edi, 0x52c320
mov dl, byte [eax]
mov bl, byte [edi]
mov cl, dl
cmp dl, bl
jne 0x409322
test cl, cl
je 0x40931e
mov dl, byte [eax + 1]
mov bl, byte [edi + 1]
mov cl, dl
cmp dl, bl
jne 0x409322
add eax, 2
add edi, 2
test cl, cl
jne 0x4092fa
xor eax, eax
jmp 0x409327
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
je 0x40934c
push ebp
push ecx
lea eax, [esp + 0x1c]
mov ecx, esp
mov dword [esp + 0x34], esp
push eax
call fcn.004d8295
mov ecx, dword [esp + 0xa0]
push ecx
mov ecx, esi
call fcn.00409910
mov edi, dword [esi + 0x60]
mov ebx, dword [esi + 0x58]
xor ebp, ebp
push 0x52c320
lea ecx, [esp + 0x18]
mov dword [esp + 0x24], edi
mov dword [esp + 0x28], ebp
call fcn.004d86a9
mov edx, dword [esi + 0x1c]
mov ecx, dword [esi + 0x14]
mov eax, edi
sub eax, edx
cmp ecx, eax
jle 0x40937b
mov dword [esi + 0x14], eax
cmp dword [esi + 0x14], ebp
jge 0x409383
mov dword [esi + 0x14], ebp
mov eax, dword [esi + 0x14]
cmp eax, ebp
mov dword [esp + 0x2c], eax
jle 0x4093a2
mov ecx, eax
cmp ebx, ebp
je 0x40939f
mov eax, ebx
mov ebx, dword [ebx]
mov edx, dword [eax + 8]
mov dword [esp + 0x10], edx
dec ecx
jne 0x409390
cmp ebx, ebp
je 0x4093b1
mov eax, ebx
mov ebx, dword [ebx]
mov eax, dword [eax + 8]
mov dword [esp + 0x10], eax
cmp dword [esp + 0x10], ebp
je 0x409495
jmp 0x4093bf
xor ebp, ebp
mov edi, dword [esp + 0x10]
cmp ebx, ebp
je 0x4093d4
mov eax, ebx
mov ebx, dword [ebx]
mov ecx, dword [eax + 8]
mov dword [esp + 0x10], ecx
jmp 0x4093d8
mov dword [esp + 0x10], ebp
mov eax, dword [edi]
lea edx, [esp + 0x38]
push edx
mov ecx, dword [eax - 8]
push ecx
push eax
mov eax, dword [esp + 0xa4]
mov ecx, dword [eax + 8]
push ecx
call dword [sym.imp.GDI32.dll_GetTextExtentPoint32A]
mov edx, dword [0x52a0ac]
mov dword [esp + 0x18], edx
push edi
lea ecx, [esp + 0x1c]
mov byte [esp + 0x94], 1
call fcn.004d8659
mov eax, dword [esp + 0x34]
mov ecx, dword [esp + 0x24]
xor edx, edx
mov dx, word [esi + 0x8e]
lea ebp, [eax + ecx]
cmp ebp, edx
jle 0x409433
mov dword [esp + 0x10], 0
jmp 0x40946e
mov eax, dword [esp + 0x38]
mov edi, dword [esi + 0x88]
mov edx, dword [esp + 0x24]
push eax
mov ecx, esi
add edi, edx
call fcn.004097a0
mov ecx, dword [esp + 0x18]
mov dword [esp + 0x24], eax
mov eax, dword [ecx - 8]
mov ecx, dword [esp + 0x98]
push eax
mov eax, dword [esp + 0x1c]
mov edx, dword [ecx]
push eax
mov eax, dword [esp + 0x2c]
push edi
push eax
call dword [edx + 0x5c]
lea ecx, [esp + 0x18]
mov dword [esp + 0x24], ebp
mov byte [esp + 0x90], 0
call fcn.004d8520
mov eax, dword [esp + 0x10]
test eax, eax
jne 0x4093bd
mov edi, dword [esp + 0x20]
xor ebp, ebp
mov eax, dword [esp + 0x28]
mov dword [esi + 0x18], ebp
cmp edi, eax
mov dword [esi + 0x1c], eax
jle 0x4096f6
mov edx, dword [esi + 0x84]
xor ecx, ecx
mov cx, word [esi + 0x8c]
mov eax, dword [esi + 0x88]
mov dword [esp + 0x5c], eax
mov dword [esp + 0x6c], eax
lea edi, [ecx + edx]
xor ecx, ecx
mov cx, word [esi + 0x8e]
lea ebx, [eax + 0xf]
mov dword [esp + 0x7c], eax
mov dword [esp + 0x4c], eax
lea edx, [eax + ecx]
mov eax, dword [esp + 0x20]
mov dword [esp + 0x74], edx
mov dword [esp + 0x74], ebx
lea ebp, [edi + 0xf]
lea ebx, [edx - 0xf]
add ecx, 0xffffffe2
mov dword [esp + 0x58], edi
test eax, eax
mov dword [esp + 0x60], ebp
mov dword [esp + 0x64], edx
mov dword [esp + 0x68], edi
mov dword [esp + 0x70], ebp
mov dword [esp + 0x78], edi
mov dword [esp + 0x80], ebp
mov dword [esp + 0x84], edx
mov dword [esp + 0x7c], ebx
mov dword [esp + 0x48], edi
mov dword [esp + 0x50], ebp
mov dword [esp + 0x54], edx
mov dword [esp + 0x24], ecx
jne 0x40953a
mov eax, 1
mov dword [esp + 0x20], eax
fild dword [esp + 0x24]
mov dword [esi + 0x20], eax
fidiv dword [esp + 0x20]
fild dword [esp + 0x28]
fmul st(1)
call fcn.004bfae0
fild dword [esp + 0x2c]
mov edi, eax
fmul st(1)
call fcn.004bfae0
cmp edi, 6
fstp st(0)
jge 0x409569
mov edi, 6
mov ecx, dword [esp + 0x74]
add eax, ecx
lea ecx, [esp + 0x48]
mov dword [esp + 0x4c], eax
add eax, edi
mov dword [esp + 0x54], eax
call fcn.004dddcb
mov eax, dword [esp + 0x7c]
mov ecx, dword [esp + 0x54]
cmp ecx, eax
jle 0x409592
mov dword [esp + 0x54], eax
mov eax, dword [esp + 0x74]
mov ecx, dword [esp + 0x4c]
cmp ecx, eax
jge 0x4095a2
mov dword [esp + 0x4c], eax
mov edi, dword [esp + 0x98]
lea edx, [esp + 0x58]
push 0xe0e0e0
push edx
mov ecx, edi
call fcn.004ddcc0
mov eax, dword [esi + 0x2c]
test eax, eax
je 0x4095fa
mov eax, dword [esp + 0x58]
mov ecx, dword [esp + 0x5c]
mov edx, dword [esp + 0x60]
mov dword [esp + 0x38], eax
mov eax, dword [esp + 0x64]
mov dword [esp + 0x3c], ecx
mov ecx, dword [esp + 0x4c]
mov dword [esp + 0x40], edx
mov dword [esp + 0x44], eax
lea edx, [esp + 0x38]
mov dword [esp + 0x44], ecx
push 0xc6c6c6
push edx
mov ecx, edi
call fcn.004ddcc0
mov eax, dword [esi + 0x30]
test eax, eax
je 0x40963a
mov ecx, dword [esp + 0x5c]
mov edx, dword [esp + 0x60]
mov eax, dword [esp + 0x58]
mov dword [esp + 0x3c], ecx
mov ecx, dword [esp + 0x54]
mov dword [esp + 0x40], edx
mov dword [esp + 0x38], eax
mov eax, dword [esp + 0x64]
lea edx, [esp + 0x38]
mov dword [esp + 0x3c], ecx
push 0xc6c6c6
push edx
mov ecx, edi
mov dword [esp + 0x4c], eax
call fcn.004ddcc0
mov eax, dword [esp + 0x9c]
mov ebp, 1
cmp eax, ebp
mov eax, dword [esi + 0x24]
jne 0x409725
test eax, eax
je 0x409667
mov ecx, dword [edi + 4]
push 0x4200
lea eax, [esp + 0x6c]
push 3
push eax
push ecx
jmp 0x409677
mov eax, dword [edi + 4]
push 0x4000
lea edx, [esp + 0x6c]
push 3
push edx
push eax
mov ebx, dword [sym.imp.USER32.dll_DrawFrameControl]
call ebx
mov eax, dword [esi + 0x28]
test eax, eax
je 0x409698
mov edx, dword [edi + 4]
push 0x4201
lea ecx, [esp + 0x7c]
push 3
push ecx
push edx
jmp 0x4096a8
mov ecx, dword [edi + 4]
push 0x4001
lea eax, [esp + 0x7c]
push 3
push eax
push ecx
call ebx
mov eax, dword [esi + 0x34]
test eax, eax
je 0x4096c3
mov eax, dword [edi + 4]
push 0xc010
lea edx, [esp + 0x4c]
push 4
push edx
push eax
jmp 0x4096d3
push 0x4010
mov edx, dword [edi + 4]
lea ecx, [esp + 0x4c]
push 4
push ecx
push edx
call ebx
mov ecx, dword [esp + 0x48]
mov edx, dword [esp + 0x4c]
lea eax, [esi + 4]
mov dword [esi + 0x18], ebp
mov dword [eax], ecx
mov ecx, dword [esp + 0x50]
mov dword [eax + 4], edx
mov edx, dword [esp + 0x54]
mov dword [eax + 8], ecx
mov dword [eax + 0xc], edx
lea ecx, [esp + 0x14]
mov dword [esp + 0x90], 0xffffffff
call fcn.004d8520
mov ecx, dword [esp + 0x88]
pop edi
pop esi
pop ebp
mov dword fs:[0], ecx
pop ebx
add esp, 0x84
ret 8
test eax, eax
je 0x40973b
mov ecx, dword [edi + 4]
push 0x4200
lea eax, [esp + 0x6c]
push 3
push eax
push ecx
jmp 0x409748
mov eax, dword [edi + 4]
push 0
lea edx, [esp + 0x6c]
push 3
push edx
push eax
mov ebx, dword [sym.imp.USER32.dll_DrawFrameControl]
call ebx
mov eax, dword [esi + 0x28]
test eax, eax
je 0x409769
mov edx, dword [edi + 4]
push 0x4201
lea ecx, [esp + 0x7c]
push 3
push ecx
push edx
jmp 0x409775
mov ecx, dword [edi + 4]
push ebp
lea eax, [esp + 0x7c]
push 3
push eax
push ecx
call ebx
mov eax, dword [esi + 0x34]
push 0x10
test eax, eax
je 0x4096c8
mov eax, dword [edi + 4]
lea edx, [esp + 0x4c]
push 4
push edx
push eax
jmp 0x4096d3