Function at 0x140084510
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 [0x14012d700]
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.1400851c0
test rax, rax
je 0x140085185
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 0x1400845ce
cmp edi, 0x18
jge 0x1400845e1
lea ecx, [rsi - 0x26]
mov eax, 0x55555556
imul ecx
mov r14d, edx
shr r14d, 0x1f
add r14d, edx
jmp 0x1400845e1
cmp edi, 0x10
jge 0x1400845e1
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 0x140085177
test ecx, ecx
js 0x140085177
je 0x140084622
mov eax, 0x7fffffff
cdq
idiv ecx
cmp r12d, eax
jg 0x140085177
mov r9d, ecx
imul r9d, r12d
test r9d, r9d
js 0x140085177
test r8d, r8d
js 0x140085177
je 0x14008464f
mov eax, 0x7fffffff
cdq
idiv r8d
cmp r9d, eax
jg 0x140085177
test ecx, ecx
js 0x1400851ab
je 0x14008466a
mov eax, 0x7fffffff
cdq
idiv ecx
cmp r12d, eax
jg 0x1400851ab
test r9d, r9d
js 0x1400851ab
test r8d, r8d
js 0x1400851ab
je 0x140084690
mov eax, 0x7fffffff
cdq
idiv r8d
cmp r9d, eax
jg 0x1400851ab
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 0x1400851ab
cmp edi, 0x10
jge 0x140084a20
mov edi, r13d
test r14d, r14d
je 0x14008516e
cmp r14d, 0x100
jg 0x14008516e
movsxd r13, r14d
test r14d, r14d
jle 0x140084813
mov rax, qword [rbx + 0xb8]
xor esi, esi
nop dword [rax]
mov rcx, qword [rbx + 0xc0]
cmp rax, rcx
jae 0x14008470b
movzx edx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x140084737
cmp dword [rbx + 0x30], edi
je 0x140084735
mov rcx, rbx
call fcn.140091890
mov rax, qword [rbx + 0xb8]
mov rcx, qword [rbx + 0xc0]
movzx edx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x140084737
xor dl, dl
mov byte [rsp + rsi*4 + 0xd2], dl
cmp rax, rcx
jae 0x140084752
movzx edx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x14008477e
cmp dword [rbx + 0x30], edi
je 0x14008477c
mov rcx, rbx
call fcn.140091890
mov rax, qword [rbx + 0xb8]
mov rcx, qword [rbx + 0xc0]
movzx edx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x14008477e
xor dl, dl
mov byte [rsp + rsi*4 + 0xd1], dl
cmp rax, rcx
jae 0x140084799
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400847be
cmp dword [rbx + 0x30], edi
je 0x1400847bc
mov rcx, rbx
call fcn.140091890
mov rax, qword [rbx + 0xb8]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400847be
xor cl, cl
mov byte [rsp + rsi*4 + 0xd0], cl
cmp r15d, 0xc
je 0x1400847fb
cmp rax, qword [rbx + 0xc0]
jae 0x1400847e0
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400847fb
cmp dword [rbx + 0x30], edi
je 0x1400847fb
mov rcx, rbx
call fcn.140091890
inc qword [rbx + 0xb8]
mov rax, qword [rbx + 0xb8]
mov byte [rsp + rsi*4 + 0xd3], 0xff
inc rsi
cmp rsi, r13
jl 0x1400846f0
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.140091f90
mov r13d, dword [rsp + 0x60]
cmp r13d, 4
jne 0x140084849
mov r14d, dword [rbx]
inc r14d
shr r14d, 1
jmp 0x140084856
cmp r13d, 8
jne 0x14008516e
mov r14d, dword [rbx]
mov eax, dword [rbx + 4]
neg r14d
and r14d, 3
xor r15d, r15d
test eax, eax
jle 0x140085068
nop dword [rax + rax]
xor esi, esi
cmp dword [rbx], esi
jle 0x1400849ce
nop word [rax + rax]
mov rax, qword [rbx + 0xb8]
cmp rax, qword [rbx + 0xc0]
jae 0x14008489f
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400848c5
cmp dword [rbx + 0x30], 0
je 0x1400848c3
mov rcx, rbx
call fcn.140091890
mov rax, qword [rbx + 0xb8]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400848c5
xor cl, cl
xor r8d, r8d
movzx eax, cl
cmp r13d, 4
jne 0x1400848db
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 0x140084922
movsxd rax, edi
inc edi
mov byte [rax + rbp], 0xff
lea eax, [rsi + 1]
cmp eax, dword [rbx]
je 0x1400849ce
cmp r13d, 8
jne 0x14008497c
mov rax, qword [rbx + 0xb8]
cmp rax, qword [rbx + 0xc0]
jae 0x140084952
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x140084978
cmp dword [rbx + 0x30], 0
je 0x140084976
mov rcx, rbx
call fcn.140091890
mov rax, qword [rbx + 0xb8]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x140084978
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 0x1400849c3
movsxd rax, edi
inc edi
mov byte [rax + rbp], 0xff
add esi, 2
cmp esi, dword [rbx]
jl 0x140084880
cmp qword [rbx + 0x10], 0
je 0x140084a02
mov ecx, dword [rbx + 0xc0]
sub ecx, dword [rbx + 0xb8]
cmp ecx, r14d
jge 0x140084a02
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 0x140084a0c
mov eax, r14d
add qword [rbx + 0xb8], rax
mov eax, dword [rbx + 4]
inc r15d
cmp r15d, eax
jl 0x140084870
jmp 0x140085068
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.140091f90
cmp edi, 0x18
jne 0x140084a6b
mov eax, dword [rbx]
lea esi, [rax + rax*2]
jmp 0x140084a78
cmp edi, 0x10
jne 0x140084a76
mov esi, dword [rbx]
add esi, esi
jmp 0x140084a78
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 0x140084aa3
lea edx, [rdi - 0x17]
mov r10d, r13d
mov edi, r13d
mov r8d, r13d
mov r11d, r13d
jmp 0x140084c7c
cmp edi, 0x20
mov edi, dword [rsp + 0x70]
jne 0x140084ae8
cmp eax, 0xff
jne 0x140084ae8
cmp edi, 0xff00
jne 0x140084ae8
cmp r11d, 0xff0000
jne 0x140084ae8
mov r9d, dword [rsp + 0x78]
cmp r9d, 0xff000000
jne 0x140084b06
mov edx, 2
mov r10d, r13d
mov r8d, r13d
mov r11d, r13d
mov edi, r13d
jmp 0x140084c7c
test r11d, r11d
je 0x14008516e
test edi, edi
je 0x14008516e
test eax, eax
je 0x14008516e
mov r9d, dword [rsp + 0x78]
mov ecx, r11d
call fcn.140089ec0
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.140089ec0
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.140089ec0
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.140089ec0
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 0x140085068
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 0x140084e66
xor r13d, r13d
test eax, eax
jle 0x140085002
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 0x140084d1f
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x140084d45
cmp dword [rbx + 0x30], 0
je 0x140084d43
mov rcx, rbx
call fcn.140091890
mov rax, qword [rbx + 0xb8]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x140084d45
xor cl, cl
mov byte [r15], cl
mov rax, qword [rbx + 0xb8]
cmp rax, qword [rbx + 0xc0]
jae 0x140084d67
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x140084d8d
cmp dword [rbx + 0x30], 0
je 0x140084d8b
mov rcx, rbx
call fcn.140091890
mov rax, qword [rbx + 0xb8]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x140084d8d
xor cl, cl
mov byte [rsi], cl
mov rax, qword [rbx + 0xb8]
cmp rax, qword [rbx + 0xc0]
jae 0x140084dae
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x140084dd4
cmp dword [rbx + 0x30], 0
je 0x140084dd2
mov rcx, rbx
call fcn.140091890
mov rax, qword [rbx + 0xb8]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x140084dd4
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 0x140084e38
mov rax, qword [rbx + 0xb8]
cmp rax, qword [rbx + 0xc0]
jae 0x140084e10
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x140084e3a
cmp dword [rbx + 0x30], 0
je 0x140084e34
mov rcx, rbx
call fcn.140091890
mov rax, qword [rbx + 0xb8]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x140084e3a
xor cl, cl
jmp 0x140084e3a
mov cl, 0xff
movzx eax, cl
or dword [rsp + 0x30], eax
cmp r12d, 4
jne 0x140084e55
inc r14d
mov byte [rdi], cl
inc r15
inc rsi
inc rdi
inc r13d
cmp r13d, dword [rbx]
jl 0x140084d00
jmp 0x140084ff9
mov dword [rsp + 0x88], 0
test eax, eax
jle 0x140085002
lea rsi, [rcx + rbp]
mov ebp, dword [rsp + 0x88]
mov rcx, rbx
call fcn.140088050
cmp dword [rsp + 0x60], 0x10
mov edi, eax
je 0x140084ea2
mov rcx, rbx
call fcn.140088050
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 0x140084edf
nop
mov eax, edx
sar eax, cl
add ecx, r13d
add r8d, eax
cmp ecx, 8
jl 0x140084ed0
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 0x140084f2f
nop dword [rax]
nop dword [rax + rax]
mov eax, edx
sar eax, cl
add ecx, r9d
add r8d, eax
cmp ecx, 8
jl 0x140084f20
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 0x140084f7f
nop word [rax + rax]
mov eax, edx
sar eax, cl
add ecx, r9d
add r8d, eax
cmp ecx, 8
jl 0x140084f70
mov eax, dword [rsp + 0x78]
add r14d, 3
mov byte [rsi + 2], r8b
add rsi, 3
test eax, eax
je 0x140084fd0
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 0x140084fd5
nop dword [rax + rax]
mov eax, edi
sar eax, cl
add ecx, r15d
add edx, eax
cmp ecx, 8
jl 0x140084fc0
jmp 0x140084fd5
mov edx, 0xff
or dword [rsp + 0x30], edx
cmp r12d, 4
jne 0x140084fe7
inc r14d
mov byte [rsi], dl
inc rsi
inc ebp
cmp ebp, dword [rbx]
jl 0x140084e84
mov rbp, qword [rsp + 0xa8]
mov r9d, dword [rsp + 0x44]
mov esi, dword [rsp + 0x50]
cmp qword [rbx + 0x10], 0
je 0x140085039
mov ecx, dword [rbx + 0xc0]
sub ecx, dword [rbx + 0xb8]
cmp ecx, esi
jge 0x140085039
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 0x140085042
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 0x140084cd0
cmp r12d, 4
jne 0x140085090
cmp dword [rsp + 0x30], 0
jne 0x140085090
imul eax, dword [rbx]
lea eax, [rax*4 - 1]
movsxd rcx, eax
test eax, eax
js 0x140085090
mov byte [rcx + rbp], 0xff
sub rcx, 4
jns 0x140085086
cmp dword [rsp + 0x9c], 0
jle 0x14008510f
mov edx, dword [rbx + 4]
xor r10d, r10d
test edx, 0xfffffffe
jle 0x14008510f
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 0x140085100
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 0x1400850e0
mov edx, dword [rbx + 4]
inc r10d
mov eax, edx
sar eax, 1
cmp r10d, eax
jl 0x1400850b0
mov r8d, dword [rsp + 0xa0]
test r8d, r8d
je 0x14008513e
cmp r8d, r12d
je 0x14008513e
mov eax, dword [rbx + 4]
mov edx, r12d
mov r9d, dword [rbx]
mov rcx, rbp
mov dword [rsp + 0x20], eax
call fcn.1400860f0
mov rbp, rax
test rax, rax
je 0x140085185
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 0x140085169
mov eax, dword [rbx + 8]
mov dword [rcx], eax
mov rax, rbp
jmp 0x140085187
mov rcx, rbp
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
lea rax, str.Corrupt_BMP
mov qword [0x1402b5ef0], rax
xor eax, eax
mov rcx, qword [rsp + 0x4d0]
xor rcx, rsp
call fcn.1400a2ec0
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 0x14008517e