Function at 0x406670
Capabilities:
Access peb ldr_data

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x46c33b
mov eax, dword fs:[0]
push eax
push ecx
mov eax, 0x173c
call fcn.00453640
mov eax, dword [0x498760]
xor eax, esp
mov dword [esp + 0x1738], eax
push ebx
push esi
push edi
mov eax, dword [0x498760]
xor eax, esp
push eax
lea eax, [esp + 0x1750]
mov dword fs:[0], eax
mov esi, dword [ebp + 8]
mov ebx, ecx
movzx eax, byte [ebx + 0xbcf]
push eax
push 0x3fa
mov ecx, esi
mov dword [esp + 0x28], esi
call fcn.0043d38e
mov ecx, eax
call fcn.0043d53c
movzx ecx, byte [ebx + 0xbd0]
push ecx
push 0x411
mov ecx, esi
call fcn.0043d38e
mov ecx, eax
call fcn.0043d53c
movzx edx, byte [ebx + 0xbc3]
push edx
push 0x3f2
mov ecx, esi
call fcn.0043d38e
mov ecx, eax
call fcn.0043d53c
movzx eax, byte [ebx + 0xbc4]
push eax
push 0x3f3
mov ecx, esi
call fcn.0043d38e
mov ecx, eax
call fcn.0043d53c
movzx ecx, byte [ebx + 0xbc5]
push ecx
push 0x40f
mov ecx, esi
call fcn.0043d38e
mov ecx, eax
call fcn.0043d53c
movzx edx, byte [ebx + 0xbc6]
push edx
push 0x3f4
mov ecx, esi
call fcn.0043d38e
mov ecx, eax
call fcn.0043d53c
movzx eax, byte [ebx + 0xbc7]
push eax
push 0x3f5
mov ecx, esi
call fcn.0043d38e
mov ecx, eax
call fcn.0043d53c
movzx ecx, byte [ebx + 0xbc8]
push ecx
push 0x3f6
mov ecx, esi
call fcn.0043d38e
mov ecx, eax
call fcn.0043d53c
movzx edx, byte [ebx + 0xbc9]
push edx
push 0x3f8
mov ecx, esi
call fcn.0043d38e
mov ecx, eax
call fcn.0043d53c
movzx eax, byte [ebx + 0xbca]
push eax
push 0x409
mov ecx, esi
call fcn.0043d38e
mov ecx, eax
call fcn.0043d53c
movzx ecx, byte [ebx + 0xbcd]
push ecx
push 0x40b
mov ecx, esi
call fcn.0043d38e
mov ecx, eax
call fcn.0043d53c
movzx edx, byte [ebx + 0xbce]
push edx
push 0x40c
mov ecx, esi
call fcn.0043d38e
mov ecx, eax
call fcn.0043d53c
movzx eax, byte [ebx + 0xbcb]
push eax
push 0x3fd
mov ecx, esi
call fcn.0043d38e
mov ecx, eax
call fcn.0043d53c
movzx ecx, byte [ebx + 0xbcc]
push ecx
push 0x401
mov ecx, esi
call fcn.0043d38e
mov ecx, eax
call fcn.0043d53c
movzx edx, byte [ebx + 0xbe4]
push edx
push 0x3ff
mov ecx, esi
call fcn.0043d38e
mov ecx, eax
call fcn.0043d53c
movzx eax, byte [ebx + 0xbe5]
push eax
push 0x400
mov ecx, esi
call fcn.0043d38e
mov ecx, eax
call fcn.0043d53c
movzx ecx, byte [ebx + 0xbe6]
push ecx
push 0x404
mov ecx, esi
call fcn.0043d38e
mov ecx, eax
call fcn.0043d53c
movzx edx, byte [ebx + 0xbe7]
push edx
push 0x405
mov ecx, esi
call fcn.0043d38e
mov ecx, eax
call fcn.0043d53c
movzx eax, byte [ebx + 0xbd1]
push eax
push 0x3e8
mov ecx, esi
call fcn.0043d38e
mov ecx, eax
call fcn.0043d53c
movzx ecx, byte [ebx + 0xbd5]
push ecx
push 0x3e9
mov ecx, esi
call fcn.0043d38e
mov ecx, eax
call fcn.0043d53c
movzx edx, byte [ebx + 0xbdb]
push edx
push 0x3ea
mov ecx, esi
call fcn.0043d38e
mov ecx, eax
call fcn.0043d53c
movzx eax, byte [ebx + 0xbd6]
push eax
push 0x3eb
mov ecx, esi
call fcn.0043d38e
mov ecx, eax
call fcn.0043d53c
movzx ecx, byte [ebx + 0xbd7]
push ecx
push 0x3ec
mov ecx, esi
call fcn.0043d38e
mov ecx, eax
call fcn.0043d53c
movzx edx, byte [ebx + 0xbdc]
push edx
push 0x3ed
mov ecx, esi
call fcn.0043d38e
mov ecx, eax
call fcn.0043d53c
movzx eax, byte [ebx + 0xbd8]
push eax
push 0x402
mov ecx, esi
call fcn.0043d38e
mov ecx, eax
call fcn.0043d53c
movzx ecx, byte [ebx + 0xbd9]
push ecx
push 0x417
mov ecx, esi
call fcn.0043d38e
mov ecx, eax
call fcn.0043d53c
movzx edx, byte [ebx + 0xbda]
push edx
push 0x419
mov ecx, esi
call fcn.0043d38e
mov ecx, eax
call fcn.0043d53c
movzx eax, byte [ebx + 0xbd2]
push eax
push 0x3ee
mov ecx, esi
call fcn.0043d38e
mov ecx, eax
call fcn.0043d53c
movzx ecx, byte [ebx + 0xbd4]
push ecx
push 0x40d
mov ecx, esi
call fcn.0043d38e
mov ecx, eax
call fcn.0043d53c
movzx edx, byte [ebx + 0xbd3]
push edx
push 0x40e
mov ecx, esi
call fcn.0043d38e
mov ecx, eax
call fcn.0043d53c
movzx eax, byte [ebx + 0xbdd]
push eax
push 0x3f1
mov ecx, esi
call fcn.0043d38e
mov ecx, eax
call fcn.0043d53c
movzx ecx, byte [ebx + 0xbde]
push ecx
push 0x3ef
mov ecx, esi
call fcn.0043d38e
mov ecx, eax
call fcn.0043d53c
movzx edx, byte [ebx + 0xbdf]
push edx
push 0x3f0
mov ecx, esi
call fcn.0043d38e
mov ecx, eax
call fcn.0043d53c
movzx eax, byte [ebx + 0xbe0]
push eax
push 0x3fb
mov ecx, esi
call fcn.0043d38e
mov ecx, eax
call fcn.0043d53c
movzx ecx, byte [ebx + 0xbe2]
push ecx
push 0x3fc
mov ecx, esi
call fcn.0043d38e
mov ecx, eax
call fcn.0043d53c
movzx edx, byte [ebx + 0xbe1]
push edx
push 0x406
mov ecx, esi
call fcn.0043d38e
mov ecx, eax
call fcn.0043d53c
movzx eax, byte [ebx + 0xbe3]
push eax
push 0x410
mov ecx, esi
call fcn.0043d38e
mov ecx, eax
call fcn.0043d53c
mov ecx, 0x49c6e4
call fcn.0043ee0b
call fcn.0043ec46
mov eax, dword [eax + 0xc]
push 0x88
push eax
call dword [sym.imp.USER32.dll_LoadMenuA]
push eax
mov ecx, 0x49c6e4
call fcn.0043edb8
mov ecx, dword [0x49c6e8]
mov edx, dword [esi + 0x20]
push ecx
push edx
call dword [sym.imp.USER32.dll_SetMenu]
push 0x474458
mov ecx, 0x49c6e4
call fcn.004233d0
cmp eax, 0xffffffff
mov dword [esp + 0x30], eax
je 0x406d41
push eax
mov eax, dword [0x49c6e8]
push eax
call dword [sym.imp.USER32.dll_GetSubMenu]
push eax
call fcn.0043ed90
test eax, eax
mov dword [esp + 0x2c], eax
je 0x406d41
mov ecx, dword [ebx + 0xb94]
mov dword [esp + 0x24], ecx
lea ecx, [esp + 0xbbc]
call fcn.004059c0
lea ecx, [esp + 0x34]
call fcn.004059c0
mov eax, dword [esp + 0xbb0]
lea esi, [ebx + 0x14]
mov ecx, 0x2e1
lea edi, [esp + 0x34]
rep movsd dword es:[edi], dword [esi]
mov dword [esp + 0xbb0], eax
mov eax, dword [esp + 0x24]
test eax, eax
mov dword [esp + 0x1c], eax
je 0x406ca1
lea ecx, [eax*8]
sub ecx, eax
add ecx, ecx
add ecx, ecx
mov dword [esp + 0x14], ecx
call fcn.0043de28
xor ecx, ecx
xor edi, edi
cmp eax, edi
setne cl
cmp ecx, edi
je 0x406cee
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [esp + 0x28], eax
xor esi, esi
cmp dword [esp + 0x24], esi
mov dword [esp + 0x1758], edi
jle 0x406c26
mov dword [esp + 0x18], esi
mov ecx, dword [esp + 0xbb0]
mov edx, dword [esp + 0x18]
lea eax, [edx + ecx]
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
je 0x406cee
push eax
mov eax, dword [esp + 0x2c]
push eax
call fcn.0045362b
add esp, 8
test eax, eax
setl al
test al, al
je 0x406c18
mov ecx, dword [esp + 0xbb0]
mov edx, dword [esp + 0x18]
add edx, ecx
jne 0x406bf6
xor eax, eax
jmp 0x406c0b
mov eax, edx
lea esi, [eax + 1]
jmp 0x406c00
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x406c00
sub eax, esi
push eax
push edx
lea ecx, [esp + 0x30]
call fcn.00401240
mov esi, edi
add dword [esp + 0x18], 0x1c
add edi, 1
cmp edi, dword [esp + 0x24]
jl 0x406baf
mov ecx, dword [esp + 0xbb0]
mov edx, dword [esp + 0x1738]
lea eax, [esi*8]
sub eax, esi
add eax, eax
add eax, eax
lea esi, [eax + ecx]
mov ecx, dword [esp + 0x14]
lea edi, [ecx + edx - 0x1c]
mov ecx, 7
rep movsd dword es:[edi], dword [esi]
mov edx, dword [esp + 0xbb0]
mov byte [eax + edx], 0
mov eax, dword [esp + 0x28]
add eax, 0xfffffff0
mov dword [esp + 0x1758], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x406c89
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [esp + 0x1c]
sub dword [esp + 0x14], 0x1c
sub eax, 1
test eax, eax
mov dword [esp + 0x1c], eax
jne 0x406b76
mov eax, dword [esp + 0x173c]
xor esi, esi
cmp eax, esi
jle 0x406d14
mov edi, dword [sym.imp.USER32.dll_InsertMenuA]
mov dword [esp + 0x14], esi
mov dword [esp + 0x1c], eax
lea esp, [esp]
mov ecx, dword [esp + 0x1738]
mov edx, dword [esp + 0x14]
cmp dword [edx + ecx + 0x10], 0
lea eax, [edx + ecx]
je 0x406d04
cmp dword [eax + 0x14], 0
mov ecx, dword [esp + 0x2c]
mov edx, dword [ecx + 4]
push eax
mov eax, dword [eax + 0x18]
push eax
je 0x406cf8
push 0x400
jmp 0x406cfd
push 0x80004005
call fcn.00401000
push 0x401
push esi
push edx
call edi
add esi, 1
add dword [esp + 0x14], 0x1c
sub dword [esp + 0x1c], 1
jne 0x406cc0
test esi, esi
jne 0x406d2f
mov eax, dword [esp + 0x30]
mov ecx, dword [0x49c6e8]
push 0
push 0
push 0x401
push eax
push ecx
call dword [sym.imp.USER32.dll_ModifyMenuA]
mov edx, dword [esp + 0x20]
mov eax, dword [edx + 0x20]
push eax
call dword [sym.imp.USER32.dll_DrawMenuBar]
mov esi, dword [esp + 0x20]
mov ecx, dword [0x49c6e8]
push 0
push ecx
call dword [sym.imp.USER32.dll_GetSubMenu]
push eax
call fcn.0043ed90
test eax, eax
mov edi, dword [sym.imp.USER32.dll_EnableMenuItem]
mov dword [esp + 0x18], eax
je 0x406e40
xor ecx, ecx
cmp dword [ebx + 0xbf8], ecx
mov dword [esp + 0x14], ecx
je 0x406db4
jmp 0x406d84
mov eax, dword [esp + 0x18]
mov edx, dword [esp + 0x14]
mov eax, dword [eax + 4]
push 0x400
push edx
push eax
call edi
mov eax, dword [esp + 0x14]
add eax, 1
cmp eax, 3
mov dword [esp + 0x14], eax
jl 0x406d80
jmp 0x406dd4
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x14]
mov edx, dword [eax + 4]
push 0x401
push ecx
push edx
call edi
mov eax, dword [esp + 0x14]
add eax, 1
cmp eax, 3
mov dword [esp + 0x14], eax
jl 0x406db0
cmp dword [ebx + 0xbf4], 0
mov dword [esp + 0x14], 4
je 0x406e1c
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x18]
mov edx, dword [ecx + 4]
push 0x400
push eax
push edx
call edi
mov eax, dword [esp + 0x14]
add eax, 1
cmp eax, 7
mov dword [esp + 0x14], eax
jl 0x406de5
mov eax, 0x8084
mov dword [esp + 0x14], eax
mov dword [esp + 0x20], 0xf
jmp 0x406e64
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x18]
mov edx, dword [ecx + 4]
push 0x401
push eax
push edx
call edi
mov eax, dword [esp + 0x14]
add eax, 1
cmp eax, 7
mov dword [esp + 0x14], eax
jl 0x406e1c
mov eax, 0x8084
mov dword [esp + 0x14], eax
mov dword [esp + 0x20], 0xf
jmp 0x406e64
mov eax, dword [esp + 0x14]
cmp byte [ebx + eax - 0x74d0], 0
je 0x406e79
push 0
push eax
mov eax, dword [0x49c6e8]
push eax
jmp 0x406e83
mov ecx, dword [0x49c6e8]
push 1
push eax
push ecx
call edi
mov eax, 1
add dword [esp + 0x14], eax
sub dword [esp + 0x20], eax
jne 0x406e60
cmp dword [ebx + 0xbec], 0
je 0x406ead
mov edx, dword [0x49c6e8]
push 0
push 0x80c7
push edx
jmp 0x406eba
mov eax, dword [0x49c6e8]
push 1
push 0x80c7
push eax
call edi
cmp dword [ebx + 0xbe8], 0
je 0x406ed5
mov ecx, dword [0x49c6e8]
push 0
push 0x80c8
push ecx
jmp 0x406ee3
mov edx, dword [0x49c6e8]
push 1
push 0x80c8
push edx
call edi
mov ecx, esi
call fcn.004148e0
mov ecx, esi
call fcn.004110b0
mov ecx, dword [esp + 0x1750]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x1738]
xor ecx, esp
call fcn.004527b7
mov esp, ebp
pop ebp
ret 4