Function at 0x3016d3f0
Capabilities:
Encode data using base64

Disassembly:
push ecx
mov eax, dword [esp + 8]
push ebx
mov ebx, dword [esp + 0x18]
push ebp
push esi
mov esi, dword [eax]
movzx eax, byte [esi + 1]
shr ebx, 0xb
and ebx, 1
inc esi
inc esi
test ebx, ebx
push edi
je 0x3016d454
cmp eax, 0xc0
jl 0x3016d454
mov ecx, eax
and ecx, 0x3f
movzx edx, byte [ecx + 0x30259078]
mov ebp, dword [edx*4 + 0x3025905c]
lea edi, [edx + edx*2]
shl edi, 1
and ebp, eax
mov ecx, edi
shl ebp, cl
test edx, edx
mov eax, ebp
jle 0x3016d454
mov ebp, edx
lea esp, [esp]
xor edx, edx
mov dl, byte [esi]
sub edi, 6
mov ecx, edi
and edx, 0x3f
shl edx, cl
or eax, edx
inc esi
dec ebp
jne 0x3016d440
dec esi
test eax, eax
jne 0x3016d46f
mov ecx, dword [esp + 0x1c]
mov edx, dword [esp + 0x18]
pop edi
mov dword [ecx], 1
mov dword [edx], esi
pop esi
pop ebp
pop ebx
pop ecx
ret
cmp eax, 0x30
jl 0x3016d7b4
cmp eax, 0x7a
jg 0x3016d7b4
lea ecx, [eax - 0x30]
movsx edx, word [ecx*2 + 0x30251238]
test edx, edx
mov dword [esp + 0x10], edx
je 0x3016d4a2
mov eax, edx
mov edx, dword [esp + 0x18]
pop edi
mov dword [edx], esi
pop esi
pop ebp
pop ebx
pop ecx
ret
cmp ecx, 0x48
ja case.0x3016d4b2.10
movzx edi, byte [ecx + 0x3016d7dc]
jmp dword [edi*4 + 0x3016d7c0]
mov edx, dword [esp + 0x1c]
mov dword [edx], 0x25
mov edx, dword [esp + 0x18]
pop edi
mov dword [edx], esi
pop esi
pop ebp
pop ebx
pop ecx
ret
cmp byte [esi + 1], 0x7b
jne 0x3016d520
mov al, byte [esi + 2]
test al, al
lea ecx, [esi + 2]
je 0x3016d4fc
nop
cmp al, 0x7d
je 0x3016d504
cmp al, 0x2d
je 0x3016d4f4
movzx eax, al
test byte [eax + 0x302513c0], 4
je 0x3016d504
mov al, byte [ecx + 1]
inc ecx
test al, al
jne 0x3016d4e0
mov edx, 1
inc esi
jmp 0x3016d522
mov cl, byte [ecx]
test cl, cl
je 0x3016d4fc
cmp cl, 0x7d
je 0x3016d4fc
mov edx, dword [esp + 0x18]
pop edi
mov dword [edx], esi
pop esi
pop ebp
mov eax, 0xffffffe6
pop ebx
pop ecx
ret
xor edx, edx
cmp byte [esi + 1], 0x2d
jne 0x3016d530
mov ecx, 1
inc esi
jmp 0x3016d532
xor ecx, ecx
movzx edi, byte [esi + 1]
mov bl, byte [edi + 0x302513c0]
xor eax, eax
test bl, 4
je 0x3016d5c1
movzx edi, byte [esi + 1]
inc esi
lea eax, [eax + eax*4]
lea eax, [edi + eax*2 - 0x30]
movzx edi, byte [esi + 1]
test byte [edi + 0x302513c0], 4
jne 0x3016d543
test eax, eax
jge 0x3016d576
mov ecx, dword [esp + 0x1c]
mov edx, dword [esp + 0x18]
pop edi
mov dword [ecx], 0x3d
mov dword [edx], esi
pop esi
pop ebp
pop ebx
pop ecx
ret
je 0x3016d5c1
test edx, edx
je 0x3016d585
mov dl, byte [esi + 1]
inc esi
cmp dl, 0x7d
jne 0x3016d5c1
test ecx, ecx
je 0x3016d5ac
mov ecx, dword [esp + 0x20]
cmp eax, ecx
jle 0x3016d5a7
mov edx, dword [esp + 0x1c]
mov dword [edx], 0xf
mov edx, dword [esp + 0x18]
pop edi
mov dword [edx], esi
pop esi
pop ebp
pop ebx
pop ecx
ret
sub ecx, eax
inc ecx
mov eax, ecx
mov edx, dword [esp + 0x18]
pop edi
mov dword [edx], esi
pop esi
mov ecx, 0xffffffe5
sub ecx, eax
pop ebp
mov eax, ecx
pop ebx
pop ecx
ret
mov edx, dword [esp + 0x1c]
mov dword [edx], 0x39
mov edx, dword [esp + 0x18]
pop edi
mov dword [edx], esi
pop esi
pop ebp
pop ebx
pop ecx
ret
mov eax, dword [esp + 0x28]
test eax, eax
jne 0x3016d634
mov eax, ecx
movzx ecx, byte [esi + 1]
test byte [ecx + 0x302513c0], 4
mov edi, esi
je 0x3016d609
movzx ecx, byte [esi + 1]
inc esi
lea eax, [eax + eax*4]
lea eax, [ecx + eax*2 - 0x30]
movzx ecx, byte [esi + 1]
test byte [ecx + 0x302513c0], 4
jne 0x3016d5f0
test eax, eax
jge 0x3016d623
mov edx, dword [esp + 0x1c]
mov dword [edx], 0x3d
mov edx, dword [esp + 0x18]
pop edi
mov dword [edx], esi
pop esi
pop ebp
pop ebx
pop ecx
ret
cmp eax, 0xa
jl 0x3016d5ac
cmp eax, dword [esp + 0x20]
jle 0x3016d5ac
mov esi, edi
movzx eax, byte [esi]
cmp eax, 0x38
jl case.0x3016d4b2.0
mov edx, dword [esp + 0x18]
dec esi
pop edi
mov dword [edx], esi
pop esi
pop ebp
xor eax, eax
pop ebx
pop ecx
ret
sub eax, 0x30
mov edi, edi
mov cl, byte [esi + 1]
inc edx
cmp cl, 0x30
jb 0x3016d66c
cmp cl, 0x37
ja 0x3016d66c
movzx ecx, byte [esi + 1]
inc esi
cmp edx, 2
lea eax, [ecx + eax*8 - 0x30]
jl 0x3016d650
test ebx, ebx
jne 0x3016d7b4
cmp eax, 0xff
jle 0x3016d7b4
mov edx, dword [esp + 0x1c]
mov dword [edx], 0x33
mov edx, dword [esp + 0x18]
pop edi
mov dword [edx], esi
pop esi
pop ebp
pop ebx
pop ecx
ret
cmp byte [esi + 1], 0x7b
jne 0x3016d718
movzx ecx, byte [esi + 2]
lea edi, [esi + 2]
xor ebp, ebp
xor eax, eax
test byte [ecx + 0x302513c0], 8
je 0x3016d6e9
nop
inc edi
test eax, eax
jne 0x3016d6ba
cmp ecx, 0x30
je 0x3016d6dd
inc ebp
cmp ecx, 0x61
jl 0x3016d6c3
sub ecx, 0x20
xor edx, edx
cmp ecx, 0x41
setge dl
shl eax, 4
dec edx
and edx, 0xfffffff9
add edx, 0x37
sub eax, edx
mov edx, dword [esp + 0x10]
add eax, ecx
movzx ecx, byte [edi]
test byte [ecx + 0x302513c0], 8
jne 0x3016d6b0
cmp byte [edi], 0x7d
jne 0x3016d718
test eax, eax
jl 0x3016d700
neg ebx
sbb ebx, ebx
and ebx, 6
add ebx, 2
cmp ebp, ebx
jle 0x3016d70a
mov ecx, dword [esp + 0x1c]
mov dword [ecx], 0x22
mov edx, dword [esp + 0x18]
mov esi, edi
pop edi
mov dword [edx], esi
pop esi
pop ebp
pop ebx
pop ecx
ret
xor eax, eax
lea ebx, [ebx]
movzx ecx, byte [esi + 1]
mov bl, byte [ecx + 0x302513c0]
inc edx
test bl, 8
je 0x3016d7b4
movzx ecx, byte [esi + 1]
inc esi
cmp ecx, 0x61
jl 0x3016d741
sub ecx, 0x20
xor ebx, ebx
cmp ecx, 0x41
setge bl
shl eax, 4
dec ebx
and ebx, 0xfffffff9
add ebx, 0x37
sub eax, ebx
add eax, ecx
cmp edx, 2
jl 0x3016d720
mov edx, dword [esp + 0x18]
pop edi
mov dword [edx], esi
pop esi
pop ebp
pop ebx
pop ecx
ret
movzx eax, byte [esi + 1]
inc esi
test eax, eax
jne 0x3016d787
mov edx, dword [esp + 0x1c]
mov dword [edx], 2
mov edx, dword [esp + 0x18]
pop edi
mov dword [edx], esi
pop esi
pop ebp
pop ebx
pop ecx
ret
cmp eax, 0x61
jl 0x3016d794
cmp eax, 0x7a
jg 0x3016d794
sub eax, 0x20
mov edx, dword [esp + 0x18]
pop edi
mov dword [edx], esi
pop esi
pop ebp
xor eax, 0x40
pop ebx
pop ecx
ret
test byte [esp + 0x24], 0x40
je 0x3016d7b4
mov ecx, dword [esp + 0x1c]
mov dword [ecx], 3
mov edx, dword [esp + 0x18]
pop edi
mov dword [edx], esi
pop esi
pop ebp
pop ebx
pop ecx
ret