Function at 0x401040
Capabilities:
Encode data using base64

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x408fd9
mov eax, dword fs:[0]
push eax
sub esp, 0x30
push ebx
push esi
push edi
mov eax, dword [0x40e228]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov ebx, dword [ebp + 0x10]
mov esi, dword [ebp + 8]
lea edx, [ebx + 2]
mov eax, 0xaaaaaaab
mul edx
shr edx, 1
add edx, edx
mov al, cl
add edx, edx
neg al
sbb al, al
and al, 0xf1
add al, 0x3d
mov dword [ebp - 0x1c], 0
movzx ecx, cl
mov byte [ebp - 0x18], al
mov eax, dword [ecx*4 + 0x40ebec]
mov dword [ebp - 0x14], eax
xor eax, eax
mov dword [esi + 0x14], 0xf
mov dword [esi + 0x10], eax
mov byte [esi], al
mov dword [ebp - 4], eax
mov edi, dword [esi + 0x10]
mov dword [ebp - 0x1c], 1
cmp edi, edx
ja 0x4010e4
cmp dword [esi + 0x14], edx
je 0x4010e4
push 1
push edx
mov eax, esi
call fcn.004014e0
test al, al
je 0x4010e4
cmp dword [esi + 0x14], 0x10
mov dword [esi + 0x10], edi
jb 0x4010de
mov eax, dword [esi]
jmp 0x4010e0
mov eax, esi
mov byte [eax + edi], 0
mov dword [ebp - 0x10], 0
test ebx, ebx
je 0x40136a
mov eax, 2
sub eax, dword [ebp + 0xc]
mov dword [ebp - 0x24], eax
mov edi, dword [ebp - 0x10]
add edi, dword [ebp + 0xc]
mov ecx, dword [ebp - 0x14]
movzx eax, byte [edi]
shr eax, 2
mov dl, byte [eax + ecx]
mov ecx, dword [esi + 0x14]
mov byte [ebp - 0x20], dl
cmp ecx, 0x10
jb 0x40111f
mov edx, dword [esi]
jmp 0x401121
mov edx, esi
mov eax, dword [esi + 0x10]
add eax, edx
cmp ecx, 0x10
jb 0x40112f
mov ecx, dword [esi]
jmp 0x401131
mov ecx, esi
test eax, eax
je 0x401137
sub eax, ecx
mov ecx, dword [ebp - 0x20]
push ecx
mov ebx, eax
call fcn.00401660
mov eax, dword [ebp - 0x24]
add eax, edi
mov dword [ebp - 0x2c], eax
dec eax
cmp eax, dword [ebp + 0x10]
movzx eax, byte [edi]
jae 0x4012c0
mov edx, dword [ebp + 0xc]
mov ecx, dword [ebp - 0x10]
movzx ecx, byte [ecx + edx + 1]
and eax, 3
shl eax, 4
add eax, dword [ebp - 0x14]
shr ecx, 4
mov dl, byte [ecx + eax]
mov ecx, dword [esi + 0x14]
mov byte [ebp - 0x28], dl
cmp ecx, 0x10
jb 0x401180
mov edx, dword [esi]
jmp 0x401182
mov edx, esi
mov eax, dword [esi + 0x10]
add eax, edx
cmp ecx, 0x10
jb 0x401190
mov ecx, dword [esi]
jmp 0x401192
mov ecx, esi
test eax, eax
je 0x401198
sub eax, ecx
mov ecx, dword [ebp - 0x28]
push ecx
mov ebx, eax
call fcn.00401660
mov edx, dword [ebp - 0x2c]
mov eax, dword [ebp - 0x10]
cmp edx, dword [ebp + 0x10]
jae 0x401247
mov edi, dword [ebp + 0xc]
movzx edx, byte [eax + edi + 2]
movzx ecx, byte [eax + edi + 1]
shr edx, 6
add edx, dword [ebp - 0x14]
and ecx, 0xf
mov al, byte [edx + ecx*4]
mov ecx, dword [esi + 0x14]
mov byte [ebp - 0x30], al
cmp ecx, 0x10
jb 0x4011da
mov edx, dword [esi]
jmp 0x4011dc
mov edx, esi
mov eax, dword [esi + 0x10]
add eax, edx
cmp ecx, 0x10
jb 0x4011ea
mov ecx, dword [esi]
jmp 0x4011ec
mov ecx, esi
test eax, eax
je 0x4011f2
sub eax, ecx
mov ecx, dword [ebp - 0x30]
push ecx
mov ebx, eax
call fcn.00401660
mov edx, dword [ebp - 0x10]
movzx eax, byte [edx + edi + 2]
mov ecx, dword [ebp - 0x14]
and eax, 0x3f
mov dl, byte [eax + ecx]
mov ecx, dword [esi + 0x14]
mov byte [ebp - 0x34], dl
cmp ecx, 0x10
jb 0x40121d
mov edx, dword [esi]
jmp 0x40121f
mov edx, esi
mov eax, dword [esi + 0x10]
add eax, edx
cmp ecx, 0x10
jb 0x40122d
mov ecx, dword [esi]
jmp 0x40122f
mov ecx, esi
test eax, eax
jne 0x40123c
mov ecx, dword [ebp - 0x34]
push ecx
jmp 0x401351
sub eax, ecx
mov ecx, dword [ebp - 0x34]
push ecx
jmp 0x401351
mov edx, dword [ebp + 0xc]
movzx ecx, byte [eax + edx + 1]
mov edx, dword [ebp - 0x14]
and ecx, 0xf
mov al, byte [edx + ecx*4]
mov ecx, dword [esi + 0x14]
mov byte [ebp - 0x38], al
cmp ecx, 0x10
jb 0x401267
mov edx, dword [esi]
jmp 0x401269
mov edx, esi
mov eax, dword [esi + 0x10]
add eax, edx
cmp ecx, 0x10
jb 0x401277
mov ecx, dword [esi]
jmp 0x401279
mov ecx, esi
test eax, eax
je 0x40127f
sub eax, ecx
mov ecx, dword [ebp - 0x38]
push ecx
mov ebx, eax
call fcn.00401660
mov ecx, dword [esi + 0x14]
cmp ecx, 0x10
jb 0x401296
mov edx, dword [esi]
jmp 0x401298
mov edx, esi
mov eax, dword [esi + 0x10]
add eax, edx
cmp ecx, 0x10
jb 0x4012a6
mov ecx, dword [esi]
jmp 0x4012a8
mov ecx, esi
test eax, eax
jne 0x4012b5
mov edx, dword [ebp - 0x18]
push edx
jmp 0x401351
mov edx, dword [ebp - 0x18]
sub eax, ecx
push edx
jmp 0x401351
mov ecx, dword [ebp - 0x14]
and eax, 3
add eax, eax
mov dl, byte [ecx + eax*8]
mov ecx, dword [esi + 0x14]
mov byte [ebp - 0x3c], dl
cmp ecx, 0x10
jb 0x4012da
mov edx, dword [esi]
jmp 0x4012dc
mov edx, esi
mov eax, dword [esi + 0x10]
add eax, edx
cmp ecx, 0x10
jb 0x4012ea
mov ecx, dword [esi]
jmp 0x4012ec
mov ecx, esi
test eax, eax
je 0x4012f2
sub eax, ecx
mov ecx, dword [ebp - 0x3c]
push ecx
mov ebx, eax
call fcn.00401660
mov ecx, dword [esi + 0x14]
cmp ecx, 0x10
jb 0x401309
mov edx, dword [esi]
jmp 0x40130b
mov edx, esi
mov eax, dword [esi + 0x10]
add eax, edx
cmp ecx, 0x10
jb 0x401319
mov ecx, dword [esi]
jmp 0x40131b
mov ecx, esi
test eax, eax
je 0x401321
sub eax, ecx
mov edi, dword [ebp - 0x18]
push edi
mov ebx, eax
call fcn.00401660
mov ecx, dword [esi + 0x14]
cmp ecx, 0x10
jb 0x401338
mov edx, dword [esi]
jmp 0x40133a
mov edx, esi
mov eax, dword [esi + 0x10]
add eax, edx
cmp ecx, 0x10
jb 0x401348
mov ecx, dword [esi]
jmp 0x40134a
mov ecx, esi
test eax, eax
je 0x401350
sub eax, ecx
push edi
mov ebx, eax
call fcn.00401660
mov eax, dword [ebp - 0x10]
add eax, 3
mov dword [ebp - 0x10], eax
cmp eax, dword [ebp + 0x10]
jb 0x4010fe
mov eax, esi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret