Function at 0x1005d910
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x18
mov ecx, dword [esi + 0x174]
push ebx
push ebp
push edi
mov edi, eax
mov eax, dword [esi + 0x170]
mov dword [esp + 0x14], ecx
mov ecx, dword [esp + 0x2c]
mov dword [esp + 0x18], eax
xor eax, eax
add ecx, dword [esi + 0x38]
adc eax, dword [esi + 0x3c]
cmp eax, 0xf
ja 0x1005dbc9
jb 0x1005d94c
cmp ecx, 0xffffffe0
ja 0x1005dbc9
cmp dword [esi + 0x16c], 0
mov dword [esi + 0x38], ecx
mov dword [esi + 0x3c], eax
je 0x1005d975
lea edx, [esi + 0x60]
push edx
lea eax, [esi + 0x40]
push eax
call fcn.1005d220
add esp, 8
mov dword [esi + 0x16c], 0
movzx ebx, byte [esi + 0xc]
movzx ecx, byte [esi + 0xd]
movzx edx, byte [esi + 0xe]
movzx eax, byte [esi + 0xf]
mov ebp, dword [esi + 0x168]
shl ebx, 8
or ebx, ecx
shl ebx, 8
or ebx, edx
shl ebx, 8
or ebx, eax
mov dword [esp + 0xc], ebp
test ebp, ebp
je 0x1005d9eb
cmp dword [esp + 0x2c], 0
je 0x1005d9cf
mov al, byte [esi + ebp + 0x10]
mov ecx, dword [esp + 0x28]
xor al, byte [ecx]
dec dword [esp + 0x2c]
mov byte [edi], al
xor byte [esi + ebp + 0x40], al
inc ecx
inc ebp
inc edi
and ebp, 0xf
mov dword [esp + 0x28], ecx
jne 0x1005d9a2
mov dword [esp + 0xc], ebp
jmp 0x1005d9db
mov dword [esp + 0xc], ebp
test ebp, ebp
jne 0x1005dbba
lea ecx, [esi + 0x60]
push ecx
lea edx, [esi + 0x40]
push edx
call fcn.1005d220
add esp, 8
mov ecx, dword [esp + 0x2c]
cmp ecx, 0xc00
jb 0x1005daac
mov eax, 0xaaaaaaab
mul ecx
shr edx, 0xb
lea ebp, [esi + 0x10]
mov dword [esp + 0x20], edx
mov dword [esp + 0x1c], 0xc0
mov eax, dword [esp + 0x14]
push eax
push ebp
push esi
call dword [esp + 0x24]
inc ebx
mov edx, ebx
shr edx, 0x10
mov eax, ebx
shr eax, 8
mov byte [esi + 0xd], dl
mov edx, dword [esp + 0x34]
mov ecx, ebx
shr ecx, 0x18
mov byte [esi + 0xe], al
add esp, 0xc
xor eax, eax
sub edx, edi
mov byte [esi + 0xc], cl
mov byte [esi + 0xf], bl
mov ecx, edi
mov dword [esp + 0x10], edx
jmp 0x1005da54
mov edx, dword [esp + 0x10]
mov edx, dword [edx + ecx]
xor edx, dword [eax + ebp]
add eax, 4
mov dword [ecx], edx
add ecx, 4
cmp eax, 0x10
jb 0x1005da50
add dword [esp + 0x28], 0x10
add edi, 0x10
sub dword [esp + 0x1c], 1
jne 0x1005da14
push 0xc00
lea eax, [esi + 0x60]
push eax
lea eax, [esi + 0x40]
lea ecx, [edi - 0xc00]
push eax
call fcn.1005d3a0
sub dword [esp + 0x38], 0xc00
add esp, 0xc
sub dword [esp + 0x20], 1
jne 0x1005da0c
mov ebp, dword [esp + 0xc]
mov ecx, dword [esp + 0x2c]
mov eax, ecx
and eax, 0xfffffff0
je 0x1005db64
mov dword [esp + 0xc], eax
cmp ecx, 0x10
jb 0x1005db4b
shr ecx, 4
mov dword [esp + 0x1c], ecx
jmp 0x1005dad0
mov eax, dword [esp + 0x14]
push eax
lea eax, [esi + 0x10]
push eax
push esi
call dword [esp + 0x24]
inc ebx
mov edx, ebx
shr edx, 0x10
mov eax, ebx
shr eax, 8
mov ecx, ebx
shr ecx, 0x18
mov byte [esi + 0xd], dl
mov edx, dword [esp + 0x34]
mov byte [esi + 0xe], al
add esp, 0xc
mov byte [esi + 0xc], cl
xor eax, eax
mov ecx, edi
sub edx, edi
mov byte [esi + 0xf], bl
mov dword [esp + 0x20], ecx
mov dword [esp + 0x10], edx
jmp 0x1005db15
mov edx, dword [esp + 0x10]
mov edx, dword [ecx + edx]
xor edx, dword [esi + eax + 0x10]
mov ecx, dword [esp + 0x20]
mov dword [ecx], edx
add eax, 4
add ecx, 4
mov dword [esp + 0x20], ecx
cmp eax, 0x10
jb 0x1005db11
mov eax, 0x10
add dword [esp + 0x28], eax
sub dword [esp + 0x2c], eax
add edi, eax
sub dword [esp + 0x1c], 1
jne 0x1005dad0
mov eax, dword [esp + 0xc]
push eax
mov ecx, edi
sub ecx, eax
lea eax, [esi + 0x60]
push eax
lea edx, [esi + 0x40]
push edx
call fcn.1005d3a0
mov ecx, dword [esp + 0x38]
add esp, 0xc
test ecx, ecx
je 0x1005dbba
mov eax, dword [esp + 0x14]
push eax
lea ecx, [esi + 0x10]
push ecx
push esi
call dword [esp + 0x24]
inc ebx
mov edx, ebx
shr edx, 0x18
mov ecx, ebx
shr ecx, 8
mov byte [esi + 0xc], dl
mov edx, dword [esp + 0x34]
mov eax, ebx
shr eax, 0x10
add esp, 0xc
mov byte [esi + 0xe], cl
mov byte [esi + 0xd], al
mov byte [esi + 0xf], bl
lea ecx, [edi + ebp]
sub edx, edi
mov al, byte [esi + ebp + 0x10]
xor al, byte [ecx + edx]
mov edi, dword [esp + 0x2c]
mov byte [ecx], al
xor byte [esi + ebp + 0x40], al
dec edi
inc ebp
inc ecx
mov dword [esp + 0x2c], edi
test edi, edi
jne 0x1005db9e
mov dword [esi + 0x168], ebp
xor eax, eax
pop edi
pop ebp
pop ebx
add esp, 0x18
ret
pop edi
pop ebp
or eax, 0xffffffff
pop ebx
add esp, 0x18
ret