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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x45805d
mov eax, dword fs:[0]
push eax
sub esp, 0x58
push ebx
push esi
push edi
mov eax, dword [0x46f190]
xor eax, esp
push eax
lea eax, [esp + 0x68]
mov dword fs:[0], eax
mov ebx, dword [ebp + 8]
cmp dword [ebx + 0x68], 4
jne 0x40d7ba
mov esi, dword [ebp + 0x10]
xor edi, edi
cmp dword [ebx + 0x6c], edi
je 0x40d6c8
mov eax, dword [esi]
xor ecx, ecx
cmp dword [ebx + 0x70], edi
cdq
sete cl
sub eax, edx
sar eax, 1
lea ecx, [ecx + ecx - 1]
imul ecx, dword [ebx + 0x74]
add ecx, eax
mov dword [esp + 0x54], ecx
jmp 0x40d6de
cmp dword [ebx + 0x70], edi
je 0x40d6d7
mov eax, dword [ebp + 0x10]
mov eax, dword [eax]
sub eax, dword [ebx + 0x74]
jmp 0x40d6da
mov eax, dword [ebx + 0x74]
mov dword [esp + 0x54], eax
cmp dword [ebx + 0x84], edi
je 0x40d709
mov eax, dword [esi]
xor ecx, ecx
cmp dword [ebx + 0x88], edi
cdq
sete cl
sub eax, edx
sar eax, 1
lea ecx, [ecx + ecx - 1]
imul ecx, dword [ebx + 0x8c]
add ecx, eax
mov edi, ecx
jmp 0x40d721
cmp dword [ebx + 0x88], edi
je 0x40d71b
mov edi, dword [esi]
sub edi, dword [ebx + 0x8c]
jmp 0x40d721
mov edi, dword [ebx + 0x8c]
xor eax, eax
cmp dword [ebx + 0x78], eax
je 0x40d749
xor ecx, ecx
cmp dword [ebx + 0x7c], eax
mov eax, dword [esi + 4]
sete cl
cdq
sub eax, edx
sar eax, 1
lea ecx, [ecx + ecx - 1]
imul ecx, dword [ebx + 0x80]
add ecx, eax
xor eax, eax
jmp 0x40d75f
cmp dword [ebx + 0x7c], eax
je 0x40d759
mov ecx, dword [esi + 4]
sub ecx, dword [ebx + 0x80]
jmp 0x40d75f
mov ecx, dword [ebx + 0x80]
cmp dword [ebx + 0x90], eax
je 0x40d791
xor edx, edx
cmp dword [ebx + 0x94], eax
mov eax, dword [esi + 4]
sete dl
lea edx, [edx + edx - 1]
imul edx, dword [ebx + 0x98]
mov dword [esp + 0x1c], edx
cdq
sub eax, edx
mov edx, dword [esp + 0x1c]
sar eax, 1
add eax, edx
jmp 0x40d7aa
cmp dword [ebx + 0x94], eax
je 0x40d7a4
mov eax, dword [esi + 4]
sub eax, dword [ebx + 0x98]
jmp 0x40d7aa
mov eax, dword [ebx + 0x98]
sub edi, dword [esp + 0x54]
sub eax, ecx
mov dword [esi], edi
mov dword [esi + 4], eax
jmp 0x40db32
call dword [sym.imp.USER32.dll_GetDesktopWindow]
push eax
call dword [sym.imp.USER32.dll_GetDC]
mov dword [esp + 0x1c], eax
xor eax, eax
mov dword [esp + 0x70], eax
mov dword [esp + 0x18], eax
mov byte [esp + 0x70], 1
mov ecx, dword [ebx + 0x4c]
lea esi, [ebx + 0x14]
lea edi, [esp + 0x54]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
mov dword [esp + 0x14], eax
movsd dword es:[edi], dword [esi]
call fcn.00409637
push dword [esp + 0x1c]
mov esi, eax
mov dword [esp + 0x28], esi
call dword [sym.imp.GDI32.dll_CreateCompatibleDC]
cmp dword [ebp + 0xc], 0
mov dword [esp + 0x18], eax
je 0x40d823
mov eax, dword [ebp + 0x10]
mov ecx, dword [eax]
add ecx, dword [esp + 0x54]
mov eax, dword [eax + 4]
add eax, dword [esp + 0x58]
mov dword [esp + 0x5c], ecx
mov dword [esp + 0x60], eax
mov eax, dword [ebx + 0x58]
test eax, eax
jne 0x40d86a
mov eax, dword [esi + 0x20]
test eax, eax
jne 0x40d86a
mov edi, ebx
mov edi, dword [edi + 8]
test edi, edi
je 0x40d86e
push edi
call fcn.004069f7
mov edi, eax
test edi, edi
pop ecx
je 0x40d86e
cmp dword [edi + 0x58], 0
jne 0x40da63
mov ecx, dword [edi + 0x4c]
call fcn.00409637
cmp dword [eax + 0x20], 0
je 0x40d833
mov ecx, dword [edi + 0x4c]
call fcn.00409637
mov eax, dword [eax + 0x20]
mov dword [esp + 0x14], eax
mov eax, dword [ebx + 0x34]
and eax, 1
cmp al, 1
jne 0x40d8b2
mov eax, dword [esi + 0x24]
test eax, eax
jne 0x40d8ae
mov edi, ebx
mov edi, dword [edi + 8]
test edi, edi
je 0x40d8b2
push edi
call fcn.004069f7
mov edi, eax
test edi, edi
pop ecx
je 0x40d8b2
mov ecx, dword [edi + 0x4c]
call fcn.00409637
cmp dword [eax + 0x24], 0
je 0x40d881
mov ecx, dword [edi + 0x4c]
call fcn.00409637
mov eax, dword [eax + 0x24]
mov dword [esp + 0x14], eax
cmp dword [esp + 0x14], 0
jne 0x40d8c5
push 0
call fcn.00421151
pop ecx
mov dword [esp + 0x14], eax
push dword [esp + 0x14]
push dword [esp + 0x1c]
call dword [sym.imp.GDI32.dll_SelectObject]
mov ecx, dword [esi + 0x28]
mov dword [esp + 0x28], eax
mov eax, dword [esi + 0x2c]
neg eax
push eax
neg ecx
push ecx
lea eax, [esp + 0x5c]
push eax
call dword [sym.imp.USER32.dll_InflateRect]
mov eax, dword [esi + 0x1c]
and eax, 0xfffffff0
test al, 0x10
je 0x40d900
mov dword [esp + 0x60], 0x7fff
mov ecx, dword [ebx + 0x28]
xor edi, edi
cmp dword [ecx - 0xc], edi
je 0x40dacf
cmp dword [esi + 0x48], edi
je 0x40dab2
lea eax, [esp + 0x3c]
push eax
push edi
push edi
mov dword [esp + 0x48], edi
call sub.gdiplus.dll_GdipCreateStringFormat
mov dword [esp + 0x40], eax
push dword [esp + 0x18]
lea esi, [esp + 0x50]
call fcn.00407a7c
mov byte [esp + 0x70], 3
push dword [esp + 0x14]
lea ebx, [esp + 0x18]
push dword [esp + 0x1c]
call fcn.0040bf15
mov esi, dword [ebp + 8]
mov byte [esp + 0x70], 4
mov eax, dword [esp + 0x5c]
sub eax, dword [esp + 0x54]
push dword [esi + 8]
mov dword [esp + 0x24], eax
mov eax, dword [esp + 0x64]
fild dword [esp + 0x24]
sub eax, dword [esp + 0x5c]
mov dword [esp + 0x24], eax
fstp dword [esp + 0x48]
fild dword [esp + 0x24]
fstp dword [esp + 0x4c]
call fcn.004069f7
pop ecx
mov ecx, eax
cmp ecx, edi
je 0x40d9ce
lea eax, [esp + 0x2c]
mov dword [esp + 0x2c], edi
mov dword [esp + 0x30], edi
mov dword [esp + 0x34], edi
mov dword [esp + 0x38], edi
call fcn.00406edf
mov eax, dword [esp + 0x34]
sub eax, dword [esp + 0x2c]
mov dword [esp + 0x20], eax
mov eax, dword [esp + 0x38]
fild dword [esp + 0x20]
sub eax, dword [esp + 0x30]
fstp dword [esp + 0x44]
mov dword [esp + 0x20], eax
fild dword [esp + 0x20]
fstp dword [esp + 0x48]
push edi
push dword [esp + 0x40]
call sub.gdiplus.dll_GdipSetStringFormatAlign
cmp eax, edi
je 0x40d9e0
mov dword [esp + 0x40], eax
mov esi, dword [esi + 0x28]
fldz
push dword [esi - 0xc]
fst dword [esp + 0x34]
mov edx, dword [esp + 0x18]
fstp dword [esp + 0x30]
push esi
lea eax, [esp + 0x54]
push eax
lea edi, [esp + 0x38]
lea ecx, [esp + 0x48]
lea eax, [esp + 0x50]
call fcn.0040db49
fld dword [esp + 0x2c]
fld dword [esp + 0x2c]
call fcn.00455a30
mov dword [esp + 0x20], eax
fisub dword [esp + 0x20]
fldz
fcom st(1)
fnstsw ax
fstp st(1)
test ah, 5
fld1
jp 0x40da39
fld dword [esp + 0x2c]
fadd st(1)
fstp dword [esp + 0x2c]
fld dword [esp + 0x30]
fld dword [esp + 0x30]
call fcn.00455a30
mov dword [esp + 0x20], eax
fisub dword [esp + 0x20]
fcomp st(2)
fnstsw ax
fstp st(1)
test ah, 0x41
jne 0x40da6b
fadd dword [esp + 0x30]
fstp dword [esp + 0x30]
jmp 0x40da6d
mov eax, dword [edi + 0x58]
jmp 0x40d86a
fstp st(0)
fild dword [esp + 0x54]
fadd dword [esp + 0x2c]
call fcn.00455a30
fild dword [esp + 0x58]
mov dword [esp + 0x5c], eax
fadd dword [esp + 0x30]
call fcn.00455a30
lea edi, [esp + 0x14]
mov dword [esp + 0x60], eax
call fcn.0040c0cf
push dword [esp + 0x4c]
call sub.gdiplus.dll_GdipDeleteGraphics
push dword [esp + 0x3c]
call sub.gdiplus.dll_GdipDeleteStringFormat
mov esi, dword [esp + 0x24]
xor edi, edi
jmp 0x40dadf
or eax, 0x400
push eax
lea eax, [esp + 0x58]
push eax
mov ebx, ecx
push dword [ebx - 0xc]
push ebx
push dword [esp + 0x28]
call dword [sym.imp.USER32.dll_DrawTextW]
jmp 0x40dadf
mov eax, dword [esp + 0x54]
mov dword [esp + 0x5c], eax
mov eax, dword [esp + 0x58]
mov dword [esp + 0x60], eax
mov eax, dword [esi + 0x28]
push dword [esp + 0x28]
add eax, eax
push dword [esp + 0x1c]
mov ecx, eax
sub ecx, dword [esp + 0x5c]
mov eax, dword [ebp + 0x10]
add ecx, dword [esp + 0x64]
mov dword [eax], ecx
mov ecx, dword [esi + 0x2c]
add ecx, ecx
sub ecx, dword [esp + 0x60]
add ecx, dword [esp + 0x68]
mov dword [eax + 4], ecx
call dword [sym.imp.GDI32.dll_SelectObject]
push dword [esp + 0x1c]
call dword [sym.imp.USER32.dll_GetDesktopWindow]
push eax
call dword [sym.imp.USER32.dll_ReleaseDC]
cmp dword [esp + 0x18], edi
je 0x40db32
push dword [esp + 0x18]
call dword [sym.imp.GDI32.dll_DeleteDC]
xor eax, eax
mov ecx, dword [esp + 0x68]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc