Function at 0x140063170
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x4e8
mov rax, qword [0x1400fd700]
xor rax, rsp
mov qword [rsp + 0x4d0], rax
mov ebp, dword [rsp + 0x550]
xor r13d, r13d
mov qword [rsp + 0xb0], rdx
mov r14d, r13d
lea rdx, [rsp + 0x60]
mov qword [rsp + 0xc0], r9
mov qword [rsp + 0xb8], r8
mov rbx, rcx
mov dword [rsp + 0xa0], ebp
mov dword [rsp + 0x7c], 0xff
call fcn.140063e20
test rax, rax
je 0x140063de5
mov eax, dword [rbx + 4]
mov r15d, dword [rsp + 0x68]
mov esi, dword [rsp + 0x64]
mov edi, dword [rsp + 0x60]
mov dword [rsp + 0x9c], eax
cdq
mov r8d, eax
mov eax, dword [rsp + 0x7c]
xor r8d, edx
mov dword [rsp + 0x30], eax
sub r8d, edx
mov dword [rbx + 4], r8d
cmp r15d, 0xc
jne 0x14006322e
cmp edi, 0x18
jge 0x140063241
lea ecx, [rsi - 0x26]
mov eax, 0x55555556
imul ecx
mov r14d, edx
shr r14d, 0x1f
add r14d, edx
jmp 0x140063241
cmp edi, 0x10
jge 0x140063241
mov r14d, esi
sub r14d, r15d
sub r14d, 0xe
sar r14d, 2
cmp dword [rsp + 0x78], r13d
mov r12d, r13d
mov ecx, dword [rbx]
setne r12b
add r12d, 3
cmp ebp, 3
mov dword [rbx + 8], r12d
cmovge r12d, ebp
test r12d, r12d
js 0x140063dd7
test ecx, ecx
js 0x140063dd7
je 0x140063282
mov eax, 0x7fffffff
cdq
idiv ecx
cmp r12d, eax
jg 0x140063dd7
mov r9d, ecx
imul r9d, r12d
test r9d, r9d
js 0x140063dd7
test r8d, r8d
js 0x140063dd7
je 0x1400632af
mov eax, 0x7fffffff
cdq
idiv r8d
cmp r9d, eax
jg 0x140063dd7
test ecx, ecx
js 0x140063e0b
je 0x1400632ca
mov eax, 0x7fffffff
cdq
idiv ecx
cmp r12d, eax
jg 0x140063e0b
test r9d, r9d
js 0x140063e0b
test r8d, r8d
js 0x140063e0b
je 0x1400632f0
mov eax, 0x7fffffff
cdq
idiv r8d
cmp r9d, eax
jg 0x140063e0b
imul ecx, r8d
imul ecx, r12d
movsxd rcx, ecx
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov qword [rsp + 0xa8], rax
mov rbp, rax
test rax, rax
je 0x140063e0b
cmp edi, 0x10
jge 0x140063680
mov edi, r13d
test r14d, r14d
je 0x140063dce
cmp r14d, 0x100
jg 0x140063dce
movsxd r13, r14d
test r14d, r14d
jle 0x140063473
mov rax, qword [rbx + 0xb8]
xor esi, esi
nop dword [rax]
mov rcx, qword [rbx + 0xc0]
cmp rax, rcx
jae 0x14006336b
movzx edx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x140063397
cmp dword [rbx + 0x30], edi
je 0x140063395
mov rcx, rbx
call fcn.1400704f0
mov rax, qword [rbx + 0xb8]
mov rcx, qword [rbx + 0xc0]
movzx edx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x140063397
xor dl, dl
mov byte [rsp + rsi*4 + 0xd2], dl
cmp rax, rcx
jae 0x1400633b2
movzx edx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400633de
cmp dword [rbx + 0x30], edi
je 0x1400633dc
mov rcx, rbx
call fcn.1400704f0
mov rax, qword [rbx + 0xb8]
mov rcx, qword [rbx + 0xc0]
movzx edx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400633de
xor dl, dl
mov byte [rsp + rsi*4 + 0xd1], dl
cmp rax, rcx
jae 0x1400633f9
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x14006341e
cmp dword [rbx + 0x30], edi
je 0x14006341c
mov rcx, rbx
call fcn.1400704f0
mov rax, qword [rbx + 0xb8]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x14006341e
xor cl, cl
mov byte [rsp + rsi*4 + 0xd0], cl
cmp r15d, 0xc
je 0x14006345b
cmp rax, qword [rbx + 0xc0]
jae 0x140063440
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x14006345b
cmp dword [rbx + 0x30], edi
je 0x14006345b
mov rcx, rbx
call fcn.1400704f0
inc qword [rbx + 0xb8]
mov rax, qword [rbx + 0xb8]
mov byte [rsp + rsi*4 + 0xd3], 0xff
inc rsi
cmp rsi, r13
jl 0x140063350
mov esi, dword [rsp + 0x64]
xor eax, eax
mov rcx, rbx
cmp r15d, 0xc
setne al
add eax, 3
imul eax, r14d
sub esi, eax
sub esi, r15d
lea edx, [rsi - 0xe]
call fcn.140070bf0
mov r13d, dword [rsp + 0x60]
cmp r13d, 4
jne 0x1400634a9
mov r14d, dword [rbx]
inc r14d
shr r14d, 1
jmp 0x1400634b6
cmp r13d, 8
jne 0x140063dce
mov r14d, dword [rbx]
mov eax, dword [rbx + 4]
neg r14d
and r14d, 3
xor r15d, r15d
test eax, eax
jle 0x140063cc8
nop dword [rax + rax]
xor esi, esi
cmp dword [rbx], esi
jle 0x14006362e
nop word [rax + rax]
mov rax, qword [rbx + 0xb8]
cmp rax, qword [rbx + 0xc0]
jae 0x1400634ff
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x140063525
cmp dword [rbx + 0x30], 0
je 0x140063523
mov rcx, rbx
call fcn.1400704f0
mov rax, qword [rbx + 0xb8]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x140063525
xor cl, cl
xor r8d, r8d
movzx eax, cl
cmp r13d, 4
jne 0x14006353b
mov r8d, eax
and r8d, 0xf
shr eax, 4
movsxd rcx, edi
lea rdx, [rax*4]
movzx eax, byte [rsp + rdx + 0xd0]
inc edi
mov byte [rcx + rbp], al
movzx eax, byte [rsp + rdx + 0xd1]
movsxd rcx, edi
inc edi
mov byte [rcx + rbp], al
movzx eax, byte [rsp + rdx + 0xd2]
movsxd rcx, edi
inc edi
mov byte [rcx + rbp], al
cmp r12d, 4
jne 0x140063582
movsxd rax, edi
inc edi
mov byte [rax + rbp], 0xff
lea eax, [rsi + 1]
cmp eax, dword [rbx]
je 0x14006362e
cmp r13d, 8
jne 0x1400635dc
mov rax, qword [rbx + 0xb8]
cmp rax, qword [rbx + 0xc0]
jae 0x1400635b2
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400635d8
cmp dword [rbx + 0x30], 0
je 0x1400635d6
mov rcx, rbx
call fcn.1400704f0
mov rax, qword [rbx + 0xb8]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400635d8
xor cl, cl
movzx r8d, cl
movsxd rcx, edi
lea rdx, [r8*4]
movzx eax, byte [rsp + rdx + 0xd0]
inc edi
mov byte [rcx + rbp], al
movzx eax, byte [rsp + rdx + 0xd1]
movsxd rcx, edi
inc edi
mov byte [rcx + rbp], al
movzx eax, byte [rsp + rdx + 0xd2]
movsxd rcx, edi
inc edi
mov byte [rcx + rbp], al
cmp r12d, 4
jne 0x140063623
movsxd rax, edi
inc edi
mov byte [rax + rbp], 0xff
add esi, 2
cmp esi, dword [rbx]
jl 0x1400634e0
cmp qword [rbx + 0x10], 0
je 0x140063662
mov ecx, dword [rbx + 0xc0]
sub ecx, dword [rbx + 0xb8]
cmp ecx, r14d
jge 0x140063662
mov rax, qword [rbx + 0xc0]
mov edx, r14d
sub edx, ecx
mov qword [rbx + 0xb8], rax
mov rcx, qword [rbx + 0x28]
call qword [rbx + 0x18]
jmp 0x14006366c
mov eax, r14d
add qword [rbx + 0xb8], rax
mov eax, dword [rbx + 4]
inc r15d
cmp r15d, eax
jl 0x1400634d0
jmp 0x140063cc8
sub esi, dword [rsp + 0x68]
xor ecx, ecx
xor eax, eax
mov dword [rsp + 0x4c], ecx
xor r15d, r15d
mov dword [rsp + 0x34], r13d
mov rcx, rbx
mov dword [rsp + 0x38], r13d
lea edx, [rsi - 0xe]
mov dword [rsp + 0x3c], r13d
mov dword [rsp + 0x40], r13d
xor r14d, r14d
mov dword [rsp + 0x58], r13d
mov dword [rsp + 0x48], eax
mov dword [rsp + 0x54], r15d
call fcn.140070bf0
cmp edi, 0x18
jne 0x1400636cb
mov eax, dword [rbx]
lea esi, [rax + rax*2]
jmp 0x1400636d8
cmp edi, 0x10
jne 0x1400636d6
mov esi, dword [rbx]
add esi, esi
jmp 0x1400636d8
xor esi, esi
mov eax, dword [rsp + 0x74]
neg esi
mov r11d, dword [rsp + 0x6c]
and esi, 3
mov dword [rsp + 0x50], esi
cmp edi, 0x18
jne 0x140063703
lea edx, [rdi - 0x17]
mov r10d, r13d
mov edi, r13d
mov r8d, r13d
mov r11d, r13d
jmp 0x1400638dc
cmp edi, 0x20
mov edi, dword [rsp + 0x70]
jne 0x140063748
cmp eax, 0xff
jne 0x140063748
cmp edi, 0xff00
jne 0x140063748
cmp r11d, 0xff0000
jne 0x140063748
mov r9d, dword [rsp + 0x78]
cmp r9d, 0xff000000
jne 0x140063766
mov edx, 2
mov r10d, r13d
mov r8d, r13d
mov r11d, r13d
mov edi, r13d
jmp 0x1400638dc
test r11d, r11d
je 0x140063dce
test edi, edi
je 0x140063dce
test eax, eax
je 0x140063dce
mov r9d, dword [rsp + 0x78]
mov ecx, r11d
call fcn.140068b20
mov edx, r11d
mov ecx, r11d
shr edx, 1
and ecx, 0x55555555
and edx, 0x55555555
add edx, ecx
lea r10d, [rax - 7]
mov ecx, edx
mov dword [rsp + 0x34], r10d
and edx, 0x33333333
shr ecx, 2
and ecx, 0x33333333
add ecx, edx
mov edx, ecx
shr edx, 4
add edx, ecx
mov ecx, edi
and edx, 0xf0f0f0f
mov eax, edx
shr eax, 8
add edx, eax
mov eax, edx
shr eax, 0x10
add eax, edx
movzx r13d, al
mov dword [rsp + 0x58], r13d
call fcn.140068b20
mov r15d, dword [rsp + 0x74]
mov edx, edi
shr edx, 1
mov ecx, edi
and edx, 0x55555555
and ecx, 0x55555555
add edx, ecx
lea r11d, [rax - 7]
mov ecx, edx
mov dword [rsp + 0x38], r11d
and edx, 0x33333333
shr ecx, 2
and ecx, 0x33333333
add ecx, edx
mov edx, ecx
shr edx, 4
add edx, ecx
mov ecx, r15d
and edx, 0xf0f0f0f
mov eax, edx
shr eax, 8
add edx, eax
mov eax, edx
shr eax, 0x10
add eax, edx
movzx eax, al
mov dword [rsp + 0x48], eax
call fcn.140068b20
mov edx, r15d
mov ecx, r15d
shr edx, 1
and ecx, 0x55555555
and edx, 0x55555555
add edx, ecx
lea edi, [rax - 7]
mov ecx, edx
mov dword [rsp + 0x3c], edi
and edx, 0x33333333
shr ecx, 2
and ecx, 0x33333333
add ecx, edx
mov edx, ecx
shr edx, 4
add edx, ecx
and edx, 0xf0f0f0f
mov eax, edx
shr eax, 8
add edx, eax
mov eax, edx
shr eax, 0x10
add eax, edx
movzx ecx, al
mov dword [rsp + 0x4c], ecx
mov ecx, r9d
call fcn.140068b20
mov edx, r9d
mov ecx, r9d
shr edx, 1
and ecx, 0x55555555
and edx, 0x55555555
add edx, ecx
lea r8d, [rax - 7]
mov ecx, edx
mov dword [rsp + 0x40], r8d
and edx, 0x33333333
shr ecx, 2
and ecx, 0x33333333
add ecx, edx
mov edx, ecx
shr edx, 4
add edx, ecx
and edx, 0xf0f0f0f
mov eax, edx
shr eax, 8
add edx, eax
mov eax, edx
shr eax, 0x10
add eax, edx
movzx r15d, al
xor edx, edx
mov dword [rsp + 0x54], r15d
mov eax, dword [rbx + 4]
xor r9d, r9d
mov qword [rsp + 0x80], rdx
mov dword [rsp + 0x44], r9d
test eax, eax
jle 0x140063cc8
mov eax, r10d
neg eax
mov dword [rsp + 0x8c], eax
mov eax, r11d
neg eax
mov dword [rsp + 0x90], eax
mov eax, edi
neg eax
mov dword [rsp + 0x94], eax
mov eax, r8d
neg eax
mov dword [rsp + 0x98], eax
nop word [rax + rax]
mov eax, dword [rbx]
movsxd rcx, r14d
test rdx, rdx
je 0x140063ac6
xor r13d, r13d
test eax, eax
jle 0x140063c62
lea rdi, [rcx + rbp]
lea rsi, [rdi + 1]
lea r15, [rdi + 2]
nop word [rax + rax]
mov rax, qword [rbx + 0xb8]
cmp rax, qword [rbx + 0xc0]
jae 0x14006397f
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400639a5
cmp dword [rbx + 0x30], 0
je 0x1400639a3
mov rcx, rbx
call fcn.1400704f0
mov rax, qword [rbx + 0xb8]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400639a5
xor cl, cl
mov byte [r15], cl
mov rax, qword [rbx + 0xb8]
cmp rax, qword [rbx + 0xc0]
jae 0x1400639c7
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400639ed
cmp dword [rbx + 0x30], 0
je 0x1400639eb
mov rcx, rbx
call fcn.1400704f0
mov rax, qword [rbx + 0xb8]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400639ed
xor cl, cl
mov byte [rsi], cl
mov rax, qword [rbx + 0xb8]
cmp rax, qword [rbx + 0xc0]
jae 0x140063a0e
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x140063a34
cmp dword [rbx + 0x30], 0
je 0x140063a32
mov rcx, rbx
call fcn.1400704f0
mov rax, qword [rbx + 0xb8]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x140063a34
xor cl, cl
mov byte [rdi], cl
add r14d, 3
add rdi, 3
add r15, 3
add rsi, 3
cmp qword [rsp + 0x80], 2
jne 0x140063a98
mov rax, qword [rbx + 0xb8]
cmp rax, qword [rbx + 0xc0]
jae 0x140063a70
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x140063a9a
cmp dword [rbx + 0x30], 0
je 0x140063a94
mov rcx, rbx
call fcn.1400704f0
mov rax, qword [rbx + 0xb8]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x140063a9a
xor cl, cl
jmp 0x140063a9a
mov cl, 0xff
movzx eax, cl
or dword [rsp + 0x30], eax
cmp r12d, 4
jne 0x140063ab5
inc r14d
mov byte [rdi], cl
inc r15
inc rsi
inc rdi
inc r13d
cmp r13d, dword [rbx]
jl 0x140063960
jmp 0x140063c59
mov dword [rsp + 0x88], 0
test eax, eax
jle 0x140063c62
lea rsi, [rcx + rbp]
mov ebp, dword [rsp + 0x88]
mov rcx, rbx
call fcn.140066cb0
cmp dword [rsp + 0x60], 0x10
mov edi, eax
je 0x140063b02
mov rcx, rbx
call fcn.140066cb0
shl eax, 0x10
add edi, eax
mov r10d, dword [rsp + 0x34]
mov edx, edi
and edx, dword [rsp + 0x6c]
mov ecx, r10d
mov eax, edx
sar eax, cl
mov ecx, dword [rsp + 0x8c]
shl edx, cl
mov ecx, r13d
test r10d, r10d
cmovns edx, eax
mov r8d, edx
cmp r13d, 8
jae 0x140063b3f
nop
mov eax, edx
sar eax, cl
add ecx, r13d
add r8d, eax
cmp ecx, 8
jl 0x140063b30
mov r11d, dword [rsp + 0x38]
mov edx, edi
and edx, dword [rsp + 0x70]
mov ecx, r11d
mov r9d, dword [rsp + 0x48]
mov eax, edx
sar eax, cl
mov ecx, dword [rsp + 0x90]
shl edx, cl
mov ecx, r9d
test r11d, r11d
mov byte [rsi], r8b
cmovns edx, eax
mov r8d, edx
cmp r9d, 8
jae 0x140063b8f
nop dword [rax]
nop dword [rax + rax]
mov eax, edx
sar eax, cl
add ecx, r9d
add r8d, eax
cmp ecx, 8
jl 0x140063b80
mov r9d, dword [rsp + 0x4c]
mov edx, edi
and edx, dword [rsp + 0x74]
mov eax, edx
mov byte [rsi + 1], r8b
mov r8d, dword [rsp + 0x3c]
mov ecx, r8d
sar eax, cl
mov ecx, dword [rsp + 0x94]
shl edx, cl
mov ecx, r9d
test r8d, r8d
cmovns edx, eax
mov r8d, edx
cmp r9d, 8
jae 0x140063bdf
nop word [rax + rax]
mov eax, edx
sar eax, cl
add ecx, r9d
add r8d, eax
cmp ecx, 8
jl 0x140063bd0
mov eax, dword [rsp + 0x78]
add r14d, 3
mov byte [rsi + 2], r8b
add rsi, 3
test eax, eax
je 0x140063c30
mov r8d, dword [rsp + 0x40]
and edi, eax
mov eax, edi
mov ecx, r8d
sar eax, cl
mov ecx, dword [rsp + 0x98]
shl edi, cl
mov ecx, r15d
test r8d, r8d
cmovns edi, eax
mov edx, edi
cmp r15d, 8
jae 0x140063c35
nop dword [rax + rax]
mov eax, edi
sar eax, cl
add ecx, r15d
add edx, eax
cmp ecx, 8
jl 0x140063c20
jmp 0x140063c35
mov edx, 0xff
or dword [rsp + 0x30], edx
cmp r12d, 4
jne 0x140063c47
inc r14d
mov byte [rsi], dl
inc rsi
inc ebp
cmp ebp, dword [rbx]
jl 0x140063ae4
mov rbp, qword [rsp + 0xa8]
mov r9d, dword [rsp + 0x44]
mov esi, dword [rsp + 0x50]
cmp qword [rbx + 0x10], 0
je 0x140063c99
mov ecx, dword [rbx + 0xc0]
sub ecx, dword [rbx + 0xb8]
cmp ecx, esi
jge 0x140063c99
mov rax, qword [rbx + 0xc0]
mov edx, esi
sub edx, ecx
mov qword [rbx + 0xb8], rax
mov rcx, qword [rbx + 0x28]
call qword [rbx + 0x18]
mov r9d, dword [rsp + 0x44]
jmp 0x140063ca2
mov eax, esi
add qword [rbx + 0xb8], rax
mov eax, dword [rbx + 4]
inc r9d
mov r15d, dword [rsp + 0x54]
mov r13d, dword [rsp + 0x58]
mov rdx, qword [rsp + 0x80]
mov dword [rsp + 0x44], r9d
cmp r9d, eax
jl 0x140063930
cmp r12d, 4
jne 0x140063cf0
cmp dword [rsp + 0x30], 0
jne 0x140063cf0
imul eax, dword [rbx]
lea eax, [rax*4 - 1]
movsxd rcx, eax
test eax, eax
js 0x140063cf0
mov byte [rcx + rbp], 0xff
sub rcx, 4
jns 0x140063ce6
cmp dword [rsp + 0x9c], 0
jle 0x140063d6f
mov edx, dword [rbx + 4]
xor r10d, r10d
test edx, 0xfffffffe
jle 0x140063d6f
nop dword [rax + rax]
mov ecx, dword [rbx]
sub edx, r10d
dec edx
mov r9d, ecx
imul edx, ecx
xor r8d, r8d
imul r9d, r10d
imul ecx, r12d
imul edx, r12d
imul r9d, r12d
mov eax, edx
add rdx, rbp
test ecx, ecx
jle 0x140063d60
sub r9, rax
nop dword [rax]
movzx eax, byte [rdx]
inc r8d
movzx ecx, byte [rdx + r9]
mov byte [rdx + r9], al
mov byte [rdx], cl
lea rdx, [rdx + 1]
mov eax, dword [rbx]
imul eax, r12d
cmp r8d, eax
jl 0x140063d40
mov edx, dword [rbx + 4]
inc r10d
mov eax, edx
sar eax, 1
cmp r10d, eax
jl 0x140063d10
mov r8d, dword [rsp + 0xa0]
test r8d, r8d
je 0x140063d9e
cmp r8d, r12d
je 0x140063d9e
mov eax, dword [rbx + 4]
mov edx, r12d
mov r9d, dword [rbx]
mov rcx, rbp
mov dword [rsp + 0x20], eax
call fcn.140064d50
mov rbp, rax
test rax, rax
je 0x140063de5
mov eax, dword [rbx]
mov rcx, qword [rsp + 0xb0]
mov dword [rcx], eax
mov rcx, qword [rsp + 0xb8]
mov eax, dword [rbx + 4]
mov dword [rcx], eax
mov rcx, qword [rsp + 0xc0]
test rcx, rcx
je 0x140063dc9
mov eax, dword [rbx + 8]
mov dword [rcx], eax
mov rax, rbp
jmp 0x140063de7
mov rcx, rbp
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
lea rax, str.Corrupt_BMP
mov qword [0x1400fee30], rax
xor eax, eax
mov rcx, qword [rsp + 0x4d0]
xor rcx, rsp
call fcn.140081df0
add rsp, 0x4e8
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
pop rbx
ret
lea rax, str.Out_of_memory
jmp 0x140063dde