Function at 0x508a30
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xb0
mov eax, dword [0x5be9a0]
xor eax, ebp
mov dword [ebp - 8], eax
mov eax, dword [ebp + 8]
push ebx
push esi
push edi
mov edi, edx
mov edx, dword [edi]
mov dword [ebp - 0xa4], eax
mov dword [ebp - 0xa8], ecx
mov dword [ebp - 0x10], edx
xor esi, esi
lea ebx, [edi + 4]
mov eax, dword [ebp + 0xc]
push eax
push ebx
call fcn.0045ddd0
mov dword [ebp + esi*4 - 0x54], eax
inc esi
add esp, 8
add ebx, 0xc
cmp esi, dword [edi]
jbe 0x508a61
mov ecx, dword [ebp - 0x10]
test ecx, ecx
jle 0x508a8d
cmp dword [ebp + ecx*4 - 0x54], 0
jne 0x508a8d
dec ecx
test ecx, ecx
jg 0x508a81
mov edx, dword [edi]
mov dword [ebp - 0x10], ecx
mov eax, dword [ebp + edx*4 - 0x54]
mov edx, dword [ebp - 0xa8]
mov dword [edx], eax
xor eax, eax
test ecx, ecx
je 0x508cbf
mov ebx, dword [ebp - 0x54]
mov dword [ebp - 0xa0], eax
test ebx, ebx
jne 0x508b0a
lea eax, [ebx + 1]
cmp ecx, eax
jb 0x508acc
lea esp, [esp]
cmp dword [ebp + eax*4 - 0x54], 0
jne 0x508acc
inc eax
cmp eax, ecx
jbe 0x508ac0
mov edx, eax
cmp eax, ecx
ja 0x508ae7
lea ecx, [ebp - 0x54]
mov esi, dword [ebp + eax*4 - 0x54]
mov dword [ecx], esi
inc eax
add ecx, 4
cmp eax, dword [ebp - 0x10]
jbe 0x508ad5
mov ebx, dword [ebp - 0x54]
mov edi, dword [ebp - 0xa4]
sub eax, edx
lea ecx, [eax - 1]
mov dword [edi], 0
mov eax, dword [ebp - 0xa0]
inc eax
mov dword [ebp - 0x10], ecx
mov dword [ebp - 0xa0], eax
jmp 0x508b10
mov edi, dword [ebp - 0xa4]
test ecx, ecx
je 0x508cbf
cmp ecx, 1
jne 0x508bcd
cmp dword [ebp + 0x10], 0
jne 0x508bbb
mov ecx, dword [ebp - 0x50]
cmp ecx, 1
je 0x508b8c
mov esi, dword [ebp + 0xc]
push esi
mov eax, ecx
call fcn.00506860
sub esi, ebx
mul esi
add esp, 4
mov dword [ebp - 0xac], eax
mov dword [ebp - 0xa8], edx
lea ecx, [ebp - 0xac]
mov eax, dword [ecx]
mov edx, dword [ecx + 4]
div dword [ebp + 0xc]
mov dword [ebp - 0xa4], edx
mov eax, dword [ebp - 0xa0]
mov ecx, dword [ebp - 0xa4]
mov dword [edi + eax*4], ecx
mov eax, dword [ebp - 0xa0]
inc eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.004bc40c
mov esp, ebp
pop ebp
ret
test ebx, ebx
jne 0x508bad
xor ecx, ecx
mov dword [edi + eax*4], ecx
mov eax, dword [ebp - 0xa0]
inc eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.004bc40c
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp + 0xc]
sub ecx, ebx
mov dword [edi + eax*4], ecx
mov eax, dword [ebp - 0xa0]
inc eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.004bc40c
mov esp, ebp
pop ebp
ret
mov esi, dword [ebp + 0xc]
cmp esi, 2
jne 0x508c10
xor esi, esi
xor edx, edx
lea esp, [esp]
xor esi, dword [ebp + edx*4 - 0x54]
inc edx
cmp edx, ecx
jbe 0x508be0
test esi, esi
jne 0x508cbf
mov dword [edi + eax*4], 1
mov eax, dword [ebp - 0xa0]
inc eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.004bc40c
mov esp, ebp
pop ebp
ret
push esi
lea edx, [esi - 1]
push edx
lea eax, [ebp - 0x9c]
push 0
push eax
lea ecx, [ebp - 0x54]
call fcn.005074f0
add esp, 0x10
mov eax, dword [ebp - 0x9c]
mov edx, dword [ebp + 0xc]
sub eax, 1
lea edx, [eax + edx]
cmovae edx, eax
mov dword [ebp - 0xa4], edx
mov eax, dword [ebp - 0x58]
mov ecx, dword [ebp - 0xa4]
mov dword [ebp - 0x9c], ecx
test eax, eax
jle 0x508c63
cmp dword [ebp + eax*4 - 0x9c], 0
jne 0x508c63
dec eax
test eax, eax
jg 0x508c54
push esi
lea edx, [ebp - 0x54]
mov dword [ebp - 0x58], eax
push edx
lea eax, [ebp - 0x9c]
push eax
call fcn.00507760
mov eax, dword [ebp - 0x58]
add esp, 0xc
cmp eax, 1
jb 0x508cb9
cmp dword [ebp + 0x10], 0
jne 0x508cb9
push esi
lea ecx, [ebp - 0x9c]
push ecx
lea edx, [ebp - 0xa0]
push edx
push 0
push edi
call fcn.00508450
mov eax, dword [ebp - 0xa0]
add esp, 0x14
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.004bc40c
mov esp, ebp
pop ebp
ret
add eax, dword [ebp - 0xa0]
mov ecx, dword [ebp - 8]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004bc40c
mov esp, ebp
pop ebp
ret