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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x68
push ebx
push ebp
push esi
push edi
mov dword [esp + 0x18], ecx
call sub.MFC71.DLL_AfxGetThread
xor edi, edi
cmp eax, edi
je 0x40c365
mov edx, dword [eax]
mov ecx, eax
call dword [edx + 0x7c]
jmp 0x40c367
xor eax, eax
mov ebx, dword [eax + 0x454]
mov ecx, dword [eax + 0x458]
mov ebp, dword [ebx + 0x54]
mov dword [ebp + 0xcc], edi
add ebp, 0x58
lea eax, [ebp + 0x194]
mov edx, dword [eax]
mov dword [esp + 0x58], edx
mov edx, dword [eax + 4]
mov dword [esp + 0x5c], edx
fld dword [esp + 0x5c]
mov edx, dword [eax + 8]
fsub dword [esp + 0x58]
mov dword [esp + 0x60], edx
mov edx, dword [ebx + 0xe0]
sub edx, 0x14
mov dword [esp + 0x20], edx
fild dword [esp + 0x20]
mov eax, dword [eax + 0xc]
mov dword [esp + 0x64], eax
mov eax, dword [ebx + 0xe4]
fdivr st(1)
sub eax, 0x14
mov dword [esp + 0x20], eax
mov dword [esp + 0x30], ebx
mov dword [esp + 0x34], ecx
fstp dword [esp + 0x10]
fld dword [esp + 0x64]
fsub dword [esp + 0x60]
fstp dword [esp + 0x14]
fild dword [esp + 0x20]
fdivr dword [esp + 0x14]
fld dword [esp + 0x10]
fcomp st(1)
fnstsw ax
test ah, 0x41
je 0x40c3fb
fstp dword [esp + 0x10]
jmp 0x40c3fd
fstp st(0)
mov edx, dword [ecx + 0xe0]
sub edx, 0x14
mov dword [esp + 0x20], edx
fidiv dword [esp + 0x20]
fld dword [esp + 0x10]
fcomp st(1)
fnstsw ax
test ah, 0x41
je 0x40c421
fstp dword [esp + 0x10]
jmp 0x40c423
fstp st(0)
mov eax, dword [ecx + 0xe4]
sub eax, 0x14
mov dword [esp + 0x20], eax
fild dword [esp + 0x20]
fdivr dword [esp + 0x14]
fld dword [esp + 0x10]
fcomp st(1)
fnstsw ax
test ah, 0x41
je 0x40c45d
fstp dword [esp + 0x10]
mov dword [esp + 0x14], edi
fld dword [esp + 0x10]
fmul dword [0x4200fc]
fstp dword [esp + 0x1c]
jmp 0x40c480
fstp st(0)
mov dword [esp + 0x14], edi
fld dword [esp + 0x10]
fmul dword [0x4200fc]
fstp dword [esp + 0x1c]
jmp 0x40c480
xor edi, edi
jmp 0x40c480
mov ecx, dword [esp + 0x14]
mov esi, dword [esp + ecx*4 + 0x30]
mov al, byte [esi + 0xe8]
test al, al
mov dword [esi + 0x104], edi
mov dword [esi + 0x100], edi
mov dword [esi + 0x108], edi
jne 0x40c4ab
mov ecx, ebp
call fcn.00407080
mov eax, dword [esi + 0x100]
mov ecx, dword [esi + 0x104]
sub esp, 0xc
mov edx, esp
mov dword [edx], eax
mov eax, dword [esi + 0x108]
mov dword [edx + 4], ecx
lea ecx, [esp + 0x54]
push ecx
mov ecx, ebp
mov dword [edx + 8], eax
call fcn.00406d00
mov edx, dword [eax + 4]
mov edi, dword [eax]
mov ecx, dword [eax + 8]
mov dword [esp + 0x5c], edx
mov edx, dword [eax + 0xc]
mov al, byte [esi + 0xe8]
test al, al
mov dword [esp + 0x58], edi
mov dword [esp + 0x60], ecx
mov dword [esp + 0x64], edx
jne 0x40c502
mov ecx, ebp
call fcn.00407080
fld dword [esp + 0x58]
mov ecx, dword [esp + 0x5c]
fsub dword [esp + 0x1c]
mov edx, dword [esp + 0x60]
lea eax, [esi + 0x10c]
mov dword [eax], edi
fst dword [esi + 0xcc]
mov dword [eax + 4], ecx
fld dword [esp + 0x60]
mov ecx, dword [esp + 0x64]
fsub dword [esp + 0x1c]
mov dword [eax + 8], edx
mov edx, dword [esp + 0x10]
mov dword [eax + 0xc], ecx
fst dword [esi + 0xd0]
mov eax, dword [esp + 0x14]
fild dword [esi + 0xe0]
inc eax
cmp eax, 2
mov dword [esi + 0xd4], edx
fmul dword [esp + 0x10]
mov dword [esp + 0x14], eax
fadd st(2)
fstp dword [esi + 0xd8]
fild dword [esi + 0xe4]
fmul dword [esp + 0x10]
fadd st(1)
fstp dword [esi + 0xdc]
fstp st(0)
fstp st(0)
jl 0x40c473
mov edi, dword [esp + 0x18]
mov eax, dword [edi + 0xb8]
push 0
push 0
push 0x1004
push eax
call dword [sym.imp.USER32.dll_SendMessageA]
test eax, eax
jle 0x40c5e7
mov ecx, dword [edi + 0x108]
lea esi, [ecx + ecx*2]
mov ecx, dword [edi + 0xf0]
shl esi, 4
add esi, ecx
lea eax, [ebp + 0x74]
mov edi, eax
mov ecx, 0xc
rep movsd dword es:[edi], dword [esi]
mov ecx, dword [ebp + 0x110]
imul ecx, dword [ebp + 0x10c]
mov eax, dword [eax + 4]
cmp eax, ecx
mov dword [esp + 0x1c], eax
jle 0x40c61b
push 0xffffffffffffffff
push 0
push 0x84
call sub.MFC71.DLL_AfxMessageBox_1
mov edi, dword [esp + 0x18]
mov ecx, dword [ebx + 0xf4]
xor eax, eax
mov edx, eax
and eax, 0x1f
shr edx, 5
lea edx, [ecx + edx*4]
mov ecx, eax
mov eax, dword [edx]
mov esi, 1
shl esi, cl
or eax, esi
mov dword [edx], eax
mov eax, dword [ebp + 8]
test eax, eax
jne 0x40cb68
xor edx, edx
jmp 0x40cb70
xor edx, edx
lea ecx, [ecx]
mov ecx, dword [ebp + 8]
test ecx, ecx
je 0x40c686
mov eax, dword [ebp + 0xc]
sub eax, ecx
sar eax, 2
cmp edx, eax
jae 0x40c686
mov ecx, dword [ebx + 0xf4]
xor eax, eax
mov eax, edx
mov esi, eax
and eax, 0x1f
shr esi, 5
lea esi, [ecx + esi*4]
mov ecx, eax
mov eax, dword [esi]
mov edi, 1
shl edi, cl
mov ecx, dword [esp + 0x34]
not edi
and eax, edi
mov dword [esi], eax
mov ecx, dword [ecx + 0xf4]
xor eax, eax
mov eax, edx
mov esi, eax
shr esi, 5
lea esi, [ecx + esi*4]
and eax, 0x1f
mov ecx, eax
mov edi, 1
shl edi, cl
mov ecx, dword [esi]
not edi
and ecx, edi
mov dword [esi], ecx
inc edx
jmp 0x40c620
mov esi, dword [esp + 0x18]
mov eax, dword [esi + 0x110]
test eax, eax
je 0x40c6aa
push eax
lea edx, [esp + 0x30]
push edx
mov ecx, ebp
call fcn.0040b630
mov eax, dword [eax]
mov byte [eax + 0xad], 0
mov eax, dword [esi + 0x114]
test eax, eax
je 0x40c6ca
push eax
lea ecx, [esp + 0x30]
push ecx
mov ecx, ebp
call fcn.0040b630
mov edx, dword [eax]
mov byte [edx + 0xae], 0
mov eax, dword [ebp + 0x74]
cmp eax, 1
je 0x40c71d
cmp eax, 3
je 0x40c71d
mov eax, dword [ebp + 0x9c]
push eax
mov dword [esi + 0x110], eax
lea eax, [esp + 0x30]
push eax
mov ecx, ebp
call fcn.0040b630
mov ecx, dword [eax]
mov byte [ecx + 0xad], 1
mov eax, dword [ebp + 0xa0]
push eax
lea edx, [esp + 0x30]
push edx
mov ecx, ebp
mov dword [esi + 0x114], eax
call fcn.0040b630
mov eax, dword [eax]
mov byte [eax + 0xae], 1
jmp 0x40c73f
mov eax, dword [ebp + 0x9c]
push eax
lea ecx, [esp + 0x30]
push ecx
mov ecx, ebp
mov dword [esi + 0x110], eax
call fcn.0040b630
mov edx, dword [eax]
mov byte [edx + 0xad], 1
fild dword [ebx + 0xe0]
fmul qword [0x420568]
fsub qword [0x420560]
fdivr dword [0x420558]
fild dword [ebx + 0xe4]
fmul qword [0x420568]
fsub qword [0x420560]
fdivr dword [0x420558]
fstp dword [esp + 0x14]
fcom dword [esp + 0x14]
fnstsw ax
test ah, 0x41
je 0x40c784
fstp st(0)
fld dword [esp + 0x14]
mov esi, dword [esp + 0x34]
fstp dword [ebx + 0xd4]
fild dword [esi + 0xe0]
fmul qword [0x420568]
fsub qword [0x420560]
fdivr dword [0x420558]
fild dword [esi + 0xe4]
fmul qword [0x420568]
fsub qword [0x420560]
fdivr dword [0x420558]
fstp dword [esp + 0x14]
fcom dword [esp + 0x14]
fnstsw ax
test ah, 0x41
je 0x40c7d3
fstp st(0)
fld dword [esp + 0x14]
fstp dword [esi + 0xd4]
mov eax, dword [ebp + 0x94]
mov edi, 2
cmp eax, edi
jg 0x40c801
xor eax, eax
mov ecx, eax
mov byte [ebx + 0xe8], 1
mov ebx, dword [ebx + 0xf4]
shr ecx, 5
lea edx, [ebx + ecx*4]
jmp 0x40c82f
mov byte [ebx + 0xe8], 0
mov eax, dword [ebp + 8]
test eax, eax
jne 0x40c813
xor ecx, ecx
jmp 0x40c81b
mov ecx, dword [ebp + 0xc]
sub ecx, eax
sar ecx, 2
mov ebx, dword [ebx + 0xf4]
xor eax, eax
lea eax, [eax + ecx - 1]
mov edx, eax
shr edx, 5
lea edx, [ebx + edx*4]
and eax, 0x1f
mov ecx, eax
mov eax, dword [edx]
mov ebx, 1
shl ebx, cl
or eax, ebx
mov dword [edx], eax
cmp dword [ebp + 0x98], edi
jg 0x40c862
xor eax, eax
mov ecx, eax
mov byte [esi + 0xe8], 1
mov esi, dword [esi + 0xf4]
shr ecx, 5
lea edx, [esi + ecx*4]
jmp 0x40c890
mov byte [esi + 0xe8], 0
mov eax, dword [ebp + 8]
test eax, eax
jne 0x40c874
xor ecx, ecx
jmp 0x40c87c
mov ecx, dword [ebp + 0xc]
sub ecx, eax
sar ecx, 2
mov edx, dword [esi + 0xf4]
xor eax, eax
lea eax, [eax + ecx - 1]
mov ecx, eax
shr ecx, 5
lea edx, [edx + ecx*4]
and eax, 0x1f
mov ecx, eax
mov eax, dword [edx]
mov esi, 1
shl esi, cl
mov dword [esp + 0x14], 0
or eax, esi
mov dword [edx], eax
lea ebx, [ebx]
mov edx, dword [esp + 0x14]
mov esi, dword [esp + edx*4 + 0x30]
mov eax, dword [esp + 0x1c]
mov ecx, dword [ebp + 0x10c]
dec eax
cdq
idiv ecx
mov ebx, dword [ebp + 0xe0]
mov edi, eax
cdq
imul ecx, edi
idiv ebx
mov edi, dword [esp + 0x1c]
sub edi, ecx
mov cl, byte [esi + 0xe8]
dec edi
test cl, cl
mov dword [esp + 0x10], eax
mov ebx, edx
jne 0x40c901
mov eax, dword [ebp + 0xe0]
sub eax, ebx
dec eax
mov ecx, ebp
mov ebx, eax
call fcn.00407080
mov eax, dword [esp + 0x10]
sub esp, 0xc
mov edx, esp
lea ecx, [esi + 0x100]
mov dword [ecx], ebx
mov dword [edx], ebx
mov dword [ecx + 4], eax
mov dword [edx + 4], eax
lea eax, [esp + 0x74]
mov dword [ecx + 8], edi
push eax
mov ecx, ebp
mov dword [edx + 8], edi
call fcn.00406d00
mov edx, dword [eax]
lea ecx, [esi + 0x10c]
mov dword [ecx], edx
mov edx, dword [eax + 4]
mov dword [ecx + 4], edx
mov edx, dword [eax + 8]
mov dword [ecx + 8], edx
mov eax, dword [eax + 0xc]
mov dword [ecx + 0xc], eax
mov ecx, dword [esp + 0x10]
mov edx, dword [ebp + 0x88]
mov eax, dword [ebp + 0x118]
push 0
push ecx
mov ecx, dword [ebp + 0x84]
push ebx
push edx
push ecx
lea edi, [edi + edi*4]
shl edi, 2
mov ecx, dword [eax + edi]
add eax, edi
sub esp, 0x14
mov edx, esp
mov dword [edx], ecx
mov ecx, dword [eax + 4]
mov dword [edx + 4], ecx
mov ecx, dword [eax + 8]
mov dword [edx + 8], ecx
mov ecx, dword [eax + 0xc]
mov eax, dword [eax + 0x10]
mov dword [edx + 0xc], ecx
lea ecx, [esp + 0x70]
push ecx
mov ecx, ebp
mov dword [edx + 0x10], eax
call fcn.00406830
mov edx, dword [eax]
mov ecx, dword [esp + 0x10]
mov eax, dword [eax + 4]
push 0
push ecx
mov ecx, dword [ebp + 0x8c]
mov dword [esp + 0x40], edx
mov edx, dword [ebp + 0x90]
push ebx
push edx
push ecx
mov dword [esp + 0x50], eax
mov eax, dword [ebp + 0x118]
mov ecx, dword [eax + edi]
add eax, edi
sub esp, 0x14
mov edx, esp
mov dword [edx], ecx
mov ecx, dword [eax + 4]
mov dword [edx + 4], ecx
mov ecx, dword [eax + 8]
mov dword [edx + 8], ecx
mov ecx, dword [eax + 0xc]
mov eax, dword [eax + 0x10]
mov dword [edx + 0xc], ecx
lea ecx, [esp + 0x80]
push ecx
mov ecx, ebp
mov dword [edx + 0x10], eax
call fcn.00406830
mov edx, dword [eax]
mov eax, dword [eax + 4]
mov dword [esp + 0x44], eax
mov al, byte [esi + 0xe8]
test al, al
mov dword [esp + 0x40], edx
jne 0x40ca10
mov ecx, ebp
call fcn.00407080
mov al, byte [esi + 0xea]
test al, al
je 0x40ca42
fld dword [esp + 0x38]
fsub dword [0x420554]
fld dword [esp + 0x38]
fadd dword [0x420554]
fld dword [esp + 0x3c]
fsub dword [0x420554]
fstp dword [esp + 0x20]
fld dword [esp + 0x3c]
jmp 0x40ca68
fld dword [esp + 0x40]
fsub dword [0x420554]
fld dword [esp + 0x40]
fadd dword [0x420554]
fld dword [esp + 0x44]
fsub dword [0x420554]
fstp dword [esp + 0x20]
fld dword [esp + 0x44]
fadd dword [0x420554]
mov eax, dword [esi + 0xe0]
mov dword [esp + 0x28], eax
cdq
fstp dword [esp + 0x10]
sub eax, edx
sar eax, 1
faddp st(1)
mov dword [esp + 0x24], eax
mov eax, dword [esi + 0xe4]
fmul dword [0x41f850]
mov dword [esp + 0x2c], eax
fild dword [esp + 0x24]
lea edi, [esi + 0xcc]
cdq
sub eax, edx
fmul dword [esi + 0xd4]
sar eax, 1
mov dword [esp + 0x24], eax
sub esp, 0x50
fsubp st(1)
mov ecx, esp
fst dword [edi]
fld dword [esp + 0x60]
fadd dword [esp + 0x70]
fmul dword [0x41f850]
fild dword [esp + 0x74]
fmul dword [esi + 0xd4]
fsubp st(1)
fst dword [esi + 0xd0]
fild dword [esp + 0x78]
fmul dword [esi + 0xd4]
fadd st(2)
fstp dword [esi + 0xd8]
fild dword [esp + 0x7c]
mov dword [esp + 0x7c], esp
push edi
fmul dword [esi + 0xd4]
fadd st(1)
fstp dword [esi + 0xdc]
fstp st(0)
fstp st(0)
call fcn.00409040
lea ecx, [esi + 0xb0]
push ecx
mov ecx, ebp
call fcn.00416f00
mov edx, dword [esi + 0x20]
push 0
push 0
push edx
call dword [sym.imp.USER32.dll_InvalidateRect]
mov eax, dword [esp + 0x14]
inc eax
cmp eax, 2
mov dword [esp + 0x14], eax
jl 0x40c8b0
mov eax, dword [esp + 0x34]
mov esi, dword [esp + 0x18]
add eax, 0xcc
push eax
mov ecx, esi
call fcn.0040bc00
mov ecx, dword [esp + 0x30]
add ecx, 0xcc
push ecx
mov ecx, esi
call fcn.0040bc00
pop edi
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret
mov edx, dword [ebp + 0xc]
sub edx, eax
sar edx, 2
mov esi, dword [esp + 0x34]
mov ecx, dword [esi + 0xf4]
xor eax, eax
lea eax, [eax + edx - 1]
mov edx, eax
shr edx, 5
lea edx, [ecx + edx*4]
and eax, 0x1f
mov ecx, 1
mov dword [esp + 0x2c], ecx
mov ecx, eax
mov eax, dword [esp + 0x2c]
shl eax, cl
mov ecx, dword [edx]
add esi, 0xcc
push esi
or ecx, eax
mov dword [edx], ecx
mov ecx, edi
call fcn.0040bc00
add ebx, 0xcc
push ebx
mov ecx, edi
call fcn.0040bc00
mov edi, dword [sym.imp.USER32.dll_InvalidateRect]
xor esi, esi
jmp 0x40cbd0
mov ebx, dword [esp + esi*4 + 0x30]
sub esp, 0x50
lea eax, [ebx + 0xcc]
mov ecx, esp
mov dword [esp + 0x7c], esp
push eax
call fcn.00409040
lea ecx, [ebx + 0xb0]
push ecx
mov ecx, ebp
call fcn.00416f00
mov edx, dword [ebx + 0x20]
push 0
push 0
push edx
call edi
inc esi
cmp esi, 2
jl 0x40cbd0
pop edi
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret