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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
mov eax, dword [ebp + 0x10]
sub esp, 0x54
push ebx
push esi
push edi
mov edi, ecx
mov dword [edi + 0x30], eax
mov eax, dword [ebp + 0x18]
mov dword [edi + 0x64], eax
lea esi, [edi + 0x90]
mov eax, dword [esi + 0x10]
sub eax, dword [esi + 0xc]
push 0x14
cdq
pop ecx
idiv ecx
or dword [0x607ef4], 0xffffffff
test eax, eax
jbe 0x51b90e
mov eax, dword [esi + 0x10]
sub eax, dword [esi + 0xc]
and dword [esp + 0xc], 0
cdq
idiv ecx
test eax, eax
jbe 0x51b4ae
push dword [esp + 0xc]
call fcn.004d4f57
mov ebx, dword [eax]
cmp dword [ebx + 0x50], 0
jne 0x51b4ae
mov ecx, dword [edi + 0x3c]
test ecx, ecx
je 0x51b46a
lea eax, [edi + 0xec]
cmp ebx, eax
je 0x51b46a
mov eax, dword [ecx]
push ebx
push dword [edi + 0x38]
call dword [eax + 0xc]
mov ecx, dword [edi + 0x44]
test ecx, ecx
je 0x51b498
mov eax, dword [ebx + 0x74]
lea edx, [esp + 0x10]
push edx
push dword [ebx + 0x84]
mov dword [esp + 0x18], eax
mov eax, dword [ecx]
call dword [eax]
test eax, eax
je 0x51b498
mov ecx, dword [esp + 0x10]
push 0
mov eax, ebx
call fcn.00509ca0
mov eax, dword [esi + 0x10]
sub eax, dword [esi + 0xc]
push 0x14
cdq
pop ecx
idiv ecx
inc dword [esp + 0xc]
cmp dword [esp + 0xc], eax
jb 0x51b43f
cmp dword [0x61dc70], 0
mov esi, dword [edi + 0x2c]
lea ebx, [edi + 4]
jne 0x51b4c4
and dword [0x61dc70], 0
lea eax, [ebx + 0x20]
push eax
push 0x61dc40
call fcn.004143c9
movzx eax, ax
push eax
xor eax, eax
push eax
push 0x8000088
push 0x80000000
push eax
push eax
push esi
call fcn.0041415b
test eax, eax
je 0x51b90e
push str.win_bk
call fcn.00503907
mov dword [edi + 0x288], eax
mov dword [esp], str.menuitem
call fcn.00503941
mov dword [edi + 0xc4], eax
mov dword [esp], str.menuitem_bold
call fcn.00503941
mov dword [edi + 0xc8], eax
mov dword [esp], str.menuitem_normal
call fcn.00503973
mov dword [edi + 0xd0], eax
mov dword [esp], str.menuitem_hilite
call fcn.00503973
mov dword [edi + 0xcc], eax
mov dword [esp], str.menuitem_disable
call fcn.00503973
mov dword [edi + 0xd4], eax
mov dword [esp], str.menuitem_hotkey
call fcn.00503973
mov dword [edi + 0xd8], eax
mov dword [esp], str.menuitem_separator
call fcn.00503973
mov dword [edi + 0xdc], eax
mov dword [esp], str.menuitem_bkcolor
call fcn.00503973
mov dword [edi + 0xe0], eax
mov dword [esp], str.menuitem_dragcolor
call fcn.00503973
mov dword [edi + 0xe4], eax
mov dword [esp], str.win_frame
call fcn.00503973
mov dword [edi + 0xe8], eax
pop ecx
lea eax, [esp + 0x20]
push eax
call fcn.0051cd3f
mov esi, dword [ebp + 0x14]
mov ebx, dword [ebp + 8]
push 2
test esi, esi
je 0x51b5d1
push esi
jmp 0x51b5ed
mov eax, dword [ebp + 0xc]
mov dword [esp + 0x18], eax
inc eax
mov dword [esp + 0x20], eax
lea ecx, [ebx + 1]
lea eax, [esp + 0x14]
mov dword [esp + 0x14], ebx
mov dword [esp + 0x1c], ecx
push eax
call dword [0x5b1758]
lea ecx, [esp + 0x38]
push ecx
push eax
mov dword [esp + 0x40], 0x28
call dword [0x5b1754]
test esi, esi
je 0x51b632
cmp dword [edi + 0x60], 0
jne 0x51b632
mov eax, dword [esp + 0x58]
mov ecx, dword [esi + 4]
sub eax, dword [esi + 0xc]
sub ecx, dword [esp + 0x50]
cmp ecx, eax
jle 0x51b62e
mov edx, dword [esp + 0x24]
add edx, 6
cmp eax, edx
jl 0x51b63a
mov ecx, eax
jmp 0x51b63a
mov ecx, dword [esp + 0x58]
sub ecx, dword [esp + 0x50]
mov eax, dword [esp + 0x24]
add eax, 6
cmp eax, ecx
jle 0x51b732
cmp ecx, 6
jle 0x51b732
add ecx, 0xfffffffa
mov eax, ecx
cdq
idiv dword [edi + 0x80]
mov eax, dword [esp + 0x24]
sub ecx, edx
lea eax, [ecx + eax - 1]
cdq
idiv ecx
mov edx, dword [esp + 0x54]
mov dword [esp + 0x24], ecx
mov ecx, edx
sub ecx, dword [esp + 0x4c]
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x20]
add eax, 3
imul eax, dword [esp + 0xc]
sub eax, 3
cmp dword [edi + 0x60], 0
je 0x51b6a1
mov ecx, dword [esi]
sub edx, dword [esi + 8]
sub ecx, dword [esp + 0x4c]
cmp edx, ecx
jle 0x51b6a1
mov ecx, edx
cmp eax, ecx
jle 0x51b736
mov eax, ecx
cdq
idiv dword [esp + 0xc]
mov edx, dword [edi + 0x78]
cmp eax, edx
mov dword [edi + 0x8c], eax
jle 0x51b6e0
mov eax, dword [edi + 0x8c]
lea ebx, [eax + 3]
imul ebx, dword [esp + 0xc]
sub ebx, 3
cmp ebx, ecx
jle 0x51b6dd
dec eax
cmp eax, edx
mov dword [edi + 0x8c], eax
jg 0x51b6bd
mov ebx, dword [ebp + 8]
cmp dword [edi + 0x8c], edx
jge 0x51b6ee
mov dword [edi + 0x8c], edx
mov eax, dword [edi + 0x7c]
cmp dword [edi + 0x8c], eax
jle 0x51b6ff
mov dword [edi + 0x8c], eax
mov eax, dword [edi + 0x8c]
add eax, 3
imul eax, dword [esp + 0xc]
sub eax, 3
cmp eax, ecx
jle 0x51b736
mov eax, dword [edi + 0x8c]
push 0xfffffffffffffffd
pop edx
sub edx, eax
add eax, 3
imul eax, dword [esp + 0xc]
sub eax, 3
add eax, edx
cmp eax, ecx
jg 0x51b72a
jmp 0x51b736
mov eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x24]
add ecx, 6
push ecx
push eax
lea eax, [esp + 0x18]
push eax
call fcn.0051cf64
cmp dword [edi + 0x70], 0
mov ecx, dword [eax]
mov eax, dword [eax + 4]
mov dword [esp + 0x20], ecx
mov dword [esp + 0x24], eax
jne 0x51b75e
sub ebx, ecx
cmp ebx, dword [esp + 0x4c]
jge 0x51b768
mov ebx, dword [esp + 0x4c]
mov eax, dword [esp + 0x54]
mov edx, eax
sub edx, ebx
cmp edx, ecx
jge 0x51b779
mov ebx, eax
sub ebx, ecx
dec ebx
cmp dword [edi + 0x60], 0
je 0x51b820
test esi, esi
je 0x51b8bd
mov ecx, dword [esp + 0x58]
sub ecx, dword [ebp + 0xc]
cmp ecx, dword [esp + 0x24]
jge 0x51b7a4
mov ecx, dword [esi + 0xc]
sub ecx, dword [esp + 0x24]
add ecx, 3
jmp 0x51b7aa
mov ecx, dword [esi + 4]
sub ecx, 3
mov edx, dword [esi + 8]
sub eax, edx
mov dword [esp + 0x10], eax
mov eax, dword [esi]
mov esi, dword [esp + 0x20]
mov dword [ebp + 0xc], ecx
mov ecx, eax
sub ecx, dword [esp + 0x4c]
cmp dword [edi + 0x20c], 0
je 0x51b7f4
cmp dword [esp + 0x10], esi
jl 0x51b7d9
lea ebx, [edx - 3]
jmp 0x51b8bd
cmp ecx, esi
jl 0x51b8bd
sub eax, esi
add eax, 3
and dword [edi + 0x20c], 0
mov ebx, eax
jmp 0x51b8bd
cmp ecx, esi
jl 0x51b804
sub eax, esi
add eax, 3
mov ebx, eax
jmp 0x51b8bd
cmp dword [esp + 0x10], esi
jl 0x51b8bd
lea ebx, [edx - 3]
mov dword [edi + 0x20c], 1
jmp 0x51b8bd
test esi, esi
je 0x51b893
mov ecx, dword [esi + 4]
mov eax, dword [esp + 0x58]
sub eax, dword [esi + 0xc]
mov edx, ecx
sub edx, dword [esp + 0x50]
cmp edx, eax
jle 0x51b845
cmp eax, dword [esp + 0x24]
jge 0x51b845
sub ecx, dword [esp + 0x24]
mov dword [ebp + 0xc], ecx
mov ecx, dword [esp + 0x20]
xor eax, eax
add ecx, ebx
mov dword [esp + 0x28], eax
mov dword [esp + 0x2c], eax
mov dword [esp + 0x30], eax
mov dword [esp + 0x34], eax
mov eax, dword [ebp + 0xc]
mov dword [esp + 0x18], ecx
mov ecx, dword [esp + 0x24]
add ecx, eax
mov dword [esp + 0x14], eax
lea eax, [esp + 0x10]
push eax
push esi
lea eax, [esp + 0x30]
push eax
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x28], ecx
call dword [0x5b15c4]
test eax, eax
je 0x51b8bd
mov ebx, dword [esi]
sub ebx, dword [esp + 0x20]
jmp 0x51b8bd
mov ecx, dword [esp + 0x58]
mov eax, ecx
sub eax, dword [ebp + 0xc]
cmp eax, dword [esp + 0x24]
jge 0x51b8bd
mov edx, dword [ebp + 0xc]
sub edx, dword [esp + 0x50]
cmp edx, eax
jle 0x51b8b6
mov eax, dword [esp + 0x24]
sub dword [ebp + 0xc], eax
jmp 0x51b8bd
sub ecx, dword [esp + 0x24]
mov dword [ebp + 0xc], ecx
mov eax, dword [esp + 0x50]
cmp dword [ebp + 0xc], eax
jge 0x51b8c9
mov dword [ebp + 0xc], eax
push 0x50
push dword [esp + 0x28]
push dword [esp + 0x28]
push dword [ebp + 0xc]
push ebx
push 0xffffffffffffffff
push dword [edi + 8]
call dword [0x5b1734]
mov esi, edi
call fcn.0051c156
push dword [edi + 0x29c]
xor esi, esi
inc esi
mov dword [edi + 0x294], esi
call dword [0x5b1794]
test eax, eax
je 0x51b90e
push esi
lea eax, [edi + 0x298]
call fcn.005361de
cmp dword [edi + 0x68], 0
je 0x51b921
cmp dword [edi + 0x60], 0
jne 0x51b921
mov eax, edi
call fcn.0051c3c7
mov eax, dword [0x607ef4]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x14