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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x40aab9
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x330
mov eax, dword [0x40f0c4]
push ebx
mov dword [esp + 0x32c], eax
mov al, byte [ebp + 0x10]
test al, al
push esi
push edi
je 0x409664
mov eax, dword [0x40f418]
mov edi, dword [0x40b5d0]
neg eax
sbb eax, eax
xor ebx, ebx
cmp eax, ebx
mov dword [esp + 0xc], eax
je 0x4090ef
lea ecx, [esp + 0x10]
call dword [sym.imp.MFC71.DLL_ATL::CStringT::CStringT]
lea eax, [esp + 0x10]
push eax
lea ecx, [esp + 0x18]
push ecx
lea edx, [esp + 0x14]
push edx
mov ecx, 0x40f40c
mov dword [esp + 0x350], ebx
call fcn.00406be0
mov esi, dword [esp + 0x14]
push esi
call edi
test eax, eax
jne 0x4090d4
push esi
mov ecx, 0x40f40c
call fcn.00408580
lea ecx, [esp + 0x10]
mov dword [esp + 0x344], 0xffffffff
call dword [0x40b210]
cmp dword [esp + 0xc], ebx
jne 0x409094
mov eax, dword [0x40f450]
neg eax
sbb eax, eax
cmp eax, ebx
mov dword [esp + 0xc], eax
je 0x409135
lea eax, [esp + 0x78]
push eax
lea ecx, [esp + 0x14]
push ecx
lea edx, [esp + 0x14]
push edx
mov ecx, 0x40f444
call fcn.00406c60
mov esi, dword [esp + 0x10]
push esi
call edi
test eax, eax
jne 0x40912f
push esi
mov ecx, 0x40f444
call fcn.00407dc0
cmp dword [esp + 0xc], ebx
jne 0x409100
mov eax, dword [ebp + 0xc]
push eax
call dword [0x40b5dc]
xor ecx, ecx
mov dword [esp + 0x28], ecx
mov dword [esp + 0x2c], ecx
mov dword [esp + 0x30], ecx
mov dword [esp + 0x34], ecx
mov dword [esp + 0x38], ecx
mov dword [esp + 0x3c], ecx
mov dword [esp + 0x40], ecx
mov dword [esp + 0x44], ecx
mov dword [esp + 0x48], ecx
mov dword [esp + 0xc], eax
mov dword [esp + 0x20], 0x30
mov dword [esp + 0x24], 0x16
mov dword [esp + 0x4c], ecx
call sub.MFC71.DLL_AfxGetThread
cmp eax, ebx
je 0x40918f
mov edx, dword [eax]
mov ecx, eax
call dword [edx + 0x7c]
jmp 0x409191
xor eax, eax
push eax
lea ecx, [esp + 0x68]
call sub.MFC71.DLL_CClientDC::CClientDC
mov eax, dword [esp + 0x68]
push 0xff000000
push 0x11
push eax
lea ecx, [esp + 0xac]
mov dword [esp + 0x350], 1
call fcn.00405be0
mov edx, dword [esp + 0x6c]
lea ecx, [esp + 0xf8]
push ecx
push edx
mov byte [esp + 0x34c], 2
call dword [0x40b08c]
mov eax, dword [esp + 0xf8]
lea ecx, [eax + 2]
cmp ecx, 0x10
jg 0x4091ed
mov ecx, 0x10
mov esi, dword [ebp + 8]
cdq
sub eax, edx
mov edi, eax
sar edi, 1
add ecx, 4
add edi, 2
cmp esi, ebx
mov dword [esp + 0x78], ecx
mov dword [esp + 0x50], edi
mov dword [esp + 0x10], ebx
mov dword [esp + 0x14], ebx
mov dword [esp + 0x18], ebx
je 0x4092b7
mov al, byte [ebp + 0x14]
test al, al
jne 0x4092b7
call sub.MFC71.DLL_CMDIFrameWnd::GetThisClass
push eax
mov ecx, esi
call sub.MFC71.DLL_CObject::IsKindOf
test eax, eax
je 0x409269
push ebx
mov ecx, esi
call sub.MFC71.DLL_CMDIFrameWnd::MDIGetActive
cmp eax, ebx
je 0x409269
push ebx
mov ecx, eax
call fcn.00406f40
cmp eax, ebx
jne 0x409251
xor eax, eax
jmp 0x409254
mov eax, dword [eax + 4]
cmp eax, dword [ebp + 0xc]
jne 0x409269
push 0x40f3e0
call dword [0x40b668]
jmp 0x40963c
call sub.MFC71.DLL_CFrameWnd::GetThisClass
push eax
mov ecx, esi
call sub.MFC71.DLL_CObject::IsKindOf
test eax, eax
je 0x409282
cmp dword [esi + 0x90], ebx
jne 0x4092ad
mov ecx, esi
call sub.MFC71.DLL_CWnd::GetParentFrame
mov esi, eax
cmp esi, ebx
je 0x4092b7
call sub.MFC71.DLL_CMDIChildWnd::GetThisClass
push eax
mov ecx, esi
call sub.MFC71.DLL_CObject::IsKindOf
test eax, eax
je 0x4092a9
mov ecx, esi
call sub.MFC71.DLL_CWnd::GetParentFrame
mov esi, eax
cmp esi, ebx
je 0x4092b7
add esi, 0x84
mov dword [esp + 0x18], esi
mov eax, dword [esp + 0xc]
test eax, eax
jle 0x4095b1
mov esi, dword [ebp + 0xc]
xor eax, eax
mov byte [esp + 0x130], 0
mov ecx, 0x3f
lea edi, [esp + 0x131]
rep stosd dword es:[edi], eax
and dword [esp + 0x24], 0xffffffdf
lea ecx, [esp + 0x20]
push ecx
stosw word es:[edi], ax
push 1
stosb byte es:[edi], al
push ebx
lea eax, [esp + 0x13c]
push esi
mov dword [esp + 0x54], eax
mov dword [esp + 0x58], 0xff
call dword [0x40b60c]
mov eax, dword [esp + 0x28]
test ah, 1
jne 0x409536
mov cl, byte [ebp + 0x14]
test cl, cl
je 0x409324
test al, 4
jne 0x409536
or eax, 0x100
xor edi, edi
test cl, cl
mov dword [esp + 0x28], eax
je 0x409391
lea eax, [esp + 0x130]
mov dword [esp + 0x54], edi
mov dword [esp + 0x58], edi
mov dword [esp + 0x5c], 0x3e8
mov dword [esp + 0x60], edi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x409351
mov ecx, dword [esp + 0x68]
sub eax, edx
push 0x420
lea edx, [esp + 0x58]
push edx
push eax
lea eax, [esp + 0x13c]
push eax
push ecx
call dword [0x40b62c]
mov eax, dword [esp + 0x54]
mov edx, dword [esp + 0x5c]
sub edx, eax
movzx eax, dx
shl eax, 0x10
mov dword [esp + 0x40], eax
or dword [esp + 0x24], 0x20
lea ecx, [esp + 0x20]
push ecx
push 1
push ebx
push esi
call dword [0x40b5d4]
mov eax, dword [esp + 0x28]
test ah, 8
jne 0x409536
lea edx, [esp + 0x130]
push edx
lea ecx, [esp + 0x20]
call dword [sym.imp.MFC71.DLL_ATL::CStringT::CStringT_1]
mov eax, dword [esp + 0x34]
cmp eax, edi
mov byte [esp + 0x344], 3
je 0x4093e1
lea ecx, [esp + 0x1c]
push ecx
push eax
mov ecx, 0x40f40c
call fcn.00408650
jmp 0x4093f5
mov eax, dword [esp + 0x30]
lea edx, [esp + 0x1c]
push edx
push eax
mov ecx, 0x40f3f0
call fcn.00408650
mov ecx, eax
call dword [sym.imp.MFC71.DLL_ATL::CStringT::operator]
mov eax, dword [esp + 0x18]
cmp eax, edi
je 0x409521
mov edi, dword [eax + 4]
test edi, edi
je 0x409521
test edi, edi
mov eax, edi
je 0x409613
mov esi, dword [eax + 8]
mov edx, dword [esi + 0x20]
mov edi, dword [edi]
push 0x100
lea ecx, [esp + 0x234]
push ecx
push edx
call dword [0x40b5d8]
lea eax, [esp + 0x230]
push str.ToolbarWindow32
push eax
call dword [0x40b56c]
add esp, 8
test eax, eax
jne 0x4094d2
mov eax, dword [esp + 0x30]
xor ecx, ecx
mov dword [esp + 0x88], ecx
mov dword [esp + 0x8c], ecx
mov dword [esp + 0x90], ecx
mov dword [esp + 0x94], ecx
lea edx, [esp + 0x80]
push edx
mov dword [esp + 0x9c], ecx
push eax
mov dword [esp + 0xa4], ecx
mov ecx, dword [esi + 0x20]
push 0x441
push ecx
mov dword [esp + 0x90], 0x20
mov dword [esp + 0x94], 0x21
call dword [0x40b600]
cmp eax, 0xffffffff
je 0x4094d2
mov edx, dword [esp + 0x88]
cmp edx, dword [esp + 0x30]
jne 0x4094d2
cmp dword [esp + 0x8c], 0xffffffff
jne 0x4094dc
test edi, edi
jne 0x409414
jmp 0x409521
mov eax, dword [esi + 0x20]
push 0
push 0
push 0x431
push eax
call dword [0x40b600]
mov edi, dword [esp + 0x8c]
mov esi, eax
mov eax, dword [esp + 0x34]
test eax, eax
je 0x40950d
push eax
mov ecx, 0x40f444
call fcn.004086e0
jmp 0x40951c
mov ecx, dword [esp + 0x30]
push ecx
mov ecx, 0x40f428
call fcn.004086e0
mov dword [eax], esi
mov dword [eax + 4], edi
lea ecx, [esp + 0x1c]
mov byte [esp + 0x344], 2
call dword [0x40b210]
mov esi, dword [ebp + 0xc]
mov al, byte [ebp + 0x14]
test al, al
jne 0x4095a0
push 1
push ebx
push esi
lea ecx, [esp + 0xbc]
call fcn.00408110
lea edx, [esp + 0x64]
push edx
lea ecx, [esp + 0xb4]
mov byte [esp + 0x348], 4
call fcn.00406f60
cmp eax, dword [esp + 0x10]
jle 0x409570
mov dword [esp + 0x10], eax
lea eax, [esp + 0x64]
push eax
lea ecx, [esp + 0xb4]
call fcn.004070c0
cmp eax, dword [esp + 0x14]
jle 0x40958b
mov dword [esp + 0x14], eax
lea ecx, [esp + 0xe0]
mov byte [esp + 0x344], 2
call dword [0x40b210]
mov eax, dword [esp + 0xc]
inc ebx
cmp ebx, eax
jl 0x4092c3
mov edi, dword [esp + 0x50]
mov al, byte [ebp + 0x14]
test al, al
jne 0x40963c
mov eax, dword [esp + 0xc]
xor esi, esi
test eax, eax
jle 0x40963c
lea ebx, [ebx]
mov ebx, dword [ebp + 0xc]
lea ecx, [esp + 0x20]
push ecx
push 1
push esi
push ebx
mov dword [esp + 0x34], 0x10
call dword [0x40b60c]
mov eax, dword [esp + 0x28]
test ah, 8
jne 0x409618
movzx ecx, word [esp + 0x10]
xor edx, edx
mov dh, byte [esp + 0x14]
shl ecx, 0x10
movzx eax, dx
movzx edx, byte [esp + 0x78]
or eax, ecx
or eax, edx
mov dword [esp + 0x40], eax
jmp 0x40961c
jmp 0x409c98
mov dword [esp + 0x40], edi
lea eax, [esp + 0x20]
push eax
push 1
push esi
push ebx
mov dword [esp + 0x34], 0x20
call dword [0x40b5d4]
mov eax, dword [esp + 0xc]
inc esi
cmp esi, eax
jl 0x4095d0
lea ecx, [esp + 0xa0]
mov byte [esp + 0x344], 1
call fcn.00405710
lea ecx, [esp + 0x64]
mov dword [esp + 0x344], 0xffffffff
call fcn.00409cf8
mov ecx, dword [esp + 0x33c]
mov dword fs:[0], ecx
mov ecx, dword [esp + 0x334]
call fcn.00409d53
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
jmp dword [sym.imp.MFC71.DLL_AfxThrowInvalidArgException]