Function at 0x180013980
Capabilities:
Encode data using xor
Generate random numbers using the delphi lcg
Hash data with crc32

Disassembly:
push rbp
push rbx
push rsi
lea rbp, [rsp - 0x570]
sub rsp, 0x670
mov rax, qword [0x1800438e8]
xor rax, rsp
mov qword [rbp + 0x540], rax
cmp dword [rcx + 0x24], 0
mov ebx, r9d
mov qword [rsp + 0x50], r8
mov rsi, rcx
je 0x1800139bf
mov eax, 0x40000
jmp 0x180013b69
cmp byte [rcx + 0x40], 0
je 0x1800139cf
mov eax, 0x50000
jmp 0x180013b69
xor r8d, r8d
mov qword [rsp + 0x650], r15
lea eax, [r8 + 0xc]
mov r15d, r8d
mov dword [rsp + 0x48], r8d
cmp qword [rcx], r8
je 0x1800139f7
cmp ebx, 4
cmovne r15d, eax
mov dword [rsp + 0x48], r15d
lea rcx, [rbp + 0x330]
sub rcx, rdx
movzx eax, word [rdx]
add rdx, 2
mov word [rdx + rcx - 2], ax
test ax, ax
jne 0x180013a01
cmp word [rbp + 0x330], r8w
jne 0x180013a26
mov eax, 0x10000
jmp 0x180013b61
mov qword [rsp + 0x668], r12
mov qword [rsp + 0x660], r13
lea rax, [rbp + 0x330]
mov qword [rsp + 0x658], r14
mov ecx, 0x2f
nop word [rax + rax]
cmp word [rax], 0x5c
jne 0x180013a59
mov word [rax], cx
add rax, 2
cmp word [rax], r8w
jne 0x180013a50
cmp ebx, 4
mov qword [rsp + 0x698], rdi
sete r13b
mov byte [rsp + 0x41], r13b
test r13b, r13b
je 0x180013a9f
or rcx, 0xffffffffffffffff
xor eax, eax
lea rdi, [rbp + 0x330]
repne scasw ax, word [rdi]
mov byte [rsp + 0x40], 1
not rcx
cmp word [rbp + rcx*2 + 0x32c], 0x2f
jne 0x180013aa4
mov byte [rsp + 0x40], r8b
mov r14d, 8
mov r12d, r14d
mov dword [rsp + 0x44], r14d
test r13b, r13b
jne 0x180013aca
lea rcx, [rbp + 0x330]
call fcn.180012ad0
xor r8d, r8d
test al, al
je 0x180013ad2
mov r12d, r8d
mov dword [rsp + 0x44], r8d
cmp ebx, 2
jne 0x180013ae9
mov rdx, qword [rsp + 0x50]
mov rcx, rsi
call fcn.180013220
jmp 0x180013b90
cmp ebx, 1
jne 0x180013b00
mov rdx, qword [rsp + 0x50]
mov rcx, rsi
call fcn.180013300
jmp 0x180013b90
cmp ebx, 3
jne 0x180013b83
mov rax, qword [rsp + 0x50]
mov qword [rsi + 0xa8], r8
mov byte [rsi + 0xb0], 0
mov dword [rsi + 0xc8], r8d
mov qword [rsi + 0x9c], 0
mov qword [rsi + 0xc0], 0
mov qword [rsi + 0xb8], rax
mov eax, 0x10000
mov rdi, qword [rsp + 0x698]
mov r13, qword [rsp + 0x660]
mov r12, qword [rsp + 0x668]
mov r14, qword [rsp + 0x658]
mov r15, qword [rsp + 0x650]
mov rcx, qword [rbp + 0x540]
xor rcx, rsp
call fcn.18001be70
add rsp, 0x670
pop rsi
pop rbx
pop rbp
ret
cmp ebx, 4
jne 0x180013b3c
mov rcx, rsi
call fcn.1800134f0
test eax, eax
jne 0x180013b41
xor ebx, ebx
lea rax, [rbp + 0xc8]
lea r8, [rbp + 0x330]
mov qword [rsp + 0x38], rbx
mov qword [rsp + 0x30], rbx
or r9d, 0xffffffff
xor edx, edx
mov ecx, 0x3a8
mov dword [rsp + 0x28], 0x104
mov qword [rbp + 0x2e0], rbx
mov byte [rbp - 0x58], bl
mov qword [rsp + 0x20], rax
call qword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
or rcx, 0xffffffffffffffff
xor eax, eax
lea rdi, [rbp + 0xc8]
repne scasb al, byte [rdi]
not rcx
dec rcx
mov qword [rsp + 0x78], rcx
cmp byte [rsp + 0x40], al
je 0x180013c13
or rcx, 0xffffffffffffffff
lea rdi, [rbp + 0xc8]
repne scasb al, byte [rdi]
movzx eax, word [0x180039fdc]
mov word [rdi - 1], ax
inc qword [rsp + 0x78]
mov eax, 0xb17
mov byte [rbp + 0x1cc], bl
mov qword [rbp + 0xc0], rbx
mov word [rsp + 0x60], ax
mov eax, socket
mov qword [rbp - 0x70], rbx
mov word [rsp + 0x62], ax
mov eax, dword [rsi + 0x90]
mov dword [rbp + 0x2d0], 1
mov dword [rbp + 0x2d8], ebx
mov word [rbp - 0x66], bx
mov dword [rsp + 0x6c], ebx
mov dword [rsp + 0x68], eax
mov word [rsp + 0x64], r14w
mov ecx, 9
cmp qword [rsi], rbx
je 0x180013c78
test r13b, r13b
jne 0x180013c78
movzx r14d, cx
mov word [rsp + 0x64], cx
mov word [rbp - 0x64], r14w
mov word [rsp + 0x66], r12w
test r12d, r12d
jne 0x180013c9b
mov eax, dword [rsi + 0x98]
test eax, eax
js 0x180013c9b
add eax, r15d
mov dword [rsp + 0x70], eax
jmp 0x180013c9f
mov dword [rsp + 0x70], ebx
mov eax, dword [rsi + 0x98]
mov rdx, qword [rsi + 0x80]
mov qword [rbp - 0x78], rcx
mov rcx, qword [rsi + 0x78]
mov dword [rsp + 0x74], eax
mov eax, dword [rsi + 0x70]
mov dword [rbp - 0x60], eax
mov eax, dword [rsi + 0x28]
mov dword [rbp + 0x2f0], 0xd5455
add eax, dword [rsi + 0x20]
mov byte [rbp + 0x2f4], 7
mov word [rbp - 0x68], bx
mov dword [rbp - 0x5c], eax
lea rax, [rbp + 0x2f0]
mov qword [rbp - 0x80], socket
mov qword [rbp + 0xb0], rax
lea rax, [rbp + 0x318]
mov qword [rbp + 0xb8], rax
movzx eax, byte [rsi + 0x80]
mov byte [rbp + 0x2f5], al
mov rax, rdx
sar rax, 8
mov byte [rbp + 0x2f6], al
mov rax, rdx
sar rdx, 0x18
sar rax, 0x10
mov byte [rbp + 0x2f8], dl
mov byte [rbp + 0x320], dl
mov byte [rbp + 0x2f7], al
movzx eax, byte [rsi + 0x78]
mov rdx, rsi
mov byte [rbp + 0x2f9], al
mov rax, rcx
sar rax, 8
mov byte [rbp + 0x2fa], al
mov rax, rcx
sar rcx, 0x18
sar rax, 0x10
mov byte [rbp + 0x2fc], cl
mov rcx, qword [rsi + 0x88]
mov byte [rbp + 0x2fb], al
movzx eax, byte [rsi + 0x88]
mov byte [rbp + 0x2fd], al
mov rax, rcx
sar rax, 8
mov byte [rbp + 0x2fe], al
mov rax, rcx
sar rcx, 0x18
sar rax, 0x10
mov byte [rbp + 0x300], cl
lea rcx, [rsp + 0x60]
mov byte [rbp + 0x2ff], al
mov rax, qword [rbp + 0x2f0]
mov qword [rbp + 0x318], rax
mov byte [rbp + 0x31a], 5
call fcn.180011c50
test eax, eax
je 0x180013dd5
mov rcx, rsi
call fcn.180013740
mov eax, 0x400
jmp 0x180013b41
mov ecx, dword [rsp + 0x78]
mov eax, dword [rbp - 0x80]
lea ecx, [rax + rcx + 0x1e]
add dword [rsi + 0x28], ecx
cmp dword [rsi + 0x24], ebx
je 0x180013df8
mov rcx, rsi
call fcn.180013740
mov eax, dword [rsi + 0x24]
jmp 0x180013b41
mov rdi, qword [rsi]
mov dword [rsi + 0x44], 0x12345678
mov dword [rsi + 0x48], 0x23456789
mov dword [rsi + 0x4c], 0x34567890
lea r8, [0x1800394e0]
test rdi, rdi
je 0x180013e6d
nop dword [rax]
movzx eax, byte [rdi]
test al, al
je 0x180013e6d
mov edx, dword [rsi + 0x44]
mov ecx, edx
shr edx, 8
xor rcx, rax
movzx eax, cl
mov ecx, dword [r8 + rax*4]
xor ecx, edx
mov edx, dword [rsi + 0x4c]
movzx eax, cl
mov dword [rsi + 0x44], ecx
movzx ecx, dl
add eax, dword [rsi + 0x48]
shr edx, 8
imul eax, eax, 0x8088405
inc eax
mov dword [rsi + 0x48], eax
movzx eax, byte [rsi + 0x4b]
xor rcx, rax
mov eax, dword [r8 + rcx*4]
xor eax, edx
inc rdi
mov dword [rsi + 0x4c], eax
jne 0x180013e20
cmp byte [0x180046e50], bl
jne 0x180013e8d
call qword [sym.imp.USER32.dll_GetDesktopWindow]
mov rdi, rax
call qword [sym.imp.KERNEL32.dll_GetTickCount]
xor edi, eax
mov ecx, edi
call fcn.18001d31c
mov rdi, rbx
call fcn.18001d334
inc rdi
sar eax, 7
mov byte [rbp + rdi + 0x307], al
cmp rdi, 0xc
jl 0x180013e90
mov eax, dword [rsp + 0x68]
mov r13d, dword [rsi + 0x4c]
mov r15d, dword [rsi + 0x44]
shr eax, 8
mov r14, rbx
mov ebx, dword [rsi + 0x48]
mov byte [rbp + 0x313], al
lea r12, [0x1800394e0]
nop word [rax + rax]
movsx r8, byte [rbp + r14 + 0x308]
mov edi, r13d
mov rax, r8
and edi, 0xfffd
xor rax, r15
or edi, 2
movzx ecx, al
mov eax, r15d
mov edx, dword [r12 + rcx*4]
shr eax, 8
mov ecx, r13d
xor edx, eax
shr ecx, 8
mov dword [rsi + 0x44], edx
mov r9d, edx
movzx r11d, dl
add r11d, ebx
movzx edx, r13b
imul r11d, r11d, 0x8088405
inc r11d
mov dword [rsi + 0x48], r11d
movzx eax, byte [rsi + 0x4b]
xor rdx, rax
mov eax, edi
mov r10d, dword [r12 + rdx*4]
xor eax, 1
xor r10d, ecx
mov dword [rsi + 0x4c], r10d
mov edx, r10d
imul eax, edi
movsx rdi, byte [rbp + r14 + 0x309]
shr eax, 8
and edx, 0xfffd
xor al, r8b
or edx, 2
mov byte [rbp + r14 + 0x308], al
mov rax, rdi
xor rax, r9
shr r9d, 8
movzx ecx, al
mov eax, dword [r12 + rcx*4]
movzx ecx, r10b
shr r10d, 8
xor eax, r9d
mov dword [rsi + 0x44], eax
movzx ebx, al
mov r8d, eax
add ebx, r11d
imul ebx, ebx, 0x8088405
inc ebx
mov dword [rsi + 0x48], ebx
movzx eax, byte [rsi + 0x4b]
xor rcx, rax
mov eax, edx
mov r9d, dword [r12 + rcx*4]
xor eax, 1
xor r9d, r10d
mov dword [rsi + 0x4c], r9d
imul eax, edx
shr eax, 8
mov edx, r9d
xor al, dil
movsx rdi, byte [rbp + r14 + 0x30a]
and edx, 0xfffd
mov byte [rbp + r14 + 0x309], al
mov rax, rdi
or edx, 2
xor rax, r8
shr r8d, 8
movzx ecx, al
mov eax, dword [r12 + rcx*4]
movzx ecx, r9b
xor eax, r8d
movzx r10d, al
mov r8d, eax
mov dword [rsi + 0x44], eax
add r10d, ebx
imul r10d, r10d, 0x8088405
inc r10d
mov dword [rsi + 0x48], r10d
movzx eax, byte [rsi + 0x4b]
xor rcx, rax
mov eax, edx
shr r9d, 8
xor r9d, dword [r12 + rcx*4]
xor eax, 1
add r14, 4
mov dword [rsi + 0x4c], r9d
imul eax, edx
shr eax, 8
mov edx, r9d
xor al, dil
movsx rdi, byte [rbp + r14 + 0x307]
and edx, 0xfffd
mov byte [rbp + r14 + 0x306], al
or edx, 2
mov rax, rdi
xor rax, r8
shr r8d, 8
movzx ecx, al
mov eax, dword [r12 + rcx*4]
movzx ecx, r9b
shr r9d, 8
xor eax, r8d
movzx ebx, al
mov r15d, eax
mov dword [rsi + 0x44], eax
add ebx, r10d
imul ebx, ebx, 0x8088405
inc ebx
mov dword [rsi + 0x48], ebx
movzx eax, byte [rsi + 0x4b]
xor rcx, rax
mov eax, dword [r12 + rcx*4]
xor eax, r9d
mov r13d, eax
mov dword [rsi + 0x4c], eax
mov eax, edx
xor eax, 1
imul eax, edx
shr eax, 8
xor al, dil
mov byte [rbp + r14 + 0x307], al
cmp r14, 0xc
jl 0x180013ed0
cmp qword [rsi], 0
mov r12d, dword [rsp + 0x44]
movzx r13d, byte [rsp + 0x41]
mov r15d, dword [rsp + 0x48]
je 0x1800140dc
test r13b, r13b
jne 0x1800140dc
lea rdx, [rbp + 0x308]
mov r8d, recv
mov rcx, rsi
call fcn.180012f70
add dword [rsi + 0x28], 0xc
xor ebx, ebx
mov edi, ebx
cmp qword [rsi], rbx
je 0x1800140ed
lea eax, [rbx + 1]
test r13b, r13b
je 0x1800140ef
mov eax, ebx
mov byte [rsi + 0x41], al
test r13b, r13b
jne 0x18001411f
cmp r12d, 8
jne 0x18001410e
lea rdx, [rsp + 0x60]
mov rcx, rsi
call fcn.1800137b0
mov edi, eax
jmp 0x180014125
test r12d, r12d
jne 0x180014125
mov rcx, rsi
call fcn.1800138f0
mov edi, eax
jmp 0x180014125
mov dword [rsi + 0xc8], ebx
mov byte [rsi + 0x41], bl
cmp byte [rsi + 0xb0], bl
je 0x180014142
mov rcx, qword [rsi + 0xa8]
test rcx, rcx
je 0x180014142
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [rsi + 0xc8]
mov eax, dword [rsi + 0x24]
mov edx, dword [rsi + 0x9c]
add dword [rsi + 0x28], ecx
mov qword [rsi + 0xa8], rbx
mov dword [rsi + 0x98], edx
test eax, eax
jne 0x180013b41
test edi, edi
jne 0x180013dcb
mov eax, dword [rsi + 0xa0]
add ecx, r15d
mov dword [rsp + 0x74], edx
cmp dword [rsp + 0x70], ecx
mov dword [rsp + 0x70], ecx
mov dword [rsp + 0x6c], eax
sete dil
cmp byte [rsi + 0x2c], bl
je 0x1800141fd
cmp qword [rsi], rbx
je 0x18001419d
test r13b, r13b
je 0x1800141fd
movzx eax, word [rsp + 0x64]
mov word [rsp + 0x66], r12w
test al, 1
jne 0x1800141b9
mov ecx, 0xfff7
and ax, cx
mov word [rsp + 0x64], ax
mov edx, dword [rbp - 0x5c]
mov rcx, rsi
mov word [rbp - 0x64], ax
sub edx, dword [rsi + 0x20]
call fcn.180013120
test al, al
je 0x1800141f3
lea rcx, [rsp + 0x60]
mov rdx, rsi
call fcn.180011c50
test eax, eax
jne 0x180013dcb
mov edx, dword [rsi + 0x28]
mov rcx, rsi
call fcn.180013120
test al, al
jne 0x18001423b
mov eax, 0x2000000
jmp 0x180013b41
cmp word [rsp + 0x66], r12w
jne 0x18001420f
test r12d, r12d
jne 0x180014219
test dil, dil
jne 0x180014219
mov eax, 0x4000000
jmp 0x180013b41
lea rcx, [rsp + 0x60]
mov rdx, rsi
call fcn.180011ff0
test eax, eax
jne 0x180013dcb
movzx eax, word [rbp - 0x64]
add dword [rsi + 0x28], 0x10
mov word [rsp + 0x64], ax
mov eax, dword [rsi + 0x24]
test eax, eax
jne 0x180013b41
mov rcx, qword [rbp - 0x78]
call fcn.18001ab88
mov r8, qword [rbp - 0x78]
mov rdx, qword [rbp + 0xb8]
mov rcx, rax
mov rdi, rax
call fcn.18001bea0
mov ecx, 0x388
mov qword [rbp + 0xb8], rdi
call fcn.18001c518
lea rdx, [rsp + 0x60]
mov r8d, 0x388
mov rcx, rax
mov rdi, rax
call fcn.18001bea0
mov rcx, qword [rsi + 0x60]
test rcx, rcx
jne 0x1800142a0
mov qword [rsi + 0x60], rdi
xor eax, eax
jmp 0x180013b41
lea rax, [rcx + 0x380]
cmp qword [rax], rbx
je 0x1800142bf
nop dword [rax]
mov rcx, qword [rax]
lea rax, [rcx + 0x380]
cmp qword [rax], rbx
jne 0x1800142b0
mov qword [rcx + 0x380], rdi
xor eax, eax
jmp 0x180013b41