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

Disassembly:
mov eax, dword fs:[0]
push 0xffffffffffffffff
push 0x59df23
push eax
mov dword fs:[0], esp
sub esp, 0x7c
push ebp
push edi
mov edi, ecx
mov ecx, dword [edi + 0x1cc]
call fcn.005166d0
mov eax, dword [edi + 0x1cc]
xor ebp, ebp
mov ecx, edi
mov dword [eax + 0x3c], ebp
call fcn.00571b82
test eax, 0x40000000
jne 0x515d17
mov ecx, dword [edi + 0x1c]
push ecx
call dword [sym.imp.USER32.dll_GetMenu]
cmp eax, ebp
je 0x515d17
mov edx, dword [edi + 0x1cc]
push ebx
push esi
push eax
mov dword [edx + 0x3c], eax
mov ecx, dword [edi + 0x1cc]
mov edx, dword [edi + 0x1c]
mov dword [ecx + 0x1c], edx
mov ecx, dword [edi + 0x1cc]
mov edx, dword [edi + 0x1c]
mov dword [ecx + 0x78], edx
call dword [sym.imp.USER32.dll_GetMenuItemCount]
mov ebx, eax
push edi
lea ecx, [esp + 0x44]
mov dword [esp + 0x28], ebx
call fcn.005790a3
mov ecx, edi
mov dword [esp + 0x94], ebp
call fcn.004de0c0
add eax, 0xc
lea ecx, [esp + 0x30]
push eax
lea eax, [esp + 0x44]
push eax
call fcn.0045cc50
push 0x37
mov byte [esp + 0x98], 1
call dword [sym.imp.USER32.dll_GetSystemMetrics]
mov ecx, dword [edi + 0x1c0]
mov esi, dword [edi + 0x1bc]
mov dword [esp + 0x18], eax
mov eax, dword [esp + 0x48]
lea edx, [esp + 0x54]
mov dword [esp + 0x10], ecx
push edx
push eax
call dword [sym.imp.GDI32.dll_GetTextMetricsA]
cmp ebx, ebp
mov dword [esp + 0x14], ebp
jle 0x515c86
jmp 0x515b34
xor ebp, ebp
push 0x1c
call fcn.0056dbe7
add esp, 4
mov dword [esp + 0x20], eax
cmp eax, ebp
mov byte [esp + 0x94], 2
je 0x515b69
mov ecx, dword [esp + 0x14]
mov edx, dword [edi + 0x1cc]
push ecx
push edx
mov ecx, eax
call fcn.005162b0
mov ebx, eax
mov dword [esp + 0x20], ebx
jmp 0x515b6f
mov dword [esp + 0x20], ebp
mov ebx, ebp
mov ecx, ebx
mov byte [esp + 0x94], 1
call fcn.00516550
cmp eax, 1
jne 0x515b8a
mov ebp, 0x14
jmp 0x515c09
mov ecx, ebx
call fcn.005164f0
test eax, eax
je 0x515b9c
mov ebp, 6
jmp 0x515c09
mov ecx, ebx
call fcn.00515a10
test eax, eax
je 0x515bad
mov ebp, dword [esp + 0x18]
jmp 0x515c09
lea eax, [esp + 0x1c]
mov ecx, ebx
push eax
call fcn.00516450
mov byte [esp + 0x94], 3
call fcn.0045d660
lea ecx, [esp + 0x1c]
push ecx
call fcn.0045ddd0
mov eax, dword [esp + 0x20]
add esp, 4
lea edx, [esp + 0x28]
mov ecx, dword [eax - 8]
push edx
push ecx
push eax
mov eax, dword [esp + 0x54]
push eax
call dword [sym.imp.GDI32.dll_GetTextExtentPoint32A]
mov ecx, dword [esp + 0x68]
mov edx, dword [esp + 0x28]
mov byte [esp + 0x94], 1
lea ebp, [edx + ecx*2 + 2]
lea ecx, [esp + 0x1c]
call fcn.0057265c
mov ecx, dword [edi + 0x1c4]
lea eax, [esi + ebp]
cmp eax, ecx
jle 0x515c32
mov eax, dword [esp + 0x14]
test eax, eax
je 0x515c32
mov ecx, dword [esp + 0x18]
mov eax, dword [esp + 0x10]
mov esi, dword [edi + 0x1bc]
add eax, ecx
mov dword [esp + 0x10], eax
mov ecx, dword [esp + 0x10]
mov edx, dword [esp + 0x18]
mov dword [ebx], esi
add ebp, esi
lea eax, [ecx + edx]
push 0xffffffffffffffff
mov dword [ebx + 4], ecx
mov dword [ebx + 8], ebp
mov dword [ebx + 0xc], eax
mov esi, dword [edi + 0x1cc]
add esi, 0x40
mov ecx, esi
mov ebx, dword [esi + 8]
lea eax, [ebx + 1]
push eax
call fcn.004b8d90
mov ecx, dword [esi + 4]
mov edx, dword [esp + 0x20]
mov eax, dword [esp + 0x14]
mov esi, ebp
mov dword [ecx + ebx*4], edx
mov ecx, dword [esp + 0x24]
inc eax
cmp eax, ecx
mov dword [esp + 0x14], eax
jl 0x515b32
mov ebx, ecx
mov ebp, dword [edi + 0x1c4]
dec ebx
test ebx, ebx
jl 0x515cde
mov ecx, dword [edi + 0x1cc]
push ebx
call fcn.005169e0
mov esi, eax
mov ecx, esi
call fcn.00516530
test ah, 0x40
jne 0x515cb6
mov ecx, esi
call fcn.00515a10
test eax, eax
je 0x515cde
mov eax, dword [esi + 4]
mov ecx, dword [esp + 0x10]
cmp eax, ecx
jne 0x515cde
mov edx, dword [esi + 8]
mov eax, ebp
sub eax, edx
push 0
push eax
push esi
call dword [sym.imp.USER32.dll_OffsetRect]
mov ecx, dword [esi]
mov eax, dword [esi + 8]
sub ecx, eax
add ebp, ecx
dec ebx
jns 0x515c91
mov edx, dword [esp + 0x18]
mov eax, dword [esp + 0x10]
mov byte [esp + 0x94], 0
lea ecx, [eax + edx + 1]
mov dword [edi + 0x1c8], ecx
lea ecx, [esp + 0x30]
call fcn.0045ccb0
lea ecx, [esp + 0x40]
mov dword [esp + 0x94], 0xffffffff
call fcn.00579115
pop esi
pop ebx
mov ecx, dword [esp + 0x84]
pop edi
pop ebp
mov dword fs:[0], ecx
add esp, 0x88
ret