Function at 0x665ef2c0
Capabilities:
Encode data using xor

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x4c
mov edi, dword [eax + 0xc]
mov esi, dword [esp + 0x68]
mov dword [esp + 0x20], eax
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x24], esi
mov ecx, esi
mov esi, dword [eax]
mov eax, dword [esp + 0x70]
mov dword [esp + 0x18], edx
mov dword [esp + 0x28], esi
sub eax, 1
mov dword [esp + 0x30], eax
js 0x665ef906
mov esi, dword [esp + 0x6c]
mov edx, 0xd
movzx ebp, byte [esi + eax]
lea ebx, [edx*8]
xor ebx, ebp
xor edx, ebx
sub eax, 1
jae 0x665ef300
lea eax, [edx*8]
movzx esi, byte [esp + 0x24]
xor eax, edx
xor edx, edx
xor eax, esi
mov dword [esp + 0x34], esi
div edi
mov eax, dword [esp + 0x20]
mov eax, dword [eax + 0x14]
mov dword [esp + 0x2c], eax
mov ebx, dword [eax + edx*4]
mov esi, edx
lea ebp, [edx*4]
test ebx, ebx
je 0x665ef4f0
mov dword [esp + 0x14], ebp
mov ebp, dword [esp + 0x70]
jmp 0x665ef362
mov ebx, dword [ebx]
test ebx, ebx
je 0x665ef4f0
cmp byte [ebx + 0x28], cl
jne 0x665ef358
cmp dword [ebx + 0x14], ebp
jne 0x665ef358
mov eax, dword [esp + 0x6c]
mov dword [esp + 8], ebp
mov byte [esp + 0x10], cl
mov dword [esp + 4], eax
lea eax, [ebx + 0x29]
mov dword [esp], eax
call sub.msvcrt.dll_memcmp
movzx ecx, byte [esp + 0x10]
test eax, eax
jne 0x665ef358
mov eax, dword [ebx + 8]
mov ecx, dword [ebx + 0x10]
mov ebp, dword [esp + 0x14]
mov edx, eax
sub edx, ecx
cmp edx, 0x15
jle 0x665ef6f2
mov eax, dword [ebx + 0x20]
mov edx, dword [ebx + 0x24]
mov ebp, ecx
mov esi, dword [esp + 0x18]
mov edi, dword [esp + 0x1c]
neg ebp
xor esi, eax
xor edi, edx
or edi, esi
je 0x665ef64e
mov esi, dword [esp + 0x18]
mov edi, dword [esp + 0x1c]
sub esi, eax
mov eax, dword [esp + 0x20]
sbb edi, edx
xor ecx, ecx
mov edx, ebx
call fcn.6659c510
mov eax, dword [ebx + 0x10]
xor edx, edx
mov ecx, 0x7f
add eax, ebx
cmp ecx, esi
mov ecx, edx
sbb ecx, edi
jae 0x665ef8ea
mov ecx, 0x3fff
cmp ecx, esi
mov ecx, edi
sbb edx, edi
mov edx, esi
jae 0x665ef781
call fcn.66581dc0
mov ecx, eax
mov eax, dword [esp + 0x18]
mov edx, dword [esp + 0x1c]
add ecx, dword [ebx + 0x10]
mov dword [ebx + 0x20], eax
mov eax, dword [esp + 0x20]
mov dword [ebx + 0x24], edx
mov edx, dword [eax]
mov dword [ebx + 0x10], ecx
mov dword [ebx + 0xc], ecx
cmp edx, 1
je 0x665ef73d
add ecx, 1
xor eax, eax
test edx, edx
mov esi, dword [esp + 0x60]
setne al
mov dword [ebx + 0x10], ecx
neg eax
mov dword [ebx + 0x1c], 0
mov word [ebx + 0x1a], ax
test esi, esi
js 0x665ef745
mov dword [esp + 0x14], 1
cwde
cmp eax, dword [esp + 0x60]
je 0x665ef692
movzx esi, word [esp + 0x60]
lea eax, [ebx + ecx]
mov dword [esp + 0x10], eax
mov word [esp + 0x18], si
test edx, edx
jne 0x665ef8f8
add ecx, 1
mov esi, dword [esp + 0x60]
mov dword [ebx + 0x10], ecx
mov ecx, 0x7f
mov byte [eax], 1
mov eax, dword [ebx + 0x10]
mov edi, esi
sar edi, 0x1f
add eax, ebx
cmp ecx, dword [esp + 0x60]
mov ecx, edx
sbb ecx, edi
jae 0x665ef990
mov ecx, 0x3fff
cmp ecx, dword [esp + 0x60]
mov ecx, edi
sbb edx, edi
mov edx, esi
jae 0x665ef955
call fcn.66581dc0
mov ecx, eax
movzx eax, word [esp + 0x18]
add ecx, dword [ebx + 0x10]
mov dword [ebx + 0x1c], 0
mov dword [ebx + 0x10], ecx
mov word [ebx + 0x1a], ax
jmp 0x665ef686
mov eax, dword [esp + 0x70]
mov edx, 0
add eax, 0x6a
cmp eax, 0x80
sbb edx, 0
mov edx, pe_nt_image_headers32
cmovge edx, eax
mov eax, dword [esp + 0x20]
mov eax, dword [eax + 8]
mov dword [esp + 0x3c], edx
mov edx, dword [0x6667ced0]
mov dword [esp + 0x10], eax
add eax, eax
cmp edi, eax
jle 0x665ef75e
test edx, edx
jne 0x665ef7a2
call fcn.66587320
test eax, eax
jne 0x665ef774
call fcn.665cb300
test eax, eax
jne 0x665ef774
mov eax, dword [esp + 0x3c]
xor edx, edx
call fcn.6658bcf0
mov ebx, eax
test eax, eax
je 0x665ef774
lea edi, [eax + 4]
mov ecx, eax
xor ebp, ebp
mov dword [eax], 0
and edi, 0xfffffffc
mov dword [eax + 0x24], 0
mov eax, ebp
sub ecx, edi
add ecx, 0x28
shr ecx, 2
rep stosd dword es:[edi], eax
mov eax, dword [esp + 0x3c]
mov edi, dword [esp + 0x70]
mov dword [ebx + 8], eax
movzx eax, byte [esp + 0x24]
mov byte [ebx + 0x28], al
lea eax, [ebx + 0x29]
mov dword [esp + 8], edi
mov edi, dword [esp + 0x6c]
mov dword [esp], eax
mov dword [esp + 4], edi
call sub.msvcrt.dll_memcpy
mov eax, dword [esp + 0x70]
mov edi, dword [esp + 0x20]
mov dword [ebx + 0x14], eax
mov byte [ebx + eax + 0x29], 0
mov edx, dword [edi + 0x14]
add eax, 0x2a
mov dword [ebx + 0x10], eax
add eax, ebx
lea edx, [edx + esi*4]
mov esi, dword [esp + 0x18]
mov ecx, dword [edx]
mov dword [ebx], ecx
mov dword [edx], ebx
mov edx, 0x7f
add dword [edi + 8], 1
mov edi, dword [esp + 0x1c]
cmp edx, esi
mov edx, ebp
sbb edx, edi
jae 0x665ef925
mov esi, dword [esp + 0x18]
mov edi, dword [esp + 0x1c]
mov edx, 0x3fff
cmp edx, esi
sbb ebp, edi
jae 0x665ef970
mov ecx, dword [esp + 0x1c]
mov edx, dword [esp + 0x18]
call fcn.66581dc0
mov ecx, eax
mov eax, dword [esp + 0x18]
mov edx, dword [esp + 0x1c]
add ecx, dword [ebx + 0x10]
mov dword [ebx + 0x20], eax
mov eax, dword [esp + 0x20]
mov dword [ebx + 0x10], ecx
mov eax, dword [eax]
mov dword [ebx + 0x24], edx
mov dword [ebx + 0xc], ecx
cmp eax, 1
je 0x665ef64c
add ecx, 1
test eax, eax
setne al
mov dword [ebx + 0x10], ecx
movzx eax, al
neg eax
mov word [ebx + 0x1a], ax
xor ebp, ebp
mov edi, dword [esp + 0x60]
test edi, edi
js 0x665ef745
mov eax, dword [esp + 0x20]
mov edx, dword [eax]
cmp edx, 1
je 0x665ef79c
mov esi, dword [esp + 0x28]
xor eax, eax
test esi, esi
sete al
mov dword [esp + 0x14], eax
movsx eax, word [ebx + 0x1a]
cmp eax, dword [esp + 0x60]
jne 0x665ef46f
mov esi, dword [esp + 0x14]
test esi, esi
je 0x665ef749
lea eax, [ebx + ecx]
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x64]
mov dword [esp + 0x60], eax
mov eax, dword [esp + 0x60]
sub eax, dword [ebx + 0x1c]
xor edx, edx
mov ecx, 0x7f
add eax, 2
mov edi, eax
mov esi, eax
sar edi, 0x1f
cmp ecx, eax
mov ecx, edx
sbb ecx, edi
jae 0x665ef915
mov ecx, 0x3fff
cmp ecx, eax
sbb edx, edi
jae 0x665ef936
mov edx, eax
mov eax, dword [esp + 0x10]
mov ecx, edi
call fcn.66581dc0
mov ecx, eax
mov eax, dword [esp + 0x60]
add ecx, dword [ebx + 0x10]
mov dword [ebx + 0x10], ecx
mov dword [ebx + 0x1c], eax
jmp 0x665ef749
lea esi, [eax + eax]
mov dword [esp], ebx
mov eax, esi
mov dword [esp + 4], esi
sar eax, 0x1f
mov dword [esp + 8], eax
call sym.libsqlite3_0.dll_sqlite3_realloc64
mov edx, eax
test eax, eax
je 0x665ef774
mov dword [eax + 8], esi
mov eax, dword [esp + 0x20]
add ebp, dword [eax + 0x14]
mov eax, dword [ebp]
cmp eax, ebx
je 0x665ef730
lea esi, [esi]
mov ebp, eax
mov eax, dword [eax]
cmp eax, ebx
jne 0x665ef728
mov dword [ebp], edx
mov ecx, dword [edx + 0x10]
mov ebx, edx
jmp 0x665ef3a7
mov eax, dword [esp + 0x60]
test eax, eax
jns 0x665ef79c
mov byte [ebx + 0x18], 1
mov eax, dword [esp + 0x20]
add ecx, ebp
mov eax, dword [eax + 4]
add dword [eax], ecx
add esp, 0x4c
xor eax, eax
pop ebx
pop esi
pop edi
pop ebp
ret
test edx, edx
jne 0x665ef7ac
call fcn.66587320
test eax, eax
jne 0x665ef774
call fcn.665cb300
test eax, eax
je 0x665ef7b1
add esp, 0x4c
mov eax, 7
pop ebx
pop esi
pop edi
pop ebp
ret
shrd edx, edi, 7
mov ecx, 2
or edx, 0xffffff80
mov byte [eax], dl
mov edx, esi
and edx, 0x7f
mov byte [eax + 1], dl
jmp 0x665ef410
mov byte [ebx + 0x19], 1
jmp 0x665ef749
lock or dword [esp], 0
jmp 0x665ef54d
lock or dword [esp], 0
lea eax, [edi + edi]
shl edi, 3
xor edx, edx
mov dword [esp + 0x10], eax
mov eax, edi
call fcn.6658bcf0
mov dword [esp + 0x14], eax
test eax, eax
je 0x665ef774
mov dword [esp + 8], edi
mov dword [esp + 4], 0
mov dword [esp], eax
call sub.msvcrt.dll_memset
mov eax, dword [esp + 0x20]
mov eax, dword [eax + 0xc]
test eax, eax
jle 0x665ef86f
mov edi, dword [esp + 0x2c]
lea eax, [edi + eax*4]
mov esi, edi
mov dword [esp + 0x38], eax
lea esi, [esi]
mov ebx, dword [esi]
test ebx, ebx
je 0x665ef866
lea esi, [esi]
lea esi, [esi]
mov eax, dword [ebx]
mov dword [esi], eax
lea eax, [ebx + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_strlen
test eax, eax
je 0x665ef8e0
lea edx, [ebx + eax + 0x27]
lea ebp, [ebx + 0x27]
mov eax, 0xd
lea esi, [esi]
nop
movzx edi, byte [edx]
lea ecx, [eax*8]
sub edx, 1
xor ecx, edi
xor eax, ecx
cmp ebp, edx
jne 0x665ef838
xor edx, edx
div dword [esp + 0x10]
mov eax, dword [esp + 0x14]
lea eax, [eax + edx*4]
mov edx, dword [eax]
mov dword [ebx], edx
mov dword [eax], ebx
mov ebx, dword [esi]
test ebx, ebx
jne 0x665ef810
add esi, 4
cmp dword [esp + 0x38], esi
jne 0x665ef800
mov eax, dword [esp + 0x2c]
mov dword [esp], eax
call sym.libsqlite3_0.dll_sqlite3_free
mov eax, dword [esp + 0x20]
mov esi, dword [esp + 0x10]
mov dword [eax + 0xc], esi
mov esi, dword [esp + 0x14]
mov dword [eax + 0x14], esi
mov eax, dword [esp + 0x30]
test eax, eax
js 0x665ef99e
mov esi, dword [esp + 0x6c]
mov edx, 0xd
lea esi, [esi]
movzx ebx, byte [esi + eax]
lea ecx, [edx*8]
xor ecx, ebx
xor edx, ecx
sub eax, 1
jae 0x665ef8a8
lea eax, [edx*8]
xor eax, edx
xor edx, edx
xor eax, dword [esp + 0x34]
div dword [esp + 0x10]
mov esi, edx
mov edx, dword [0x6667ced0]
jmp 0x665ef52b
mov eax, 0xd
jmp 0x665ef84d
mov edx, esi
mov ecx, 1
mov byte [eax], dl
jmp 0x665ef410
movzx eax, word [esp + 0x60]
mov word [ebx + 0x1a], ax
jmp 0x665ef6a1
mov eax, 0x68
mov edx, 0xd
jmp 0x665ef31b
mov esi, dword [esp + 0x10]
mov ecx, 1
mov byte [esi], al
jmp 0x665ef6e3
movzx edx, byte [esp + 0x18]
mov ecx, 1
mov byte [eax], dl
jmp 0x665ef616
mov edx, dword [esp + 0x10]
shrd eax, edi, 7
mov ecx, 2
or eax, 0xffffff80
mov byte [edx], al
mov eax, esi
and eax, 0x7f
mov byte [edx + 1], al
jmp 0x665ef6e3
shrd edx, edi, 7
mov ecx, 2
or edx, 0xffffff80
mov byte [eax], dl
mov edx, esi
and edx, 0x7f
mov byte [eax + 1], dl
jmp 0x665ef4ce
shrd esi, edi, 7
mov ecx, 2
mov edx, esi
or edx, 0xffffff80
mov byte [eax], dl
movzx edx, byte [esp + 0x18]
and edx, 0x7f
mov byte [eax + 1], dl
jmp 0x665ef616
mov edx, esi
mov ecx, 1
mov byte [eax], dl
jmp 0x665ef4ce
mov eax, 0x68
mov edx, 0xd
jmp 0x665ef8c3