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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x4f34f8
mov eax, dword fs:[0]
push eax
sub esp, 0x70
push ebx
push esi
push edi
mov eax, dword [0x5321c0]
xor eax, esp
push eax
lea eax, [esp + 0x80]
mov dword fs:[0], eax
push 3
pop eax
xor ecx, ecx
mov dword [esp + 0x18], eax
mov edx, 0x454
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call 0x5b87ef
mov ebx, dword [ebp + 8]
xor edi, edi
cmp dword [ebx + 0x18], edi
pop ecx
mov dword [esp + 0x14], eax
mov dword [esp + 0x24], edi
mov dword [esp + 0x4c], 1
jne 0x512a10
jmp 0x512319
xor edi, edi
cmp dword [ebx + 0x20], edi
jne 0x512343
cmp dword [ebx + 0x18], edi
push 0x32
pop esi
jne 0x512a10
push 0x14
call dword [0x4f62a4]
dec esi
je 0x51233a
cmp dword [ebx + 0x18], edi
je 0x51232a
cmp dword [ebx + 0x18], edi
jne 0x512a10
mov ecx, dword [ebx + 0x48]
cmp ecx, edi
je 0x512430
mov eax, dword [ebx + 0x4c]
sub eax, ecx
push 0x28
cdq
pop ecx
idiv ecx
cmp eax, edi
jbe 0x512430
cmp dword [0x53c018], edi
je 0x512430
mov dword [esp + 0x1c], edi
mov dword [esp + 0x20], edi
mov ecx, dword [ebx + 0x48]
cmp ecx, edi
je 0x512430
mov eax, dword [ebx + 0x4c]
sub eax, ecx
push 0x28
cdq
pop ecx
idiv ecx
cmp dword [esp + 0x1c], eax
jae 0x512430
mov ecx, dword [ebx + 0x48]
cmp ecx, edi
je 0x5123ad
mov eax, dword [ebx + 0x4c]
sub eax, ecx
push 0x28
cdq
pop ecx
idiv ecx
cmp dword [esp + 0x1c], eax
jb 0x5123b2
call 0x5b9e21
mov eax, dword [ebx + 0x48]
add eax, dword [esp + 0x20]
mov ecx, dword [0x53c018]
mov edx, dword [ecx]
push eax
call dword [edx + 0x1c]
test eax, eax
jne 0x512422
mov esi, dword [ebx + 0x48]
cmp esi, dword [ebx + 0x4c]
jbe 0x5123d6
call 0x5b9e21
mov eax, dword [esp + 0x20]
add esi, eax
cmp esi, dword [ebx + 0x4c]
ja 0x5123e6
cmp esi, dword [ebx + 0x48]
jae 0x5123eb
call 0x5b9e21
mov edx, dword [ebx + 0x4c]
lea eax, [esi + 0x28]
cmp eax, edx
je 0x512413
lea ecx, [eax - 0x28]
mov dword [esp + 0x2c], ecx
mov edi, dword [esp + 0x2c]
add dword [esp + 0x2c], 0x28
mov esi, eax
push 0xa
add eax, 0x28
cmp eax, edx
pop ecx
rep movsd dword es:[edi], dword [esi]
jne 0x5123fc
add dword [ebx + 0x4c], 0xffffffd8
dec dword [esp + 0x1c]
sub dword [esp + 0x20], 0x28
xor edi, edi
inc dword [esp + 0x1c]
add dword [esp + 0x20], 0x28
jmp 0x512375
mov dword [ebx + 0x20], edi
cmp dword [0x53c018], edi
mov dword [esp + 0x10], edi
je 0x512601
mov eax, dword [esp + 0x18]
mov ecx, dword [0x53c018]
imul eax, eax, 0x454
lea edx, [esp + 0x10]
push edx
lea edx, [esp + 0x34]
push edx
push dword [esp + 0x1c]
mov dword [esp + 0x3c], eax
mov eax, dword [ecx]
call dword [eax + 0x2c]
and dword [esp + 0x2c], 0
mov esi, eax
jmp 0x5124e0
mov esi, dword [esp + 0x10]
add esi, 2
xor ecx, ecx
mov eax, esi
mov edx, 0x454
mul edx
seto cl
mov dword [esp + 0x18], esi
neg ecx
or ecx, eax
push ecx
call 0x5b87ef
imul esi, esi, 0x454
pop ecx
mov ecx, dword [0x53c018]
lea edx, [esp + 0x10]
push edx
lea edx, [esp + 0x34]
mov edi, eax
push edx
mov dword [esp + 0x38], esi
mov eax, dword [ecx]
push edi
call dword [eax + 0x2c]
mov esi, eax
test esi, esi
jne 0x5124ce
push dword [esp + 0x14]
call 0x5b9b0d
mov dword [esp + 0x18], edi
jmp 0x5124d4
push edi
call 0x5b9b0d
inc dword [esp + 0x30]
cmp dword [esp + 0x30], 5
pop ecx
jg 0x5124e5
cmp esi, 0xfffffff1
je 0x512473
xor edi, edi
cmp esi, edi
jne 0x512601
cmp dword [esp + 0x18], 6
mov dword [esp + 0x24], edi
jle 0x51255d
mov ecx, dword [esp + 0x18]
mov eax, dword [esp + 0x10]
sub ecx, eax
cmp ecx, 3
jle 0x51255d
push 5
pop ecx
cmp eax, ecx
mov dword [esp + 0x18], eax
jge 0x512518
mov dword [esp + 0x18], ecx
mov eax, dword [esp + 0x18]
xor ecx, ecx
mov edx, 0x454
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call 0x5b87ef
mov esi, eax
mov eax, dword [esp + 0x14]
imul eax, eax, 0x454
pop ecx
push eax
push dword [esp + 0x18]
push esi
call 0x5bd300
add esp, 0xc
push dword [esp + 0x14]
call 0x5b9b0d
pop ecx
mov dword [esp + 0x14], esi
xor edi, edi
cmp dword [esp + 0x4c], edi
je 0x512839
cmp dword [0x53c4dc], edi
jle 0x512835
mov dword [esp + 0x70], edi
mov dword [esp + 0x74], edi
mov dword [esp + 0x78], edi
mov dword [esp + 0x88], edi
cmp dword [esp + 0x10], edi
mov dword [esp + 0x44], edi
jle 0x5127fb
mov esi, dword [esp + 0x14]
add esi, 0x50
mov dword [esp + 0x20], esi
cmp word [esi], 1
mov dword [esp + 0x40], edi
jne 0x51265b
lea eax, [esi + 6]
push eax
lea eax, [esp + 0x38]
push eax
call fcn.004fb3f5
lea ecx, [esp + 0x34]
mov byte [esp + 0x88], 1
call fcn.00512ab3
test eax, eax
jle 0x5125e8
lea eax, [esp + 0x34]
push eax
lea edi, [esp + 0x70]
mov dword [esp + 0x44], 1
call fcn.004f8d8b
xor edi, edi
mov byte [esp + 0x88], 0
mov eax, dword [esp + 0x34]
add eax, 0xfffffff0
call fcn.004f7bea
jmp 0x5127c3
xor esi, esi
inc dword [esp + 0x24]
cmp dword [esp + 0x24], 3
mov dword [esp + 0x10], esi
jne 0x512635
mov ecx, dword [0x53c018]
cmp ecx, esi
je 0x512631
mov eax, dword [ecx]
call dword [eax]
mov ecx, dword [0x53c018]
push dword [0x53c530]
mov eax, dword [ecx]
call dword [eax + 0x3c]
mov dword [esp + 0x24], esi
cmp dword [ebx + 0x18], esi
push 0x32
pop edi
jne 0x512a06
push 0x14
call dword [0x4f62a4]
dec edi
je 0x512a06
cmp dword [ebx + 0x18], 0
je 0x512641
jmp 0x512a06
mov eax, dword [esp + 0x20]
movzx edi, word [eax]
and dword [esp + 0x4c], 0
mov eax, edi
imul eax, eax, 0x218
mov dword [esp + 0x50], eax
xor ecx, ecx
mov esi, 0x218
mov eax, edi
mov edx, esi
mul edx
seto cl
mov dword [esp + 0x1c], 1
neg ecx
or ecx, eax
push ecx
call 0x5b87ef
and dword [esp + 0x2c], 0
pop ecx
mov ecx, dword [0x53c018]
mov edx, dword [ecx]
lea edi, [esp + 0x28]
push edi
lea edi, [esp + 0x54]
push edi
push eax
mov dword [esp + 0x48], eax
mov eax, dword [esp + 0x2c]
add eax, 0xffffffb0
push eax
call dword [edx + 0x18]
test eax, eax
jne 0x5127b3
and dword [esp + 0x2c], eax
cmp dword [esp + 0x28], eax
jle 0x512731
mov edi, dword [esp + 0x3c]
add edi, 0x1a
push edi
lea eax, [esp + 0x4c]
push eax
call fcn.004fb3f5
lea ecx, [esp + 0x48]
mov byte [esp + 0x88], 2
call fcn.00512ab3
test eax, eax
jne 0x5126fc
and dword [esp + 0x1c], eax
test eax, eax
jl 0x512706
mov dword [esp + 0x4c], 1
mov byte [esp + 0x88], 0
mov eax, dword [esp + 0x48]
add eax, 0xfffffff0
call fcn.004f7bea
inc dword [esp + 0x2c]
mov eax, dword [esp + 0x2c]
add edi, esi
cmp eax, dword [esp + 0x28]
jl 0x5126d6
cmp dword [esp + 0x4c], 0
jne 0x512736
and dword [esp + 0x1c], 0
cmp dword [esp + 0x1c], 0
je 0x5127b3
and dword [esp + 0x1c], 0
cmp dword [esp + 0x28], 0
jle 0x5127ab
mov eax, dword [esp + 0x3c]
add eax, 0x1a
mov dword [esp + 0x2c], eax
push dword [esp + 0x2c]
lea eax, [esp + 0x3c]
push eax
call fcn.004fb3f5
lea ecx, [esp + 0x38]
mov byte [esp + 0x88], 3
call fcn.00512ab3
test eax, eax
jl 0x512785
lea eax, [esp + 0x38]
push eax
lea edi, [esp + 0x70]
call fcn.004f8d8b
mov byte [esp + 0x88], 0
mov eax, dword [esp + 0x38]
add eax, 0xfffffff0
call fcn.004f7bea
inc dword [esp + 0x1c]
mov eax, dword [esp + 0x1c]
add dword [esp + 0x2c], esi
cmp eax, dword [esp + 0x28]
jl 0x512754
mov dword [esp + 0x40], 1
push dword [esp + 0x3c]
call 0x5b9b0d
mov esi, dword [esp + 0x24]
pop ecx
xor edi, edi
cmp dword [esp + 0x40], edi
je 0x5127df
mov ecx, dword [0x53c018]
mov eax, dword [ecx]
lea edx, [esi - 0x50]
push edx
call dword [eax + 0x1c]
mov dword [ebx + 0x20], 1
add esi, 0x454
inc dword [esp + 0x44]
mov eax, dword [esp + 0x44]
cmp eax, dword [esp + 0x10]
mov dword [esp + 0x20], esi
jl 0x51259f
xor esi, esi
cmp dword [esp + 0x70], edi
je 0x512822
mov eax, dword [esp + 0x74]
sub eax, dword [esp + 0x70]
sar eax, 2
cmp esi, eax
jae 0x512822
mov eax, dword [esp + 0x70]
push dword [eax + esi*4]
call dword [0x4f6320]
inc esi
jmp 0x5127fd
or dword [esp + 0x88], 0xffffffff
lea esi, [esp + 0x6c]
call fcn.004fb731
xor edi, edi
mov dword [esp + 0x4c], edi
cmp dword [ebx + 0x20], edi
jne 0x512a06
push ebx
mov dword [esp + 0x30], edi
call dword [fcn.004f62dc]
cmp dword [ebx + 0x20], edi
jne 0x5129ff
lea eax, [ebx + 0x34]
mov dword [esp + 0x1c], edi
mov dword [esp + 0x20], eax
call fcn.0050b3c5
test eax, eax
jbe 0x51292f
mov esi, dword [esp + 0x1c]
mov edi, dword [esp + 0x20]
call fcn.0050701f
push dword [eax]
push ebx
call fcn.00516e1d
test eax, eax
je 0x512916
cmp dword [eax + 0x30], 2
jge 0x512916
mov ecx, dword [esp + 0x14]
and dword [esp + 0x40], 0
cmp dword [esp + 0x10], 0
mov dword [esp + 0x44], ecx
jle 0x5128cf
mov edi, dword [esp + 0x44]
push 0xa
pop ecx
lea esi, [eax + 4]
xor edx, edx
repe cmpsd dword [esi], dword es:[edi]
je 0x512916
add dword [esp + 0x44], 0x454
inc dword [esp + 0x40]
mov ecx, dword [esp + 0x40]
cmp ecx, dword [esp + 0x10]
jl 0x5128a9
push dword [eax]
push ebx
call fcn.00515eb9
test eax, eax
je 0x5128e3
mov dword [esp + 0x2c], 1
push dword [esp + 0x1c]
mov edi, dword [esp + 0x24]
lea esi, [esp + 0x58]
call fcn.00518b04
lea ebx, [esp + 0x60]
call fcn.00521398
push dword [eax + 4]
mov esi, dword [esp + 0x24]
push dword [eax]
lea edi, [esp + 0x6c]
call fcn.00518b78
dec dword [esp + 0x1c]
mov ebx, dword [ebp + 8]
mov eax, dword [esp + 0x20]
inc dword [esp + 0x1c]
call fcn.0050b3c5
cmp dword [esp + 0x1c], eax
jb 0x51286e
xor edi, edi
cmp dword [esp + 0x10], edi
mov eax, dword [esp + 0x14]
mov dword [esp + 0x1c], eax
mov dword [esp + 0x44], edi
jle 0x5129d6
mov eax, dword [esp + 0x20]
call fcn.0050b3c5
xor esi, esi
test eax, eax
mov dword [esp + 0x50], eax
jle 0x512978
mov edi, dword [esp + 0x20]
call fcn.0050701f
push dword [esp + 0x1c]
mov edi, eax
push ebx
call fcn.00516c50
cmp dword [edi], eax
je 0x5129ae
inc esi
cmp esi, dword [esp + 0x50]
jl 0x512958
push dword [esp + 0x1c]
push ebx
call fcn.0051594f
test eax, eax
je 0x5129bc
push dword [esp + 0x1c]
push ebx
call fcn.00516c50
push eax
push 2
push 0x467
push dword [ebx + 0x90]
call dword [fcn.004f6470]
mov dword [esp + 0x2c], 1
jmp 0x5129bc
mov eax, dword [esp + 0x1c]
push ebx
call fcn.00516152
mov dword [esp + 0x2c], eax
add dword [esp + 0x1c], 0x454
inc dword [esp + 0x44]
mov eax, dword [esp + 0x44]
cmp eax, dword [esp + 0x10]
jl 0x512945
cmp dword [esp + 0x2c], 0
je 0x5129e3
push ebx
call fcn.00511638
mov ecx, ebx
call fcn.00516081
push 0
push 0xa
push 0x467
push dword [ebx + 0x90]
call dword [fcn.004f6470]
push ebx
call dword [fcn.004f62cc]
cmp dword [ebx + 0x18], 0
je 0x512317
push dword [esp + 0x14]
call 0x5b9b0d
pop ecx
mov ecx, dword [esp + 0x80]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4