Function at 0x408080
Capabilities:
Encode data using base64

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x48
mov rax, qword [rsp + 0xb8]
mov dword [rax], 0
mov rbx, rcx
mov r12, rdx
mov rsi, r8
mov ebp, r9d
test r9d, r9d
js 0x4083a0
mov rax, qword [rsp + 0xc0]
mov eax, dword [rax]
cmp r9d, 0x14
jg 0x408240
lea r14d, [r9 - 1]
cmp r14d, 1
ja 0x4080da
test eax, r9d
jne 0x408240
test rbx, rbx
je 0x408880
mov rdi, r12
lea r10, [rbx + rsi]
sub rdi, rsi
cmp rdi, 2
jbe 0x408265
cmp word [r10], 0xd8ff
je 0x4083b0
cmp rdi, 7
jbe 0x408265
movabs rax, 0xa1a0a0d474e5089
cmp qword [r10], rax
jne 0x408265
lea rcx, [rdi - 8]
lea r13, str.image_png
cmp rcx, 0xb
jbe 0x4083f0
mov r11d, 0xffffffff
xor r15d, r15d
xor r9d, r9d
xor r8d, r8d
mov edx, 8
jmp 0x40817b
cmp r11d, 1
jne 0x408165
cmp dword [r10 + rdx + 4], 0x45544c50
je 0x408994
add eax, 0xc
mov rcx, rdi
add rdx, rax
sub rcx, rdx
cmp rcx, 0xb
jbe 0x408910
movzx eax, byte [r10 + rdx]
movzx r13d, byte [r10 + rdx + 3]
sub rcx, 0xc
shl eax, 0x18
or eax, r13d
movzx r13d, byte [r10 + rdx + 1]
shl r13d, 0x10
or eax, r13d
movzx r13d, byte [r10 + rdx + 2]
shl r13d, 8
or eax, r13d
mov r13d, eax
cmp r13, rcx
ja 0x408910
cmp eax, 0xd
jne 0x408150
cmp dword [r10 + rdx + 4], 0x52444849
jne 0x408150
movzx r8d, byte [r10 + rdx + 8]
movzx ecx, byte [r10 + rdx + 9]
movzx r9d, byte [r10 + rdx + 0xc]
shl ecx, 0x10
shl r8d, 0x18
or r8d, ecx
movzx ecx, byte [r10 + rdx + 0xb]
shl r9d, 0x18
or r8d, ecx
movzx ecx, byte [r10 + rdx + 0xa]
shl ecx, 8
or r8d, ecx
movzx ecx, byte [r10 + rdx + 0xd]
shl ecx, 0x10
or r9d, ecx
movzx ecx, byte [r10 + rdx + 0xf]
or r9d, ecx
movzx ecx, byte [r10 + rdx + 0xe]
shl ecx, 8
or r9d, ecx
movzx ecx, byte [r10 + rdx + 0x11]
cmp ecx, 3
jne 0x4089b3
mov r11d, 1
mov r15d, 0x18
jmp 0x408165
mov rax, qword [rsp + 0xb8]
xor r8d, r8d
mov dword [rax], 0xffffffe0
mov rax, r8
add rsp, 0x48
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
mov rdx, rdi
mov rcx, r10
call fcn.00408030
test eax, eax
je 0x408240
cmp rdi, 0xd
jbe 0x4083e0
movzx ecx, byte [r10 + 0xa]
mov r15d, 1
movzx r8d, word [r10 + 6]
lea r13, str.image_gif
movzx r9d, word [r10 + 8]
and ecx, 7
add ecx, 1
shl r15d, cl
xor ecx, ecx
mov dword [rsp + 0x20], r15d
mov r15d, 0x18
test r9d, r9d
sete dl
test r8d, r8d
sete al
or dl, al
jne 0x4083f0
test cl, cl
jne 0x4083f0
cmp ebp, 1
jne 0x408890
cmp r9d, 0x20
jne 0x4083f9
cmp r8d, 0x20
jne 0x4083f9
mov rcx, r13
call sub.msvcrt.dll_strlen
cmp rax, 9
jne 0x4083f9
lea r8, [0x0046a6af]
mov r9, r13
mov eax, 0x69
lea r11, [r8 + 8]
jmp 0x408318
movsx eax, byte [r8]
add r8, 1
movsx ecx, byte [r9]
lea r10d, [rax - 0x61]
lea edx, [rax - 0x20]
cmp r10d, 0x1a
lea r10d, [rcx - 0x61]
cmovb eax, edx
lea edx, [rcx - 0x20]
cmp r10d, 0x1a
cmovae edx, ecx
cmp eax, edx
jne 0x4083f9
add r9, 1
cmp r11, r8
jne 0x408310
mov edx, dword [rsp + 0x20]
mov r10d, r15d
mov r8d, 0x20
xor ecx, ecx
mov byte [rsp + 0x3c], 0
mov r9d, 0x20
mov eax, edx
mov r11d, edx
mov byte [rsp + 0x38], 0
shr eax, 0x18
mov byte [rsp + 0x34], 0
mov dword [rsp + 0x20], eax
mov eax, edx
shr eax, 0x10
mov byte [rsp + 0x30], 0
mov byte [rsp + 0x27], al
movzx eax, dh
mov edx, r15d
mov dword [rsp + 0x28], eax
movzx eax, dh
xor edx, edx
mov dword [rsp + 0x2c], eax
jmp 0x4084fa
mov r14d, 2
mov ebp, 3
jmp 0x4080da
cmp byte [r10 + 2], 0xff
mov eax, 2
jne 0x408103
lea rdx, [rax + 1]
movzx ecx, byte [r10 + rax]
mov r8, rdx
cmp rdi, rax
jbe 0x408435
cmp cl, 0xff
je 0x408410
mov rax, rdx
jmp 0x4083c0
lea r13, str.image_gif
nop word [rax + rax]
cmp ebp, 1
jne 0x4084c2
mov rax, qword [rsp + 0xb8]
xor r8d, r8d
mov dword [rax], 0xffffffdf
jmp 0x408251
mov r9, rax
jmp 0x408421
mov r9, rdx
cmp cl, 0xff
jne 0x408435
add rdx, 1
mov rax, rdx
movzx ecx, byte [r10 + rdx]
lea r8, [r9 + 2]
cmp rdi, rdx
jne 0x408415
mov rax, rdi
cmp rdi, r8
jbe 0x408900
movzx edx, cl
lea r9d, [rdx - 0xd8]
cmp r9d, 2
jbe 0x408900
lea r9d, [rdx - 0xd0]
cmp r9d, 7
jbe 0x408820
mov r11, rdi
sub r11, r8
cmp r11, 1
jbe 0x408900
movzx r9d, byte [r10 + r8]
movzx r13d, byte [r10 + rax + 2]
shl r9d, 8
or r9d, r13d
movsxd r13, r9d
cmp r11, r13
jb 0x408900
cmp r9d, 1
jle 0x408900
cmp cl, 0xc0
je 0x40893d
sub edx, 0xc1
cmp edx, 0xe
ja 0x4084b8
and ecx, 3
jne 0x40893d
lea rax, [r13 + r8]
jmp 0x4083c0
mov byte [rsp + 0x3c], 0
xor r8d, r8d
xor edx, edx
xor r9d, r9d
mov byte [rsp + 0x38], 0
xor ecx, ecx
xor r10d, r10d
xor r11d, r11d
mov byte [rsp + 0x34], 0
mov byte [rsp + 0x30], 0
mov byte [rsp + 0x2c], 0
mov byte [rsp + 0x28], 0
mov byte [rsp + 0x27], 0
mov byte [rsp + 0x20], 0
movzx eax, byte [rsp + 0x20]
mov r15d, edi
mov byte [rbx + rsi - 5], r11b
shr r15d, 0x18
mov byte [rbx + rsi - 9], r10b
mov byte [rbx + rsi - 8], al
movzx eax, byte [rsp + 0x27]
mov byte [rbx + rsi - 4], r15b
mov r15d, edi
mov byte [rbx + rsi - 7], al
movzx eax, byte [rsp + 0x28]
shr r15d, 0x10
mov byte [rbx + rsi - 3], r15b
mov r15d, edi
mov byte [rbx + rsi - 6], al
movzx eax, byte [rsp + 0x2c]
shr r15d, 8
mov byte [rbx + rsi - 0xd], r9b
mov byte [rbx + rsi - 0xa], al
movzx eax, byte [rsp + 0x30]
mov byte [rbx + rsi - 1], dil
lea rdi, [rsi - 0x14]
mov byte [rbx + rsi - 0x10], al
movzx eax, byte [rsp + 0x34]
mov byte [rbx + rsi - 0xf], cl
mov rcx, qword [rsp + 0xb0]
mov byte [rbx + rsi - 0xe], al
movzx eax, byte [rsp + 0x38]
mov byte [rbx + rsi - 0x13], dl
mov byte [rbx + rsi - 0x14], al
movzx eax, byte [rsp + 0x3c]
mov byte [rbx + rsi - 0x11], r8b
mov byte [rbx + rsi - 2], r15b
mov byte [rbx + rsi - 0xc], 0
mov byte [rbx + rsi - 0xb], 0
mov byte [rbx + rsi - 0x12], al
call sub.msvcrt.dll_strlen
mov rdx, qword [rsp + 0xb0]
sub rdi, rax
mov r8, rax
lea rcx, [rbx + rdi]
lea rsi, [rdi - 4]
call sub.msvcrt.dll_memcpy
mov rcx, qword [rsp + 0xb0]
call sub.msvcrt.dll_strlen
mov rcx, qword [rsp + 0xb0]
shr rax, 0x18
mov byte [rbx + rdi - 4], al
call sub.msvcrt.dll_strlen
mov rcx, qword [rsp + 0xb0]
shr rax, 0x10
mov byte [rbx + rdi - 3], al
call sub.msvcrt.dll_strlen
mov rcx, qword [rsp + 0xb0]
shr rax, 8
mov byte [rbx + rdi - 2], al
call sub.msvcrt.dll_strlen
mov rcx, r13
mov byte [rbx + rdi - 1], al
call sub.msvcrt.dll_strlen
mov rcx, qword [r13]
sub rsi, rax
lea rdx, [rbx + rsi]
mov qword [rdx], rcx
mov ecx, eax
mov r8, qword [r13 + rcx - 8]
mov qword [rdx + rcx - 8], r8
lea r8, [rdx + 8]
and r8, 0xfffffffffffffff8
sub rdx, r8
sub r13, rdx
add edx, eax
and edx, 0xfffffff8
cmp edx, 8
jb 0x40865f
and edx, 0xfffffff8
xor ecx, ecx
mov r9d, ecx
add ecx, 8
mov r10, qword [r13 + r9]
mov qword [r8 + r9], r10
cmp ecx, edx
jb 0x40864c
movabs rcx, 0xaaaaaaaaaaaaaaab
mov byte [rbx + rsi - 1], al
lea rax, [rsi - 8]
sub r12, rax
lea rdi, [rbx + rax]
mov byte [rbx + rsi - 4], 0
lea rdx, [r12 + 2]
mov byte [rbx + rsi - 3], 0
mov rax, rdx
mov byte [rbx + rsi - 2], 0
mul rcx
mov byte [rdi], 0
mov byte [rbx + rsi - 7], 0
mov byte [rbx + rsi - 6], 0
mov byte [rbx + rsi - 5], bpl
shr rdx, 1
lea rcx, [rdx*4 + 1]
call sub.msvcrt.dll_malloc
mov r8, rax
test rax, rax
je 0x408804
mov eax, r12d
mov edx, 0x55555556
mov ecx, r12d
imul edx
mov eax, r12d
sar eax, 0x1f
sub edx, eax
cmp r12d, 2
jle 0x408930
mov r9, rdi
xor ecx, ecx
lea r11, str.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_Unknown_error._Bad_error_code_or_strange_version_mismatch.
nop dword [rax + rax]
movzx ebx, byte [r9]
movzx eax, byte [r9 + 1]
add r9, 3
movzx r10d, byte [r9 - 1]
mov esi, ebx
shl ebx, 4
shr esi, 2
and ebx, 0x30
movzx esi, byte [r11 + rsi]
mov byte [r8 + rcx*4], sil
mov esi, eax
shl eax, 2
shr esi, 4
and eax, 0x3c
or ebx, esi
movzx ebx, byte [r11 + rbx]
mov byte [r8 + rcx*4 + 1], bl
movzx ebx, r10b
and r10d, 0x3f
shr ebx, 6
or eax, ebx
movzx eax, byte [r11 + rax]
mov byte [r8 + rcx*4 + 2], al
movzx eax, byte [r11 + r10]
mov byte [r8 + rcx*4 + 3], al
add rcx, 1
cmp edx, ecx
jg 0x4086f0
test edx, edx
mov eax, 1
cmovle edx, eax
lea ecx, [rdx*4]
mov esi, edx
sub esi, ecx
movsxd r9, ecx
mov ecx, esi
lea rax, [r8 + r9]
add ecx, r12d
cmp ecx, 1
je 0x408830
cmp ecx, 2
jne 0x4087e8
lea r10d, [rdx + rdx*2]
lea r11, str.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_Unknown_error._Bad_error_code_or_strange_version_mismatch.
movsxd r10, r10d
movzx ecx, byte [rdi + r10]
movzx r10d, byte [rdi + r10 + 1]
mov ebx, ecx
shr ebx, 2
movzx ebx, byte [r11 + rbx]
mov byte [rax], bl
mov eax, ecx
mov ecx, r10d
shl r10d, 2
shl eax, 4
shr ecx, 4
and r10d, 0x3c
mov byte [r8 + r9 + 3], 0x3d
and eax, 0x30
or eax, ecx
movzx eax, byte [r11 + rax]
mov byte [r8 + r9 + 1], al
movzx eax, byte [r11 + r10]
mov byte [r8 + r9 + 2], al
lea eax, [rdx*4 + 4]
cdqe
add rax, r8
mov byte [rax], 0
cmp r14d, 1
ja 0x408251
mov rax, qword [rsp + 0xc0]
or dword [rax], ebp
jmp 0x408251
mov rax, qword [rsp + 0xb8]
mov dword [rax], 0xffffffef
jmp 0x408251
mov rax, r8
jmp 0x4083c0
lea ecx, [rdx + rdx*2]
lea r11, str.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_Unknown_error._Bad_error_code_or_strange_version_mismatch.
movsxd rcx, ecx
movzx ecx, byte [rdi + rcx]
mov r10d, ecx
shl ecx, 4
shr r10d, 2
and ecx, 0x30
movzx r10d, byte [r11 + r10]
mov byte [rax], r10b
movzx eax, byte [r11 + rcx]
mov byte [r8 + r9 + 2], 0x3d
mov byte [r8 + r9 + 1], al
lea eax, [rdx*4 + 4]
cdqe
mov byte [r8 + r9 + 3], 0x3d
add rax, r8
jmp 0x4087e8
xor r8d, r8d
jmp 0x408251
mov edx, dword [rsp + 0x20]
mov ecx, r9d
mov r10d, r15d
shr ecx, 0x10
mov eax, edx
mov r11d, edx
shr eax, 0x18
mov dword [rsp + 0x20], eax
mov eax, edx
shr eax, 0x10
mov byte [rsp + 0x27], al
movzx eax, dh
mov edx, r15d
mov dword [rsp + 0x28], eax
movzx eax, dh
mov edx, r9d
mov dword [rsp + 0x2c], eax
mov eax, r9d
shr eax, 0x18
mov dword [rsp + 0x30], eax
movzx eax, dh
mov edx, r8d
mov dword [rsp + 0x34], eax
mov eax, r8d
shr edx, 0x10
shr eax, 0x18
mov dword [rsp + 0x38], eax
mov eax, r8d
movzx eax, ah
mov dword [rsp + 0x3c], eax
jmp 0x4084fa
lea r13, str.image_jpeg
jmp 0x4083f0
test r15d, r15d
mov dword [rsp + 0x20], 0
lea r13, str.image_png
sete cl
jmp 0x4082b0
mov rax, r8
xor r9d, r9d
xor edx, edx
jmp 0x408777
cmp r13, 7
jbe 0x408900
movzx r9d, byte [r10 + rax + 4]
movzx edx, byte [r10 + rax + 5]
mov dword [rsp + 0x20], 0
lea r13, str.image_jpeg
movzx r8d, byte [r10 + rax + 6]
shl r9d, 8
or r9d, edx
movzx edx, byte [r10 + rax + 7]
shl r8d, 8
or r8d, edx
movzx edx, byte [r10 + rax + 3]
movzx eax, byte [r10 + rax + 8]
imul edx, eax
test edx, edx
mov r15d, edx
sete cl
jmp 0x4082b0
mov edx, 0xaaaaaaab
lea r13, str.image_png
mul edx
shr edx, 1
test r15d, r15d
mov dword [rsp + 0x20], edx
sete cl
jmp 0x4082b0
movzx eax, byte [r10 + rdx + 0x10]
test ecx, ecx
jne 0x4089db
movzx r15d, al
mov dword [rsp + 0x20], 0
lea r13, str.image_png
test r15d, r15d
sete cl
jmp 0x4082b0
cmp ecx, 2
je 0x408a0b
cmp ecx, 4
je 0x408a29
cmp ecx, 6
jne 0x408910
shl eax, 2
mov dword [rsp + 0x20], 0
lea r13, str.image_png
mov r15d, eax
sete cl
jmp 0x4082b0
lea r15d, [rax + rax*2]
mov dword [rsp + 0x20], 0
lea r13, str.image_png
test r15d, r15d
sete cl
jmp 0x4082b0
add eax, eax
mov dword [rsp + 0x20], 0
lea r13, str.image_png
mov r15d, eax
sete cl
jmp 0x4082b0