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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xffffffc0
sub esp, 0x74
push ebx
push esi
push edi
mov edi, ecx
cmp dword [edi + 0x10], 0
je 0x40e87b
push 2
push 0x486a18
lea eax, [esp + 0x58]
push eax
call fcn.0045c4c0
mov ebx, dword [edi + 8]
push 4
push dword [edi + 0x14]
mov dword [esp + 0x34], ebx
call fcn.0046974c
mov esi, eax
add esp, 8
mov dword [esp + 0x3c], esi
test esi, esi
je 0x40e87b
push 4
push dword [edi + 0x14]
call fcn.0046974c
add esp, 8
mov dword [esp + 0x40], eax
test eax, eax
jne 0x40e3b0
push esi
call fcn.004640b0
add esp, 4
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov esi, dword [edi + 0x14]
xor ecx, ecx
test esi, esi
je 0x40e3d1
mov edx, dword [edi + 0x10]
mov ebx, dword [esp + 0x3c]
mov eax, dword [edx]
lea edx, [edx + 0xc]
mov dword [ebx + ecx*4], eax
inc ecx
cmp ecx, esi
jb 0x40e3c0
mov ebx, dword [esp + 0x2c]
push dword [edi + 0x2c]
xor esi, esi
push dword [edi + 0x20]
push esi
call dword [sym.imp.GDI32.dll_CreatePen]
test eax, eax
cmovne esi, eax
push esi
push dword [edi + 4]
mov dword [esp + 0x64], esi
call dword [sym.imp.GDI32.dll_SelectObject]
mov dword [esp + 0x58], eax
lea eax, [esp + 0x44]
push eax
push dword [edi + 0x6c]
push 0
push dword [edi + 4]
call dword [sym.imp.GDI32.dll_MoveToEx]
push dword [edi + 0x6c]
push ebx
push dword [edi + 4]
call dword [sym.imp.GDI32.dll_LineTo]
mov ecx, dword [edi + 0x1c]
mov eax, ecx
and eax, 1
and ecx, 2
cmp byte [edi + 0x24], 0
mov dword [esp + 0x4c], eax
mov dword [esp + 0x38], ecx
je 0x40e56f
mov eax, dword [edi + 0x14]
xor edx, edx
xor ecx, ecx
mov dword [esp + 0x18], edx
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x20], ecx
test eax, eax
je 0x40e52d
xor esi, esi
mov eax, dword [edi + 0x10]
mov ebx, dword [esi + eax + 8]
cmp ebx, 0xffffffff
jne 0x40e46b
mov ebx, dword [esp + 0x1c]
inc edx
mov dword [esp + 0x18], edx
jmp 0x40e51a
cmp ebx, 0xfffffffe
jne 0x40e4a9
mov edx, dword [esi + eax]
mov ecx, edx
lea ebx, [ecx + 2]
nop dword [eax + eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40e480
sub ecx, ebx
lea eax, [esp + 0x44]
sar ecx, 1
push ecx
push edx
push eax
mov ecx, edi
call fcn.0045c4c0
mov ecx, dword [edi + 0x18]
mov eax, dword [esp + 0x44]
lea ecx, [eax + ecx*2]
jmp 0x40e4fc
push 0x58
push dword [edi + 4]
call dword [sym.imp.GDI32.dll_GetDeviceCaps]
movd xmm1, ebx
sub esp, 8
cvtdq2pd xmm1, xmm1
movd xmm0, eax
cvtdq2pd xmm0, xmm0
mulsd xmm0, xmm1
divsd xmm0, qword [0x493e60]
movsd qword [esp + 0x38], xmm0
fld qword [esp + 0x38]
fstp qword [esp]
call fcn.00474580
fstp qword [esp + 0x38]
cvttsd2si ecx, qword [esp + 0x38]
add esp, 8
mov eax, 1
test ecx, ecx
cmove ecx, eax
mov eax, dword [edi + 0x10]
mov ebx, dword [esp + 0x1c]
mov edx, dword [esp + 0x18]
mov dword [esi + eax + 8], ecx
mov eax, dword [edi + 0x10]
mov ecx, dword [esp + 0x20]
sub ebx, dword [esi + eax + 8]
mov dword [esp + 0x1c], ebx
mov eax, dword [edi + 0x14]
inc ecx
add esi, 0xc
mov dword [esp + 0x20], ecx
cmp ecx, eax
jb 0x40e451
movd xmm1, ebx
xor ecx, ecx
movd xmm0, edx
cvtdq2pd xmm1, xmm1
cvtdq2pd xmm0, xmm0
divsd xmm1, xmm0
cvttsd2si esi, xmm1
test eax, eax
je 0x40e567
xor eax, eax
nop dword [eax]
mov edx, dword [edi + 0x10]
cmp dword [eax + edx + 8], 0xffffffff
jne 0x40e55e
mov dword [eax + edx + 8], esi
inc ecx
add eax, 0xc
cmp ecx, dword [edi + 0x14]
jb 0x40e550
mov ecx, dword [esp + 0x38]
mov byte [edi + 0x24], 0
mov eax, dword [edi + 0x18]
mov dword [esp + 0x1c], eax
add eax, eax
mov dword [esp + 0x28], eax
nop dword [eax]
mov bl, 1
test ecx, ecx
je 0x40e590
mov dword [esp + 0x20], 1
jmp 0x40e59f
mov eax, dword [edi + 0x14]
mov dword [esp + 0x20], eax
test eax, eax
je 0x40e7f2
mov edx, dword [esp + 0x40]
xor esi, esi
mov eax, dword [esp + 0x3c]
sub eax, edx
mov dword [esp + 0x18], edx
mov dword [esp + 0x44], eax
mov eax, dword [esp + 0x20]
mov dword [esp + 0x30], eax
nop dword [eax + eax]
test ecx, ecx
je 0x40e5ca
mov ecx, dword [esp + 0x2c]
jmp 0x40e5d1
mov eax, dword [edi + 0x10]
mov ecx, dword [esi + eax + 8]
mov eax, dword [edi + 0x18]
neg eax
lea eax, [ecx + eax*2]
mov ecx, dword [esp + 0x44]
push dword [ecx + edx]
mov ecx, edi
push eax
call fcn.0040d980
mov edx, dword [esp + 0x18]
xor ecx, ecx
test eax, eax
movzx ebx, bl
cmovg ebx, ecx
add esi, 0xc
mov ecx, dword [esp + 0x38]
mov dword [edx], eax
add edx, 4
sub dword [esp + 0x30], 1
mov dword [esp + 0x18], edx
jne 0x40e5c0
test bl, bl
jne 0x40e7f2
mov eax, dword [edi + 0x6c]
add eax, dword [esp + 0x54]
add eax, dword [esp + 0x28]
cmp eax, dword [edi + 0xc]
jle 0x40e647
cmp dword [edi + 0x48], 0xffffffff
jle 0x40e634
push dword [edi + 4]
call dword [sym.imp.GDI32.dll_EndPage]
push dword [edi + 4]
call dword [sym.imp.GDI32.dll_StartPage]
inc dword [edi + 0x48]
mov dword [edi + 0x6c], 0
mov ebx, dword [esp + 0x3c]
xor esi, esi
mov edx, dword [esp + 0x40]
xor ecx, ecx
mov eax, dword [edi + 0x10]
sub edx, ebx
mov dword [esp + 0x30], esi
mov dword [esp + 0x18], ecx
mov dword [esp + 0x24], ebx
mov dword [esp + 0x44], edx
nop dword [eax + eax]
mov edx, dword [esp + 0x38]
mov ebx, dword [esp + 0x2c]
test edx, edx
jne 0x40e680
mov ebx, dword [ecx + eax + 8]
cmp dword [esp + 0x4c], 0
jne 0x40e68b
test edx, edx
je 0x40e6e4
mov ecx, dword [edi + 0x6c]
lea eax, [ebx + esi]
push dword [edi + 0x30]
mov dword [esp + 0x6c], eax
mov eax, dword [esp + 0x58]
push dword [edi + 4]
add eax, ecx
mov dword [esp + 0x68], esi
add eax, dword [esp + 0x30]
mov dword [esp + 0x6c], ecx
mov dword [esp + 0x74], eax
call dword [sym.imp.GDI32.dll_SetBkColor]
push 0
push 0
push 0
mov esi, eax
lea eax, [esp + 0x6c]
push eax
push 2
push 0
push 0
push dword [edi + 4]
call dword [sym.imp.GDI32.dll_ExtTextOutW]
push esi
push dword [edi + 4]
call dword [sym.imp.GDI32.dll_SetBkColor]
mov eax, dword [edi + 0x10]
mov esi, dword [esp + 0x30]
mov ecx, dword [esp + 0x44]
mov edx, dword [esp + 0x24]
mov edx, dword [ecx + edx]
mov ecx, dword [esp + 0x18]
test edx, edx
je 0x40e74b
mov ecx, dword [ecx + eax + 4]
mov eax, 2
cmp dword [esp + 0x4c], 0
push edx
cmovne ecx, eax
mov eax, dword [esp + 0x20]
add dword [edi + 0x6c], eax
mov eax, dword [esp + 0x28]
mov esi, dword [eax]
mov eax, dword [edi + 0x18]
sub ebx, eax
add ebx, dword [esp + 0x34]
add eax, dword [esp + 0x34]
push esi
push ecx
push ebx
push eax
mov ecx, edi
call fcn.0040db00
mov ebx, dword [esp + 0x24]
mov ecx, dword [esp + 0x44]
mov eax, dword [esp + 0x1c]
sub dword [edi + 0x6c], eax
mov eax, dword [ecx + ebx]
lea eax, [esi + eax*2]
mov esi, dword [esp + 0x30]
mov dword [ebx], eax
jmp 0x40e74f
mov ebx, dword [esp + 0x24]
lea eax, [esp + 0x78]
push eax
push dword [edi + 0x6c]
push esi
push dword [edi + 4]
call dword [sym.imp.GDI32.dll_MoveToEx]
mov eax, dword [edi + 0x6c]
add eax, dword [esp + 0x54]
add eax, dword [esp + 0x28]
push eax
push esi
push dword [edi + 4]
call dword [sym.imp.GDI32.dll_LineTo]
mov ecx, dword [esp + 0x18]
add ebx, 4
mov eax, dword [edi + 0x10]
mov dword [esp + 0x24], ebx
add esi, dword [eax + ecx + 8]
add ecx, 0xc
sub dword [esp + 0x20], 1
mov dword [esp + 0x30], esi
mov dword [esp + 0x18], ecx
jne 0x40e670
mov esi, dword [esp + 0x2c]
lea eax, [esp + 0x70]
push eax
push dword [edi + 0x6c]
dec esi
push esi
push dword [edi + 4]
call dword [sym.imp.GDI32.dll_MoveToEx]
mov eax, dword [edi + 0x6c]
add eax, dword [esp + 0x54]
add eax, dword [esp + 0x28]
push eax
push esi
push dword [edi + 4]
call dword [sym.imp.GDI32.dll_LineTo]
mov eax, dword [esp + 0x54]
add eax, dword [esp + 0x28]
mov edx, dword [esp + 0x1c]
add dword [edi + 0x6c], eax
neg edx
mov ecx, dword [esp + 0x38]
mov dword [esp + 0x28], 0
mov dword [esp + 0x1c], edx
jmp 0x40e580
lea eax, [esp + 0x70]
push eax
push dword [edi + 0x6c]
push 0
push dword [edi + 4]
call dword [sym.imp.GDI32.dll_MoveToEx]
push dword [edi + 0x6c]
push dword [esp + 0x30]
push dword [edi + 4]
call dword [sym.imp.GDI32.dll_LineTo]
push dword [esp + 0x58]
push dword [edi + 4]
call dword [sym.imp.GDI32.dll_SelectObject]
xor ebx, ebx
mov dword [edi + 0x1c], 0
cmp dword [edi + 0x14], ebx
jbe 0x40e854
xor esi, esi
mov eax, dword [edi + 0x10]
push dword [esi + eax]
call fcn.004640b0
mov eax, dword [edi + 0x10]
lea esi, [esi + 0xc]
inc ebx
add esp, 4
mov dword [esi + eax - 0xc], 0
cmp ebx, dword [edi + 0x14]
jb 0x40e832
push dword [esp + 0x3c]
call fcn.004640b0
add esp, 4
push dword [esp + 0x40]
call fcn.004640b0
mov eax, dword [esp + 0x60]
add esp, 4
test eax, eax
je 0x40e87b
push eax
call dword [sym.imp.GDI32.dll_DeleteObject]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret