Function at 0x409740
Capabilities:
Resolve function by parsing pe exports

Disassembly:
sub esp, 0x54
push ebx
mov ebx, dword [sym.imp.USER32.dll_GetSysColor]
push ebp
push esi
mov esi, dword [esp + 0x64]
mov ebp, dword [esi]
push edi
push 5
mov edi, ecx
call ebx
push eax
mov ecx, esi
call dword [ebp + 0x2c]
mov ebp, dword [esi]
push 8
call ebx
push eax
mov ecx, esi
call dword [ebp + 0x30]
lea eax, [edi + 0x34]
test eax, eax
je 0x40978a
mov eax, dword [eax + 4]
test eax, eax
je 0x40978a
push eax
mov eax, dword [esi + 4]
push eax
call dword [sym.imp.GDI32.dll_SelectObject]
mov dword [esp + 0x1c], eax
jmp 0x409792
mov dword [esp + 0x1c], 0
mov ebp, dword [esp + 0x6c]
mov eax, dword [ebp + 4]
mov ecx, dword [edi + 0x60]
cdq
idiv ecx
mov ebx, eax
mov eax, dword [ebp + 0xc]
cdq
idiv ecx
mov edx, dword [edi + 0x58]
mov ecx, dword [edi + 0x50]
sub ecx, edx
cmp eax, ecx
jl 0x4097b5
mov eax, ecx
mov ecx, dword [edi + 0x60]
imul ecx, ebx
add edx, ebx
shl edx, 4
cmp ebx, eax
mov dword [esp + 0x30], ecx
mov dword [esp + 0x40], ecx
mov dword [esp + 0x68], edx
jg 0x409a51
sub eax, ebx
inc eax
mov dword [esp + 0x18], eax
jmp 0x4097e1
mov edx, dword [esp + 0x68]
mov eax, dword [edi + 0x68]
mov ebx, dword [edi + 0x60]
mov dword [esp + 0x28], ecx
add ecx, ebx
xor ebp, ebp
mov dword [esp + 0x2c], eax
mov dword [esp + 0x10], eax
cmp dword [edi + 0xb8], ebp
mov dword [esp + 0x30], ecx
mov dword [esp + 0x24], ebp
lea ecx, [esp + 0x44]
je 0x40980e
push edx
jmp 0x409817
mov eax, dword [edi + 0xb4]
add eax, edx
push eax
push str._08X
push ecx
call dword [sym.imp.USER32.dll_wsprintfA]
mov edx, dword [esi]
add esp, 0xc
push ebp
push 8
lea eax, [esp + 0x4c]
push eax
mov eax, dword [esp + 0x34]
lea ecx, [esp + 0x30]
push ecx
push 2
push eax
push ebp
mov ecx, esi
call dword [edx + 0x60]
mov eax, dword [esp + 0x40]
mov ecx, dword [edi + 0x60]
mov dword [esp + 0x38], eax
add eax, ecx
mov ecx, dword [edi + 0x6c]
mov dword [esp + 0x40], eax
mov dword [esp + 0x3c], ecx
mov dword [esp + 0x14], 0
mov ecx, dword [esp + 0x68]
cmp ecx, dword [edi + 0x78]
jl 0x4098b8
cmp ecx, dword [edi + 0x7c]
jl 0x40988a
test ebp, ebp
je 0x4098b8
mov ebx, dword [esi]
push 5
xor ebp, ebp
call dword [sym.imp.USER32.dll_GetSysColor]
push eax
mov ecx, esi
call dword [ebx + 0x2c]
push 8
jmp 0x4098a6
cmp ebp, 1
je 0x4098b8
mov ebx, dword [esi]
push 0xd
mov ebp, 1
call dword [sym.imp.USER32.dll_GetSysColor]
push eax
mov ecx, esi
call dword [ebx + 0x2c]
push 0xe
mov ebx, dword [esi]
call dword [sym.imp.USER32.dll_GetSysColor]
mov ecx, esi
push eax
call dword [ebx + 0x30]
mov ecx, dword [esp + 0x68]
mov eax, dword [edi + 0xac]
test eax, eax
je 0x4098ef
cmp ecx, eax
jb 0x4098ef
test ebp, ebp
jne 0x4098ef
mov eax, dword [edi + 0xa4]
mov edx, dword [esi]
push eax
mov ecx, esi
mov ebp, 2
call dword [edx + 0x2c]
mov eax, dword [edi + 0xa8]
mov edx, dword [esi]
push eax
mov ecx, esi
call dword [edx + 0x30]
mov ecx, dword [esp + 0x68]
cmp ecx, dword [edi + 0x44]
jge 0x4099c6
mov edx, dword [edi + 0x40]
mov bl, byte [ecx + edx]
mov eax, dword [esp + 0x2c]
mov edx, dword [edi + 0x64]
mov ecx, dword [esp + 0x14]
mov dword [esp + 0x24], eax
add eax, edx
cmp ecx, 0xf
mov dword [esp + 0x2c], eax
jne 0x40991f
sub eax, dword [edi + 0x5c]
mov dword [esp + 0x2c], eax
movzx eax, bl
push eax
mov dword [esp + 0x24], eax
lea eax, [esp + 0x48]
push 0x462338
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
mov edx, dword [esi]
add esp, 0xc
push 0
push 2
lea eax, [esp + 0x4c]
push eax
mov eax, dword [esp + 0x34]
lea ecx, [esp + 0x30]
push ecx
mov ecx, dword [esp + 0x20]
push 2
push eax
push ecx
mov ecx, esi
call dword [edx + 0x60]
mov edx, dword [edi + 0x64]
mov eax, dword [esp + 0x10]
add eax, edx
mov edx, dword [edi + 0x5c]
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x3c]
mov ecx, eax
add eax, edx
test bl, bl
mov dword [esp + 0x34], ecx
mov dword [esp + 0x3c], eax
je 0x409989
mov al, byte [esp + 0x20]
mov byte [esp + 0x44], al
jmp 0x40998e
mov byte [esp + 0x44], 0x2e
mov edx, dword [esi]
push 0
push 1
lea eax, [esp + 0x4c]
push eax
lea eax, [esp + 0x40]
push eax
mov eax, dword [esp + 0x48]
push 2
push eax
push ecx
mov ecx, esi
call dword [edx + 0x60]
mov eax, dword [esp + 0x14]
mov edx, dword [esp + 0x68]
inc eax
inc edx
cmp eax, 0x10
mov dword [esp + 0x14], eax
mov dword [esp + 0x68], edx
jl 0x409862
test ebp, ebp
je 0x4099e8
mov ebx, dword [sym.imp.USER32.dll_GetSysColor]
mov ebp, dword [esi]
push 5
call ebx
push eax
mov ecx, esi
call dword [ebp + 0x2c]
mov ebp, dword [esi]
push 8
call ebx
push eax
mov ecx, esi
call dword [ebp + 0x30]
mov eax, dword [esp + 0x2c]
mov ecx, dword [edi + 0x6c]
mov edx, dword [esi]
push 0
push 0
mov dword [esp + 0x34], ecx
push 0
lea ecx, [esp + 0x30]
push ecx
mov ecx, dword [esp + 0x38]
push 2
push ecx
push eax
mov ecx, esi
mov dword [esp + 0x40], eax
call dword [edx + 0x60]
mov eax, dword [esp + 0x3c]
mov edx, dword [edi + 0x70]
push 0
push 0
push 0
lea ecx, [esp + 0x40]
push ecx
mov ecx, dword [esp + 0x48]
push 2
push ecx
mov dword [esp + 0x54], edx
mov edx, dword [esi]
push eax
mov ecx, esi
mov dword [esp + 0x50], eax
call dword [edx + 0x60]
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x30]
dec eax
mov dword [esp + 0x18], eax
jne 0x4097dd
mov ebp, dword [esp + 0x6c]
mov eax, dword [ebp + 0xc]
cmp ecx, eax
jge 0x409a86
mov edx, dword [edi + 0x70]
push 0
push 0
push 0
mov dword [esp + 0x38], edx
lea edx, [esp + 0x30]
push edx
push 2
push ecx
mov dword [esp + 0x40], ecx
mov dword [esp + 0x48], eax
mov eax, dword [esi]
push 0
mov ecx, esi
mov dword [esp + 0x40], 0
call dword [eax + 0x60]
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x409a99
push eax
mov eax, dword [esi + 4]
push eax
call dword [sym.imp.GDI32.dll_SelectObject]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x54
ret 8