Function at 0x413040
Capabilities:
Encode data using base64

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4ff4c9
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x10
xor edx, edx
push esi
mov esi, dword [ebp + 8]
mov dword [ebp - 0x1c], edx
mov dword [esi + 0x14], 0xf
mov dword [esi + 0x10], edx
push edi
mov byte [esi], dl
xor edi, edi
mov dword [ebp - 4], edx
mov dword [ebp - 0x1c], 1
cmp dword [ebp + 0x10], edx
je 0x413340
push ebx
mov eax, dword [ebp + 0xc]
mov cl, byte [eax]
dec dword [ebp + 0x10]
mov byte [ebp + edi - 0x10], cl
inc edi
inc eax
mov dword [ebp - 0x14], edi
mov dword [ebp + 0xc], eax
cmp edi, 3
jne 0x413192
mov al, byte [ebp - 0x10]
mov cl, al
and al, 3
shr cl, 2
shl al, 4
mov byte [ebp - 0x18], cl
mov cl, al
mov al, byte [ebp - 0xf]
mov bl, al
and al, 0xf
add al, al
shr bl, 4
add cl, bl
mov byte [ebp - 0x17], cl
mov dword [ebp - 0x14], edx
lea ecx, [eax + eax]
mov al, byte [ebp - 0xe]
mov bl, al
shr bl, 6
add ecx, ebx
and al, 0x3f
mov byte [ebp - 0x16], cl
mov byte [ebp - 0x15], al
nop
mov eax, dword [0x55d6ac]
mov edx, 0x10
cmp dword [0x55d6c0], edx
jae 0x4130f7
mov eax, 0x55d6ac
mov ecx, dword [ebp - 0x14]
movzx ecx, byte [ebp + ecx - 0x18]
mov bl, byte [ecx + eax]
mov eax, dword [esi + 0x10]
or ecx, 0xffffffff
sub ecx, eax
cmp ecx, 1
jbe 0x413255
lea edi, [eax + 1]
cmp edi, 0xfffffffe
ja 0x413255
mov ecx, dword [esi + 0x14]
cmp ecx, edi
jae 0x413136
push eax
push edi
mov ecx, esi
call fcn.00402d00
mov edx, 0x10
jmp 0x41314a
test edi, edi
jne 0x41314c
mov dword [esi + 0x10], edi
cmp ecx, edx
jb 0x413145
mov eax, dword [esi]
jmp 0x413147
mov eax, esi
mov byte [eax], 0
test edi, edi
setne al
test al, al
je 0x413176
mov ecx, dword [esi + 0x10]
cmp dword [esi + 0x14], edx
jb 0x41315f
mov eax, dword [esi]
jmp 0x413161
mov eax, esi
mov byte [eax + ecx], bl
mov dword [esi + 0x10], edi
cmp dword [esi + 0x14], edx
jb 0x413170
mov eax, dword [esi]
jmp 0x413172
mov eax, esi
mov byte [eax + edi], 0
mov eax, dword [ebp - 0x14]
inc eax
mov dword [ebp - 0x14], eax
cmp eax, 4
jl 0x4130e0
mov dword [ebp - 0x14], 0
mov edi, dword [ebp - 0x14]
xor edx, edx
cmp dword [ebp + 0x10], edx
jne 0x413087
cmp edi, edx
je 0x41333f
cmp edi, 3
jge 0x4131c0
mov ecx, 3
sub ecx, edi
push ecx
lea eax, [ebp + edi - 0x10]
push edx
push eax
call fcn.004e00a0
add esp, 0xc
xor edx, edx
mov al, byte [ebp - 0x10]
mov cl, al
and al, 3
shl al, 4
shr cl, 2
mov byte [ebp - 0x18], cl
mov cl, al
mov al, byte [ebp - 0xf]
mov bl, al
and al, 0xf
add al, al
shr bl, 4
add cl, bl
mov byte [ebp - 0x17], cl
mov dword [ebp + 0x10], edx
lea ecx, [eax + eax]
mov al, byte [ebp - 0xe]
mov bl, al
shr bl, 6
and al, 0x3f
mov byte [ebp - 0x15], al
lea eax, [edi + 1]
add ecx, ebx
mov byte [ebp - 0x16], cl
cmp eax, edx
jle 0x4132b5
jmp 0x413210
cmp dword [0x55d6c0], 0x10
mov eax, dword [0x55d6ac]
jae 0x413223
mov eax, 0x55d6ac
movzx ecx, byte [ebp + edx - 0x18]
mov bl, byte [ecx + eax]
mov eax, dword [esi + 0x10]
or ecx, 0xffffffff
sub ecx, eax
cmp ecx, 1
jbe 0x413255
lea edi, [eax + 1]
cmp edi, 0xfffffffe
ja 0x413255
mov ecx, dword [esi + 0x14]
cmp ecx, edi
jae 0x41325f
push eax
push edi
mov ecx, esi
call fcn.00402d00
mov edx, dword [ebp + 0x10]
jmp 0x413274
push str.string_too_long
call fcn.004cc096
test edi, edi
jne 0x413276
mov dword [esi + 0x10], edi
cmp ecx, 0x10
jb 0x41326f
mov eax, dword [esi]
jmp 0x413271
mov eax, esi
mov byte [eax], 0
test edi, edi
setne al
test al, al
je 0x4132a2
cmp dword [esi + 0x14], 0x10
mov ecx, dword [esi + 0x10]
jb 0x41328a
mov eax, dword [esi]
jmp 0x41328c
mov eax, esi
mov byte [eax + ecx], bl
cmp dword [esi + 0x14], 0x10
mov dword [esi + 0x10], edi
jb 0x41329c
mov eax, dword [esi]
jmp 0x41329e
mov eax, esi
mov byte [eax + edi], 0
mov eax, dword [ebp - 0x14]
inc edx
inc eax
mov dword [ebp + 0x10], edx
cmp edx, eax
jl 0x413210
mov edi, dword [ebp - 0x14]
cmp edi, 3
jge 0x41333f
jmp 0x4132c3
mov edi, dword [ebp - 0x14]
mov eax, dword [esi + 0x10]
or edx, 0xffffffff
inc edi
sub edx, eax
mov dword [ebp - 0x14], edi
cmp edx, 1
jbe 0x413255
lea edi, [eax + 1]
cmp edi, 0xfffffffe
ja 0x413255
mov ecx, dword [esi + 0x14]
cmp ecx, edi
jae 0x4132f2
push eax
push edi
mov ecx, esi
call fcn.00402d00
jmp 0x413307
test edi, edi
jne 0x413309
mov dword [esi + 0x10], edi
cmp ecx, 0x10
jb 0x413302
mov eax, dword [esi]
jmp 0x413304
mov eax, esi
mov byte [eax], 0
test edi, edi
setne al
test al, al
je 0x413339
mov ecx, dword [esi + 0x10]
mov edx, 0x10
cmp dword [esi + 0x14], edx
jb 0x413321
mov eax, dword [esi]
jmp 0x413323
mov eax, esi
mov byte [eax + ecx], 0x3d
mov dword [esi + 0x10], edi
cmp dword [esi + 0x14], edx
jb 0x413333
mov eax, dword [esi]
jmp 0x413335
mov eax, esi
mov byte [edi + eax], 0
cmp dword [ebp - 0x14], 3
jl 0x4132c0
pop ebx
mov ecx, dword [ebp - 0xc]
pop edi
mov eax, esi
pop esi
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret