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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x26c
mov eax, dword [0x67f864]
xor eax, esp
mov dword [esp + 0x268], eax
mov eax, dword [ebp + 0x14]
mov ecx, dword [ebp + 0x10]
push ebx
mov ebx, dword [ebp + 8]
add dword [ebx], 2
mov dword [esp + 0x10], eax
mov eax, dword [ebx]
xor edx, edx
mov dh, byte [eax + 1]
push esi
mov esi, dword [ebp + 0x18]
push edi
mov edi, dword [ebp + 0x1c]
add eax, 6
push edi
mov dl, byte [eax - 6]
mov edi, dword [ebp + 0xc]
mov dword [ebx], eax
lea eax, [esp + 0x10]
push eax
push ecx
push edi
movzx edx, dx
mov dword [esp + 0x30], edx
mov edx, esi
mov ecx, ebx
mov dword [esp + 0x40], ebx
mov dword [esp + 0x24], 0
call fcn.005155e0
add esp, 0x10
cmp edi, 1
jne 0x5165dc
mov esi, dword [esp + 0xc]
push esi
call dword [sym.imp.USER32.dll_GetMenuItemCount]
cmp eax, edi
jne 0x5165fc
push 0x30
lea ecx, [esp + 0x44]
push 0
push ecx
call fcn.005d5de0
mov edx, dword [0x69284c]
add esp, 0xc
lea eax, [esp + 0x40]
push eax
push edi
push 0
push esi
mov dword [esp + 0x50], edx
mov dword [esp + 0x54], 0x100
call dword [sym.imp.USER32.dll_GetMenuItemInfoW]
cmp dword [esp + 0x48], 0x800
jne 0x5165fc
push 0x400
push 0
push esi
call dword [sym.imp.USER32.dll_DeleteMenu]
jmp 0x5165fc
test edi, edi
jne 0x5165f8
mov ecx, dword [0x692854]
mov dword [esp + 0xc], ecx
mov dword [0x692858], 3
mov esi, ecx
jmp 0x516607
mov esi, dword [esp + 0xc]
push esi
call dword [sym.imp.USER32.dll_GetMenuItemCount]
mov dword [esp + 0x14], eax
xor eax, eax
mov dword [esp + 0x34], eax
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x20]
cmp ax, 1
mov dword [esp + 0x38], esi
jb 0x5168ed
mov edx, dword [esp + 0x14]
movzx eax, ax
mov dword [esp + 0x2c], edx
mov dword [esp + 0x20], eax
jmp 0x516638
mov ebx, dword [esp + 0x30]
mov eax, dword [ebx]
xor ecx, ecx
mov ch, byte [eax + 1]
add eax, 2
push 0x1f6
push 0
mov edi, 1
mov cl, byte [eax - 2]
mov dword [ebx], eax
mov edx, dword [0x63dc14]
mov eax, dword [0x63dc18]
mov dword [esp + 0x78], edx
mov dword [esp + 0x7c], eax
movzx esi, cx
lea ecx, [esp + 0x80]
push ecx
call fcn.005d5de0
mov edx, dword [esp + 0x38]
add esp, 0xc
xor ebx, ebx
cmp si, di
mov dword [esp + 0x24], 0x400
mov dword [esp + 0x1c], edx
jne 0x516742
mov edx, dword [esp + 0x18]
mov esi, dword [ebp + 0xc]
lea eax, [esp + 0x1c]
push eax
mov eax, dword [esp + 0x10]
lea ecx, [esp + 0x74]
push ecx
push edx
mov edx, dword [esp + 0x3c]
push eax
lea ecx, [esi + 1]
push ecx
push edx
mov dword [esp + 0x3c], 0x410
call fcn.00516510
mov edi, eax
add esp, 0x18
test edi, edi
mov dword [esp + 0x28], edi
je 0x516735
mov eax, dword [esp + 0x1c]
xor ecx, ecx
cmp eax, 0xffffffff
setne cl
cmp eax, 0xffffffff
jne 0x5166ff
test esi, esi
jne 0x5166f6
mov edx, dword [0x692858]
mov eax, edx
add edx, 1
mov dword [0x692858], edx
jmp 0x5166fb
movzx eax, word [esp + 0x10]
mov dword [esp + 0x1c], eax
mov edx, dword [esp + 0xc]
push ecx
mov ecx, dword [esp + 0x18]
push 0
add eax, ecx
push edi
push eax
push edx
lea ecx, [esp + 0x84]
mov edx, 0x410
call fcn.005163a0
add esp, 0x14
test eax, eax
jne 0x51672b
mov dword [esp + 0xc], eax
add dword [esp + 0x10], 1
jmp 0x516822
mov dword [esp + 0xc], 0
jmp 0x5168d3
test si, si
jne 0x51675c
mov dword [esp + 0x24], 0xc00
mov dword [esp + 0x28], 0xffff
jmp 0x516824
test esi, 0x8000
je 0x516810
movzx eax, si
and eax, 0xffff7fff
cmp eax, 0x91
jge 0x516804
movzx ebx, byte [eax + 0x629fd0]
xor eax, eax
cmp ebx, 0x94
setne al
test eax, eax
je 0x516804
cmp ebx, 0x89
jne 0x5167cf
mov eax, dword [esp + 0x34]
mov edx, dword [esp + 0x3c]
mov ecx, dword [esp + 0x38]
mov dword [0x6952f0], eax
mov ax, word [esp + 0x10]
mov dword [0x6952f8], edx
mov word [0x6952f8], ax
mov edx, ebx
mov eax, 0x6952f0
mov dword [0x6952f4], ecx
call fcn.004c5180
jmp 0x516822
mov edx, dword [esp + 0x10]
mov ecx, dword [esp + 0x14]
xor eax, eax
add ecx, edx
cmp ebx, 0x61
setne al
mov edx, ebx
mov word [esp + 0x3c], cx
sub eax, 1
and eax, 2
mov dword [esp + 0x34], eax
lea eax, [esp + 0x34]
call fcn.004c5180
movzx ecx, ax
mov dword [esp + 0x28], ecx
jmp 0x516824
mov edx, dword [esp + 0x18]
mov dword [edx], 1
jmp 0x516822
test esi, 0x2000
je 0x516824
mov eax, dword [esp + 0x18]
mov dword [eax], 1
xor edi, edi
cmp dword [esp + 0xc], 0
je 0x5168d3
test edi, edi
je 0x5168d3
mov esi, dword [esp + 0x28]
cmp esi, 0x1fff
ja 0x5168a0
mov edi, dword [esp + 0x18]
lea eax, [edi + 4]
lea edx, [eax + 2]
lea ecx, [ecx]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x516850
sub eax, edx
movzx ecx, bx
sar eax, 1
cmp ecx, eax
jae 0x51686d
movzx eax, word [edi + ecx*2 + 4]
jmp 0x516872
mov eax, 0x20
cmp ebx, 0x30
jne 0x51687e
mov eax, 0x2191
jmp 0x516890
cmp ebx, 0x31
jne 0x51688a
mov eax, 0x2193
jmp 0x516890
cmp ax, 0x20
je 0x5168a0
push ebx
lea ecx, [esp + 0x74]
push ecx
push eax
push esi
call fcn.005158c0
add esp, 0x10
movzx edx, word [esp + 0x10]
add edx, dword [esp + 0x14]
mov eax, dword [esp + 0xc]
push 0
push ebx
push esi
push edx
mov edx, dword [esp + 0x34]
push eax
lea ecx, [esp + 0x84]
call fcn.005163a0
add esp, 0x14
test eax, eax
jne 0x5168ce
mov dword [esp + 0xc], eax
add dword [esp + 0x10], 1
mov eax, 1
add dword [esp + 0x2c], eax
sub dword [esp + 0x20], eax
jne 0x516634
mov edi, dword [ebp + 0xc]
mov esi, dword [esp + 0xc]
test esi, esi
jne 0x5168f8
test edi, edi
lea eax, [esi + 1]
je 0x5168fa
mov eax, esi
mov ecx, dword [esp + 0x274]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.005ce60a
mov esp, ebp
pop ebp
ret