Function at 0x14004a820
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
mov rax, rsp
mov qword [rax + 0x10], rbx
mov qword [rax + 0x18], rsi
mov qword [rax + 0x20], rdi
push rbp
push r12
push r13
push r14
push r15
lea rbp, [rax - 0x3a8]
sub rsp, 0x480
mov rax, qword [0x140090120]
xor rax, rsp
mov qword [rbp + 0x370], rax
xor ebx, ebx
mov rsi, rcx
xor ecx, ecx
mov byte [rsp + 0x40], bl
mov word [rsp + 0x60], cx
mov r13b, bl
mov byte [rsp + 0x62], cl
mov r15d, ebx
mov rdi, qword [rsi]
lea r14d, [rbx + 1]
mov rcx, rdi
mov dword [rsp + 0x48], ebx
mov r12d, ebx
mov dword [rsp + 0x44], r14d
mov dword [rsp + 0x50], ebx
mov dword [rsp + 0x54], ebx
mov dword [rsp + 0x4c], ebx
mov qword [rsi + 0x10], rbx
mov qword [rsi + 8], rbx
mov qword [rsi + 0x18], rbx
call fcn.14004949c
test eax, eax
je 0x14004adef
mov rcx, rdi
call fcn.140049470
mov rbx, rax
mov qword [rsp + 0x58], rax
shr rax, 0x20
cmp eax, 0x43674249
je 0x14004ac46
cmp eax, 0x49444154
je 0x14004abbb
cmp eax, 0x49454e44
je 0x14004ad0d
cmp eax, 0x49484452
je 0x14004aa7c
cmp eax, 0x504c5445
je 0x14004a9fe
cmp eax, 0x74524e53
je 0x14004a91d
test r14d, r14d
jne 0x14004acb4
bt eax, 0x1d
jae 0x14004ac53
mov edx, ebx
mov rcx, rdi
call fcn.140044974
jmp 0x14004a970
test r14d, r14d
jne 0x14004acb4
cmp qword [rsi + 8], 0
jne 0x14004aca2
test r13b, r13b
je 0x14004a97d
test r12d, r12d
je 0x14004ac90
cmp ebx, r12d
ja 0x14004ac87
mov r13b, 4
test ebx, ebx
je 0x14004a96b
mov rcx, rdi
call fcn.1400448e4
lea ecx, [r14*4 + 3]
inc r14d
mov byte [rsp + rcx + 0x70], al
cmp r14d, ebx
jb 0x14004a94f
mov r14d, dword [rsp + 0x44]
mov rcx, rdi
call fcn.140044abc
jmp 0x14004a8ac
mov ecx, dword [rdi + 8]
test cl, 1
je 0x14004ac99
lea eax, [rcx + rcx]
cmp ebx, eax
jne 0x14004ac87
xor r14d, r14d
mov byte [rsp + 0x40], 1
cmp dword [rsi + 0x20], 0x10
jne 0x14004a9c5
test ecx, ecx
jle 0x14004a96b
lea rbx, [rsp + 0x64]
mov rcx, rdi
call fcn.140044a8c
inc r14d
mov word [rbx], ax
lea rbx, [rbx + 2]
cmp r14d, dword [rdi + 8]
jl 0x14004a9ab
jmp 0x14004a96b
test ecx, ecx
jle 0x14004a96b
lea rbx, [rsp + 0x60]
mov rcx, rdi
call fcn.140044a8c
movsxd rcx, dword [rsi + 0x20]
lea rdx, [0x1400818f0]
movzx eax, al
inc r14d
movzx edx, byte [rcx + rdx]
imul eax, edx
mov byte [rbx], al
inc rbx
cmp r14d, dword [rdi + 8]
jl 0x14004a9ce
jmp 0x14004a96b
test r14d, r14d
jne 0x14004acb4
cmp ebx, 0x300
ja 0x14004acab
mov eax, 0xaaaaaaab
mul ebx
mov r12d, edx
shr r12d, 1
lea eax, [r12 + r12*2]
cmp eax, ebx
jne 0x14004acab
test r12d, r12d
je 0x14004a96b
mov rcx, rdi
lea ebx, [r14*4]
call fcn.1400448e4
mov rcx, rdi
mov byte [rsp + rbx + 0x70], al
call fcn.1400448e4
lea ecx, [rbx + 1]
mov byte [rsp + rcx + 0x70], al
mov rcx, rdi
call fcn.1400448e4
lea ecx, [rbx + 2]
inc r14d
mov byte [rsp + rcx + 0x70], al
lea eax, [rbx + 3]
mov byte [rsp + rax + 0x70], 0xff
cmp r14d, r12d
jb 0x14004aa35
jmp 0x14004a96b
test r14d, r14d
je 0x14004acfc
xor r14d, r14d
mov dword [rsp + 0x44], r14d
cmp ebx, 0xd
jne 0x14004acf3
mov rcx, rdi
call fcn.140044abc
mov rcx, rdi
mov dword [rdi], eax
call fcn.140044abc
mov ecx, 0x1000000
mov dword [rdi + 4], eax
cmp eax, ecx
ja 0x14004abaf
cmp dword [rdi], ecx
ja 0x14004abaf
mov rcx, rdi
call fcn.1400448e4
movzx eax, al
mov dword [rsi + 0x20], eax
cmp eax, 1
je 0x14004aaea
cmp eax, 0x10
ja 0x14004acbd
mov ecx, 0x10114
bt ecx, eax
jae 0x14004acbd
mov rcx, rdi
call fcn.1400448e4
movzx ebx, al
mov dword [rsp + 0x54], ebx
cmp ebx, 6
ja 0x14004acea
cmp ebx, 3
jne 0x14004ab16
cmp dword [rsi + 0x20], 0x10
je 0x14004acea
mov r13b, bl
jmp 0x14004ab1f
test bl, 1
jne 0x14004acea
mov rcx, rdi
call fcn.1400448e4
test al, al
jne 0x14004ace1
mov rcx, rdi
call fcn.1400448e4
test al, al
jne 0x14004acd8
mov rcx, rdi
call fcn.1400448e4
movzx eax, al
mov dword [rsp + 0x50], eax
cmp eax, 1
ja 0x14004accf
cmp dword [rdi], r14d
je 0x14004acc6
mov r9d, dword [rdi + 4]
test r9d, r9d
je 0x14004acc6
xor edx, edx
mov eax, 0x40000000
div dword [rdi]
test r13b, r13b
jne 0x14004ab9c
mov r8d, ebx
mov ecx, ebx
shr r8d, 2
and ecx, 2
and r8d, 1
or ecx, 1
add r8d, ecx
xor edx, edx
mov dword [rdi + 8], r8d
div r8d
jmp 0x14004aba6
mov dword [rdi + 8], 1
shr eax, 2
cmp eax, r9d
jae 0x14004a970
lea rcx, str.too_large
jmp 0x14004ad03
test r14d, r14d
jne 0x14004acb4
test r13b, r13b
je 0x14004abd2
test r12d, r12d
je 0x14004aea0
mov eax, dword [rsp + 0x48]
lea r14d, [rbx + rax]
cmp r14d, eax
jl 0x14004adef
cmp r14d, r15d
jbe 0x14004ac23
test r15d, r15d
jne 0x14004ac00
mov eax, 0x1000
cmp ebx, eax
mov r15d, eax
cmova r15d, ebx
jmp 0x14004ac00
add r15d, r15d
cmp r14d, r15d
ja 0x14004abfd
mov rcx, qword [rsi + 8]
mov edx, r15d
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_realloc]
test rax, rax
je 0x14004aeac
mov qword [rsi + 8], rax
mov eax, dword [rsp + 0x48]
mov edx, eax
mov r8d, ebx
add rdx, qword [rsi + 8]
mov rcx, rdi
call fcn.1400449c8
test eax, eax
je 0x14004aeb8
mov dword [rsp + 0x48], r14d
jmp 0x14004a96b
mov dword [rsp + 0x4c], 1
jmp 0x14004a911
mov ecx, dword [rsp + 0x5c]
mov eax, ecx
shr eax, 0x18
mov byte [str.XXXX_PNG_chunk_not_known], al
mov eax, ecx
shr eax, 0x10
mov byte [0x140090159], al
mov eax, ecx
shr eax, 8
mov byte [0x14009015b], cl
lea rcx, str.XXXX_PNG_chunk_not_known
mov byte [0x14009015a], al
jmp 0x14004ad03
lea rcx, str.bad_tRNS_len
jmp 0x14004ad03
lea rcx, str.tRNS_before_PLTE
jmp 0x14004ad03
lea rcx, str.tRNS_with_alpha
jmp 0x14004ad03
lea rcx, str.tRNS_after_IDAT
jmp 0x14004ad03
lea rcx, str.invalid_PLTE
jmp 0x14004ad03
lea rcx, str.first_not_IHDR
jmp 0x14004ad03
lea rcx, str.1_2_4_8_16_bit_only
jmp 0x14004ad03
lea rcx, str.0_pixel_image
jmp 0x14004ad03
lea rcx, str.bad_interlace_method
jmp 0x14004ad03
lea rcx, str.bad_filter_method
jmp 0x14004ad03
lea rcx, str.bad_comp_method
jmp 0x14004ad03
lea rcx, str.bad_ctype
jmp 0x14004ad03
lea rcx, str.bad_IHDR_len
jmp 0x14004ad03
lea rcx, str.multiple_IHDR
call fcn.140044180
jmp 0x14004adf1
xor r15d, r15d
test r14d, r14d
jne 0x14004acb4
mov rcx, qword [rsi + 8]
test rcx, rcx
jne 0x14004ad27
lea rcx, str.no_IDAT
jmp 0x14004ad03
mov r8d, dword [rdi]
lea r9, [rsp + 0x44]
imul r8d, dword [rsi + 0x20]
mov eax, r15d
mov r14d, dword [rsp + 0x4c]
mov edx, dword [rsp + 0x48]
add r8d, 7
shr r8d, 3
imul r8d, dword [rdi + 8]
inc r8d
imul r8d, dword [rdi + 4]
test r14d, r14d
sete al
mov dword [rsp + 0x20], eax
mov dword [rsp + 0x44], r8d
call fcn.1400493c8
mov qword [rsi + 0x10], rax
test rax, rax
je 0x14004adef
mov rcx, qword [rsi + 8]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rsi + 8], r15
mov eax, dword [rdi + 8]
lea r9d, [rax + 1]
test r9d, r9d
jne 0x14004ad95
test r13b, r13b
je 0x14004ae21
mov bl, byte [rsp + 0x40]
test bl, bl
jne 0x14004ada0
mov r9d, eax
mov eax, dword [rsp + 0x50]
mov rcx, rsi
mov dword [rsp + 0x30], eax
mov eax, dword [rsp + 0x54]
mov dword [rdi + 0xc], r9d
mov r8d, dword [rsp + 0x44]
mov rdx, qword [rsi + 0x10]
mov dword [rsp + 0x28], eax
mov eax, dword [rsi + 0x20]
mov dword [rsp + 0x20], eax
call fcn.14004a248
test eax, eax
je 0x14004adef
test bl, bl
je 0x14004ae36
cmp dword [rsi + 0x20], 0x10
mov rcx, rsi
mov r8d, dword [rdi + 0xc]
jne 0x14004ae2a
lea rdx, [rsp + 0x64]
call fcn.14004a5dc
test eax, eax
jne 0x14004ae36
xor eax, eax
mov rcx, qword [rbp + 0x370]
xor rcx, rsp
call fcn.14005bd30
lea r11, [rsp + 0x480]
mov rbx, qword [r11 + 0x38]
mov rsi, qword [r11 + 0x40]
mov rdi, qword [r11 + 0x48]
mov rsp, r11
pop r15
pop r14
pop r13
pop r12
pop rbp
ret
mov bl, byte [rsp + 0x40]
jmp 0x14004ada0
lea rdx, [rsp + 0x60]
call fcn.14004a570
jmp 0x14004adeb
test r14d, r14d
je 0x14004ae52
cmp dword [0x140092e68], r15d
je 0x14004ae52
cmp dword [rdi + 0xc], 2
jle 0x14004ae52
mov rcx, rsi
call fcn.14004a744
test r13b, r13b
je 0x14004ae79
movzx r9d, r13b
lea rdx, [rsp + 0x70]
mov rcx, rsi
mov dword [rdi + 8], r9d
mov dword [rdi + 0xc], r9d
call fcn.14004a660
test eax, eax
jne 0x14004ae80
jmp 0x14004adef
test bl, bl
je 0x14004ae80
inc dword [rdi + 8]
mov rcx, qword [rsi + 0x10]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov rcx, rdi
mov qword [rsi + 0x10], r15
call fcn.140044abc
mov eax, 1
jmp 0x14004adf1
lea rcx, str.no_PLTE
jmp 0x14004ad03
lea rcx, str.outofmem
jmp 0x14004ad03
lea rcx, str.outofdata
jmp 0x14004ad03