Function at 0x504fc0
Capabilities:
Encode data using xor

Disassembly:
mov eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x24]
mov edx, dword [esp + 0x20]
sub esp, 0xa8
push ebp
mov ebp, dword [esp + 0xbc]
push edi
mov edi, dword [esp + 0xb8]
push eax
push ecx
mov ecx, dword [esp + 0xd4]
lea eax, [esp + 0x64]
push edx
mov edx, dword [esp + 0xd4]
push eax
push ecx
push edx
push edi
push ebp
call fcn.00547180
add esp, 0x20
test eax, eax
je 0x505016
pop edi
mov eax, 1
pop ebp
add esp, 0xa8
ret
mov ebp, dword [ebp + 8]
mov eax, dword [edi + 8]
push ebx
mov ebx, dword [esp + 0x78]
push esi
mov esi, dword [esp + 0x84]
mov dword [esp + 0x28], ebp
mov ebp, dword [esp + 0x6c]
mov ecx, dword [esp + 0x80]
mov edx, dword [esp + 0x78]
sub esi, ebx
imul ebx, dword [esp + 0x28]
imul ebp, eax
sub ecx, edx
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x68]
lea edx, [edx + edx*2]
add ebx, edx
mov edx, dword [esp + 0xc8]
lea ebp, [ebp + eax*4]
mov dword [esp + 0x4c], ecx
add ebp, dword [edi + 4]
mov edi, dword [edx + 4]
mov dl, byte [esp + 0x64]
add ebx, edi
test dl, dl
mov dword [esp + 0x2c], ebx
je 0x50546f
mov edi, ecx
mov edx, ecx
sar edi, 3
mov dword [esp + 0x5c], edi
mov edi, dword [esp + 0x70]
and edx, 7
sub eax, edi
mov edi, dword [esp + 0x1c]
add eax, edx
mov dword [esp + 0x48], edx
lea eax, [edi + eax*4]
mov dword [esp + 0x54], eax
mov eax, edx
sub eax, ecx
mov ecx, dword [esp + 0x28]
lea ecx, [ecx + eax*2]
add eax, ecx
test esi, esi
mov dword [esp + 0x58], eax
jle 0x50561b
mov dword [esp + 0x30], esi
mov eax, dword [esp + 0x5c]
test eax, eax
jle 0x5053c1
lea edi, [ebx + 6]
lea esi, [ebp + 0xb]
mov dword [esp + 0x24], eax
mov edx, ebp
mov ax, word [edx]
mov word [esp + 0x34], ax
mov cl, byte [edx + 2]
xor edx, edx
mov dl, byte [esi - 8]
mov byte [esp + 0x36], cl
push edx
lea ecx, [esp + 0x38]
call fcn.004f7fa0
lea eax, [esp + 0x34]
mov ecx, ebx
push eax
call fcn.00505630
lea ecx, [esi - 7]
mov dx, word [esi - 7]
mov word [esp + 0x28], dx
mov al, byte [ecx + 2]
xor ecx, ecx
mov cl, byte [esi - 4]
mov byte [esp + 0x2a], al
push ecx
lea ecx, [esp + 0x2c]
call fcn.004f7fa0
lea edx, [esp + 0x28]
lea ecx, [edi - 3]
push edx
call fcn.00505630
lea eax, [esi - 3]
mov cx, word [esi - 3]
mov word [esp + 0x20], cx
lea ecx, [esp + 0x20]
mov dl, byte [eax + 2]
xor eax, eax
mov al, byte [esi]
mov byte [esp + 0x22], dl
push eax
call fcn.004f7fa0
mov edx, dword [edi]
mov ecx, dword [esp + 0x20]
and edx, 0xffffff
and ecx, 0xffffff
mov eax, edx
not eax
mov ebx, eax
xor eax, ecx
and ebx, ecx
and eax, 0xfefefe
lea eax, [eax + ebx*2]
shr eax, 8
and eax, 0x10101
add eax, 0x7f7f7f
xor eax, 0x7f7f7f
mov ebx, eax
or eax, edx
or ebx, ecx
mov ecx, edi
sub eax, ebx
push eax
call fcn.004f6bb0
lea ecx, [esi + 1]
mov dx, word [esi + 1]
mov word [esp + 0x18], dx
mov al, byte [ecx + 2]
xor ecx, ecx
mov cl, byte [esi + 4]
mov byte [esp + 0x1a], al
push ecx
lea ecx, [esp + 0x1c]
call fcn.004f7fa0
mov ebx, dword [edi + 3]
mov edx, dword [esp + 0x18]
and ebx, 0xffffff
and edx, 0xffffff
mov eax, ebx
not eax
mov ecx, eax
xor eax, edx
and ecx, edx
and eax, 0xfefefe
lea eax, [eax + ecx*2]
shr eax, 8
and eax, 0x10101
add eax, 0x7f7f7f
xor eax, 0x7f7f7f
mov ecx, eax
or eax, ebx
or ecx, edx
sub eax, ecx
lea ecx, [edi + 3]
push eax
call fcn.004f6bb0
lea edx, [esi + 5]
mov ax, word [esi + 5]
mov word [esp + 0x1c], ax
mov cl, byte [edx + 2]
xor edx, edx
mov dl, byte [esi + 8]
mov byte [esp + 0x1e], cl
push edx
lea ecx, [esp + 0x20]
call fcn.004f7fa0
mov ebx, dword [edi + 6]
mov edx, dword [esp + 0x1c]
and ebx, 0xffffff
and edx, 0xffffff
mov eax, ebx
not eax
mov ecx, eax
xor eax, edx
and ecx, edx
and eax, 0xfefefe
lea eax, [eax + ecx*2]
shr eax, 8
and eax, 0x10101
add eax, 0x7f7f7f
xor eax, 0x7f7f7f
mov ecx, eax
or eax, ebx
or ecx, edx
sub eax, ecx
lea ecx, [edi + 6]
push eax
call fcn.004f6bb0
lea edx, [esi + 9]
mov ax, word [esi + 9]
mov word [esp + 0x10], ax
xor eax, eax
mov cl, byte [edx + 2]
mov ah, byte [esi + 0xc]
mov byte [esp + 0x12], cl
mov edx, dword [esp + 0x10]
and edx, 0xff
mov cl, byte [edx + eax + 0xa2ee04]
mov edx, dword [esp + 0x11]
and edx, 0xff
push ecx
mov cl, byte [edx + eax + 0xa2ee04]
mov edx, dword [esp + 0x16]
and edx, 0xff
push ecx
lea ecx, [esp + 0x18]
mov al, byte [edx + eax + 0xa2ee04]
push eax
call fcn.004db580
lea ecx, [esp + 0x10]
push ecx
lea ecx, [edi + 9]
call fcn.00505630
lea edx, [esi + 0xd]
mov ax, word [esi + 0xd]
mov word [esp + 0x38], ax
xor eax, eax
mov cl, byte [edx + 2]
mov ah, byte [esi + 0x10]
mov byte [esp + 0x3a], cl
mov edx, dword [esp + 0x38]
and edx, 0xff
mov cl, byte [edx + eax + 0xa2ee04]
mov edx, dword [esp + 0x39]
push ecx
and edx, 0xff
mov cl, byte [edx + eax + 0xa2ee04]
mov edx, dword [esp + 0x3e]
and edx, 0xff
push ecx
lea ecx, [esp + 0x40]
mov al, byte [edx + eax + 0xa2ee04]
push eax
call fcn.004db580
lea ecx, [esp + 0x38]
push ecx
lea ecx, [edi + 0xc]
call fcn.00505630
lea edx, [esi + 0x11]
mov ax, word [esi + 0x11]
mov word [esp + 0x4c], ax
xor eax, eax
mov cl, byte [edx + 2]
mov ah, byte [esi + 0x14]
mov byte [esp + 0x4e], cl
mov edx, dword [esp + 0x4c]
and edx, 0xff
mov cl, byte [edx + eax + 0xa2ee04]
mov edx, dword [esp + 0x4d]
and edx, 0xff
push ecx
mov cl, byte [edx + eax + 0xa2ee04]
mov edx, dword [esp + 0x52]
and edx, 0xff
push ecx
lea ecx, [esp + 0x54]
mov al, byte [edx + eax + 0xa2ee04]
push eax
call fcn.004db580
lea ecx, [esp + 0x4c]
push ecx
lea ecx, [edi + 0xf]
call fcn.00505630
mov eax, dword [esp + 0x2c]
add edi, 0x18
add eax, 0x18
add ebp, 0x20
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x24]
mov ebx, dword [esp + 0x2c]
add esi, 0x20
dec eax
mov dword [esp + 0x24], eax
jne 0x5050d4
mov edx, dword [esp + 0x48]
test edx, edx
jle 0x505443
mov edi, ebx
mov esi, ebp
mov dword [esp + 0x24], edx
mov edx, esi
mov ax, word [edx]
mov word [esp + 0x40], ax
xor eax, eax
mov cl, byte [edx + 2]
mov ah, byte [esi + 3]
mov byte [esp + 0x42], cl
mov edx, dword [esp + 0x40]
and edx, 0xff
mov cl, byte [edx + eax + 0xa2ee04]
mov edx, dword [esp + 0x41]
and edx, 0xff
push ecx
mov cl, byte [edx + eax + 0xa2ee04]
mov edx, dword [esp + 0x46]
and edx, 0xff
push ecx
lea ecx, [esp + 0x48]
mov al, byte [edx + eax + 0xa2ee04]
push eax
call fcn.004db580
lea ecx, [esp + 0x40]
push ecx
mov ecx, edi
call fcn.00505630
mov eax, dword [esp + 0x24]
add esi, 4
add edi, 3
dec eax
mov dword [esp + 0x24], eax
jne 0x5053cd
mov edx, dword [esp + 0x48]
mov esi, dword [esp + 0x58]
mov ecx, dword [esp + 0x54]
mov eax, dword [esp + 0x30]
add ebx, esi
add ebp, ecx
dec eax
mov dword [esp + 0x2c], ebx
mov dword [esp + 0x30], eax
jne 0x5050be
pop esi
pop ebx
pop edi
xor eax, eax
pop ebp
add esp, 0xa8
ret
mov edx, dword [esp + 0xa4]
lea eax, [edx*4]
mov edx, dword [esp + 0x98]
mov dword [esp + 0x5c], edx
mov edx, dword [esp + 0x9c]
mov dword [esp + 0x60], eax
mov eax, dword [esp + 0x1c]
imul eax, dword [esp + 0xb4]
mov dword [esp + 0x24], edx
mov edx, dword [esp + 0xac]
mov dword [esp + 0x54], edx
mov edx, dword [esp + 0xa0]
mov dword [esp + 0x34], edx
mov edx, dword [esp + 0xb0]
mov dword [esp + 0x58], edx
mov edx, dword [esp + 0xa8]
test esi, esi
mov dword [esp + 0x40], eax
mov dword [esp + 0x18], edx
jle 0x50561b
mov dword [esp + 0x48], esi
mov edx, dword [esp + 0x18]
mov esi, dword [esp + 0x54]
add edx, esi
mov dword [esp + 0x18], edx
js 0x5054ff
mov edi, dword [esp + 0x1c]
mov esi, dword [esp + 0x58]
add ebp, edi
sub edx, esi
mov dword [esp + 0x18], edx
mov edx, dword [esp + 0x5c]
mov dword [esp + 0x38], ebp
test ecx, ecx
mov dword [esp + 0x20], edx
jle 0x5055fb
mov esi, ebx
mov dword [esp + 0x30], ecx
mov eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x24]
add eax, ecx
mov dword [esp + 0x20], eax
js 0x505536
mov ecx, dword [esp + 0x34]
add ebp, 4
sub eax, ecx
mov dword [esp + 0x20], eax
mov eax, ebp
add esi, 3
mov cx, word [eax]
mov word [esp + 0x10], cx
mov dl, byte [eax + 2]
xor eax, eax
mov ah, byte [ebp + 3]
mov byte [esp + 0x12], dl
mov ecx, dword [esp + 0x12]
and ecx, 0xff
mov dl, byte [ecx + eax + 0xa2ee04]
mov byte [esp + 0x12], dl
mov ecx, dword [esp + 0x11]
and ecx, 0xff
mov dl, byte [ecx + eax + 0xa2ee04]
mov byte [esp + 0x11], dl
mov ecx, dword [esp + 0x10]
and ecx, 0xff
mov dl, byte [ecx + eax + 0xa2ee04]
mov eax, dword [esi - 3]
mov byte [esp + 0x10], dl
mov ecx, dword [esp + 0x10]
and eax, 0xffffff
and ecx, 0xffffff
mov edx, eax
mov ebx, ecx
not edx
mov edi, ecx
xor ebx, edx
and edi, edx
and ebx, 0xfefefe
lea edx, [ebx + edi*2]
shr edx, 8
and edx, 0x10101
add edx, 0x7f7f7f
xor edx, 0x7f7f7f
or ecx, edx
or eax, edx
mov edx, dword [esp + 0x60]
sub eax, ecx
mov word [esi - 3], ax
add ebp, edx
shr eax, 0x10
mov byte [esi - 1], al
mov eax, dword [esp + 0x30]
dec eax
mov dword [esp + 0x30], eax
jne 0x505519
mov ebx, dword [esp + 0x2c]
mov eax, dword [esp + 0x40]
mov ecx, dword [esp + 0x4c]
mov edx, dword [esp + 0x38]
mov esi, dword [esp + 0x28]
add ebx, esi
lea ebp, [edx + eax]
mov edx, dword [esp + 0x48]
dec edx
mov dword [esp + 0x2c], ebx
mov dword [esp + 0x48], edx
jne 0x5054df
pop esi
pop ebx
pop edi
xor eax, eax
pop ebp
add esp, 0xa8
ret