Function at 0x507f80
Capabilities:
Encode data using xor

Disassembly:
push ecx
mov eax, dword [esp + 0x28]
push ebx
push ebp
push esi
mov esi, ecx
push edi
mov dword [esp + 0x10], esi
test eax, eax
je 0x507f9b
mov ecx, dword [esp + 0x28]
mov dword [ecx], eax
jmp 0x507fd7
mov edx, dword [esp + 0x18]
mov eax, dword [edx]
cmp eax, 0xffffffff
je 0x507fb0
test eax, eax
jne 0x507fae
xor edx, edx
jmp 0x507fb0
add edx, eax
mov ecx, 0x17b91
test edx, edx
je 0x507fd1
movsx eax, byte [edx]
test eax, eax
je 0x507fd1
xor eax, ecx
mov ecx, eax
shl ecx, 4
inc edx
add ecx, eax
movsx eax, byte [edx]
test eax, eax
jne 0x507fc0
mov edx, dword [esp + 0x28]
mov dword [edx], ecx
mov eax, dword [esp + 0x28]
mov ebp, dword [eax]
mov ebx, dword [esi + 0xc]
xor edx, edx
mov eax, ebp
div ebx
mov eax, dword [esi]
mov edi, edx
cmp eax, 0xffffffff
jne 0x507ff3
mov eax, esi
jmp 0x507ff9
test eax, eax
je 0x507ff9
add eax, esi
lea ecx, [edi + edi*2]
lea esi, [eax + ecx*4]
mov eax, dword [esi]
cmp eax, 0xffffffff
jne 0x50800a
mov ecx, esi
jmp 0x508011
test eax, eax
je 0x508015
lea ecx, [eax + esi]
test ecx, ecx
jne 0x50802f
mov edx, dword [esp + 0x20]
mov eax, dword [esp + 0x24]
mov dword [edx], edi
pop edi
mov dword [eax], 0
mov eax, esi
pop esi
pop ebp
pop ebx
pop ecx
ret 0x24
cmp eax, 0xffffffff
je 0x50808d
test eax, eax
je 0x50803a
add eax, esi
cmp eax, esi
je 0x50808d
cmp dword [esp + 0x1c], 2
je 0x50808d
mov ecx, dword [esp + 0x18]
push ebp
push ecx
lea ecx, [esi + 4]
call fcn.005077a0
test eax, eax
je 0x50808d
mov edx, dword [esp + 0x20]
mov eax, dword [esp + 0x24]
mov dword [edx], edi
mov edi, dword [esp + 0x2c]
mov dword [eax], 1
test edi, edi
je 0x508083
mov ecx, esi
call fcn.00507770
mov edx, dword [esp + 0x30]
xor ecx, ecx
cmp edi, eax
sete cl
mov dword [edx], ecx
pop edi
mov eax, esi
pop esi
pop ebp
pop ebx
pop ecx
ret 0x24
xor ebp, ebp
cmp edi, ebp
je 0x508097
sub ebx, edi
jmp 0x50809c
mov ebx, 1
mov eax, dword [esp + 0x24]
mov dword [esp + 0x38], ebp
mov dword [eax], ebp
sub edi, ebx
jns 0x5080bd
mov ecx, dword [esp + 0x10]
mov eax, dword [ecx + 0xc]
add edi, eax
sub eax, ebx
lea edx, [eax + eax*2]
lea esi, [esi + edx*4]
jmp 0x5080cb
lea eax, [ebx*4]
sub eax, ebx
neg eax
lea esi, [esi + eax*4]
mov eax, dword [esi]
cmp eax, 0xffffffff
jne 0x5080d6
mov ecx, esi
jmp 0x5080dd
test eax, eax
je 0x508142
lea ecx, [eax + esi]
test ecx, ecx
je 0x508142
cmp eax, 0xffffffff
je 0x5080f0
test eax, eax
je 0x5080ec
add eax, esi
cmp eax, esi
jne 0x5080fc
test ebp, ebp
jne 0x5080a6
mov ebp, edi
mov dword [esp + 0x38], esi
jmp 0x5080a6
cmp dword [esp + 0x1c], 2
je 0x5080a6
mov ecx, dword [esp + 0x28]
mov edx, dword [ecx]
mov eax, dword [esp + 0x18]
push edx
push eax
lea ecx, [esi + 4]
call fcn.005077a0
test eax, eax
je 0x5080a6
mov ecx, dword [esp + 0x2c]
mov edx, dword [esp + 0x24]
mov dword [edx], 1
mov ebp, edi
mov dword [esp + 0x38], esi
test ecx, ecx
je 0x508175
mov eax, dword [esi]
cmp eax, 0xffffffff
je 0x508168
test eax, eax
jne 0x508166
xor esi, esi
jmp 0x508168
mov ecx, dword [esp + 0x24]
mov dword [ecx], 0
test ebp, ebp
jne 0x508175
mov edx, dword [esp + 0x20]
mov ebp, edi
pop edi
mov dword [esp + 0x34], esi
mov eax, esi
pop esi
mov dword [edx], ebp
pop ebp
pop ebx
pop ecx
ret 0x24
add esi, eax
xor eax, eax
cmp ecx, esi
mov ecx, dword [esp + 0x30]
sete al
mov dword [ecx], eax
mov edx, dword [esp + 0x20]
mov eax, dword [esp + 0x38]
pop edi
pop esi
mov dword [edx], ebp
pop ebp
pop ebx
pop ecx
ret 0x24