Function at 0x1005deb0
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x10
mov eax, dword [esi + 0x174]
mov ecx, dword [esp + 0x1c]
mov dword [esp + 4], eax
xor eax, eax
add ecx, dword [esi + 0x38]
push ebx
adc eax, dword [esi + 0x3c]
push ebp
mov ebp, dword [esp + 0x20]
push edi
cmp eax, 0xf
ja 0x1005e0d5
jb 0x1005dee4
cmp ecx, 0xffffffe0
ja 0x1005e0d5
cmp dword [esi + 0x16c], 0
mov dword [esi + 0x38], ecx
mov dword [esi + 0x3c], eax
je 0x1005df0d
lea ecx, [esi + 0x60]
push ecx
lea edx, [esi + 0x40]
push edx
call fcn.1005d220
add esp, 8
mov dword [esi + 0x16c], 0
movzx ebx, byte [esi + 0xc]
movzx eax, byte [esi + 0xd]
movzx ecx, byte [esi + 0xe]
movzx edx, byte [esi + 0xf]
mov edi, dword [esi + 0x168]
shl ebx, 8
or ebx, eax
shl ebx, 8
or ebx, ecx
shl ebx, 8
or ebx, edx
test edi, edi
je 0x1005df78
cmp dword [esp + 0x28], 0
je 0x1005df60
mov al, byte [edi + esi + 0x10]
mov ecx, dword [esp + 0x20]
xor al, byte [ecx]
dec dword [esp + 0x28]
mov byte [ebp], al
xor byte [edi + esi + 0x40], al
inc ecx
inc edi
inc ebp
and edi, 0xf
mov dword [esp + 0x20], ecx
jne 0x1005df36
jmp 0x1005df68
test edi, edi
jne 0x1005e0c6
lea eax, [esi + 0x60]
push eax
lea ecx, [esi + 0x40]
push ecx
call fcn.1005d220
add esp, 8
mov ecx, dword [esp + 0x28]
cmp ecx, 0xc00
jb 0x1005e000
mov eax, 0xaaaaaaab
mul ecx
shr edx, 0xb
mov dword [esp + 0x14], edx
mov edx, dword [esp + 0x10]
mov eax, dword [esp + 0x20]
push esi
push edx
push 0xc0
push ebp
push eax
call dword [esp + 0x40]
add ebx, 0xc0
mov eax, ebx
shr eax, 8
add esp, 0x14
mov byte [esi + 0xe], al
push 0xc00
lea eax, [esi + 0x60]
mov ecx, ebx
shr ecx, 0x18
push eax
mov edx, ebx
lea eax, [esi + 0x40]
mov byte [esi + 0xc], cl
shr edx, 0x10
push eax
mov ecx, ebp
mov byte [esi + 0xd], dl
mov byte [esi + 0xf], bl
call fcn.1005d3a0
mov eax, 0xc00
add dword [esp + 0x2c], eax
sub dword [esp + 0x34], eax
add esp, 0xc
add ebp, eax
sub dword [esp + 0x14], 1
jne 0x1005df96
mov ecx, dword [esp + 0x28]
mov eax, ecx
and eax, 0xfffffff0
mov dword [esp + 0x14], eax
je 0x1005e06c
mov ecx, dword [esp + 0x10]
mov edx, dword [esp + 0x20]
push esi
push ecx
shr eax, 4
push eax
push ebp
push edx
mov dword [esp + 0x2c], eax
call dword [esp + 0x40]
add ebx, dword [esp + 0x2c]
add esp, 0x14
mov eax, ebx
shr eax, 0x18
mov byte [esi + 0xc], al
mov eax, dword [esp + 0x14]
add dword [esp + 0x20], eax
sub dword [esp + 0x28], eax
push eax
mov ecx, ebx
shr ecx, 0x10
mov byte [esi + 0xd], cl
lea eax, [esi + 0x60]
push eax
lea ecx, [esi + 0x40]
mov edx, ebx
shr edx, 8
push ecx
mov ecx, ebp
mov byte [esi + 0xe], dl
mov byte [esi + 0xf], bl
call fcn.1005d3a0
mov ecx, dword [esp + 0x34]
add esp, 0xc
add ebp, dword [esp + 0x14]
test ecx, ecx
je 0x1005e0c6
mov edx, dword [esp + 0x10]
mov ecx, dword [esi + 0x170]
push edx
lea eax, [esi + 0x10]
push eax
push esi
call ecx
inc ebx
mov edx, ebx
shr edx, 0x18
mov ecx, ebx
shr ecx, 8
mov byte [esi + 0xc], dl
mov edx, dword [esp + 0x2c]
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, ebp
mov al, byte [esi + edi + 0x10]
xor al, byte [edx + ecx]
mov ebx, dword [esp + 0x28]
mov byte [ecx], al
xor byte [esi + edi + 0x40], al
dec ebx
inc edi
inc ecx
mov dword [esp + 0x28], ebx
test ebx, ebx
jne 0x1005e0aa
mov dword [esi + 0x168], edi
xor eax, eax
pop edi
pop ebp
pop ebx
add esp, 0x10
ret
pop edi
pop ebp
or eax, 0xffffffff
pop ebx
add esp, 0x10
ret