Function at 0x1046766
Capabilities:
Encode data using base64

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
push ecx
push ecx
push ebx
push esi
push edi
mov edi, dword [ebp + 8]
test edi, edi
jne 0x1046781
mov esi, 0x80070057
jmp 0x1046a2a
cmp dword [ebp + 0x14], 0
je 0x1046777
mov eax, edi
lea edx, [eax + 2]
mov cx, word [eax]
inc eax
inc eax
test cx, cx
jne 0x104678c
mov ecx, dword [ebp + 0xc]
sub eax, edx
sar eax, 1
cmp eax, ecx
jae 0x10467a3
mov ecx, eax
and dword [ebp + 0xc], 0
lea ebx, [edi + ecx*2]
jmp 0x10468e6
movzx eax, word [edi]
mov ecx, 0x100
cmp ax, cx
jae 0x1046777
movzx ecx, ax
cmp byte [ecx + 0x1003c48], 0x3f
jbe 0x10468cc
cmp ax, 0x20
je 0x10468e4
cmp ax, 9
je 0x10468e4
cmp ax, 0xd
je 0x10468e4
cmp ax, 0xa
je 0x10468e4
mov eax, dword [ebp + 0xc]
test eax, eax
je 0x1046777
and eax, 3
je 0x1046817
cmp word [edi], 0x3d
jne 0x1046777
cmp eax, 1
je 0x1046777
mov ecx, dword [ebp + 0xc]
shr ecx, 2
xor esi, esi
cmp ecx, esi
je 0x10468fb
mov ebx, ecx
imul ebx, ebx, 3
push 3
xor edx, edx
mov eax, ebx
pop edi
div edi
cmp eax, ecx
je 0x10468f3
mov eax, 0x80070216
mov esi, eax
mov ecx, dword [0x136ec90]
cmp ecx, 0x136ec90
je 0x104686b
test byte [ecx + 0x3c], 2
je 0x104686b
push eax
push 0x10039dc
push 0xc
push dword [ecx + 0x34]
push dword [ecx + 0x30]
call fcn.0103e52d
test esi, esi
jl 0x1046a2a
mov eax, dword [ebp + 0xc]
and eax, 3
dec eax
je 0x1046a21
dec eax
je 0x104689e
dec eax
jne 0x10468b6
lea eax, [ebp - 4]
push eax
push 1
push dword [ebp - 4]
call fcn.0103f13a
mov esi, eax
test esi, esi
jl 0x1046a2a
lea eax, [ebp - 4]
push eax
push 1
push dword [ebp - 4]
call fcn.0103f13a
mov esi, eax
test esi, esi
jl 0x1046a2a
mov ebx, dword [ebp + 0x10]
test ebx, ebx
jne 0x1046903
mov eax, dword [ebp + 0x14]
mov ecx, dword [ebp - 4]
mov dword [eax], ecx
xor esi, esi
jmp 0x1046a4f
lea eax, [ebp + 0xc]
push eax
push 1
push dword [ebp + 0xc]
call fcn.0103f13a
mov esi, eax
test esi, esi
jl 0x1046a2a
inc edi
inc edi
cmp edi, ebx
jb 0x10467af
jmp 0x1046817
mov dword [ebp - 4], ebx
jmp 0x104686b
mov dword [ebp - 4], esi
jmp 0x104686b
mov eax, dword [ebp - 4]
mov ecx, dword [ebp + 0x14]
cmp dword [ecx], eax
jae 0x1046917
mov esi, 0x8007007a
jmp 0x1046a2a
mov ecx, dword [ebp + 8]
add eax, ebx
cmp dword [ebp + 0xc], 0
mov dword [ebp - 4], eax
ja 0x1046943
push dword [ebp + 0x14]
sub ebx, dword [ebp + 0x10]
push ebx
call fcn.010452e4
mov esi, eax
test esi, esi
jl 0x1046a2a
jmp 0x1046a26
mov ecx, dword [ebp - 8]
xor eax, eax
lea edi, [ebp + 8]
stosd dword es:[edi], eax
xor edi, edi
push 4
pop eax
cmp dword [ebp + 0xc], eax
ja 0x1046956
mov eax, dword [ebp + 0xc]
cmp edi, eax
jae 0x1046984
mov edx, 0x100
jmp 0x104696f
movzx eax, ax
cmp byte [eax + 0x1003c48], 0x3f
jbe 0x1046979
inc ecx
inc ecx
movzx eax, word [ecx]
mov esi, edx
cmp si, ax
ja 0x1046961
mov al, byte [ecx]
inc ecx
mov byte [ebp + edi + 8], al
inc ecx
inc edi
jmp 0x104694b
mov dword [ebp - 8], ecx
cmp ebx, dword [ebp - 4]
jae 0x1046a1a
movzx esi, byte [ebp + 9]
movzx eax, byte [ebp + 8]
mov al, byte [eax + 0x1003c48]
mov cl, byte [esi + 0x1003c48]
shl al, 2
shr cl, 4
or al, cl
mov byte [ebx], al
inc ebx
cmp edi, 2
jbe 0x10469d4
cmp ebx, dword [ebp - 4]
jae 0x1046a1a
movzx eax, byte [ebp + 0xa]
mov al, byte [eax + 0x1003c48]
mov cl, byte [esi + 0x1003c48]
shr al, 2
shl cl, 4
or al, cl
mov byte [ebx], al
inc ebx
cmp edi, 3
jbe 0x10469f8
cmp ebx, dword [ebp - 4]
jae 0x1046a1a
movzx eax, byte [ebp + 0xa]
mov al, byte [eax + 0x1003c48]
movzx ecx, byte [ebp + 0xb]
shl al, 6
or al, byte [ecx + 0x1003c48]
mov byte [ebx], al
inc ebx
lea eax, [ebp + 0xc]
push eax
push edi
push dword [ebp + 0xc]
call fcn.0104458e
mov esi, eax
test esi, esi
jl 0x1046a2a
cmp dword [ebp + 0xc], 0
ja 0x1046940
jmp 0x1046925
mov esi, 0x8000ffff
jmp 0x1046a2a
mov esi, 0x80070057
test esi, esi
jge 0x1046a4f
mov eax, dword [0x136ec90]
cmp eax, 0x136ec90
je 0x1046a4f
test byte [eax + 0x3c], 2
je 0x1046a4f
push esi
push 0x1003aa0
push 0xf
push dword [eax + 0x34]
push dword [eax + 0x30]
call fcn.0103e52d
pop edi
mov eax, esi
pop esi
pop ebx
leave
ret 0x10