Function at 0x50f920
Capabilities:
Encode data using xor

Disassembly:
mov eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x24]
mov edx, dword [esp + 0x20]
sub esp, 0xb4
push ebp
mov ebp, dword [esp + 0xc8]
push edi
mov edi, dword [esp + 0xc4]
push eax
push ecx
mov ecx, dword [esp + 0xe0]
lea eax, [esp + 0x70]
push edx
mov edx, dword [esp + 0xe0]
push eax
push ecx
push edx
push edi
push ebp
call fcn.00547180
add esp, 0x20
test eax, eax
je 0x50f976
pop edi
mov eax, 1
pop ebp
add esp, 0xb4
ret
mov ecx, dword [edi + 8]
mov edi, dword [ebp + 8]
mov eax, dword [esp + 0x80]
mov ebp, dword [esp + 0x70]
push ebx
push esi
mov esi, dword [esp + 0x90]
mov ebx, dword [esp + 0x8c]
mov edx, dword [esp + 0x84]
mov dword [esp + 0x18], edi
sub esi, eax
imul eax, dword [esp + 0x18]
imul ebp, ecx
mov dword [esp + 0x20], ecx
mov ecx, dword [esp + 0x74]
sub ebx, edx
lea edx, [edx + edx*2]
lea edi, [ecx + ecx*2]
add eax, edx
mov edx, dword [esp + 0xd4]
add ebp, edi
mov edi, dword [esp + 0xcc]
add ebp, dword [edi + 4]
mov edi, dword [edx + 4]
add eax, edi
mov edx, eax
mov al, byte [esp + 0x70]
test al, al
mov dword [esp + 0x1c], edx
je 0x50fe20
mov eax, ebx
mov edi, ebx
sar eax, 3
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x7c]
and edi, 7
sub ecx, eax
mov eax, dword [esp + 0x20]
add ecx, edi
mov dword [esp + 0x24], edi
lea eax, [eax + ecx*2]
add ecx, eax
mov eax, edi
mov dword [esp + 0x6c], ecx
mov ecx, dword [esp + 0x18]
sub eax, ebx
lea ecx, [ecx + eax*2]
add eax, ecx
test esi, esi
mov dword [esp + 0x68], eax
jle 0x50ff88
mov dword [esp + 0x44], esi
mov eax, dword [esp + 0x28]
test eax, eax
jle 0x50fd62
mov esi, dword [esp + 0xd8]
lea edi, [edx + 6]
mov edx, eax
lea ebx, [ebp + 6]
shl esi, 8
mov dword [esp + 0x18], edx
mov eax, ebp
mov cx, word [eax]
mov word [esp + 0x10], cx
mov dl, byte [eax + 2]
mov byte [esp + 0x12], dl
mov eax, dword [esp + 0x12]
mov edx, dword [esp + 0x11]
and eax, 0xff
and edx, 0xff
mov cl, byte [eax + esi + 0xa2ee04]
mov al, byte [edx + esi + 0xa2ee04]
push ecx
mov ecx, dword [esp + 0x14]
push eax
and ecx, 0xff
mov dl, byte [ecx + esi + 0xa2ee04]
lea ecx, [esp + 0x18]
push edx
call fcn.004d9c90
mov ecx, dword [esp + 0x1c]
lea eax, [esp + 0x10]
push eax
call fcn.00505630
lea ecx, [ebx - 3]
mov dx, word [ebx - 3]
mov word [esp + 0x58], dx
mov al, byte [ecx + 2]
mov byte [esp + 0x5a], al
mov ecx, dword [esp + 0x5a]
mov eax, dword [esp + 0x59]
and ecx, 0xff
and eax, 0xff
mov dl, byte [ecx + esi + 0xa2ee04]
mov cl, byte [eax + esi + 0xa2ee04]
push edx
mov edx, dword [esp + 0x5c]
push ecx
and edx, 0xff
lea ecx, [esp + 0x60]
mov al, byte [edx + esi + 0xa2ee04]
push eax
call fcn.004d9c90
lea ecx, [esp + 0x58]
push ecx
lea ecx, [edi - 3]
call fcn.00505630
mov edx, ebx
mov ax, word [edx]
mov word [esp + 0x48], ax
mov cl, byte [edx + 2]
mov byte [esp + 0x4a], cl
mov edx, dword [esp + 0x4a]
mov ecx, dword [esp + 0x49]
and edx, 0xff
and ecx, 0xff
mov al, byte [edx + esi + 0xa2ee04]
mov dl, byte [ecx + esi + 0xa2ee04]
push eax
mov eax, dword [esp + 0x4c]
push edx
and eax, 0xff
mov cl, byte [eax + esi + 0xa2ee04]
push ecx
lea ecx, [esp + 0x54]
call fcn.004d9c90
lea edx, [esp + 0x48]
mov ecx, edi
push edx
call fcn.00505630
lea eax, [ebx + 3]
mov cx, word [ebx + 3]
mov word [esp + 0x3c], cx
mov dl, byte [eax + 2]
mov byte [esp + 0x3e], dl
mov eax, dword [esp + 0x3e]
mov edx, dword [esp + 0x3d]
and eax, 0xff
and edx, 0xff
mov cl, byte [eax + esi + 0xa2ee04]
mov al, byte [edx + esi + 0xa2ee04]
push ecx
mov ecx, dword [esp + 0x40]
push eax
and ecx, 0xff
mov dl, byte [ecx + esi + 0xa2ee04]
lea ecx, [esp + 0x44]
push edx
call fcn.004d9c90
lea eax, [esp + 0x3c]
lea ecx, [edi + 3]
push eax
call fcn.00505630
lea ecx, [ebx + 6]
mov dx, word [ebx + 6]
mov word [esp + 0x34], dx
mov al, byte [ecx + 2]
mov byte [esp + 0x36], al
mov ecx, dword [esp + 0x36]
mov eax, dword [esp + 0x35]
and ecx, 0xff
and eax, 0xff
mov dl, byte [ecx + esi + 0xa2ee04]
mov cl, byte [eax + esi + 0xa2ee04]
push edx
mov edx, dword [esp + 0x38]
push ecx
and edx, 0xff
lea ecx, [esp + 0x3c]
mov al, byte [edx + esi + 0xa2ee04]
push eax
call fcn.004d9c90
lea ecx, [esp + 0x34]
push ecx
lea ecx, [edi + 6]
call fcn.00505630
lea edx, [ebx + 9]
mov ax, word [ebx + 9]
mov word [esp + 0x50], ax
mov cl, byte [edx + 2]
mov byte [esp + 0x52], cl
mov edx, dword [esp + 0x52]
mov ecx, dword [esp + 0x51]
and edx, 0xff
and ecx, 0xff
mov al, byte [edx + esi + 0xa2ee04]
mov dl, byte [ecx + esi + 0xa2ee04]
push eax
mov eax, dword [esp + 0x54]
push edx
and eax, 0xff
mov cl, byte [eax + esi + 0xa2ee04]
push ecx
lea ecx, [esp + 0x5c]
call fcn.004d9c90
lea edx, [esp + 0x50]
lea ecx, [edi + 9]
push edx
call fcn.00505630
lea eax, [ebx + 0xc]
mov cx, word [ebx + 0xc]
mov word [esp + 0x60], cx
mov dl, byte [eax + 2]
mov byte [esp + 0x62], dl
mov eax, dword [esp + 0x62]
mov edx, dword [esp + 0x61]
and eax, 0xff
and edx, 0xff
mov cl, byte [eax + esi + 0xa2ee04]
mov al, byte [edx + esi + 0xa2ee04]
push ecx
mov ecx, dword [esp + 0x64]
push eax
and ecx, 0xff
mov dl, byte [ecx + esi + 0xa2ee04]
lea ecx, [esp + 0x68]
push edx
call fcn.004d9c90
lea eax, [esp + 0x60]
lea ecx, [edi + 0xc]
push eax
call fcn.00505630
lea ecx, [ebx + 0xf]
mov dx, word [ecx]
mov word [esp + 0x2c], dx
mov al, byte [ecx + 2]
mov byte [esp + 0x2e], al
mov ecx, dword [esp + 0x2e]
mov eax, dword [esp + 0x2d]
and ecx, 0xff
and eax, 0xff
mov dl, byte [ecx + esi + 0xa2ee04]
mov cl, byte [eax + esi + 0xa2ee04]
push edx
mov edx, dword [esp + 0x30]
push ecx
and edx, 0xff
lea ecx, [esp + 0x34]
mov al, byte [edx + esi + 0xa2ee04]
push eax
call fcn.004d9c90
lea ecx, [esp + 0x2c]
push ecx
lea ecx, [edi + 0xf]
call fcn.00505630
mov ecx, dword [esp + 0x1c]
mov eax, dword [esp + 0x18]
add ecx, 0x18
add edi, 0x18
add ebp, 0x18
add ebx, 0x18
dec eax
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x18], eax
jne 0x50fa4e
mov edi, dword [esp + 0x24]
mov edx, ecx
test edi, edi
jle 0x50fdf4
mov ebx, ebp
mov esi, edx
sub ebx, edx
mov dword [esp + 0x18], edi
lea edx, [ebx + esi]
mov ax, word [ebx + esi]
mov word [esp + 0x20], ax
mov cl, byte [edx + 2]
mov edx, dword [esp + 0xd8]
mov byte [esp + 0x22], cl
push edx
lea ecx, [esp + 0x24]
call fcn.004f8650
mov edx, dword [esi]
mov ecx, dword [esp + 0x20]
and edx, 0xffffff
and ecx, 0xffffff
mov eax, edx
not eax
mov edi, eax
xor eax, ecx
and edi, ecx
and eax, 0xfefefe
lea eax, [eax + edi*2]
shr eax, 8
and eax, 0x10101
add eax, 0x7f7f7f
xor eax, 0x7f7f7f
mov edi, eax
or eax, edx
or edi, ecx
mov ecx, esi
sub eax, edi
push eax
call fcn.004f6bb0
mov eax, dword [esp + 0x18]
add esi, 3
dec eax
mov dword [esp + 0x18], eax
jne 0x50fd74
mov edi, dword [esp + 0x24]
mov edx, dword [esp + 0x1c]
mov esi, dword [esp + 0x68]
mov ecx, dword [esp + 0x6c]
mov eax, dword [esp + 0x44]
add edx, esi
add ebp, ecx
dec eax
mov dword [esp + 0x1c], edx
mov dword [esp + 0x44], eax
jne 0x50fa2c
pop esi
pop ebx
pop edi
xor eax, eax
pop ebp
add esp, 0xb4
ret
mov eax, dword [esp + 0xb0]
mov ecx, dword [esp + 0xa4]
mov dword [esp + 0x60], ecx
mov ecx, dword [esp + 0xa8]
lea eax, [eax + eax*2]
mov dword [esp + 0x50], ecx
mov ecx, dword [esp + 0xb8]
mov dword [esp + 0x3c], eax
mov eax, dword [esp + 0x20]
mov dword [esp + 0x6c], ecx
imul eax, dword [esp + 0xc0]
mov ecx, dword [esp + 0xac]
mov dword [esp + 0x48], eax
mov dword [esp + 0x34], ecx
mov ecx, dword [esp + 0xbc]
mov dword [esp + 0x2c], ecx
mov ecx, dword [esp + 0xb4]
test esi, esi
mov dword [esp + 0x24], ecx
jle 0x50ff88
mov dword [esp + 0x68], esi
mov ecx, dword [esp + 0x24]
mov esi, dword [esp + 0x6c]
add ecx, esi
mov dword [esp + 0x24], ecx
js 0x50feac
mov edi, dword [esp + 0x20]
mov esi, dword [esp + 0x2c]
add ebp, edi
sub ecx, esi
mov dword [esp + 0x24], ecx
mov ecx, dword [esp + 0x60]
mov dword [esp + 0x58], ebp
test ebx, ebx
mov dword [esp + 0x28], ecx
jle 0x50ff68
mov esi, dword [esp + 0xd8]
mov edi, edx
shl esi, 8
mov dword [esp + 0x44], ebx
mov eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x50]
add eax, ecx
mov dword [esp + 0x28], eax
js 0x50feed
mov ecx, dword [esp + 0x34]
add ebp, 3
sub eax, ecx
mov dword [esp + 0x28], eax
mov edx, ebp
mov ax, word [edx]
mov word [esp + 0x10], ax
mov cl, byte [edx + 2]
mov byte [esp + 0x12], cl
mov edx, dword [esp + 0x10]
mov ecx, dword [esp + 0x11]
and edx, 0xff
and ecx, 0xff
mov al, byte [edx + esi + 0xa2ee04]
mov dl, byte [ecx + esi + 0xa2ee04]
mov byte [esp + 0x10], al
mov eax, dword [esp + 0x12]
mov byte [esp + 0x11], dl
and eax, 0xff
lea edx, [esp + 0x10]
push edx
mov cl, byte [eax + esi + 0xa2ee04]
mov byte [esp + 0x16], cl
mov ecx, edi
call fcn.00505630
mov edx, dword [esp + 0x3c]
mov eax, dword [esp + 0x44]
add ebp, edx
add edi, 3
dec eax
mov dword [esp + 0x44], eax
jne 0x50fed0
mov edx, dword [esp + 0x1c]
mov eax, dword [esp + 0x48]
mov ecx, dword [esp + 0x58]
mov esi, dword [esp + 0x18]
add edx, esi
lea ebp, [ecx + eax]
mov ecx, dword [esp + 0x68]
dec ecx
mov dword [esp + 0x1c], edx
mov dword [esp + 0x68], ecx
jne 0x50fe8c
pop esi
pop ebx
pop edi
xor eax, eax
pop ebp
add esp, 0xb4
ret