Function at 0x401650
Capabilities:
Encode data using base64

Disassembly:
sub esp, 0x10
push ebx
push ebp
push esi
push edi
mov edi, eax
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x401660
sub eax, edx
mov ebp, eax
test ebp, ebp
jg 0x401680
mov eax, 0x421cc9
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10
ret 4
lea eax, [ebp + ebp*2 + 0x80]
push eax
call fcn.00413577
mov esi, dword [esp + 0x28]
add esp, 4
add esi, 0x10
lea ebx, [esp + 0x14]
mov dword [esp + 0x14], eax
call fcn.004018a0
mov ebx, dword [esp + 0x14]
lea eax, [ebp - 3]
xor ecx, ecx
test eax, eax
mov dword [esp + 0x24], edi
jle 0x40177f
lea ecx, [eax - 1]
mov eax, 0xaaaaaaab
mul ecx
shr edx, 1
add edx, 1
mov dword [esp + 0x18], edx
lea edx, [edx + edx*2]
mov dword [esp + 0x1c], edx
mov eax, dword [esp + 0x24]
mov ecx, dword [eax]
mov eax, ecx
shr eax, 2
and eax, 0x3f
cmp eax, 0x3f
ja 0x4016ee
mov al, byte [eax + str.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_]
jmp 0x4016f0
mov al, 0x3d
movsx edx, al
mov eax, ecx
shr eax, 0xc
mov esi, ecx
and esi, 3
and eax, 0xf
shl esi, 4
or eax, esi
cmp eax, 0x3f
ja 0x401712
mov al, byte [eax + str.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_]
jmp 0x401714
mov al, 0x3d
movsx edi, al
mov eax, ecx
shr eax, 8
and eax, 0xf
add eax, eax
mov esi, ecx
shr esi, 0x16
add eax, eax
and esi, 3
or eax, esi
cmp eax, 0x3f
ja 0x40173a
mov al, byte [eax + str.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_]
jmp 0x40173c
mov al, 0x3d
shr ecx, 0x10
and ecx, 0x3f
cmp ecx, 0x3f
movsx esi, al
ja 0x401752
mov al, byte [ecx + str.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_]
jmp 0x401754
mov al, 0x3d
add dword [esp + 0x24], 3
movsx ecx, al
shl ecx, 8
or ecx, esi
shl ecx, 8
or ecx, edi
shl ecx, 8
or ecx, edx
mov dword [ebx], ecx
add ebx, 4
sub dword [esp + 0x18], 1
jne 0x4016d3
mov ecx, dword [esp + 0x1c]
cmp ecx, ebp
jge 0x401834
sub ebp, ecx
xor ecx, ecx
test ebp, ebp
mov dword [esp + 0x18], ecx
jle 0x4017aa
mov edx, dword [esp + 0x24]
push ebp
push edx
lea eax, [esp + 0x20]
push eax
call sub.MSVCR80.dll_memcpy
mov ecx, dword [esp + 0x24]
add esp, 0xc
mov eax, ecx
shr eax, 2
and eax, 0x3f
cmp eax, 0x3f
ja 0x4017bf
mov al, byte [eax + str.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_]
jmp 0x4017c1
mov al, 0x3d
mov byte [ebx], al
mov eax, ecx
shr eax, 0xc
mov edx, ecx
and edx, 3
and eax, 0xf
shl edx, 4
or eax, edx
cmp eax, 0x3f
ja 0x4017e2
mov al, byte [eax + str.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_]
jmp 0x4017e4
mov al, 0x3d
cmp ebp, 1
mov byte [ebx + 1], al
jle 0x40180f
mov eax, ecx
shr eax, 8
and eax, 0xf
add eax, eax
mov edx, ecx
shr edx, 0x16
add eax, eax
and edx, 3
or eax, edx
cmp eax, 0x3f
ja 0x40180f
mov al, byte [eax + str.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_]
jmp 0x401811
mov al, 0x3d
cmp ebp, 2
mov byte [ebx + 2], al
jle 0x40182c
shr ecx, 0x10
and ecx, 0x3f
cmp ecx, 0x3f
ja 0x40182c
mov al, byte [ecx + str.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_]
jmp 0x40182e
mov al, 0x3d
mov byte [ebx + 3], al
add ebx, 4
mov eax, dword [esp + 0x14]
pop edi
pop esi
pop ebp
mov byte [ebx], 0
pop ebx
add esp, 0x10
ret 4