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

Disassembly:
sub esp, 0x90
push ebx
push ebp
push esi
push edi
mov edi, dword [esp + 0xa4]
mov esi, dword [edi + 0xc]
mov ecx, dword [edi]
mov dword [esp + 0x3c], 0xffffffff
movzx eax, byte [esi + 0x10]
mov edx, dword [ecx + 4]
lea eax, [eax + eax*4]
shl eax, 4
mov ebp, dword [eax + edx + 0x54]
lea ebx, [eax + edx + 8]
mov eax, dword [ebx + 0x10]
mov edx, dword [edi + 4]
mov dword [esp + 0x14], 0
mov dword [esp + 0x2c], 1
mov dword [esp + 0x28], ecx
mov dword [esp + 0x20], ebx
mov dword [esp + 0x24], eax
mov dword [esp + 0x30], edx
test ebp, ebp
je 0x5160d6
mov dword [esp + 0x18], ebp
jmp 0x516170
test byte [eax + 0x24], 0x20
je 0x5160ea
mov edx, dword [eax + 8]
mov dword [esp + 0x18], edx
mov ebp, edx
jmp 0x516170
push 0x3c
lea eax, [esp + 0x68]
push 0
push eax
call fcn.0052e300
mov ecx, 1
mov word [esp + 0xa2], cx
mov edx, ecx
lea eax, [esp + 0x48]
mov dword [esp + 0x74], eax
mov eax, dword [esp + 0x30]
lea ecx, [esp + 0x44]
mov dword [esp + 0x78], ecx
mov word [esp + 0xa4], dx
mov byte [esp + 0xa6], 5
mov dword [esp + 0x7c], eax
mov dx, word [eax + 0x2e]
mov word [esp + 0xa0], dx
mov ax, word [eax + 0x2c]
xor ecx, ecx
add esp, 0xc
mov word [esp + 0x38], ax
mov word [esp + 0x3a], cx
test byte [ebx + 0x28], 1
jne 0x51615e
mov edx, dword [ebx + 0x10]
mov eax, dword [edx + 8]
mov dword [esp + 0x78], eax
mov eax, dword [esp + 0x24]
lea ecx, [esp + 0x64]
mov dword [esp + 0x18], ecx
mov ebp, ecx
mov ecx, dword [esp + 0x28]
movzx edx, word [eax + 0x2c]
cmp dx, 0xa
mov dword [esp + 0x34], edx
jg 0x516188
mov dword [esp + 0x1c], 0
jmp 0x5161a9
movsx eax, dx
cdq
push edx
push eax
call fcn.004b3900
mov ecx, dword [esp + 0x30]
add esp, 8
sub ax, 0x21
movzx edx, ax
mov eax, dword [esp + 0x24]
mov dword [esp + 0x1c], edx
cmp dword [edi + 0x10], 0
jne 0x516314
test byte [ecx + 0x2c], 0x20
jne 0x516314
mov ecx, dword [ecx]
mov edx, dword [ecx]
test dword [edx + 0x18], 0x8000
je 0x516314
cmp dword [ebx + 0x4c], 0
jne 0x516314
mov ecx, dword [ebx + 0x28]
test cl, 1
jne 0x516314
test byte [eax + 0x24], 0x20
jne 0x516314
test cl, 0x28
jne 0x516314
mov eax, dword [esp + 0x30]
mov edi, dword [eax + 0x14]
mov eax, dword [eax + 0xc]
lea ebx, [eax + eax*2]
mov eax, dword [esp + 0x14]
shl ebx, 4
add ebx, edi
lea ecx, [ecx]
cmp edi, ebx
jae 0x5162f7
mov eax, dword [esi + 8]
mov ecx, dword [esi + 0xc]
and eax, dword [edi + 0x20]
and ecx, dword [edi + 0x24]
or eax, ecx
jne 0x5162dd
push eax
push eax
mov eax, dword [esp + 0x28]
mov ecx, edi
call fcn.00513e20
add esp, 8
test eax, eax
je 0x5162dd
mov eax, 1
xor ecx, ecx
mov edx, eax
mov word [esi + 0x18], ax
mov eax, dword [esi + 0x30]
mov word [esi + 0x28], dx
mov edx, dword [esp + 0x34]
mov word [esi + 0x2a], cx
mov dword [esi + 0x20], ecx
mov ecx, dword [esp + 0x1c]
mov dword [eax], edi
lea eax, [ecx + edx + 4]
mov edx, dword [esp + 0x24]
mov word [esi + 0x12], ax
cmp dword [edx + 0xc], 0
jne 0x516288
test byte [edx + 0x24], 2
jne 0x516288
add eax, 0x18
mov word [esi + 0x12], ax
cmp word [esi + 0x12], 0
jge 0x516295
xor eax, eax
mov word [esi + 0x12], ax
mov edx, 0x2b
mov eax, edx
mov word [esi + 0x16], dx
call fcn.004b38b0
mov word [esi + 0x14], ax
mov dword [esi + 0x24], 0x4000
mov ecx, dword [edi + 0x24]
mov eax, dword [edi + 0x20]
or ecx, dword [esp + 0xac]
or eax, dword [esp + 0xa8]
mov dword [esi + 4], ecx
mov ecx, dword [esp + 0xa4]
push esi
mov dword [esi], eax
call fcn.00515330
add esp, 4
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x14]
add edi, 0x30
test eax, eax
je 0x516210
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x90
ret
test eax, eax
jne 0x516668
mov edi, dword [esp + 0xa4]
mov ebx, dword [esp + 0x20]
jmp 0x516314
mov ebp, dword [esp + 0x18]
test ebp, ebp
je 0x516664
mov eax, dword [ebp + 0x24]
test eax, eax
je 0x51633d
mov edx, dword [esp + 0x30]
push eax
mov eax, dword [ebx + 0x30]
push edx
push eax
call fcn.00515fd0
add esp, 0xc
test eax, eax
je 0x51664d
mov ecx, dword [ebp + 8]
movzx ebx, word [ecx]
xor edx, edx
xor eax, eax
xor ecx, ecx
mov word [esi + 0x18], dx
mov word [esi + 0x1a], ax
mov word [esi + 0x2a], dx
mov edx, dword [esp + 0xa8]
mov word [esi + 0x28], ax
mov eax, dword [esp + 0xac]
mov word [esi + 0x1c], cx
mov byte [esi + 0x11], cl
mov word [esi + 0x12], cx
mov ecx, dword [esp + 0x20]
mov dword [esi], edx
mov dword [esi + 4], eax
mov word [esi + 0x16], bx
mov dword [esi + 0x20], ebp
mov edx, dword [ecx + 0x30]
push edx
push ebp
push edi
mov dword [esp + 0x40], ebx
call fcn.00515e70
add esp, 0xc
cmp dword [ebp + 0x2c], 0
mov dword [esp + 0x1c], eax
jg 0x5163e2
mov ecx, dword [esp + 0x30]
neg eax
sbb al, al
and al, byte [esp + 0x2c]
push ebx
mov byte [esi + 0x11], al
lea eax, [ebx + 0x10]
push esi
push ecx
mov dword [esi + 0x24], 0x100
mov word [esi + 0x14], ax
call fcn.00515490
add esp, 0xc
push esi
mov ecx, edi
call fcn.00515330
add esp, 4
mov word [esi + 0x16], bx
test eax, eax
jne 0x516668
jmp 0x516618
test byte [ebp + 0x38], 0x20
je 0x5163f5
xor ecx, ecx
mov dword [esi + 0x24], 0x240
xor edi, edi
jmp 0x516421
mov eax, ebp
call fcn.00515f90
mov ecx, eax
mov eax, dword [esp + 0x20]
mov edi, edx
not ecx
and ecx, dword [eax + 0x40]
not edi
and edi, dword [eax + 0x44]
mov edx, ecx
or edx, edi
mov eax, 0x240
je 0x51641e
mov eax, 0x200
mov dword [esi + 0x24], eax
cmp dword [esp + 0x1c], 0
jne 0x516483
mov eax, dword [esp + 0x24]
test byte [eax + 0x24], 0x20
jne 0x516483
cmp dword [ebp + 0x24], 0
jne 0x516483
mov edx, ecx
or edx, edi
jne 0x516611
test byte [ebp + 0x38], 4
jne 0x516611
mov dx, word [ebp + 0x30]
cmp dx, word [eax + 0x2e]
jge 0x516611
mov eax, dword [esp + 0x28]
test byte [eax + 0x2c], 4
jne 0x516611
cmp dword [0x5eb9f0], 0
je 0x516611
mov eax, dword [eax]
mov edx, dword [eax]
test byte [edx + 0x40], 0x40
jne 0x516611
mov eax, dword [esp + 0x1c]
mov edx, dword [esp + 0x18]
neg eax
sbb al, al
and al, byte [esp + 0x2c]
mov byte [esi + 0x11], al
movsx edx, word [edx + 0x30]
mov eax, edx
shl eax, 4
sub eax, edx
mov edx, dword [esp + 0x24]
movsx ebp, word [edx + 0x2e]
cdq
idiv ebp
or ecx, edi
lea eax, [eax + ebx + 1]
mov word [esi + 0x14], ax
je 0x5165e6
mov edx, dword [esp + 0x20]
mov eax, dword [edx + 0x30]
lea ecx, [ebx + 0x10]
movzx ebp, cx
mov ecx, dword [esp + 0x28]
cmp dword [ecx + 0x5c], 0
mov dword [esp + 0x14], eax
mov dword [esp + 0x1c], 0
jle 0x51657c
xor ebx, ebx
mov edx, dword [esp + 0x28]
mov edi, dword [edx + 0x64]
mov ecx, dword [edi + ebx]
mov edx, dword [esp + 0x18]
xor eax, eax
mov dword [esp + 0x44], eax
mov dword [esp + 0x58], eax
mov dword [esp + 0x40], eax
mov dword [esp + 0x48], eax
mov dword [esp + 0x4c], eax
mov dword [esp + 0x50], eax
mov dword [esp + 0x54], eax
mov eax, dword [esp + 0x14]
add edi, ebx
mov dword [esp + 0x60], eax
lea eax, [esp + 0x5c]
mov dword [esp + 0x5c], edx
mov dword [esp + 0x44], 0x4e62c0
mov dword [esp + 0x58], eax
test ecx, ecx
je 0x516541
push ecx
lea ecx, [esp + 0x44]
push ecx
call fcn.004dda50
add esp, 8
cmp byte [esp + 0x54], 0
jne 0x516578
movzx eax, word [edi + 8]
test ax, ax
jg 0x516555
add ebp, eax
jmp 0x51655f
dec ebp
test byte [edi + 0xc], 0x82
je 0x51655f
sub ebp, 0x13
mov eax, dword [esp + 0x1c]
mov edx, dword [esp + 0x28]
inc eax
add ebx, 0x30
cmp eax, dword [edx + 0x5c]
mov dword [esp + 0x1c], eax
jl 0x5164e5
mov ebx, dword [esp + 0x34]
movzx ecx, word [esi + 0x14]
cmp cx, bp
jl 0x5165b3
movsx edx, bp
movsx eax, cx
lea edi, [edx + 0x31]
cmp eax, edi
jle 0x516597
movzx eax, cx
jmp 0x5165e2
lea edi, [edx + 0x1f]
cmp eax, edi
jle 0x5165a4
inc ecx
movzx eax, cx
jmp 0x5165e2
sub eax, edx
movzx ax, byte [eax + str._n_n_t_t_b_b_a_a_a]
add ax, cx
jmp 0x5165df
movsx ecx, cx
movsx eax, bp
lea edx, [ecx + 0x31]
cmp eax, edx
jle 0x5165c5
movzx eax, bp
jmp 0x5165e2
lea edx, [ecx + 0x1f]
cmp eax, edx
jle 0x5165d2
inc ebp
movzx eax, bp
jmp 0x5165e2
sub eax, ecx
movzx ax, byte [eax + str._n_n_t_t_b_b_a_a_a]
add ax, bp
movzx eax, ax
mov word [esi + 0x14], ax
mov ecx, dword [esp + 0x30]
push ebx
push esi
push ecx
call fcn.00515490
mov ecx, dword [esp + 0xb0]
add esp, 0xc
push esi
call fcn.00515330
add esp, 4
mov word [esi + 0x16], bx
test eax, eax
jne 0x516668
mov ebp, dword [esp + 0x18]
mov edi, dword [esp + 0xa4]
mov ebx, dword [esp + 0x20]
push 0
push ebp
push ebx
push edi
mov dword [edi + 0x14], 0
call fcn.005157d0
add esp, 0x10
cmp dword [edi + 0x14], 1
mov dword [esp + 0x14], eax
jne 0x516645
mov ecx, dword [esp + 0x24]
or dword [ecx + 0x24], 0x100
cmp dword [ebx + 0x4c], 0
jne 0x516668
jmp 0x516651
mov eax, dword [esp + 0x14]
mov edx, dword [ebp + 0x14]
inc dword [esp + 0x2c]
mov dword [esp + 0x18], edx
test eax, eax
je 0x516310
mov eax, dword [esp + 0x14]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x90
ret