Function at 0x50d960
Capabilities:
Encode data using xor

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
sub rsp, 0xa8
mov r12, rdx
mov r13, rcx
mov eax, dword [rsp + 0x140]
mov dword [rsp + 0x64], eax
mov cl, byte [rsp + 0x138]
mov bl, byte [rsp + 0x130]
mov al, byte [rsp + 0x128]
mov byte [rsp + 0x5b], al
movzx eax, word [rsp + 0x120]
mov word [rsp + 0x6a], ax
mov eax, dword [rsp + 0x118]
mov dword [rsp + 0x5c], eax
mov eax, dword [rsp + 0x110]
mov dword [rsp + 0x9c], eax
mov rsi, qword [r13 + 0x10]
mov eax, dword [r13 + 0x44]
mov qword [rsp + 0x80], rax
add eax, 0xffffffff
mov dword [rsp + 0x60], eax
mov dword [r13 + 0x44], eax
xor eax, eax
cmp byte [rdx + 0x30], 0
mov dword [rsp + 0x54], r9d
mov r14, r8
setns al
lea edi, [rax + rax*2]
add edi, 0x1b
mov byte [rsp + 0x53], cl
test cl, cl
je 0x50db83
mov dword [rsp + 0x78], edi
mov rax, qword [r13]
mov eax, dword [rax + 0x30]
not eax
or rax, 0xffffffffffffbfff
mov byte [rsp + 0x52], bl
movzx ecx, bl
mov dword [rsp + 0x7c], ecx
cmp rax, 0xffffffffffffffff
mov qword [rsp + 0x70], rsi
je 0x50da36
cmp byte [r12 + 0x3f], 0
je 0x50de18
test r14, r14
je 0x50dded
mov qword [rsp + 0x90], r14
mov r15d, dword [rsp + 0x54]
xor edi, edi
mov rbp, qword [rsp + 0x90]
mov ebx, dword [rsp + 0x7c]
jmp 0x50da6b
mov edi, esi
mov rbp, qword [rbp + 0x40]
test rbp, rbp
je 0x50dae6
mov esi, edi
cmp byte [rbp + 0x10], 0x80
jne 0x50da60
mov al, byte [rbp + 0x11]
not al
or al, 0xfc
cmp al, 0xff
je 0x50da60
mov edi, 0xffffffff
cmp byte [rbp + 0x12], 0
jne 0x50da62
mov rax, qword [r13 + 0xa0]
test rax, rax
cmove rax, r13
mov rax, qword [rax + 0xb0]
jmp 0x50daa4
mov rax, qword [rax + 8]
test rax, rax
je 0x50dab5
cmp qword [rax], rbp
jne 0x50daa0
cmp dword [rax + 0x18], ebx
jne 0x50daa0
jmp 0x50dad6
mov rcx, r13
mov rdx, rbp
mov r8, r12
mov r9d, ebx
call fcn.005125d0
mov rcx, qword [r13]
mov dword [rcx + 0x54], 0xffffffff
test rax, rax
je 0x50da60
mov edi, dword [rax + 0x1c]
mov eax, edi
and eax, esi
xor edi, esi
or edi, eax
jmp 0x50da62
mov rsi, qword [rsp + 0x70]
mov rcx, r13
mov rdx, r12
call fcn.0050ecd0
mov rcx, r13
mov r13d, eax
mov edx, dword [rcx + 0x38]
lea r9d, [rdx + 1]
movsx eax, word [r12 + 0x36]
mov rbp, rdx
lea eax, [rdx + rax + 1]
mov qword [rsp + 0xa0], rcx
mov dword [rcx + 0x38], eax
movsxd rax, dword [rsi + 0x90]
cmp dword [rsi + 0x94], eax
mov dword [rsp + 0x6c], r9d
jle 0x50dbef
lea ecx, [rax + 1]
mov dword [rsi + 0x90], ecx
mov rcx, qword [rsi + 0x88]
lea rax, [rax + rax*2]
mov dword [rcx + rax*8], 0x50
mov edx, dword [rsp + 0x5c]
mov dword [rcx + rax*8 + 4], edx
mov dword [rcx + rax*8 + 8], r9d
mov dword [rcx + rax*8 + 0xc], 0
mov qword [rcx + rax*8 + 0x10], 0
mov rbx, rbp
movzx eax, word [r12 + 0x36]
test ax, ax
jg 0x50dc1b
jmp 0x50e05b
mov eax, dword [rsi + 0x90]
cmp dword [rsi + 0x94], eax
jle 0x50de70
movsxd rcx, eax
lea edx, [rcx + 1]
mov dword [rsi + 0x90], edx
mov rdx, qword [rsi + 0x88]
lea rcx, [rcx + rcx*2]
mov byte [rdx + rcx*8], dil
mov word [rdx + rcx*8 + 2], 0
mov ebp, dword [rsp + 0x54]
mov dword [rdx + rcx*8 + 4], ebp
mov ebp, dword [rsp + 0x60]
mov dword [rdx + rcx*8 + 8], ebp
mov ebp, dword [rsp + 0x5c]
mov dword [rdx + rcx*8 + 0xc], ebp
mov qword [rdx + rcx*8 + 0x10], 0
mov byte [rdx + rcx*8 + 1], 0
mov rcx, qword [rsi]
cmp byte [rcx + 0x67], 0
jne 0x50da01
jmp 0x50de9b
mov dword [rsp + 0x20], 0
mov rcx, rsi
mov edx, 0x50
mov r8d, dword [rsp + 0x5c]
call fcn.0047df60
mov rbx, rbp
movzx eax, word [r12 + 0x36]
test ax, ax
jle 0x50e05b
mov ecx, r13d
and ecx, edi
xor r13d, edi
or r13d, ecx
add ebx, 2
cmp r13d, 0xffffffff
mov qword [rsp + 0x88], rbx
je 0x50debb
xor r14d, r14d
not r13d
jmp 0x50dc74
mov eax, r14d
cwde
add eax, ebx
mov dword [rsp + 0x20], eax
mov rcx, rsi
mov rdx, r12
mov r8d, r15d
mov r9d, r14d
call fcn.004cdfb0
movzx eax, word [r12 + 0x36]
add r14d, 1
movsx ecx, ax
cmp r14d, ecx
jge 0x50e05b
cmp r14d, 1
mov edx, 1
cmova edx, r14d
cmp r14d, 0x1f
ja 0x50dc64
mov ebp, 0xfffffffe
mov ecx, r14d
rol ebp, cl
or ebp, r13d
cmp ebp, 0xffffffff
je 0x50dc64
mov eax, dword [r12 + 0x30]
not eax
or eax, 0xffffffdf
cmp eax, 0xffffffff
je 0x50dc43
mov r10, qword [r12 + 8]
movzx ebx, word [r10 + 0x12]
and ebx, 0x20
test r14w, r14w
je 0x50dcf2
cmp r14d, 1
mov r8d, 1
cmova r8d, r14d
movabs rax, 0x361d84dcebacdb96
mov r9d, eax
not r9d
or r9d, eax
and r9d, edx
and r9d, 1
cmp r14d, 2
jae 0x50dcfc
xor edi, edi
xor eax, eax
jmp 0x50dd8f
xor r8d, r8d
xor eax, eax
jmp 0x50ddca
mov r11d, edx
xor r11d, 0x80000001
and r11d, edx
lea rbp, [r10 + 0x42]
xor edi, edi
xor ecx, ecx
mov rsi, r11
nop word cs:[rax + rax]
nop
movzx eax, bx
shr eax, 5
mov edx, eax
not edx
and edx, 1
and eax, 0xfffffffe
or eax, edx
add ecx, eax
mov eax, edi
and eax, 1
mov rdx, rdi
xor rdx, 1
or rdx, rax
lea rax, [rdx + rdx*2]
movzx edx, word [r10 + rax*8 + 0x12]
shr edx, 5
mov eax, edx
xor eax, 0x7fe
and eax, edx
mov edx, eax
not edx
and edx, 0xffffbd7a
and eax, 0x285
or eax, edx
xor eax, 0xffffbd7b
add eax, ecx
add rdi, 2
movzx ecx, word [rbp]
mov ebx, ecx
xor ebx, 0xffffffdf
and ebx, ecx
add rsi, 0xfffffffffffffffe
add rbp, 0x30
mov ecx, eax
cmp r11, rdi
jne 0x50dd20
test r9, r9
mov rsi, qword [rsp + 0x70]
je 0x50ddca
lea rcx, [rdi + rdi*2]
movzx ecx, word [r10 + rcx*8 + 0x2a]
movzx edx, bx
mov ebx, ecx
xor ebx, 0xffffffdf
and ebx, ecx
shr edx, 5
mov ecx, edx
not ecx
and ecx, 0xffff80ff
and edx, 0x700
or edx, ecx
xor edx, 0xffff80fe
add eax, edx
test bx, bx
je 0x50dddb
sub r8d, eax
add r8w, word [r12 + 0x38]
mov eax, r8d
mov r15d, dword [rsp + 0x54]
mov rbx, qword [rsp + 0x88]
jmp 0x50dc46
mov dword [rsp + 0x6c], 0
mov bpl, byte [rsp + 0x52]
mov r15d, dword [rsp + 0x54]
mov rbx, qword [rsp + 0x80]
cmp byte [r12 + 0x3f], 2
jne 0x50e1b5
jmp 0x50e372
mov rcx, qword [r12]
mov r9, qword [r12 + 0x60]
mov rsi, qword [r9 + 0x60]
test rsi, rsi
je 0x50e44d
mov bl, byte [rcx]
test bl, bl
je 0x50e464
lea rdx, [rcx + 1]
xor eax, eax
lea rdi, [0x005fade0]
nop word cs:[rax + rax]
nop
movzx ebp, bl
movzx ebp, byte [rbp + rdi]
add ebp, eax
imul eax, ebp, 0x9e3779b1
movzx ebx, byte [rdx]
add rdx, 1
test bl, bl
jne 0x50de50
jmp 0x50e466
movzx edx, dil
mov eax, dword [rsp + 0x5c]
mov dword [rsp + 0x20], eax
mov rcx, rsi
mov r8d, dword [rsp + 0x54]
mov r9d, dword [rsp + 0x60]
call fcn.0047df60
mov rcx, qword [rsi]
cmp byte [rcx + 0x67], 0
jne 0x50da01
movsx ecx, word [rsp + 0x6a]
mov rdx, qword [rsi + 0x88]
cdqe
lea rax, [rax + rax*2]
mov byte [rdx + rax*8 + 1], 0xfd
mov dword [rdx + rax*8 + 0x10], ecx
jmp 0x50da01
xor r13d, r13d
movabs r14, 0x805cabc5020e3559
jmp 0x50df00
mov ebp, r13d
movsx eax, bp
add eax, ebx
mov dword [rsp + 0x20], eax
mov rcx, rsi
mov rdx, r12
mov r8d, r15d
mov r9d, r13d
call fcn.004cdfb0
add r13d, 1
movsx eax, word [r12 + 0x36]
cmp r13d, eax
jge 0x50e05b
cmp r13d, 1
mov eax, 1
cmova eax, r13d
mov ecx, dword [r12 + 0x30]
not ecx
or ecx, 0xffffffdf
cmp ecx, 0xffffffff
je 0x50ded0
test r13w, r13w
js 0x50ded0
mov r10, qword [r12 + 8]
movzx ebx, word [r10 + 0x12]
and ebx, 0x20
test r13w, r13w
je 0x50df65
movsx r8d, r13w
cmp r8d, 1
mov ecx, 1
cmovbe r8d, ecx
mov r9d, r14d
not r9d
or r9d, r14d
and r9d, eax
and r9d, 1
cmp r13d, 2
jae 0x50df6f
xor edx, edx
xor ebp, ebp
jmp 0x50e009
xor r8d, r8d
xor ebp, ebp
jmp 0x50e038
mov r11d, eax
xor r11d, 0x80000001
and r11d, eax
lea rax, [r10 + 0x42]
xor edx, edx
xor ecx, ecx
mov rsi, r11
nop word [rax + rax]
movzx ebp, bx
shr ebp, 5
mov ebx, ebp
not ebx
and ebx, 0x4a70
and ebp, 0x58f
or ebp, ebx
xor ebp, 0x4a71
add ecx, ebp
mov edi, edx
and edi, 1
mov rbx, rdx
xor rbx, 1
or rbx, rdi
lea rdi, [rbx + rbx*2]
movzx edi, word [r10 + rdi*8 + 0x12]
shr edi, 5
mov ebp, edi
xor ebp, 0x7fe
and ebp, edi
mov edi, ebp
not edi
and edi, 0x3918
and ebp, 0x6e7
or ebp, edi
xor ebp, 0x3919
add ebp, ecx
add rdx, 2
movzx ebx, word [rax]
and ebx, 0x20
add rsi, 0xfffffffffffffffe
add rax, 0x30
mov ecx, ebp
cmp r11, rdx
jne 0x50df90
test r9, r9
mov rsi, qword [rsp + 0x70]
je 0x50e038
lea rax, [rdx + rdx*2]
movzx eax, word [r10 + rax*8 + 0x2a]
movzx ecx, bx
mov ebx, eax
xor ebx, 0xffffffdf
and ebx, eax
shr ecx, 5
or ecx, 0x51b2
xor ecx, 0x51b3
add ebp, ecx
test bx, bx
je 0x50e049
sub r8d, ebp
add r8w, word [r12 + 0x38]
mov ebp, r8d
mov r15d, dword [rsp + 0x54]
mov rbx, qword [rsp + 0x88]
jmp 0x50ded3
mov rax, qword [rsp + 0x70]
mov esi, dword [rax + 0x90]
mov eax, dword [rsp + 0x60]
mov dword [rsp + 0x40], eax
mov eax, dword [rsp + 0x7c]
mov dword [rsp + 0x38], eax
mov edi, dword [rsp + 0x6c]
mov dword [rsp + 0x30], edi
mov qword [rsp + 0x28], r12
mov dword [rsp + 0x20], 1
mov r13, qword [rsp + 0xa0]
mov rcx, r13
mov r14, qword [rsp + 0x90]
mov rdx, r14
mov r8d, pe_nt_image_headers64
xor r9d, r9d
call fcn.0050f580
mov rax, qword [rsp + 0x70]
mov eax, dword [rax + 0x90]
cmp esi, eax
mov rsi, qword [rsp + 0x70]
mov rbx, qword [rsp + 0x80]
mov bpl, byte [rsp + 0x52]
jge 0x50e187
cmp dword [rsi + 0x94], eax
jle 0x50e13e
movsxd rcx, eax
lea edx, [rax + 1]
mov dword [rsi + 0x90], edx
mov rdx, qword [rsi + 0x88]
lea rcx, [rcx + rcx*2]
mov r8d, ebp
mov ebp, dword [rsp + 0x78]
mov byte [rdx + rcx*8], bpl
mov word [rdx + rcx*8 + 2], 0
mov dword [rdx + rcx*8 + 4], r15d
mov ebp, dword [rsp + 0x60]
mov dword [rdx + rcx*8 + 8], ebp
mov ebp, dword [rsp + 0x5c]
mov dword [rdx + rcx*8 + 0xc], ebp
mov ebp, r8d
mov qword [rdx + rcx*8 + 0x10], 0
mov byte [rdx + rcx*8 + 1], 0
mov rcx, qword [rsi]
mov dword [rsp + 0x64], 0xffffffff
cmp byte [rcx + 0x67], 0
jne 0x50e187
jmp 0x50e16c
movzx edx, byte [rsp + 0x78]
mov eax, dword [rsp + 0x5c]
mov dword [rsp + 0x20], eax
mov rcx, rsi
mov r8d, r15d
mov r9d, dword [rsp + 0x60]
call fcn.0047df60
mov rcx, qword [rsi]
mov dword [rsp + 0x64], 0xffffffff
cmp byte [rcx + 0x67], 0
jne 0x50e187
movsx ecx, word [rsp + 0x6a]
mov rdx, qword [rsi + 0x88]
cdqe
lea rax, [rax + rax*2]
mov byte [rdx + rax*8 + 1], 0xfd
mov dword [rdx + rax*8 + 0x10], ecx
mov dword [rsp + 0x28], 0
mov qword [rsp + 0x20], 0
mov rcx, r13
mov rdx, r12
mov r8d, edi
xor r9d, r9d
call fcn.005101a0
cmp byte [r12 + 0x3f], 2
je 0x50e372
mov eax, dword [rsp + 0x64]
mov dword [rsp + 0x28], eax
mov qword [rsp + 0x20], 0
mov rcx, r13
mov rdx, r12
mov r8d, r15d
mov r9d, dword [rsp + 0x9c]
call fcn.00510cf0
xor r9d, r9d
cmp byte [rsp + 0x5b], 0
setne r9b
movsxd rax, dword [rsi + 0x90]
cmp dword [rsi + 0x94], eax
jle 0x50e236
lea ecx, [rax + 1]
mov dword [rsi + 0x90], ecx
mov rcx, qword [rsi + 0x88]
lea rax, [rax + rax*2]
mov dword [rcx + rax*8], 0x82
mov dword [rcx + rax*8 + 4], r15d
mov dword [rcx + rax*8 + 8], r9d
mov dword [rcx + rax*8 + 0xc], 0
mov qword [rcx + rax*8 + 0x10], 0
cmp byte [r13 + 0x1e], 0
jne 0x50e255
jmp 0x50e28e
mov dword [rsp + 0x20], 0
mov rcx, rsi
mov edx, 0x82
mov r8d, r15d
call fcn.0047df60
cmp byte [r13 + 0x1e], 0
je 0x50e28e
mov rax, qword [r12]
test rax, rax
je 0x50e2b8
xor ecx, ecx
lea rdx, [0x005fd6ff]
lea rbp, [0x005fade0]
jmp 0x50e27d
movzx ebx, byte [rbx + rbp]
cmp bl, byte [rdi + rbp]
jne 0x50e2b8
add rcx, 1
movzx ebx, byte [rax + rcx]
movzx edi, byte [rcx + rdx]
cmp bl, dil
jne 0x50e270
test bl, bl
jne 0x50e279
mov rax, qword [rsi]
cmp byte [rax + 0x67], 0
jne 0x50e2b8
mov rax, qword [rsi + 0x88]
mov ecx, dword [rsi + 0x90]
add ecx, 0xffffffff
movsxd rcx, ecx
lea rcx, [rcx + rcx*2]
mov byte [rax + rcx*8 + 1], 0xfb
mov qword [rax + rcx*8 + 0x10], r12
cmp byte [rsp + 0x53], 0
je 0x50e2de
mov eax, dword [rsi + 0x90]
test eax, eax
jle 0x50e2de
mov rcx, qword [rsi + 0x88]
add eax, 0xffffffff
lea rax, [rax + rax*2]
mov word [rcx + rax*8 + 2], 4
mov ecx, dword [rsp + 0x64]
test ecx, ecx
setns al
sets dl
cmp ecx, dword [rsp + 0x54]
setne cl
sete bl
xor bl, dl
mov rbx, qword [rsp + 0x80]
mov bpl, byte [rsp + 0x52]
jne 0x50e349
or al, cl
xor al, 1
jne 0x50e349
movsxd rax, dword [rsi + 0x90]
cmp dword [rsi + 0x94], eax
jle 0x50e41d
lea ecx, [rax + 1]
mov dword [rsi + 0x90], ecx
mov rcx, qword [rsi + 0x88]
lea rax, [rax + rax*2]
mov dword [rcx + rax*8], 0x82
mov edx, dword [rsp + 0x64]
mov dword [rcx + rax*8 + 4], edx
xorps xmm0, xmm0
movups xmmword [rcx + rax*8 + 8], xmm0
mov eax, dword [rsi + 0x90]
test eax, eax
jle 0x50e372
xor ecx, ecx
cmp byte [rsp + 0x53], 2
sete cl
add ecx, ecx
mov rdx, qword [rsi + 0x88]
add eax, 0xffffffff
lea rax, [rax + rax*2]
mov word [rdx + rax*8 + 2], cx
mov dword [rsp + 0x28], 0
mov qword [rsp + 0x20], 0
mov rcx, r13
mov rdx, r12
xor r8d, r8d
mov edi, dword [rsp + 0x6c]
mov r9d, edi
call fcn.00511060
movzx eax, bpl
mov ecx, dword [rsp + 0x60]
mov dword [rsp + 0x40], ecx
mov dword [rsp + 0x38], eax
mov dword [rsp + 0x30], edi
mov qword [rsp + 0x28], r12
mov dword [rsp + 0x20], 2
mov rcx, r13
mov rdx, r14
mov r8d, pe_nt_image_headers64
xor r9d, r9d
call fcn.0050f580
mov rcx, qword [rsi + 0x18]
neg ebx
mov eax, dword [rcx + 0x44]
add eax, dword [rcx + 0x48]
js 0x50e3ff
mov eax, dword [rsi + 0x90]
mov rcx, qword [rcx + 0x50]
movsxd rdx, ebx
mov dword [rcx + rdx*4], eax
add rsp, 0xa8
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
mov rdx, rsi
mov r8d, ebx
add rsp, 0xa8
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
jmp fcn.004d3e00
mov dword [rsp + 0x20], 0
mov rcx, rsi
mov edx, 0x82
mov r8d, dword [rsp + 0x64]
xor r9d, r9d
call fcn.0047df60
mov eax, dword [rsi + 0x90]
test eax, eax
jg 0x50e353
jmp 0x50e372
lea rdx, [r9 + 0x54]
add r9, 0x58
mov edx, dword [rdx]
lea r8, [0x0213b3c8]
test edx, edx
jne 0x50e488
jmp 0x50e4ca
xor eax, eax
xor edx, edx
div dword [r9 + 0x50]
shl rdx, 4
lea r9, [rsi + rdx]
add r9, 8
add rdx, rsi
mov edx, dword [rdx]
lea r8, [0x0213b3c8]
test edx, edx
je 0x50e4ca
lea rbx, [0x005fade0]
mov r9, qword [r9]
add edx, 0xffffffff
mov rdi, qword [r9 + 0x18]
xor esi, esi
jmp 0x50e4ae
movzx eax, byte [rax + rbx]
cmp al, byte [rbp + rbx]
jne 0x50e4c1
add rsi, 1
movzx eax, byte [rdi + rsi]
movzx ebp, byte [rcx + rsi]
cmp al, bpl
jne 0x50e4a0
test al, al
jne 0x50e4aa
jmp 0x50e4c7
test edx, edx
jne 0x50e48f
jmp 0x50e4ca
mov r8, r9
cmp qword [r8 + 0x10], 0
mov rsi, qword [rsp + 0x70]
mov r15d, dword [rsp + 0x54]
mov rbx, qword [rsp + 0x80]
je 0x50e4fb
test r14, r14
mov qword [rsp + 0x90], r14
jne 0x50da4c
xor edi, edi
jmp 0x50daeb
test r14, r14
jne 0x50e4e3
cmp qword [r12 + 0x48], 0
jne 0x50e4e3
mov dword [rsp + 0x6c], 0
mov al, 1
test al, al
je 0x50e4e3
mov bpl, byte [rsp + 0x52]
cmp byte [r12 + 0x3f], 2
jne 0x50e1b5
jmp 0x50e372