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

Disassembly:
push ebp
push edi
push esi
push ebx
mov ebx, ecx
sub esp, 0x5c
mov eax, dword [ecx + 0x1e]
mov dword [esp + 0x34], 1
mov esi, dword [esp + 0x70]
cmp byte [eax + 0xa], 0x4d
je 0x51fa70
movzx edi, word [esi + 0x1c]
mov edx, dword [esi + 0x1e]
movzx ebp, word [esi + 0x1a]
sar di, 5
mov dword [esp + 0x48], edx
movsx eax, di
sar bp, 5
mov dword [esp + 0x44], eax
movsx eax, word [edx + 0x10]
movsx ecx, bp
mov dword [esp + 0x40], ecx
mov dword [esp + 0xc], eax
movsx eax, word [edx + 0xe]
mov dword [esp], ecx
mov ecx, ebx
mov dword [esp + 8], eax
movsx eax, di
mov dword [esp + 4], eax
call fcn.0051d060
mov word [ebx + 0x40], di
sub esp, 0x10
mov ecx, eax
mov word [ebx + 0x47], di
movzx edi, word [ebx + 0x1a]
mov dword [esp + 0x3c], eax
movzx eax, word [ebx + 0x1c]
mov word [ebx + 0x3e], bp
mov word [esp + 0x3a], ax
movsx eax, byte [ebx + 0x72]
mov word [ebx + 0x45], bp
mov edx, eax
cmp eax, ecx
jge 0x51f920
mov edx, dword [esp + 0x34]
test edx, edx
je 0x51fab0
mov ecx, ebx
call fcn.0051cf30
test eax, eax
jne 0x51f8fa
movzx eax, byte [ebx + 9]
sub eax, 2
cmp al, 2
jbe 0x51f90f
mov dword [esp], esi
mov ecx, ebx
call fcn.00522a10
sub esp, 4
test eax, eax
jne 0x51fb30
add esp, 0x5c
pop ebx
pop esi
pop edi
pop ebp
ret 4
mov eax, dword [ebx + 0x1e]
movsx ecx, di
mov ebp, dword [eax + 0x14]
movsx eax, word [ebx + 0x12]
sub eax, ecx
mov ecx, eax
neg ecx
cmovs ecx, eax
cmp ecx, ebp
jge 0x51f90f
movsx ecx, word [esp + 0x3a]
movsx eax, word [ebx + 0x14]
sub eax, ecx
mov ecx, eax
neg ecx
cmovs ecx, eax
cmp ebp, ecx
jle 0x51f90f
mov eax, edi
sar ax, 5
movsx ebp, ax
movzx eax, word [esp + 0x3a]
mov dword [esp + 0x4c], ebp
sar ax, 5
movsx ebp, ax
cmp dl, 1
jle 0x51fad0
cmp dword [esp + 0x3c], 1
je 0x51fb90
cmp dl, 1
jle 0x51fad0
movzx eax, byte [ebx + 0xc]
mov edi, dword [esp + 0x48]
mov ecx, 0x5b52c0
lea edx, [eax + eax*8]
lea eax, [eax + edx*2]
add eax, dword [ebx + 0x6d]
movsx edx, byte [eax + 9]
mov dword [esp + 0x2c], edx
movsx eax, byte [eax + 7]
mov dword [esp + 0x28], eax
lea eax, [ebx + 0x50]
mov dword [esp + 0x24], eax
lea eax, [ebx + 0x4e]
mov dword [esp + 0x20], eax
movsx eax, word [edi + 0x10]
mov dword [esp + 0x1c], eax
movsx eax, word [edi + 0xe]
mov dword [esp + 0x18], eax
movsx eax, byte [esi + 8]
mov dword [esp + 4], ebp
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x44]
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x40]
mov dword [esp + 0xc], eax
movsx eax, byte [ebx + 8]
mov dword [esp + 8], eax
mov eax, dword [esp + 0x4c]
mov dword [esp], eax
call fcn.0041b7d0
sub esp, 0x30
test eax, eax
je 0x51fb58
mov eax, dword [ebx + 0x1a]
mov ecx, ebx
mov dword [esp], 0
mov dword [ebx + 0x12], eax
mov eax, dword [ebx]
call dword [eax + 0x2c]
movsx eax, word [ebx + 0x50]
mov ecx, ebx
sub esp, 4
mov dword [esp + 0xc], eax
movsx eax, word [ebx + 0x4e]
mov dword [esp + 4], ebp
mov dword [esp + 8], eax
mov eax, dword [esp + 0x4c]
mov dword [esp], eax
call fcn.0051e860
sub esp, 0x10
cmp byte [0x5b31cf], 0
jne 0x51fbc8
mov ecx, ebx
call fcn.004de440
mov ecx, ebx
test eax, eax
je 0x51fb80
call fcn.0052fa90
jmp 0x51f90f
movsx eax, byte [ecx + 0x22]
imul eax, eax, 0x84
add eax, dword [0x5b6a8c]
cmp word [eax - 0x4e], 0
je 0x51f862
cmp byte [ecx + 0xea], 0
je 0x51f862
xor eax, eax
cmp byte [ecx + 0xe4], 1
setle al
mov dword [esp + 0x34], eax
jmp 0x51f862
mov dword [esp + 0x70], 0
add esp, 0x5c
mov ecx, ebx
pop ebx
pop esi
pop edi
pop ebp
jmp fcn.0052c430
cmp dword [esp + 0x3c], 1
jne 0x51f90f
movzx eax, word [esp + 0x3a]
mov ecx, ebx
mov word [ebx + 0x12], di
mov dword [esp], 0
mov word [ebx + 0x14], ax
mov eax, dword [ebx]
call dword [eax + 0x2c]
mov ecx, ebx
sub esp, 4
mov eax, dword [esp + 0x44]
mov dword [esp + 4], ebp
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x40]
mov dword [esp + 8], eax
mov eax, dword [esp + 0x4c]
mov dword [esp], eax
call fcn.0051e860
sub esp, 0x10
mov byte [ebx + 0xb], 1
jmp 0x51fa4e
mov dword [ebx + 0x4e], 0xffffffff
movsx eax, byte [esi + 8]
mov ecx, ebx
mov dword [esp + 4], eax
mov eax, dword [esp + 0x3c]
mov dword [esp], eax
call fcn.0051e640
sub esp, 8
jmp 0x51f90f
mov eax, dword [esp + 0x34]
test eax, eax
je 0x51fab0
mov dword [esp], esi
mov ecx, ebx
call fcn.00522a10
sub esp, 4
test eax, eax
je 0x51f90f
jmp 0x51fb37
call fcn.0052faa0
jmp 0x51f90f
movsx eax, byte [esi + 8]
mov dword [esp], 1
mov ecx, ebx
mov dword [esp + 4], eax
call fcn.0051e640
sub esp, 8
cmp byte [ebx + 0x72], 1
jg 0x51f986
movzx eax, word [ebx + 0x1c]
movzx edi, word [ebx + 0x1a]
mov word [esp + 0x3a], ax
jmp 0x51fadb
mov ecx, ebx
call fcn.0051e950
jmp 0x51fb1e