Function at 0x502eb0
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x454
mov eax, dword [0x6398ac]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
mov edx, dword [ebp + 0xc]
push ebx
push esi
mov dword [ebp - 0x454], eax
mov esi, 4
mov eax, dword [eax + 0x18]
cmp eax, esi
push edi
cmovl esi, eax
xor ecx, ecx
mov dword [ebp - 0x450], esi
lea eax, [edx + 8]
nop word [eax + eax]
cmp dword [eax - 8], 0
jne 0x502f2d
cmp dword [eax - 4], 0
jne 0x502f2c
cmp dword [eax], 0
jne 0x502f27
cmp dword [eax + 4], 0
jne 0x502f22
add ecx, 4
add eax, 0x10
mov dword [ebp - 0x44c], ecx
cmp ecx, 0xff
jle 0x502ef0
mov eax, 0xff
jmp 0x502f4d
add ecx, 3
jmp 0x502f2d
add ecx, 2
jmp 0x502f2d
inc ecx
mov eax, 0xff
mov dword [ebp - 0x44c], ecx
mov dword [ebp - 0x43c], eax
cmp ecx, eax
jge 0x502f53
cmp dword [edx + eax*4], 0
jne 0x502f4d
dec eax
cmp eax, ecx
jg 0x502f42
mov dword [ebp - 0x43c], eax
mov ebx, eax
xor edi, edi
sub ebx, ecx
test esi, esi
jle 0x502f8a
lea eax, [esi + esi]
mov dword [ebp - 0x440], eax
lea eax, [ebx + ebx]
mov dword [ebp - 0x438], eax
nop
mov eax, ebx
add ebx, dword [ebp - 0x438]
cdq
idiv dword [ebp - 0x440]
add eax, ecx
mov dword [ebp + edi*4 - 0x14], eax
inc edi
cmp edi, esi
jl 0x502f70
mov dword [ebp - 0x440], 0
test esi, esi
jle 0x502fbb
lea edx, [esi*4]
xor eax, eax
mov ecx, edx
lea edi, [ebp - 0x24]
shr ecx, 2
rep stosd dword es:[edi], eax
shr edx, 2
lea edi, [ebp - 0x34]
mov ecx, edx
rep stosd dword es:[edi], eax
mov ecx, dword [ebp - 0x44c]
mov eax, dword [ebp - 0x43c]
xor edi, edi
mov ebx, ecx
cmp ecx, eax
jg 0x503034
mov ecx, dword [ebp + 0xc]
nop dword [eax]
mov edx, dword [ecx + ebx*4]
mov dword [ebp - 0x438], edx
test edx, edx
je 0x50302f
lea ecx, [edi + 1]
cmp ecx, esi
jge 0x503012
mov eax, ebx
sub eax, dword [ebp + edi*4 - 0x10]
cdq
mov esi, eax
mov eax, ebx
sub eax, dword [ebp + edi*4 - 0x14]
xor esi, edx
sub esi, edx
cdq
xor eax, edx
sub eax, edx
cmp esi, eax
mov esi, dword [ebp - 0x450]
jge 0x50300c
inc ecx
inc edi
cmp ecx, esi
jl 0x502fe4
mov edx, dword [ebp - 0x438]
mov ecx, dword [ebp + 0xc]
mov eax, edx
imul eax, ebx
mov dword [ebp + ebx*4 - 0x434], edi
add dword [ebp + edi*4 - 0x34], eax
add dword [ebp + edi*4 - 0x24], edx
mov eax, dword [ebp - 0x43c]
inc ebx
cmp ebx, eax
jle 0x502fd0
xor ebx, ebx
xor ecx, ecx
xor edi, edi
mov dword [ebp - 0x444], ebx
mov dword [ebp - 0x448], ebx
mov dword [ebp - 0x438], ecx
test esi, esi
jle 0x5030a5
mov ebx, dword [ebp + edi*4 - 0x24]
test ebx, ebx
je 0x50309a
mov eax, ebx
cdq
sub eax, edx
mov ecx, eax
mov eax, dword [ebp + edi*4 - 0x34]
sar ecx, 1
add eax, ecx
cdq
idiv ebx
mov ecx, eax
mov eax, dword [ebp + edi*4 - 0x14]
sub eax, ecx
mov dword [ebp + edi*4 - 0x14], ecx
cdq
xor eax, edx
sub eax, edx
add dword [ebp - 0x444], eax
mov eax, ebx
imul eax, ecx
mov ecx, dword [ebp - 0x438]
add dword [ebp - 0x448], eax
add ecx, ebx
mov dword [ebp - 0x438], ecx
inc edi
cmp edi, esi
jl 0x503050
mov ebx, dword [ebp - 0x444]
mov eax, ecx
cdq
sub eax, edx
sar eax, 1
add eax, dword [ebp - 0x448]
cdq
idiv ecx
mov dword [ebp - 0x438], eax
cmp ebx, 5
jl 0x5030dc
mov eax, dword [ebp - 0x440]
mov ecx, dword [ebp - 0x44c]
inc eax
mov dword [ebp - 0x440], eax
cmp eax, 6
jl 0x502f94
mov ebx, dword [ebp - 0x454]
xor edi, edi
mov eax, dword [ebx + 0x2c]
imul eax, dword [ebx + 0x28]
test eax, eax
jle 0x503123
nop
mov eax, dword [ebx + 0x588c]
lea edx, [eax + edi*8]
inc edi
movzx eax, byte [edx + 4]
mov ecx, dword [ebp + eax*4 - 0x434]
mov eax, ecx
shl eax, 5
xor eax, dword [edx]
and eax, 0x60
xor dword [edx], eax
mov al, byte [ebp + ecx*4 - 0x14]
mov byte [edx + 4], al
mov eax, dword [ebx + 0x2c]
imul eax, dword [ebx + 0x28]
cmp edi, eax
jl 0x5030f0
cmp esi, 1
jle 0x503139
mov eax, dword [ebx]
test byte [eax + 0x44], 1
je 0x503139
push ebx
call fcn.00503a00
add esp, 4
push dword [ebp - 0x438]
lea eax, [ebp - 0x14]
push eax
push ebx
call fcn.00503870
mov ecx, dword [ebp - 4]
add esp, 0xc
xor ecx, ebp
pop edi
pop esi
pop ebx
call fcn.0057fc8e
mov esp, ebp
pop ebp
ret