Function at 0x40d660
Capabilities:
Encode data using base64

Disassembly:
sub esp, 0x128
mov eax, dword [0x5894dc]
xor eax, esp
mov dword [esp + 0x124], eax
mov eax, dword [esp + 0x134]
mov edx, dword [esp + 0x13c]
mov dword [esp + 0x18], ecx
mov ecx, dword [esp + 0x138]
push ebx
push edi
mov edi, dword [esp + 0x138]
mov dword [esp + 8], ecx
xor ecx, ecx
cmp edi, ecx
mov dword [esp + 0xc], eax
mov dword [esp + 0x18], edx
je 0x40d902
mov ebx, dword [esp + 0x134]
cmp ebx, ecx
je 0x40d902
mov eax, 0x55555556
imul edi
mov eax, edx
shr eax, 0x1f
push ebp
add eax, edx
push esi
xor esi, esi
cmp eax, ecx
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x24], ecx
mov dword [esp + 0x18], eax
jle 0x40d800
movzx eax, byte [esi + ebx]
movzx edi, byte [esi + ebx + 1]
mov edx, eax
sar edx, 2
and edx, 0x3f
movzx edx, byte [edx + 0x511448]
mov byte [esp + ecx + 0x2c], dl
add esi, 1
movzx ebp, byte [esi + ebx + 1]
mov edx, edi
sar edx, 4
and edx, 0xf
and eax, 3
shl eax, 4
or edx, eax
movzx eax, byte [edx + 0x511448]
add esi, 1
and edi, 0xf
mov edx, ebp
sar edx, 6
mov byte [esp + ecx + 0x2d], al
add ecx, 1
and edx, 3
add edi, edi
add edi, edi
or edx, edi
movzx eax, byte [edx + 0x511448]
add ecx, 1
mov byte [esp + ecx + 0x2c], al
mov eax, dword [esp + 0x1c]
and ebp, 0x3f
movzx edx, byte [ebp + 0x511448]
add ecx, 1
mov byte [esp + ecx + 0x2c], dl
mov edx, dword [esp + 0x28]
add eax, 4
add esi, 1
add ecx, 1
cmp eax, dword [edx + 4]
mov dword [esp + 0x1c], eax
jl 0x40d788
mov byte [esp + ecx + 0x2c], 0xd
add ecx, 1
mov byte [esp + ecx + 0x2c], 0xa
add ecx, 1
mov dword [esp + 0x1c], 0
cmp ecx, 0x100
jl 0x40d7b6
mov eax, dword [esp + 0x20]
mov edx, dword [esp + 0x10]
push eax
push edx
push 1
push ecx
mov ecx, dword [esp + 0x24]
lea eax, [esp + 0x3c]
push eax
call fcn.00451d50
cmp eax, 1
jne 0x40d8e1
xor ecx, ecx
mov eax, dword [esp + 0x24]
add eax, 1
cmp eax, dword [esp + 0x18]
mov dword [esp + 0x24], eax
jl 0x40d6e1
test ecx, ecx
je 0x40d7f5
mov edx, dword [esp + 0x20]
mov eax, dword [esp + 0x10]
push edx
push eax
push 1
push ecx
lea ecx, [esp + 0x3c]
push ecx
mov ecx, dword [esp + 0x28]
call fcn.00451d50
cmp eax, 1
jne 0x40d8e1
xor ecx, ecx
mov eax, dword [esp + 0x18]
mov edi, dword [esp + 0x140]
lea edx, [eax + eax*2]
sub edi, edx
sub edi, 0
je 0x40d8ad
sub edi, 1
je 0x40d871
sub edi, 1
jne 0x40d8bd
movzx eax, byte [esi + ebx]
movzx esi, byte [esi + ebx + 1]
mov edx, eax
sar edx, 2
and edx, 0x3f
movzx edx, byte [edx + 0x511448]
mov byte [esp + ecx + 0x2c], dl
mov edx, esi
sar edx, 4
and eax, 3
and edx, 0xf
shl eax, 4
or edx, eax
mov al, byte [edx + 0x511448]
add ecx, 1
and esi, 0xf
movzx edx, byte [esi*4 + 0x511448]
mov byte [esp + ecx + 0x2c], al
add ecx, 1
mov byte [esp + ecx + 0x2c], dl
add ecx, 1
mov byte [esp + ecx + 0x2c], 0x3d
jmp 0x40d8aa
movzx eax, byte [esi + ebx]
mov edx, eax
sar edx, 2
and eax, 3
and edx, 0x3f
mov dl, byte [edx + 0x511448]
mov byte [esp + ecx + 0x2c], dl
shl eax, 4
mov al, byte [eax + 0x511448]
add ecx, 1
mov byte [esp + ecx + 0x2c], al
add ecx, 1
mov al, 0x3d
mov byte [esp + ecx + 0x2c], al
add ecx, 1
mov byte [esp + ecx + 0x2c], al
add ecx, 1
mov byte [esp + ecx + 0x2c], 0xd
add ecx, 1
mov byte [esp + ecx + 0x2c], 0xa
add ecx, 1
test ecx, ecx
je 0x40d8fe
mov edx, dword [esp + 0x20]
mov eax, dword [esp + 0x10]
push edx
push eax
push 1
push ecx
lea ecx, [esp + 0x3c]
push ecx
mov ecx, dword [esp + 0x28]
call fcn.00451d50
cmp eax, 1
je 0x40d8fe
xor al, al
pop esi
pop ebp
mov ecx, dword [esp + 0x12c]
pop edi
pop ebx
xor ecx, esp
call fcn.004ec47e
add esp, 0x128
ret 0x14
mov al, 1
jmp 0x40d8e3
mov al, 1
jmp 0x40d8e5