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

Disassembly:
mov ecx, dword fs:[0x14]
mov ecx, dword [ecx]
cmp esp, dword [ecx + 8]
jbe 0x51b578
sub esp, 0x80
mov eax, dword [esp + 0x8c]
cmp eax, 2
jl 0x51b50c
mov ecx, eax
sar eax, 0x1f
shr eax, 0x1d
add eax, ecx
sar eax, 3
shl eax, 3
mov edx, ecx
sub ecx, eax
test ecx, ecx
jne 0x51b505
mov eax, 8
mov dword [esp + 0x40], eax
lea ecx, [0x7b4b60]
mov dword [esp], ecx
lea ecx, [edx + 7]
sar ecx, 0x1f
shr ecx, 0x1d
lea ecx, [ecx + edx + 7]
sar ecx, 3
mov dword [esp + 4], ecx
mov dword [esp + 8], ecx
call fcn.00438a20
mov eax, dword [esp + 0x10]
mov dword [esp + 0x38], eax
mov ecx, dword [esp + 0x14]
mov dword [esp + 0x3c], ecx
mov edx, dword [esp + 0xc]
mov dword [esp + 0x64], edx
lea ebx, [0x7dce40]
mov dword [esp], ebx
call fcn.00409c40
mov eax, dword [esp + 4]
mov dword [esp + 0x60], eax
mov byte [esp + 0x70], 0
mov dword [esp + 0x74], 0
mov dword [esp + 0x78], 0
mov dword [esp + 0x7c], 0
jmp 0x51b326
mov edx, dword [esp + 0x48]
inc edx
mov eax, ecx
mov ecx, dword [esp + 0x68]
mov ebx, dword [esp + 0x30]
mov ebp, dword [esp + 0x4c]
movzx esi, byte [esp + 0x23]
mov edi, dword [esp + 0x34]
mov dword [esp + 0x48], edx
mov edx, dword [esp + 0x50]
mov edi, dword [esp + 0x48]
cmp edi, ebp
jge 0x51b281
movzx ebx, byte [ecx + edi]
mov dword [esp + 0x44], ebx
mov dword [esp], eax
mov dword [esp + 4], edx
mov dword [esp + 8], ebx
mov dword [esp + 0xc], 0
call fcn.00448400
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0x14]
test eax, eax
sete al
test ecx, ecx
sete cl
and ecx, eax
test cl, cl
je 0x51b26d
mov eax, dword [esp + 0x8c]
cmp eax, 6
jg 0x51b1e5
mov ecx, dword [esp + 0x2c]
mov edx, dword [esp + 0x44]
cmp ecx, edx
setne dl
mov ebx, dword [esp + 0x50]
test ebx, ebx
xchg ebp, ebx
setne bl
xchg ebp, ebx
or ebp, edx
xchg ebp, eax
test al, al
xchg ebp, eax
je 0x51b147
mov ebp, dword [esp + 0x30]
add ebp, 2
mov edx, dword [esp + 0x34]
adc edx, 0
mov esi, dword [esp + 0x28]
mov edi, dword [esp + 0x24]
mov eax, edi
mov ecx, esi
mov ebx, ebp
cmp ebx, 0x100000
xchg ebp, ebx
setb bl
xchg ebp, ebx
test edx, edx
xchg esi, ebx
sete bl
xchg esi, ebx
and ebp, esi
test edx, edx
xchg edi, ebx
setb bl
xchg edi, ebx
or ebp, edi
xchg ebp, eax
test al, al
xchg ebp, eax
je 0x51b29d
mov dword [esp + 0x34], edx
mov dword [esp + 0x30], ebx
xchg esi, eax
mov byte [esp + 0x23], al
xchg esi, eax
add eax, ebx
mov dword [esp + 0x2c], eax
mov edi, edx
adc edx, ecx
mov dword [esp + 0x50], edx
mov ecx, dword [0xb789a0]
mov dword [esp + 0x68], ecx
mov ebp, dword [0xb789a4]
mov dword [esp + 0x4c], ebp
mov dword [esp + 0x58], eax
xor eax, eax
mov dword [esp + 0x48], eax
mov eax, dword [esp + 0x58]
jmp 0x51b16b
mov eax, dword [esp + 0x8c]
mov ecx, dword [esp + 0x2c]
mov ebx, dword [esp + 0x50]
jmp 0x51b147
test ebx, ebx
seta al
and esi, eax
mov eax, dword [esp + 0x34]
test eax, eax
seta cl
or esi, ecx
xchg esi, eax
test al, al
xchg esi, eax
jne 0x51b479
mov eax, dword [esp + 0x60]
mov dword [esp], eax
mov dword [esp + 4], 0x14
call fcn.004f8250
movzx eax, byte [esp + 8]
test al, al
je 0x51b463
mov eax, dword [esp + 0x60]
mov ecx, dword [eax + 4]
mov edx, dword [eax + 8]
lea ebx, [edx - 1]
test ebx, ebx
jl 0x51b456
mov ecx, dword [ecx + edx*4 - 4]
cmp ecx, 0x10000
jb 0x51b44f
shr ecx, 0x10
mov edx, 0x10
cmp ecx, 0x100
jb 0x51b2f9
shr ecx, 8
add edx, 8
cmp ecx, 0x100
jae 0x51b56a
shl ebx, 5
lea ebp, [0xb49640]
movzx ecx, byte [ebp + ecx]
add ecx, edx
add ecx, ebx
mov edx, dword [esp + 0x8c]
cmp ecx, edx
je 0x51b42b
mov eax, dword [esp + 0x84]
mov dword [esp], eax
mov ecx, dword [esp + 0x88]
mov dword [esp + 4], ecx
mov edx, dword [esp + 0x64]
mov dword [esp + 8], edx
mov ebx, dword [esp + 0x38]
mov dword [esp + 0xc], ebx
mov ebp, dword [esp + 0x3c]
mov dword [esp + 0x10], ebp
call fcn.004600f0
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x1c]
test eax, eax
jne 0x51b4e5
mov edx, dword [esp + 0x38]
test edx, edx
jbe 0x51b571
mov dword [esp + 0x54], eax
mov dword [esp + 0x6c], ecx
mov ebx, dword [esp + 0x64]
movzx ebp, byte [ebx]
mov ecx, dword [esp + 0x40]
mov edi, 1
shl edi, cl
cmp ecx, 0x20
sbb esi, esi
and edi, esi
lea esi, [edi - 1]
and esi, ebp
xchg esi, eax
mov byte [ebx], al
xchg esi, eax
cmp ecx, 2
jb 0x51b4c4
lea ebp, [ecx - 2]
mov ecx, ebp
mov edi, 3
shl edi, cl
cmp ecx, 0x20
sbb ebp, ebp
and edi, ebp
or edi, esi
xchg edi, eax
mov byte [ebx], al
xchg edi, eax
movzx eax, byte [edx + ebx - 1]
or eax, 1
mov byte [edx + ebx - 1], al
mov eax, dword [esp + 0x60]
mov dword [esp], eax
mov dword [esp + 4], ebx
mov dword [esp + 8], edx
mov ecx, dword [esp + 0x3c]
mov dword [esp + 0xc], ecx
call fcn.004e8d50
lea eax, [esp + 0x70]
mov dword [esp], eax
mov ecx, dword [esp + 0x60]
mov dword [esp + 4], ecx
mov edx, dword [0xb7fa24]
mov dword [esp + 8], edx
call fcn.004e8540
mov eax, dword [esp + 0x78]
mov ecx, dword [esp + 0x74]
test eax, eax
jne 0x51b4aa
xor eax, eax
xor ecx, ecx
mov dword [esp + 0x24], eax
mov dword [esp + 0x28], ecx
xor edx, edx
xor ebx, ebx
jmp 0x51b201
mov dword [esp + 0x90], eax
mov eax, dword [esp + 0x54]
mov dword [esp + 0x94], eax
mov eax, dword [esp + 0x6c]
mov dword [esp + 0x98], eax
add esp, 0x80
ret
xor edx, edx
jmp 0x51b2eb
lea ebp, [0xb49640]
xor ecx, ecx
jmp 0x51b317
mov eax, dword [esp + 0x60]
mov edx, dword [esp + 0x8c]
lea ebp, [0xb49640]
jmp 0x51b326
lea ecx, [esp + 0x70]
mov dword [esp], ecx
mov dword [esp + 4], ebx
mov dword [esp + 8], eax
call fcn.004e7370
mov eax, dword [esp + 0x60]
mov dword [esp], eax
mov dword [esp + 4], eax
lea ecx, [esp + 0x70]
mov dword [esp + 8], ecx
call fcn.004e7820
jmp 0x51b29d
mov edx, dword [ecx]
cmp eax, 1
jle 0x51b4bb
mov ecx, dword [ecx + 4]
mov eax, edx
jmp 0x51b41a
mov eax, edx
xor ecx, ecx
jmp 0x51b41a
or esi, 1
xchg esi, eax
mov byte [ebx], al
xchg esi, eax
cmp edx, 1
jle 0x51b3c0
movzx ebp, byte [ebx + 1]
or ebp, 0xffffff80
xchg ebp, eax
mov byte [ebx + 1], al
xchg ebp, eax
jmp 0x51b3c0
mov dword [esp + 0x90], 0
mov dword [esp + 0x94], eax
mov dword [esp + 0x98], ecx
add esp, 0x80
ret
mov eax, ecx
jmp 0x51b0cd
lea eax, [0x7d00e0]
mov dword [esp], eax
call fcn.00409c40
mov edi, dword [esp + 4]
mov dword [edi + 4], 0x2e
mov eax, dword [0xb92b90]
test eax, eax
jne 0x51b55d
lea eax, [0x84aa4f]
mov dword [edi], eax
mov dword [esp + 0x90], 0
lea eax, [0x8b2890]
mov dword [esp + 0x94], eax
mov dword [esp + 0x98], edi
add esp, 0x80
ret
lea eax, [0x84aa4f]
call fcn.0044c990
jmp 0x51b537
call fcn.004264e0
ud2
call fcn.004264e0
ud2
call fcn.0044b230
jmp fcn.0051b080