Function at 0x8511b1
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov eax, 0x102c
push edi
push esi
push ebx
call fcn.0085d581
xor ebp, ebp
sub esp, eax
mov ebx, dword [esp + 0x1044]
mov esi, dword [esp + 0x1040]
mov eax, dword [ebx + 0xc]
mov ecx, dword [ebx + 0x18]
cmp dword [ebx + 8], ecx
sbb eax, ebp
jb 0x8515d1
mov eax, dword [esi + 0x1060]
test eax, eax
je 0x851371
cmp eax, 2
je 0x8515e5
cmp eax, 3
jne 0x8515d1
test ecx, ecx
je 0x85151e
cmp byte [esi + 0x1058], 0
mov ebp, dword [ebx + 0x14]
jne 0x851291
mov eax, dword [esi + 0x1070]
mov dword [esp + 4], ecx
mov dword [esp + 8], 0
mov dword [esp + 0xc], eax
mov dword [esp], ebp
call dword [esi + 0x1064]
mov ecx, eax
test eax, eax
jle 0x8515db
cmp dword [ebx + 0x18], eax
jb 0x85159a
cdq
add eax, dword [esi + 0x1050]
adc edx, dword [esi + 0x1054]
mov dword [esi + 0x1050], eax
mov edi, eax
mov ebp, edx
mov dword [esi + 0x1054], edx
mov eax, dword [esi + 0x1048]
mov edx, dword [esi + 0x104c]
xor eax, edi
xor edx, ebp
or edx, eax
jne 0x851283
mov dword [esi + 0x1060], 0
add esp, 0x102c
mov eax, ecx
pop ebx
pop esi
pop edi
pop ebp
ret
lea eax, [ebp + ecx]
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], eax
cmp eax, ebp
jbe 0x8515fc
lea esi, [esi]
nop
mov eax, dword [esp + 0x18]
mov ebx, 0x1000
mov edi, eax
sub edi, ebp
cmp edi, 0x1000
cmova edi, ebx
cmp eax, ebp
je 0x851531
mov ecx, dword [esi + 0x1050]
mov ebx, dword [esi + 0x1054]
xor eax, eax
lea esi, [esi]
mov edx, ecx
and edx, 3
movzx edx, byte [esi + edx + 0x1059]
xor dl, byte [ebp + eax]
mov byte [esp + eax + 0x20], dl
add eax, 1
add ecx, 1
adc ebx, 0
cmp edi, eax
ja 0x8512e1
mov eax, dword [esi + 0x1070]
mov dword [esp + 8], 0
mov dword [esp + 4], edi
mov dword [esp + 0xc], eax
lea eax, [esp + 0x20]
mov dword [esp], eax
call dword [esi + 0x1064]
mov ecx, eax
test eax, eax
jle 0x851558
cmp edi, eax
jb 0x85159a
cdq
add ebp, eax
add eax, dword [esi + 0x1050]
adc edx, dword [esi + 0x1054]
mov dword [esi + 0x1050], eax
add dword [esp + 0x1c], ecx
mov dword [esi + 0x1054], edx
cmp dword [esp + 0x18], ebp
ja 0x8512b1
mov ecx, dword [esp + 0x1c]
mov edi, eax
mov ebp, edx
jmp 0x851265
lea edi, [esi + 0x1030]
xor edx, edx
mov dword [esi + 0x1030], 0
mov dword [edi + 4], 0
mov dword [edi + 8], 0
mov word [edi + 0xc], dx
movzx ecx, byte [ebx]
shl ecx, 7
or cl, byte [esi + 0x1030]
mov byte [esi + 0x1030], cl
movzx edx, byte [ebx + 1]
shl edx, 4
and edx, 0x70
or edx, ecx
mov byte [esi + 0x1030], dl
movzx ecx, byte [ebx + 2]
and ecx, 0xf
or edx, ecx
mov byte [esi + 0x1030], dl
movzx edx, byte [ebx + 0x10]
shl edx, 7
or dl, byte [esi + 0x1031]
mov byte [esi + 0x1031], dl
test byte [ebx + 2], 8
mov ecx, dword [ebx + 8]
mov ebp, dword [ebx + 0xc]
mov byte [esp + 0x18], dl
mov edx, 0x7d
jne 0x85157c
cmp edx, ecx
mov edx, eax
sbb edx, ebp
jae 0x851582
mov edx, 0xffff
cmp edx, ecx
sbb eax, ebp
jae 0x8515ac
test ebp, ebp
js 0x8515d1
mov dword [esp + 4], ebp
lea ebp, [esi + 0x103a]
mov dword [esp], ecx
call fcn.00851f91
or byte [esi + 0x1031], 0x7f
mov dword [esi + 0x1032], eax
mov dword [esi + 0x1036], edx
cmp byte [ebx + 0x10], 0
mov eax, dword [esi + 0x1070]
je 0x851484
mov dword [esp + 8], eax
lea eax, [esi + 0x1059]
mov dword [esp + 4], 4
mov dword [esp], eax
call dword [esi + 0x106c]
test eax, eax
jne 0x85159a
mov eax, dword [esi + 0x1059]
mov byte [esi + 0x1058], 1
add ebp, 4
mov dword [ebp - 4], eax
mov eax, dword [esi + 0x1070]
mov edx, dword [ebx + 8]
mov ecx, dword [ebx + 0xc]
mov dword [esi + 0x1060], 2
mov dword [esi + 0x1040], edi
mov dword [esi + 0x1044], ebp
mov dword [esi + 0x1048], edx
mov dword [esi + 0x1050], 0
mov dword [esi + 0x1054], 0
mov dword [esi + 0x104c], ecx
mov ecx, dword [ebx + 0x18]
sub ebp, edi
mov dword [esp + 0xc], eax
xor eax, eax
test ecx, ecx
setne al
mov dword [esp + 4], ebp
mov dword [esp + 8], eax
mov dword [esp], edi
call dword [esi + 0x1064]
test eax, eax
jle 0x8515db
cmp ebp, eax
jl 0x85159a
add eax, dword [esi + 0x1040]
mov dword [esi + 0x1040], eax
cmp eax, dword [esi + 0x1044]
jne 0x8515db
mov dword [esi + 0x1060], 3
mov ecx, dword [ebx + 0x18]
test ecx, ecx
jne 0x85120a
mov edi, dword [esi + 0x1050]
mov ebp, dword [esi + 0x1054]
jmp 0x851265
mov eax, dword [esi + 0x1070]
mov dword [esp + 8], 0
mov dword [esp + 4], edi
mov dword [esp + 0xc], eax
lea eax, [esp + 0x20]
mov dword [esp], eax
call dword [esi + 0x1064]
test eax, eax
jg 0x85159a
mov eax, dword [esp + 0x1c]
mov ecx, 0xffffff9b
test eax, eax
je 0x851283
mov edi, dword [esi + 0x1050]
mov ebp, dword [esi + 0x1054]
mov ecx, eax
jmp 0x851265
cmp edx, ecx
sbb eax, ebp
jb 0x8515d1
movzx edx, byte [esp + 0x18]
lea ebp, [esi + 0x1032]
or edx, ecx
mov byte [esi + 0x1031], dl
jmp 0x85143c
add esp, 0x102c
mov ecx, 0xfffffed3
pop ebx
mov eax, ecx
pop esi
pop edi
pop ebp
ret
mov dword [esp], ecx
lea ebp, [esi + 0x1034]
call dword [fcn.00a33aa8]
or byte [esi + 0x1031], 0x7e
mov word [esi + 0x1032], ax
sub esp, 4
jmp 0x85143c
mov ecx, 0xfffffed4
jmp 0x851283
mov ecx, 0xffffff9b
jmp 0x851283
mov ebp, dword [esi + 0x1044]
mov edi, dword [esi + 0x1040]
mov eax, dword [esi + 0x1070]
jmp 0x8514c3
mov edi, dword [esi + 0x1050]
mov ebp, dword [esi + 0x1054]
xor ecx, ecx
jmp 0x851265