Function at 0x507760
Capabilities:
Encode data using xor

Disassembly:
mov eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x24]
mov edx, dword [esp + 0x20]
sub esp, 0x90
push ebp
mov ebp, dword [esp + 0xa4]
push edi
mov edi, dword [esp + 0xa0]
push eax
push ecx
mov ecx, dword [esp + 0xbc]
lea eax, [esp + 0x4c]
push edx
mov edx, dword [esp + 0xbc]
push eax
push ecx
push edx
push edi
push ebp
call fcn.00547180
add esp, 0x20
test eax, eax
je 0x5077b6
pop edi
mov eax, 1
pop ebp
add esp, 0x90
ret
mov edx, dword [edi + 8]
push ebx
mov ebx, dword [ebp + 8]
mov ecx, dword [esp + 0x64]
mov eax, dword [esp + 0x5c]
mov dword [esp + 0xc], ebx
mov ebx, dword [esp + 0x50]
push esi
mov esi, dword [esp + 0x6c]
imul ebx, edx
sub ecx, eax
mov eax, dword [esp + 0x64]
sub esi, eax
imul eax, dword [esp + 0x10]
mov dword [esp + 0x18], ebx
mov ebx, dword [esp + 0x50]
mov dword [esp + 0x20], edx
mov edx, dword [esp + 0x18]
mov dword [esp + 0x3c], ecx
lea edx, [edx + ebx*4]
add edx, dword [edi + 4]
mov edi, dword [esp + 0x60]
lea eax, [eax + edi*4]
mov edi, dword [ebp + 4]
add eax, edi
cmp byte [esp + 0x4c], 0
je 0x507ac1
mov ebp, ecx
mov edi, ecx
sar ebp, 3
mov dword [esp + 0x18], ebp
mov ebp, dword [esp + 0x58]
and edi, 7
sub ebx, ebp
mov ebp, dword [esp + 0x20]
add ebx, edi
mov dword [esp + 0x14], edi
lea ebx, [ebp + ebx*4]
mov dword [esp + 0x28], ebx
mov ebx, edi
sub ebx, ecx
mov ecx, dword [esp + 0x10]
test esi, esi
lea ecx, [ecx + ebx*4]
mov dword [esp + 0x20], ecx
jle 0x507bee
mov dword [esp + 0x1c], esi
mov ebx, dword [esp + 0x18]
test ebx, ebx
jle 0x507a37
mov edi, dword [eax]
mov esi, dword [edx]
mov ecx, edi
not ecx
mov ebp, ecx
xor ecx, esi
and ecx, 0xfefefe
and ebp, esi
lea ecx, [ecx + ebp*2]
shr ecx, 8
and ecx, 0x10101
add ecx, 0x7f7f7f
xor ecx, 0x7f7f7f
mov ebp, ecx
or ecx, edi
or ebp, esi
sub ecx, ebp
mov dword [eax], ecx
mov edi, dword [eax + 4]
mov esi, dword [edx + 4]
mov ecx, edi
not ecx
mov ebp, ecx
xor ecx, esi
and ecx, 0xfefefe
and ebp, esi
lea ecx, [ecx + ebp*2]
shr ecx, 8
and ecx, 0x10101
add ecx, 0x7f7f7f
xor ecx, 0x7f7f7f
mov ebp, ecx
or ecx, esi
or ebp, edi
sub ebp, ecx
mov dword [eax + 4], ebp
mov edi, dword [eax + 8]
mov esi, dword [edx + 8]
mov ecx, edi
not ecx
mov ebp, ecx
xor ecx, esi
and ebp, esi
and ecx, 0xfefefe
lea ecx, [ecx + ebp*2]
shr ecx, 8
and ecx, 0x10101
add ecx, 0x7f7f7f
xor ecx, 0x7f7f7f
mov ebp, ecx
or ecx, edi
or ebp, esi
sub ecx, ebp
mov dword [eax + 8], ecx
mov edi, dword [eax + 0xc]
mov esi, dword [edx + 0xc]
mov ecx, edi
not ecx
mov ebp, ecx
xor ecx, esi
and ebp, esi
and ecx, 0xfefefe
lea ecx, [ecx + ebp*2]
shr ecx, 8
and ecx, 0x10101
add ecx, 0x7f7f7f
xor ecx, 0x7f7f7f
mov ebp, ecx
or ecx, edi
or ebp, esi
sub ecx, ebp
mov dword [eax + 0xc], ecx
mov edi, dword [eax + 0x10]
mov esi, dword [edx + 0x10]
mov ecx, edi
not ecx
mov ebp, ecx
xor ecx, esi
and ebp, esi
and ecx, 0xfefefe
lea ecx, [ecx + ebp*2]
shr ecx, 8
and ecx, 0x10101
add eax, 0x20
add ecx, 0x7f7f7f
add edx, 0x20
xor ecx, 0x7f7f7f
mov ebp, ecx
or ecx, edi
or ebp, esi
sub ecx, ebp
mov dword [eax - 0x10], ecx
mov edi, dword [eax - 0xc]
mov esi, dword [edx - 0xc]
mov ecx, edi
not ecx
mov ebp, ecx
xor ecx, esi
and ebp, esi
and ecx, 0xfefefe
lea ecx, [ecx + ebp*2]
shr ecx, 8
and ecx, 0x10101
add ecx, 0x7f7f7f
xor ecx, 0x7f7f7f
mov ebp, ecx
or ecx, edi
or ebp, esi
sub ecx, ebp
mov dword [eax - 0xc], ecx
mov edi, dword [eax - 8]
mov esi, dword [edx - 8]
mov ecx, edi
not ecx
mov ebp, ecx
and ecx, esi
xor ebp, esi
and ebp, 0xfefefe
lea ecx, [ebp + ecx*2]
shr ecx, 8
and ecx, 0x10101
add ecx, 0x7f7f7f
xor ecx, 0x7f7f7f
mov ebp, ecx
or ecx, edi
or ebp, esi
sub ecx, ebp
mov dword [eax - 8], ecx
mov edi, dword [eax - 4]
mov esi, dword [edx - 4]
mov ecx, edi
not ecx
mov ebp, ecx
xor ecx, esi
and ebp, esi
and ecx, 0xfefefe
lea ecx, [ecx + ebp*2]
shr ecx, 8
and ecx, 0x10101
add ecx, 0x7f7f7f
xor ecx, 0x7f7f7f
mov ebp, ecx
or ecx, edi
or ebp, esi
sub ecx, ebp
dec ebx
mov dword [eax - 4], ecx
jne 0x507860
mov edi, dword [esp + 0x14]
test edi, edi
jle 0x507a99
mov ecx, edx
mov esi, eax
sub ecx, eax
mov dword [esp + 0x10], edi
mov dword [esp + 0x24], ecx
jmp 0x507a4f
mov ecx, dword [esp + 0x24]
mov ebp, dword [esi]
mov edi, dword [ecx + esi]
mov ecx, ebp
add esi, 4
not ecx
mov ebx, ecx
xor ecx, edi
and ebx, edi
and ecx, 0xfefefe
lea ecx, [ecx + ebx*2]
shr ecx, 8
and ecx, 0x10101
add ecx, 0x7f7f7f
xor ecx, 0x7f7f7f
mov ebx, ecx
or ecx, ebp
or ebx, edi
sub ecx, ebx
mov dword [esi - 4], ecx
mov ecx, dword [esp + 0x10]
dec ecx
mov dword [esp + 0x10], ecx
jne 0x507a4b
mov edi, dword [esp + 0x14]
mov ebx, dword [esp + 0x20]
mov esi, dword [esp + 0x28]
mov ecx, dword [esp + 0x1c]
add eax, ebx
add edx, esi
dec ecx
mov dword [esp + 0x1c], ecx
jne 0x507854
pop esi
pop ebx
pop edi
xor eax, eax
pop ebp
add esp, 0x90
ret
mov edi, dword [esp + 0x8c]
mov ebx, dword [esp + 0x80]
shl edi, 2
mov dword [esp + 0x40], ebx
mov ebx, dword [esp + 0x84]
mov dword [esp + 0x30], edi
mov edi, dword [esp + 0x20]
imul edi, dword [esp + 0x9c]
mov dword [esp + 0x38], ebx
mov ebx, dword [esp + 0x94]
mov dword [esp + 0x28], ebx
mov ebx, dword [esp + 0x88]
mov dword [esp + 0x48], ebx
mov ebx, dword [esp + 0x98]
mov dword [esp + 0x2c], ebx
mov ebx, dword [esp + 0x90]
test esi, esi
mov dword [esp + 0x34], edi
mov dword [esp + 0x1c], ebx
jle 0x507bee
mov dword [esp + 0x18], esi
mov esi, dword [esp + 0x1c]
mov ebx, dword [esp + 0x28]
add esi, ebx
mov dword [esp + 0x1c], esi
js 0x507b4d
mov ebp, dword [esp + 0x20]
mov ebx, dword [esp + 0x2c]
add edx, ebp
sub esi, ebx
mov dword [esp + 0x1c], esi
mov esi, dword [esp + 0x40]
mov dword [esp + 0x44], edx
test ecx, ecx
mov dword [esp + 0x14], esi
jle 0x507bd3
mov ebx, eax
mov dword [esp + 0x24], ecx
mov ecx, dword [esp + 0x14]
mov esi, dword [esp + 0x38]
add ecx, esi
mov dword [esp + 0x14], ecx
js 0x507b80
mov esi, dword [esp + 0x48]
add edx, 4
sub ecx, esi
mov dword [esp + 0x14], ecx
mov edi, dword [ebx]
mov esi, dword [edx]
mov ecx, edi
add ebx, 4
not ecx
mov ebp, ecx
xor ecx, esi
and ebp, esi
and ecx, 0xfefefe
lea ecx, [ecx + ebp*2]
shr ecx, 8
and ecx, 0x10101
add ecx, 0x7f7f7f
xor ecx, 0x7f7f7f
mov ebp, ecx
or ecx, edi
mov edi, dword [esp + 0x30]
or ebp, esi
sub ecx, ebp
add edx, edi
mov dword [ebx - 4], ecx
mov ecx, dword [esp + 0x24]
dec ecx
mov dword [esp + 0x24], ecx
jne 0x507b63
mov edi, dword [esp + 0x34]
mov ecx, dword [esp + 0x3c]
mov edx, dword [esp + 0x44]
mov ebx, dword [esp + 0x10]
mov esi, dword [esp + 0x18]
add edx, edi
add eax, ebx
dec esi
mov dword [esp + 0x18], esi
jne 0x507b2d
pop esi
pop ebx
pop edi
xor eax, eax
pop ebp
add esp, 0x90
ret