Function at 0x405430
Capabilities:
Encode data using base64

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x10
push esi
push edi
mov edi, dword [ebp + 8]
test edi, edi
je 0x40561f
mov esi, dword [ebp + 0x10]
test esi, esi
je 0x40561f
cmp dword [ebp + 0x14], 0
je 0x40561f
mov eax, dword [ebp + 0x18]
push ebx
mov ebx, dword [ebp + 0xc]
push eax
push ebx
call fcn.00405390
mov ecx, dword [ebp + 0x14]
add esp, 8
cmp dword [ecx], eax
jge 0x405479
pop ebx
pop edi
xor eax, eax
pop esi
mov esp, ebp
pop ebp
ret
mov eax, 0x55555556
imul ebx
mov ecx, edx
shr ecx, 0x1f
add ecx, edx
lea edx, [ecx*4]
mov eax, 0x6bca1af3
imul edx
sar edx, 5
mov ebx, edx
shr ebx, 0x1f
add ebx, edx
mov eax, 0x13
mov dword [ebp + 8], 0
mov dword [ebp - 0x10], ecx
mov dword [ebp - 8], eax
mov dword [ebp - 4], 0
js 0x405595
mov edx, dword [ebp + 0x18]
and edx, 2
mov dword [ebp - 0xc], edx
cmp dword [ebp - 4], ebx
jne 0x4054e6
mov edx, ebx
imul edx, edx, 0x4c
lea eax, [ecx*4]
sub eax, edx
cdq
and edx, 3
add eax, edx
sar eax, 2
mov dword [ebp - 8], eax
test eax, eax
jle 0x405558
mov edx, eax
lea esp, [esp]
movzx ecx, byte [edi]
movzx eax, byte [edi + 1]
shl ecx, 8
or ecx, eax
movzx eax, byte [edi + 2]
shl ecx, 8
or ecx, eax
shl ecx, 8
mov eax, ecx
shr eax, 0x1a
movzx eax, byte [eax + str.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_]
mov byte [esi], al
shl ecx, 6
mov eax, ecx
shr eax, 0x1a
movzx eax, byte [eax + str.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_]
shl ecx, 6
mov byte [esi + 1], al
mov eax, ecx
shr eax, 0x1a
movzx eax, byte [eax + str.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_]
shr ecx, 0x14
and ecx, 0x3f
mov byte [esi + 2], al
mov cl, byte [ecx + str.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_]
mov byte [esi + 3], cl
add edi, 3
add esi, 4
dec edx
jne 0x4054f0
mov ecx, dword [ebp - 0x10]
mov eax, dword [ebp - 8]
cmp dword [ebp - 0xc], 0
mov edx, dword [ebp + 8]
lea edx, [edx + eax*4]
mov dword [ebp + 8], edx
jne 0x405573
mov word [esi], 0xa0d
add esi, 2
add dword [ebp + 8], 2
mov edx, dword [ebp - 4]
inc edx
mov dword [ebp - 4], edx
cmp edx, ebx
jle 0x4054c7
cmp dword [ebp + 8], 0
je 0x405595
cmp dword [ebp - 0xc], 0
jne 0x405595
sub esi, 2
sub dword [ebp + 8], 2
lea eax, [ecx + ecx*2]
mov ecx, dword [ebp + 0xc]
sub ecx, eax
je 0x40560b
lea edx, [ecx + 1]
test edx, edx
je 0x40560b
xor eax, eax
test ecx, ecx
jle 0x4055b0
movzx eax, byte [edi]
inc edi
shl eax, 8
cmp ecx, 1
jle 0x4055be
movzx ebx, byte [edi]
or eax, ebx
inc edi
shl eax, 8
cmp ecx, 2
jle 0x4055cb
movzx ecx, byte [edi]
or eax, ecx
shl eax, 8
test edx, edx
jle 0x4055e8
mov ecx, edx
mov edi, eax
shr edi, 0x1a
mov bl, byte [edi + str.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_]
mov byte [esi], bl
inc esi
shl eax, 6
dec ecx
jne 0x4055d4
add dword [ebp + 8], edx
test byte [ebp + 0x18], 1
jne 0x40560b
mov edi, 4
sub edi, edx
test edi, edi
jle 0x405608
push edi
push 0x3d
push esi
call fcn.0042fa50
add esp, 0xc
add dword [ebp + 8], edi
mov eax, dword [ebp + 8]
mov edx, dword [ebp + 0x14]
pop ebx
pop edi
mov dword [edx], eax
mov eax, 1
pop esi
mov esp, ebp
pop ebp
ret
pop edi
xor eax, eax
pop esi
mov esp, ebp
pop ebp
ret