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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x8c
push ebx
push esi
xor esi, esi
push edi
mov dword [esp + 0x14], esi
mov dword [esp + 0x18], esi
mov dword [esp + 0x1c], esi
cmp word [ebp + 0x18], si
je 0x51af99
mov eax, dword [ebp + 8]
mov ecx, dword [eax]
mov edx, dword [ecx]
test byte [edx + 0x44], 0x40
je 0x51af99
xor al, al
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp + 0xc]
movzx eax, word [eax]
mov dword [esp + 0x70], eax
cmp ax, 0x3f
ja 0x51af90
movzx ecx, ax
mov eax, 1
xor edx, edx
mov byte [esp + 0x11], 1
mov dword [esp + 0x34], ecx
call fcn.0058de50
add eax, 0xffffffff
mov dword [esp + 0x60], eax
mov eax, dword [ebp + 0x14]
adc edx, 0xffffffff
and eax, 0x800
mov dword [esp + 0x64], edx
mov dword [esp + 0x58], esi
mov dword [esp + 0x5c], esi
mov dword [esp + 0x48], esi
mov dword [esp + 0x4c], esi
mov dword [esp + 0x44], 0x182
mov dword [esp + 0x78], eax
je 0x51affd
mov dword [esp + 0x44], 0x183
mov dword [esp + 0x38], esi
mov ecx, dword [esp + 0x1c]
cmp ecx, dword [esp + 0x64]
ja 0x51b5f6
jb 0x51b01f
mov edx, dword [esp + 0x18]
cmp edx, dword [esp + 0x60]
jae 0x51b5f6
movzx eax, word [ebp + 0x18]
mov ecx, dword [esp + 0x38]
cmp ecx, eax
jg 0x51b5f6
test ecx, ecx
jle 0x51b045
mov edx, dword [esp + 0x14]
mov esi, dword [edx + 8]
mov edx, dword [edx + 0xc]
or dword [esp + 0x48], esi
or dword [esp + 0x4c], edx
cmp ecx, eax
jge 0x51b066
cmp word [esp + 0x78], 0
mov eax, dword [ebp + 0x10]
mov edx, dword [eax + 0x18]
mov eax, dword [edx + ecx*4]
mov dword [esp + 0x14], eax
jne 0x51b5d6
mov ecx, eax
jmp 0x51b06d
mov ecx, dword [ebp + 0x1c]
mov dword [esp + 0x14], ecx
test dword [ecx + 0x24], 0x400
jne 0x51b5f0
movzx eax, byte [ecx + 0x10]
xor edx, edx
cmp dword [esp + 0x34], 0
mov word [ecx + 0x1e], dx
mov edx, dword [ebp + 8]
mov edx, dword [edx + 4]
lea eax, [eax + eax*8]
mov eax, dword [edx + eax*8 + 0x34]
mov dword [esp + 0x3c], eax
mov dword [esp + 0x24], 0
jle 0x51b1bd
mov ecx, dword [ebp + 0xc]
add ecx, 4
mov dword [esp + 0x2c], ecx
mov ecx, dword [esp + 0x24]
mov eax, 1
xor edx, edx
call fcn.0058de50
mov ebx, edx
mov edi, eax
and eax, dword [esp + 0x18]
mov ecx, ebx
and ecx, dword [esp + 0x1c]
mov dword [esp + 0x50], edi
or eax, ecx
mov dword [esp + 0x54], ebx
jne 0x51b1a1
mov edx, dword [esp + 0x2c]
mov eax, dword [edx]
call fcn.004df840
mov esi, eax
cmp byte [esi], 0x9e
jne 0x51b1a1
mov eax, dword [esp + 0x3c]
cmp dword [esi + 0x1c], eax
jne 0x51b1a1
movzx ecx, word [esp + 0x44]
mov eax, dword [esp + 0x4c]
mov edx, dword [esp + 0x48]
push 0
push ecx
movsx ecx, word [esi + 0x20]
not edx
not eax
push eax
push edx
mov edx, dword [esp + 0x4c]
push edx
mov edx, dword [ebp + 8]
add edx, 0x50
call fcn.00517170
add esp, 0x14
test eax, eax
je 0x51b1a1
movzx ecx, word [eax + 0xc]
cmp cx, 1
jne 0x51b16f
mov edx, dword [esp + 0x14]
movzx edi, word [edx + 0x28]
xor ecx, ecx
test edi, edi
jle 0x51b163
mov edx, dword [edx + 0x30]
cmp eax, dword [edx]
je 0x51b163
mov ebx, dword [esp + 0x14]
movzx ebx, word [ebx + 0x28]
inc ecx
add edx, 4
cmp ecx, ebx
jl 0x51b14f
cmp ecx, edi
jge 0x51b1a1
mov ebx, dword [esp + 0x54]
mov edi, dword [esp + 0x50]
movzx ecx, word [eax + 0xc]
test cl, 0x82
je 0x51b199
cmp word [esi + 0x20], 0
jl 0x51b199
mov eax, dword [eax]
mov ecx, dword [esp + 0x2c]
mov edx, dword [ebp + 8]
mov esi, dword [edx]
push eax
mov eax, dword [ecx]
call fcn.004dfa40
add esp, 4
test eax, eax
je 0x51b1a1
or dword [esp + 0x18], edi
or dword [esp + 0x1c], ebx
mov eax, dword [esp + 0x24]
add dword [esp + 0x2c], 0x18
inc eax
cmp eax, dword [esp + 0x34]
mov dword [esp + 0x24], eax
jl 0x51b0b2
mov ecx, dword [esp + 0x14]
mov eax, dword [ecx + 0x24]
test eax, 0x1000
jne 0x51b4cf
test eax, 0x100
je 0x51b1e3
xor eax, eax
mov dword [esp + 0x2c], eax
mov dword [esp + 0x6c], eax
mov eax, 1
jmp 0x51b211
mov ecx, dword [ecx + 0x20]
mov dword [esp + 0x2c], ecx
test ecx, ecx
je 0x51af90
test byte [ecx + 0x38], 4
jne 0x51af90
movzx eax, word [ecx + 0x32]
cmp byte [ecx + 0x36], 0
mov dword [esp + 0x6c], eax
movzx eax, word [ecx + 0x34]
setne byte [esp + 0x11]
movzx eax, ax
xor ebx, ebx
cmp eax, ebx
mov byte [esp + 0x2a], 0
mov byte [esp + 0x2b], 0
mov byte [esp + 0x29], 0
mov dword [esp + 0x24], ebx
mov dword [esp + 0x74], eax
jle 0x51b4cf
mov dword [esp + 0x30], ebx
lea esp, [esp]
mov eax, dword [esp + 0x14]
movzx edi, word [eax + 0x18]
cmp ebx, edi
mov byte [esp + 0x12], 1
jge 0x51b2b3
movzx ecx, word [eax + 0x2a]
cmp ebx, ecx
jl 0x51b2b3
mov edx, dword [eax + 0x30]
mov eax, dword [edx + ebx*4]
movzx ecx, word [eax + 0xc]
mov esi, ecx
and esi, dword [esp + 0x44]
test si, si
je 0x51b284
test ecx, 0x100
je 0x51b4b6
mov byte [esp + 0x11], 0
jmp 0x51b4b6
test cl, 1
je 0x51b2b3
mov esi, dword [eax]
lea eax, [ebx + 1]
cmp eax, edi
jge 0x51b2b3
lea ecx, [edx + ebx*4 + 4]
mov edx, dword [ecx]
cmp dword [edx], esi
je 0x51b2ae
mov edx, dword [esp + 0x14]
movzx edx, word [edx + 0x18]
inc eax
add ecx, 4
cmp eax, edx
jl 0x51b296
jmp 0x51b2b3
mov byte [esp + 0x12], 0
mov esi, dword [esp + 0x2c]
test esi, esi
je 0x51b2dd
mov ecx, dword [esi + 0x1c]
mov dl, byte [ebx + ecx]
mov eax, dword [esi + 4]
mov ecx, dword [esi + 0xc]
movsx eax, word [eax + ebx*2]
mov byte [esp + 0x13], dl
movsx edx, word [ecx + 0x28]
mov dword [esp + 0x40], eax
cmp eax, edx
jne 0x51b2e9
jmp 0x51b2e2
mov byte [esp + 0x13], 0
or eax, 0xffffffff
mov dword [esp + 0x40], eax
cmp byte [esp + 0x11], 0
je 0x51b30d
test eax, eax
jl 0x51b30d
cmp ebx, edi
jl 0x51b30d
mov ecx, dword [esi + 0xc]
mov edx, dword [ecx + 4]
shl eax, 4
cmp byte [edx + eax + 0xc], 0
jne 0x51b30d
mov byte [esp + 0x11], 0
xor edi, edi
cmp byte [esp + 0x12], 0
je 0x51b404
mov ebx, dword [ebp + 0xc]
add ebx, 4
cmp edi, dword [esp + 0x34]
jge 0x51b404
mov eax, 1
xor edx, edx
mov ecx, edi
call fcn.0058de50
and eax, dword [esp + 0x18]
and edx, dword [esp + 0x1c]
or eax, edx
jne 0x51b3f5
mov eax, dword [ebx]
test eax, eax
je 0x51b372
mov edi, edi
mov ecx, dword [eax + 4]
test ecx, 0x1000
je 0x51b372
test ecx, 0x40000
je 0x51b36b
mov eax, dword [eax + 0x14]
mov eax, dword [eax + 4]
jmp 0x51b36e
mov eax, dword [eax + 0xc]
test eax, eax
jne 0x51b350
test byte [ebp + 0x14], 0xc0
jne 0x51b37d
mov byte [esp + 0x12], 0
mov esi, dword [esp + 0x40]
cmp esi, 0xffffffff
jl 0x51b39c
cmp byte [eax], 0x9e
jne 0x51b3f5
mov ecx, dword [esp + 0x3c]
cmp dword [eax + 0x1c], ecx
jne 0x51b3f5
movsx edx, word [eax + 0x20]
cmp edx, esi
jmp 0x51b3ba
mov ecx, dword [esp + 0x2c]
mov edx, dword [ecx + 0x28]
mov ecx, dword [esp + 0x30]
mov ecx, dword [edx + ecx + 4]
mov edx, dword [esp + 0x3c]
push edx
call fcn.004e62d0
add esp, 4
test eax, eax
jne 0x51b3f5
cmp esi, 0xffffffff
je 0x51b42f
mov ecx, dword [ebp + 8]
mov esi, dword [ecx]
mov eax, dword [ebx]
push esi
call fcn.004df870
mov ecx, eax
add esp, 4
test ecx, ecx
jne 0x51b3dc
mov edx, dword [esi]
mov ecx, dword [edx + 8]
mov eax, dword [esp + 0x2c]
mov edx, dword [eax + 0x20]
mov eax, dword [esp + 0x24]
mov eax, dword [edx + eax*4]
mov ecx, dword [ecx]
call fcn.004ae7e0
test eax, eax
je 0x51b42f
inc edi
add ebx, 0x18
cmp byte [esp + 0x12], 0
jne 0x51b320
mov eax, dword [esp + 0x24]
test eax, eax
je 0x51b415
movzx edx, word [esp + 0x6c]
cmp eax, edx
jge 0x51b41a
mov byte [esp + 0x11], 0
cmp byte [esp + 0x29], 0
je 0x51b4cf
mov byte [esp + 0x11], 1
jmp 0x51b4da
mov ecx, dword [esp + 0x24]
mov edx, dword [esp + 0x14]
inc ecx
test byte [ebp + 0x14], 0x40
mov word [edx + 0x1e], cx
jne 0x51b490
cmp byte [esp + 0x2a], 0
je 0x51b45f
mov al, byte [esp + 0x13]
xor al, byte [esp + 0x2b]
mov edx, dword [ebp + 0xc]
lea ecx, [edi + edi*2]
cmp al, byte [edx + ecx*8 + 0x10]
jne 0x51b404
jmp 0x51b490
mov ecx, dword [ebp + 0xc]
lea eax, [edi + edi*2]
mov al, byte [ecx + eax*8 + 0x10]
xor al, byte [esp + 0x13]
mov byte [esp + 0x2b], al
je 0x51b48b
mov ecx, dword [esp + 0x38]
mov eax, 1
xor edx, edx
call fcn.0058de50
mov ecx, dword [ebp + 0x20]
or dword [ecx], eax
or dword [ecx + 4], edx
mov byte [esp + 0x2a], 1
cmp dword [esp + 0x40], 0xffffffff
jne 0x51b49c
mov byte [esp + 0x29], 1
mov eax, 1
xor edx, edx
mov ecx, edi
call fcn.0058de50
or dword [esp + 0x18], eax
or dword [esp + 0x1c], edx
mov ebx, dword [esp + 0x24]
add dword [esp + 0x30], 0x18
inc ebx
cmp ebx, dword [esp + 0x74]
mov dword [esp + 0x24], ebx
jl 0x51b240
jmp 0x51b41a
cmp byte [esp + 0x11], 0
je 0x51b5d6
mov eax, dword [esp + 0x14]
mov ecx, dword [eax + 8]
or dword [esp + 0x58], ecx
mov edx, dword [eax + 0xc]
or dword [esp + 0x5c], edx
xor ecx, ecx
cmp dword [esp + 0x34], ecx
mov dword [esp + 0x24], ecx
jle 0x51b5d6
mov eax, dword [ebp + 0xc]
add eax, 4
mov dword [esp + 0x30], eax
mov eax, 1
xor edx, edx
call fcn.0058de50
mov ecx, edx
mov dword [esp + 0x50], eax
and eax, dword [esp + 0x18]
mov dword [esp + 0x54], ecx
and ecx, dword [esp + 0x1c]
or eax, ecx
jne 0x51b5be
mov ecx, dword [esp + 0x30]
mov esi, dword [ecx]
test esi, esi
je 0x51b5e7
mov edx, dword [ebp + 8]
add edx, 0x1e8
push esi
push edx
call fcn.00516900
mov ebx, edx
add esp, 8
mov edi, eax
or eax, ebx
jne 0x51b59a
mov byte [esp + 0x90], 1
mov dword [esp + 0x80], 0x4e1a00
mov dword [esp + 0x84], 0x4e19a0
mov dword [esp + 0x94], 0
test esi, esi
je 0x51b59a
lea ecx, [esp + 0x7c]
push esi
push ecx
call fcn.004dd300
add esp, 8
cmp byte [esp + 0x90], 0
je 0x51b5be
mov eax, dword [esp + 0x58]
mov ecx, dword [esp + 0x5c]
not eax
not ecx
and eax, edi
and ecx, ebx
or eax, ecx
jne 0x51b5be
mov edx, dword [esp + 0x50]
mov eax, dword [esp + 0x54]
or dword [esp + 0x18], edx
or dword [esp + 0x1c], eax
mov ecx, dword [esp + 0x24]
add dword [esp + 0x30], 0x18
inc ecx
cmp ecx, dword [esp + 0x34]
mov dword [esp + 0x24], ecx
jl 0x51b506
inc dword [esp + 0x38]
cmp byte [esp + 0x11], 0
jne 0x51b001
jmp 0x51b5f6
xor edi, edi
xor ebx, ebx
jmp 0x51b555
cmp byte [ecx + 0x1d], 0
jne 0x51b60a
mov ecx, dword [esp + 0x60]
cmp dword [esp + 0x18], ecx
jne 0x51b615
mov edx, dword [esp + 0x64]
cmp dword [esp + 0x1c], edx
jne 0x51b615
mov al, byte [esp + 0x70]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp byte [esp + 0x11], 0
jne 0x51b66a
mov ebx, dword [esp + 0x34]
dec ebx
test ebx, ebx
jle 0x51af90
mov edi, dword [esp + 0x18]
mov eax, 1
xor edx, edx
mov ecx, ebx
call fcn.0058de50
add eax, 0xffffffff
adc edx, 0xffffffff
mov ecx, eax
mov esi, edx
and esi, dword [esp + 0x1c]
and ecx, edi
cmp ecx, eax
jne 0x51b653
cmp esi, edx
je 0x51b661
dec ebx
test ebx, ebx
jg 0x51b62d
xor al, al
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov al, bl
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
pop edi
pop esi
or al, 0xff
pop ebx
mov esp, ebp
pop ebp
ret