Function at 0x506d90
Capabilities:
Encode data using xor

Disassembly:
mov eax, dword [esp + 0x34]
mov ecx, dword [esp + 0x30]
mov edx, dword [esp + 0x2c]
sub esp, 0x94
push ebx
mov ebx, dword [esp + 0xa0]
push ebp
mov ebp, dword [esp + 0xac]
push eax
push ecx
mov ecx, dword [esp + 0xcc]
lea eax, [esp + 0x50]
push edx
mov edx, dword [esp + 0xcc]
push eax
push ecx
push edx
push ebx
push ebp
call fcn.00547180
add esp, 0x20
test eax, eax
je 0x506de6
pop ebp
mov eax, 1
pop ebx
add esp, 0x94
ret
mov edx, dword [ebp + 8]
mov ebp, dword [esp + 0x4c]
sub ebp, dword [esp + 0x54]
mov ebx, dword [ebx + 8]
mov ecx, dword [esp + 0x5c]
push esi
push edi
mov edi, dword [esp + 0x6c]
sub edi, ecx
lea ebp, [ebx + ebp*2]
mov dword [esp + 0x24], ebp
mov dword [esp + 0x28], edx
lea ebp, [edi + edi]
mov esi, dword [esp + 0x70]
mov eax, dword [esp + 0x68]
sub edx, ebp
mov dword [esp + 0x1c], edx
mov edx, dword [esp + 0x58]
imul edx, ebx
mov ebp, dword [esp + 0x54]
sub esi, eax
imul eax, dword [esp + 0x28]
lea edx, [edx + ebp*2]
mov ebp, dword [esp + 0xac]
lea eax, [eax + ecx*2]
mov dword [esp + 0x30], edi
add edx, dword [ebp + 4]
mov ebp, dword [esp + 0xb4]
mov dword [esp + 0x40], ebx
add eax, dword [ebp + 4]
cmp byte [esp + 0x50], 0
je 0x507091
and cl, 1
mov ebp, edi
mov byte [esp + 0x13], cl
je 0x506e69
lea ebp, [edi - 1]
mov ebx, ebp
and ebx, 7
mov cl, bl
sar ebp, 3
and cl, 1
mov dword [esp + 0x20], ebp
sar ebx, 1
test esi, esi
mov byte [esp + 0x12], cl
mov dword [esp + 0x14], ebx
jle 0x5071ba
mov dword [esp + 0x18], esi
mov cl, byte [esp + 0x13]
test cl, cl
je 0x506ed8
mov di, word [eax]
mov si, word [edx]
mov ecx, edi
add eax, 2
not ecx
mov ebp, ecx
xor ecx, esi
and ebp, esi
and ecx, 0x7bde
lea ecx, [ecx + ebp*2]
shr ecx, 5
and ecx, 0x421
add ecx, 0x3def
xor ecx, 0x3def
mov ebp, ecx
or ecx, edi
or ebp, esi
sub ecx, ebp
add edx, 2
mov word [eax - 2], cx
mov ebp, dword [esp + 0x20]
test ebp, ebp
jle 0x506fd7
mov edi, dword [eax]
mov esi, dword [edx]
mov ecx, edi
add eax, 0x10
not ecx
mov ebx, ecx
and ecx, esi
xor ebx, esi
add edx, 0x10
and ebx, 0x7bde7bde
lea ecx, [ebx + ecx*2]
shr ecx, 5
and ecx, 0x4210421
add ecx, 0x3def3def
xor ecx, 0x3def3def
mov ebx, ecx
or ecx, esi
or ebx, edi
sub ebx, ecx
mov dword [eax - 0x10], ebx
mov edi, dword [eax - 0xc]
mov esi, dword [edx - 0xc]
mov ecx, edi
not ecx
mov ebx, ecx
and ecx, esi
xor ebx, esi
and ebx, 0x7bde7bde
lea ecx, [ebx + ecx*2]
shr ecx, 5
and ecx, 0x4210421
add ecx, 0x3def3def
xor ecx, 0x3def3def
mov ebx, ecx
or ecx, esi
or ebx, edi
sub ebx, ecx
mov dword [eax - 0xc], ebx
mov edi, dword [eax - 8]
mov esi, dword [edx - 8]
mov ecx, edi
not ecx
mov ebx, ecx
and ecx, esi
xor ebx, esi
and ebx, 0x7bde7bde
lea ecx, [ebx + ecx*2]
shr ecx, 5
and ecx, 0x4210421
add ecx, 0x3def3def
xor ecx, 0x3def3def
mov ebx, ecx
or ecx, edi
or ebx, esi
sub ecx, ebx
mov dword [eax - 8], ecx
mov edi, dword [eax - 4]
mov esi, dword [edx - 4]
mov ecx, edi
not ecx
mov ebx, ecx
and ecx, esi
xor ebx, esi
and ebx, 0x7bde7bde
lea ecx, [ebx + ecx*2]
shr ecx, 5
and ecx, 0x4210421
add ecx, 0x3def3def
xor ecx, 0x3def3def
mov ebx, ecx
or ecx, edi
or ebx, esi
sub ecx, ebx
dec ebp
mov dword [eax - 4], ecx
jne 0x506ee4
mov ebx, dword [esp + 0x14]
test ebx, ebx
jle 0x507021
mov ebp, ebx
mov edi, dword [eax]
mov esi, dword [edx]
mov ecx, edi
add eax, 4
not ecx
mov ebx, ecx
and ecx, esi
xor ebx, esi
add edx, 4
and ebx, 0x7bde7bde
lea ecx, [ebx + ecx*2]
shr ecx, 5
and ecx, 0x4210421
add ecx, 0x3def3def
xor ecx, 0x3def3def
mov ebx, ecx
or ecx, edi
or ebx, esi
sub ecx, ebx
dec ebp
mov dword [eax - 4], ecx
jne 0x506fdd
mov ebx, dword [esp + 0x14]
mov cl, byte [esp + 0x12]
test cl, cl
je 0x507069
mov di, word [eax]
mov si, word [edx]
mov ecx, edi
add eax, 2
not ecx
mov ebp, ecx
xor ecx, esi
and ebp, esi
and ecx, 0x7bde
lea ecx, [ecx + ebp*2]
shr ecx, 5
and ecx, 0x421
add ecx, 0x3def
xor ecx, 0x3def
mov ebp, ecx
or ecx, esi
or ebp, edi
sub ebp, ecx
add edx, 2
mov word [eax - 2], bp
mov edi, dword [esp + 0x1c]
mov esi, dword [esp + 0x24]
mov ecx, dword [esp + 0x18]
add eax, edi
add edx, esi
dec ecx
mov dword [esp + 0x18], ecx
jne 0x506e90
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x94
ret
mov ecx, dword [esp + 0x90]
mov ebp, dword [esp + 0x84]
add ecx, ecx
mov dword [esp + 0x34], ebp
mov ebp, dword [esp + 0x88]
mov dword [esp + 0x4c], ecx
mov ecx, ebx
mov dword [esp + 0x44], ebp
imul ecx, dword [esp + 0xa0]
mov ebp, dword [esp + 0x98]
mov dword [esp + 0x38], ecx
mov dword [esp + 0x24], ebp
mov ebp, dword [esp + 0x8c]
mov dword [esp + 0x3c], ebp
mov ebp, dword [esp + 0x9c]
mov dword [esp + 0x2c], ebp
mov ebp, dword [esp + 0x94]
test esi, esi
jle 0x5071ba
mov dword [esp + 0x20], esi
jmp 0x5070fc
mov ebp, dword [esp + 0x18]
add ebp, dword [esp + 0x24]
mov dword [esp + 0x18], ebp
js 0x507112
mov esi, dword [esp + 0x2c]
add edx, ebx
sub ebp, esi
mov dword [esp + 0x18], ebp
mov esi, dword [esp + 0x34]
mov dword [esp + 0x48], edx
test edi, edi
mov dword [esp + 0x14], esi
jle 0x50719f
mov ebx, eax
mov dword [esp + 0x1c], edi
mov ecx, dword [esp + 0x14]
mov esi, dword [esp + 0x44]
add ecx, esi
mov dword [esp + 0x14], ecx
js 0x507145
mov esi, dword [esp + 0x3c]
add edx, 2
sub ecx, esi
mov dword [esp + 0x14], ecx
mov di, word [ebx]
mov si, word [edx]
mov ecx, edi
add ebx, 2
not ecx
mov ebp, ecx
xor ecx, esi
and ebp, esi
and ecx, 0x7bde
lea ecx, [ecx + ebp*2]
shr ecx, 5
and ecx, 0x421
add ecx, 0x3def
xor ecx, 0x3def
mov ebp, ecx
or ecx, edi
mov edi, dword [esp + 0x4c]
or ebp, esi
sub ecx, ebp
add edx, edi
mov word [ebx - 2], cx
mov ecx, dword [esp + 0x1c]
dec ecx
mov dword [esp + 0x1c], ecx
jne 0x507128
mov edi, dword [esp + 0x30]
mov ecx, dword [esp + 0x38]
mov ebx, dword [esp + 0x40]
mov edx, dword [esp + 0x48]
mov ebp, dword [esp + 0x28]
mov esi, dword [esp + 0x20]
add edx, ecx
add eax, ebp
dec esi
mov dword [esp + 0x20], esi
jne 0x5070f8
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x94
ret