Function at 0x665e1860
Capabilities:
Resolve function by parsing pe exports

Disassembly:
push ebp
push edi
push esi
mov esi, ecx
push ebx
mov ebx, eax
sub esp, 0x5c
cmp byte [ebx + 0xc], 0
mov eax, dword [esp + 0x7c]
mov ebp, dword [esp + 0x70]
mov dword [esp + 0x24], edx
mov edi, dword [esp + 0x78]
mov edx, dword [esp + 0x74]
mov dword [esp + 0x28], eax
jne 0x665e1891
lea eax, [ebp + 1]
cmp eax, dword [ebx + 0x14]
jl 0x665e18f0
test edx, edx
je 0x665e18af
mov dword [esp + 4], esi
mov dword [esp], edx
mov dword [esp + 8], ebp
mov dword [esp + 0x28], edx
call sub.msvcrt.dll_memcpy
mov edx, dword [esp + 0x28]
mov esi, edx
test edi, edi
jne 0x665e18e0
movzx eax, byte [ebx + 0xc]
lea edx, [eax + 1]
add eax, 8
mov byte [ebx + 0xc], dl
mov dword [ebx + eax*4 + 4], esi
movzx esi, word [esp + 0x24]
mov word [ebx + eax*2 + 0xc], si
add esp, 0x5c
pop ebx
pop esi
pop edi
pop ebp
ret
bswap edi
mov dword [esi], edi
jmp 0x665e18b3
mov eax, dword [ebx + 0x48]
call fcn.665dd740
test eax, eax
jne 0x665e1994
movzx eax, word [ebx + 0x12]
movzx edx, word [ebx + 0x18]
mov dword [esp + 0x4c], 0
mov ecx, dword [ebx + 0x38]
lea edx, [eax + edx*2]
movzx eax, byte [ebx + 9]
mov dword [esp + 0x34], ecx
mov dword [esp + 0x2c], edx
lea edx, [ecx + eax + 5]
lea ecx, [ecx + eax + 6]
mov dword [esp + 0x38], ecx
mov ecx, dword [esp + 0x38]
mov dword [esp + 0x3c], edx
movzx edx, byte [edx]
movzx ecx, byte [ecx]
shl edx, 8
or edx, ecx
mov dword [esp + 0x30], edx
cmp dword [esp + 0x2c], edx
jle 0x665e19a8
test edx, edx
jne 0x665e1963
mov edx, dword [ebx + 0x34]
mov dword [esp + 0x30], 0x10000
cmp dword [edx + 0x28], 0x10000
je 0x665e19a8
mov dword [esp + 0x10], 0x6667e21c
mov dword [esp + 0xc], 0x10442
mov dword [esp + 8], str.database_corruption
mov dword [esp + 4], str._s_at_line__d_of___.10s_
mov dword [esp], 0xb
call sym.libsqlite3_0.dll_sqlite3_log
mov eax, 0xb
mov edi, dword [esp + 0x28]
mov dword [edi], eax
add esp, 0x5c
pop ebx
pop esi
pop edi
pop ebp
ret
mov ecx, dword [esp + 0x34]
cmp byte [ecx + eax + 2], 0
je 0x665e1ab8
mov eax, dword [esp + 0x2c]
add eax, 1
cmp eax, dword [esp + 0x30]
jl 0x665e1b38
mov eax, dword [esp + 0x2c]
lea eax, [eax + ebp + 2]
cmp dword [esp + 0x30], eax
jl 0x665e1ae8
mov eax, dword [esp + 0x30]
mov ecx, dword [esp + 0x3c]
sub eax, ebp
mov edx, eax
mov byte [esp + 0x3c], al
sar edx, 8
mov byte [ecx], dl
mov ecx, dword [esp + 0x38]
mov byte [esp + 0x30], dl
mov byte [ecx], al
lea edx, [ebp + 2]
movzx edx, dx
sub dword [ebx + 0x14], edx
mov edx, dword [esp + 0x34]
lea ecx, [edx + eax]
test edi, edi
je 0x665e1ad0
lea eax, [edx + eax + 4]
sub ebp, 4
lea edx, [esi + 4]
mov dword [esp + 0x2c], ecx
mov dword [esp + 8], ebp
bswap edi
mov dword [esp + 4], edx
mov dword [esp], eax
call sub.msvcrt.dll_memcpy
mov ecx, dword [esp + 0x2c]
mov dword [ecx], edi
mov eax, dword [ebx + 0x40]
mov ecx, dword [esp + 0x24]
lea edi, [eax + ecx*2]
movzx eax, word [ebx + 0x18]
mov dword [esp + 4], edi
sub eax, ecx
add eax, eax
mov dword [esp + 8], eax
lea eax, [edi + 2]
mov dword [esp], eax
call sub.msvcrt.dll_memmove
movzx eax, byte [esp + 0x30]
mov byte [edi], al
movzx eax, byte [esp + 0x3c]
mov byte [edi + 1], al
mov edi, dword [esp + 0x34]
movzx eax, byte [ebx + 9]
add word [ebx + 0x18], 1
lea edx, [edi + eax + 4]
add byte [edx], 1
jne 0x665e1a8a
movzx eax, byte [ebx + 9]
add byte [edi + eax + 3], 1
mov eax, dword [ebx + 0x34]
cmp byte [eax + 0x11], 0
je 0x665e18ce
mov eax, dword [esp + 0x28]
mov ecx, esi
mov edx, ebx
mov dword [esp + 0x70], eax
add esp, 0x5c
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
jmp fcn.665e0760
cmp byte [ecx + eax + 1], 0
jne 0x665e19b7
jmp 0x665e19c8
mov dword [esp + 8], ebp
mov dword [esp + 4], esi
mov dword [esp], ecx
call sub.msvcrt.dll_memcpy
jmp 0x665e1a37
mov edx, dword [ebx + 0x14]
lea eax, [ebp + 2]
sub edx, eax
mov eax, 4
cmp edx, 4
cmovg edx, eax
mov eax, ebx
call fcn.665b1ed0
mov dword [esp + 0x4c], eax
test eax, eax
jne 0x665e1994
mov eax, dword [esp + 0x3c]
mov ecx, dword [esp + 0x38]
movzx eax, byte [eax]
movzx edx, byte [ecx]
shl eax, 8
or eax, edx
sub eax, 1
movzx eax, ax
add eax, 1
mov dword [esp + 0x30], eax
jmp 0x665e19da
lea ecx, [esp + 0x4c]
mov edx, ebp
mov eax, ebx
call fcn.665b1d40
test eax, eax
je 0x665e1b77
sub eax, dword [esp + 0x34]
movzx ecx, ah
mov byte [esp + 0x3c], al
mov dword [esp + 0x30], ecx
cmp dword [esp + 0x2c], eax
jl 0x665e19f9
mov dword [esp + 0x10], 0x6667e21c
mov dword [esp + 0xc], 0x10454
jmp 0x665e1973
mov eax, dword [esp + 0x4c]
test eax, eax
je 0x665e19c8
jmp 0x665e1994