Function at 0x1004cfd0
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x24
push ebx
push ebp
mov ebp, dword [esp + 0x3c]
push esi
mov esi, dword [esp + 0x34]
push edi
mov eax, dword [esi]
mov edi, dword [esi + 0x6008]
mov ebx, dword [esi + 4]
mov dword [esp + 0x10], eax
lea eax, [esi + 8]
mov dword [esp + 0x20], eax
lea eax, [esi + 0x2008]
mov dword [esp + 0x38], eax
lea eax, [edi*4]
push eax
push 0
push ebp
mov dword [esp + 0x20], ebx
call fcn.10058d80
add esp, 0xc
cmp dword [esp + 0x10], 0
je 0x1004d1d1
test ebx, ebx
je 0x1004d1d1
cmp dword [esi + 0x600c], 0
je 0x1004d111
mov ecx, dword [esp + 0x3c]
xor eax, eax
mov dword [esp + 0x1c], eax
mov dword [esp + 0x18], ecx
test ecx, ecx
jle 0x1004d1d1
lea edx, [edi - 1]
lea esi, [ebp - 4]
mov dword [esp + 0x30], edx
lea esi, [esi + edi*4]
lea edi, [edx*4]
mov dword [esp + 0x28], esi
mov dword [esp + 0x2c], edi
mov edi, dword [esp + 0x40]
mov dword [esp + 0x24], edi
mov edi, dword [esp + 0x20]
mov ebx, dword [esp + 0x24]
mov eax, dword [ebx + eax*4]
xor eax, dword [esi]
mov ebx, dword [esp + 0x14]
je 0x1004d0da
mov esi, dword [esp + 0x10]
mov esi, dword [esi + eax*4]
mov eax, edx
test eax, eax
jle 0x1004d0c9
lea edx, [ebp - 4]
mov ebp, dword [esp + 0x38]
lea edx, [edx + eax*4]
nop word [eax + eax]
cmp word [edi + eax*2], 0
je 0x1004d0b4
mov ecx, dword [ebp + eax*4]
add ecx, esi
mov ecx, dword [ebx + ecx*4]
xor ecx, dword [edx]
jmp 0x1004d0b6
mov ecx, dword [edx]
mov dword [edx + 4], ecx
dec eax
sub edx, 4
test eax, eax
jg 0x1004d0a0
mov ebp, dword [esp + 0x44]
mov ecx, dword [esp + 0x18]
mov eax, dword [esp + 0x38]
mov eax, dword [eax]
add eax, esi
mov esi, dword [esp + 0x28]
mov eax, dword [ebx + eax*4]
jmp 0x1004d0f1
push dword [esp + 0x2c]
lea eax, [ebp + 4]
push ebp
push eax
call fcn.10058800
mov ecx, dword [esp + 0x24]
add esp, 0xc
xor eax, eax
mov edx, dword [esp + 0x30]
mov dword [ebp], eax
mov eax, dword [esp + 0x1c]
inc eax
mov dword [esp + 0x1c], eax
cmp eax, ecx
jl 0x1004d074
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x24
ret
mov eax, dword [esp + 0x3c]
xor esi, esi
mov dword [esp + 0x1c], esi
test eax, eax
jle 0x1004d1d1
mov eax, dword [esp + 0x40]
lea ecx, [edi - 1]
lea edx, [ebp - 4]
mov dword [esp + 0x2c], ecx
lea edx, [edx + edi*4]
lea ebx, [ecx*4]
mov dword [esp + 0x28], edx
mov dword [esp + 0x30], ebx
mov eax, dword [eax + esi*4]
xor eax, dword [edx]
je 0x1004d1a3
mov edx, dword [esp + 0x10]
mov ebx, dword [edx + eax*4]
mov edx, ecx
test edx, edx
jle 0x1004d18e
mov edi, dword [esp + 0x38]
lea esi, [edx*4]
add esi, ebp
sub edi, ebp
mov ebp, dword [esp + 0x14]
nop word [eax + eax]
mov eax, dword [edi + esi]
lea esi, [esi - 4]
add eax, ebx
dec edx
mov eax, dword [ebp + eax*4]
xor eax, dword [esi]
mov dword [esi + 4], eax
test edx, edx
jg 0x1004d170
mov ebp, dword [esp + 0x44]
mov esi, dword [esp + 0x1c]
mov eax, dword [esp + 0x38]
mov ecx, dword [esp + 0x14]
mov eax, dword [eax]
add eax, ebx
mov ebx, dword [esp + 0x30]
mov eax, dword [ecx + eax*4]
jmp 0x1004d1b3
push ebx
lea eax, [ebp + 4]
push ebp
push eax
call fcn.10058800
add esp, 0xc
xor eax, eax
mov ecx, dword [esp + 0x2c]
inc esi
mov edx, dword [esp + 0x28]
mov dword [ebp], eax
mov eax, dword [esp + 0x40]
mov dword [esp + 0x1c], esi
cmp esi, dword [esp + 0x3c]
jl 0x1004d143
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x24
ret