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

Disassembly:
sub esp, 0x5c
mov ecx, dword [esp + 0x70]
push ebx
mov ebx, dword [esp + 0x7c]
push ebp
push esi
push edi
mov edi, dword [esp + 0x78]
mov esi, dword [ebx + 0x14]
sub ecx, edi
mov ebp, dword [ebx + 0x20]
mov eax, ecx
add ebp, 2
cdq
imul ebp, esi
idiv esi
mov dword [esp + 0x30], eax
mov eax, ecx
cdq
idiv ebp
mov ecx, dword [ebx + 0xc]
mov esi, eax
mov eax, dword [ebx + 8]
mov dword [esp + 0x1c], esi
mov edx, dword [ecx + eax*4 - 4]
push edx
call fcn.0049717e
mov dword [esp + 0x24], eax
mov eax, dword [ebx + 0xc]
mov ecx, dword [eax]
push ecx
call fcn.0049717e
mov dword [esp + 0x88], eax
mov eax, dword [esp + 0x8c]
add esp, 8
cmp eax, 1
jne 0x40efd9
mov ecx, dword [ebx + 0x14]
xor eax, eax
cmp ecx, eax
mov dword [esp + 0x84], eax
jle 0x40f190
mov edx, dword [esp + 0x8c]
add esi, edi
mov edi, dword [sym.imp.GDI32.dll_SelectObject]
mov dword [esp + 0x18], esi
mov esi, dword [esp + 0x70]
mov dword [esp + 0x14], eax
mov dword [esp + 0x10], edx
mov eax, dword [ebx + 0x20]
xor ebp, ebp
test eax, eax
jle 0x40ef94
fild dword [esp + 0x80]
mov ecx, dword [esp + 0x7c]
mov eax, dword [esp + 0x74]
mov edx, dword [esp + 0x20]
sub ecx, eax
fstp qword [esp + 0x34]
mov dword [esp + 0x8c], ecx
mov ecx, dword [esp + 0x80]
fild dword [esp + 0x8c]
sub edx, ecx
mov ecx, dword [esp + 0x14]
mov dword [esp + 0x8c], edx
mov edx, dword [esp + 0x18]
fstp qword [esp + 0x3c]
fild dword [esp + 0x8c]
inc eax
mov dword [esp + 0x70], 0x4d5924
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x1c]
fstp qword [esp + 0x44]
fild dword [esp + 0x2c]
lea ebx, [ecx + eax*2]
mov eax, dword [esp + 0x78]
add ebx, eax
mov dword [esp + 0x8c], edx
fstp qword [esp + 0x4c]
mov eax, dword [esp + 0x10]
mov ecx, dword [eax]
fld qword [ecx + ebp*8]
fsub qword [esp + 0x34]
fmul qword [esp + 0x3c]
fdiv qword [esp + 0x44]
fadd qword [esp + 0x4c]
fadd qword [0x4bd0b8]
call fcn.00496fa4
mov edx, dword [esp + 0x70]
mov dword [esp + 0x64], eax
mov eax, dword [edx]
push eax
call dword [sym.imp.GDI32.dll_CreateSolidBrush]
push eax
push esi
call edi
push 0
push 0
push 0
mov dword [esp + 0x30], eax
call dword [sym.imp.GDI32.dll_CreatePen]
push eax
push esi
call edi
mov ecx, dword [esp + 0x64]
mov edx, dword [esp + 0x8c]
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x2c]
push ebx
push ecx
push edx
push eax
push esi
call dword [sym.imp.GDI32.dll_Rectangle]
mov ecx, dword [esp + 0x24]
push ecx
push esi
call edi
push eax
call dword [sym.imp.GDI32.dll_DeleteObject]
mov edx, dword [esp + 0x28]
push edx
push esi
call edi
push eax
call dword [sym.imp.GDI32.dll_DeleteObject]
mov eax, dword [esp + 0x1c]
mov edx, dword [esp + 0x8c]
add edx, eax
add ebx, eax
mov eax, dword [esp + 0x88]
mov dword [esp + 0x8c], edx
mov edx, dword [esp + 0x70]
inc ebp
mov ecx, dword [eax + 0x20]
add edx, 4
cmp ebp, ecx
mov dword [esp + 0x70], edx
jl 0x40eed5
mov ebx, eax
mov eax, dword [esp + 0x10]
mov ebp, dword [esp + 0x14]
mov edx, dword [esp + 0x18]
mov ecx, dword [esp + 0x84]
add eax, 4
inc ecx
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x30]
add ebp, eax
add edx, eax
mov eax, dword [ebx + 0x14]
mov dword [esp + 0x84], ecx
cmp ecx, eax
mov dword [esp + 0x14], ebp
mov dword [esp + 0x18], edx
jl 0x40ee51
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x5c
ret
cmp eax, 2
jne 0x40f190
mov eax, dword [ebx + 0x14]
xor ecx, ecx
cmp eax, ecx
mov dword [esp + 0x84], ecx
jle 0x40f190
mov eax, dword [esp + 0x74]
mov ebp, dword [sym.imp.GDI32.dll_SelectObject]
mov dword [esp + 0x18], ecx
mov ecx, dword [esp + 0x8c]
add esi, edi
mov edi, dword [esp + 0x70]
mov dword [esp + 0x8c], ecx
mov dword [esp + 0x14], esi
jmp 0x40f025
mov ebx, dword [esp + 0x88]
mov edx, dword [ebx + 0x20]
mov ebx, dword [esp + 0x18]
lea esi, [eax + 1]
lea ecx, [edx + 1]
mov dword [esp + 0x5c], esi
imul ecx, dword [esp + 0x1c]
add ecx, ebx
mov ebx, dword [esp + 0x78]
add ecx, ebx
mov ebx, esi
xor esi, esi
mov dword [esp + 0x50], ecx
test edx, edx
jle 0x40f146
test esi, esi
jne 0x40f090
mov edx, dword [esp + 0x8c]
fild dword [esp + 0x80]
mov ecx, dword [edx]
mov edx, dword [esp + 0x7c]
sub edx, eax
mov eax, dword [esp + 0x20]
fsubr qword [ecx]
mov ecx, dword [esp + 0x80]
mov dword [esp + 0x70], edx
fild dword [esp + 0x70]
sub eax, ecx
fmulp st(1)
mov dword [esp + 0x70], eax
fild dword [esp + 0x70]
jmp 0x40f0bd
mov ecx, dword [esp + 0x7c]
mov edx, dword [esp + 0x8c]
sub ecx, eax
mov eax, dword [edx]
mov dword [esp + 0x70], ecx
fild dword [esp + 0x70]
mov ecx, dword [esp + 0x20]
fmul qword [eax + esi*8]
sub ecx, dword [esp + 0x80]
mov dword [esp + 0x70], ecx
fild dword [esp + 0x70]
fdivp st(1)
call fcn.00496fa4
mov edx, dword [esi*4 + 0x4d5924]
add ebx, eax
push edx
call dword [sym.imp.GDI32.dll_CreateSolidBrush]
push eax
push edi
call ebp
mov dword [esp + 0x24], eax
mov eax, dword [esi*4 + 0x4d5924]
push eax
push 0
push 0
call dword [sym.imp.GDI32.dll_CreatePen]
push eax
push edi
call ebp
mov ecx, dword [esp + 0x50]
mov edx, dword [esp + 0x14]
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x5c]
push ecx
push ebx
push edx
push eax
push edi
call dword [sym.imp.GDI32.dll_Rectangle]
mov ecx, dword [esp + 0x24]
mov dword [esp + 0x5c], ebx
push ecx
push edi
call ebp
push eax
call dword [sym.imp.GDI32.dll_DeleteObject]
mov edx, dword [esp + 0x28]
push edx
push edi
call ebp
push eax
call dword [sym.imp.GDI32.dll_DeleteObject]
mov eax, dword [esp + 0x88]
inc esi
mov ecx, dword [eax + 0x20]
mov eax, dword [esp + 0x74]
cmp esi, ecx
jl 0x40f053
mov edx, dword [esp + 0x30]
mov ebx, dword [esp + 0x18]
mov esi, dword [esp + 0x14]
mov ecx, dword [esp + 0x84]
add ebx, edx
add esi, edx
mov edx, dword [esp + 0x88]
mov dword [esp + 0x18], ebx
mov ebx, dword [esp + 0x8c]
mov dword [esp + 0x14], esi
mov esi, dword [edx + 0x14]
inc ecx
add ebx, 4
cmp ecx, esi
mov dword [esp + 0x84], ecx
mov dword [esp + 0x8c], ebx
jl 0x40f01e
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x5c
ret