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

Disassembly:
push ebp
push edi
push esi
push ebx
mov esi, edx
mov ebx, eax
sub esp, 0x4c
cmp edx, 1
mov dword [esp + 0x28], ecx
mov dword [esp + 0x38], 0
je 0x665beb72
xor edi, edi
cmp byte [eax + 0x16], 0
je 0x665beaec
cmp byte [eax + 0x10], 1
mov edi, 1
je 0x665beaec
mov edi, dword [esp + 0x60]
shr edi, 1
and edi, 1
test esi, esi
jne 0x665beb21
mov dword [esp + 0xc], 0x6661a358
mov dword [esp + 8], 0xb74e
mov dword [esp + 4], str.database_corruption_at_line__d_of___.10s_
mov dword [esp], 0xb
call sym.libsqlite3_0.dll_sqlite3_log
mov eax, 0xb
add esp, 0x4c
pop ebx
pop esi
pop edi
pop ebp
ret
mov edx, dword [ebx + 0x28]
mov byte [ebx + 0x17], 1
test edx, edx
jne 0x665beb53
test edi, edi
je 0x665beb7f
mov eax, dword [ebx + 0xd0]
test eax, eax
je 0x665bec00
lea ecx, [esp + 0x38]
mov edx, esi
call sym._sqlite3WalFindFrame
test eax, eax
mov edx, eax
je 0x665bebf1
mov esi, dword [ebx + 0x78]
test esi, esi
je 0x665bedb0
mov eax, dword [esp + 0x28]
mov dword [eax], 0
add esp, 0x4c
mov eax, edx
pop ebx
pop esi
pop edi
pop ebp
ret
mov edx, dword [eax + 0x28]
xor edi, edi
mov byte [eax + 0x17], 1
test edx, edx
jne 0x665beb53
mov edx, dword [ebx + 0xcc]
movzx eax, byte [edx + 0x1d]
mov dword [esp + 4], esi
and eax, 3
mov dword [esp + 8], eax
mov eax, dword [edx + 0x28]
mov dword [esp], eax
call dword [0x66619204]
test eax, eax
mov ebp, dword [ebx + 0xcc]
je 0x665bee30
mov ecx, eax
mov edx, esi
mov eax, ebp
call sym._sqlite3PcacheFetchFinish
mov ebp, eax
mov eax, dword [esp + 0x28]
test ebp, ebp
mov dword [eax], ebp
je 0x665bee20
mov ecx, dword [esp + 0x60]
mov eax, dword [ebp + 0x10]
and ecx, 1
test eax, eax
je 0x665becc2
test ecx, ecx
jne 0x665becc2
add dword [ebx + 0xb8], 1
xor eax, eax
jmp 0x665beb19
mov edx, dword [esp + 0x38]
test edx, edx
jne 0x665beb7f
lea esi, [esi]
lea eax, [esi - 1]
mov dword [esp + 0x3c], 0
mov ecx, eax
mov eax, dword [ebx + 0x3c]
mov dword [esp + 0x2c], ecx
mov ebp, dword [eax]
lea eax, [esp + 0x3c]
mov dword [esp + 0x10], eax
mov eax, dword [ebx + 0x98]
mov dword [esp + 0xc], eax
mov eax, dword [ebx + 0x98]
cdq
mov eax, ecx
imul edx, ecx
mov ecx, edx
mul dword [ebx + 0x98]
add edx, ecx
mov dword [esp + 4], eax
mov dword [esp + 8], edx
mov eax, dword [ebx + 0x3c]
mov dword [esp], eax
call dword [ebp + 0x44]
test eax, eax
mov edx, eax
jne 0x665beb53
mov ebp, dword [esp + 0x3c]
test ebp, ebp
je 0x665beb7f
cmp byte [ebx + 0x10], 1
ja 0x665beec5
mov edi, dword [ebx + 0x88]
test edi, edi
je 0x665bef45
mov eax, dword [edi + 0xc]
movzx edx, word [ebx + 0x8c]
mov dword [ebx + 0x88], eax
mov eax, dword [edi + 8]
mov dword [edi + 0xc], 0
mov dword [esp + 8], edx
mov dword [esp + 4], 0
mov dword [esp], eax
call sym._memset
mov dword [edi + 0x14], esi
mov dword [edi + 4], ebp
add dword [ebx + 0x78], 1
mov eax, dword [esp + 0x28]
mov dword [eax], edi
xor eax, eax
jmp 0x665beb19
test esi, esi
mov dword [ebp + 0x10], ebx
js 0x665bedd5
mov eax, dword [ebx + 0x98]
mov edx, eax
mov eax, dword [0x66619164]
mov dword [esp + 0x2c], edx
cdq
idiv dword [esp + 0x2c]
add eax, 1
cmp esi, eax
je 0x665bedd5
cmp byte [ebx + 0xf], 0
jne 0x665bed40
cmp esi, dword [ebx + 0x18]
ja 0x665bed40
test byte [esp + 0x60], 1
jne 0x665bed40
mov eax, dword [ebx + 0x3c]
mov eax, dword [eax]
test eax, eax
je 0x665bed40
test edi, edi
mov eax, dword [ebx + 0xd0]
jne 0x665bed1b
test eax, eax
jne 0x665bef2b
add dword [ebx + 0xbc], 1
mov edx, dword [esp + 0x38]
mov eax, ebp
call sym._readDbPage
test eax, eax
mov edx, eax
jne 0x665bedfe
xor eax, eax
jmp 0x665beb19
cmp esi, dword [ebx + 0x9c]
ja 0x665bee12
test ecx, ecx
je 0x665bed86
mov eax, dword [0x6663c47c]
test eax, eax
je 0x665bed5b
call eax
cmp esi, dword [ebx + 0x1c]
jbe 0x665bef1c
lea edx, [ebx + 0x60]
lea eax, [ebx + 0x5c]
mov ecx, esi
call sym._addToSavepointBitvecs.isra.295
mov eax, dword [0x6663c480]
test eax, eax
je 0x665bed7c
call eax
mov eax, dword [ebx + 0x98]
mov dword [esp + 0x2c], eax
mov eax, dword [ebp + 4]
mov ecx, dword [esp + 0x2c]
mov dword [esp + 4], 0
mov dword [esp + 8], ecx
mov dword [esp], eax
call sym._memset
xor eax, eax
jmp 0x665beb19
mov eax, dword [ebx + 0xcc]
mov ecx, dword [eax + 0xc]
test ecx, ecx
jne 0x665beb5e
mov eax, ebx
mov dword [esp + 0x2c], edx
call sym._pagerUnlockAndRollback
mov edx, dword [esp + 0x2c]
jmp 0x665beb5e
mov dword [esp + 0xc], 0x6661a358
mov dword [esp + 8], 0xb79e
mov dword [esp + 4], str.database_corruption_at_line__d_of___.10s_
mov dword [esp], 0xb
call sym.libsqlite3_0.dll_sqlite3_log
mov edx, 0xb
mov eax, ebp
mov dword [esp + 0x2c], edx
call sym._sqlite3PcacheDrop
mov edx, dword [esp + 0x2c]
jmp 0x665beb53
mov edx, 0xd
jmp 0x665bedfe
mov edx, 7
jmp 0x665beb53
cmp byte [ebp + 0x1d], 2
je 0x665bebae
mov eax, dword [ebp + 8]
test eax, eax
je 0x665bee59
cmp word [eax + 0x1a], 0
jne 0x665bee52
test byte [eax + 0x18], 4
je 0x665bef14
mov eax, dword [eax + 0x24]
test eax, eax
jne 0x665bee41
mov eax, dword [ebp + 4]
mov dword [ebp + 8], 0
test eax, eax
jne 0x665bee77
jmp 0x665bee9a
mov eax, dword [eax + 0x24]
test eax, eax
je 0x665bee9a
cmp word [eax + 0x1a], 0
jne 0x665bee70
mov dword [esp + 4], eax
mov eax, dword [ebp + 0x24]
mov dword [esp], eax
call dword [ebp + 0x20]
test eax, eax
mov edx, eax
je 0x665bee9a
cmp eax, 5
jne 0x665beb53
mov dword [esp + 8], 2
mov dword [esp + 4], esi
mov eax, dword [ebp + 0x28]
mov dword [esp], eax
call dword [0x66619204]
test eax, eax
je 0x665bee20
mov ebp, dword [ebx + 0xcc]
jmp 0x665bebae
lea eax, [ebx + 0xcc]
mov edx, esi
call sym._sqlite3PagerLookup.isra.281
test eax, eax
mov edi, eax
je 0x665befb9
mov ecx, dword [ebx + 0x3c]
mov eax, dword [esp + 0x3c]
mov ebp, dword [ecx]
mov dword [esp + 0xc], eax
mov eax, dword [ebx + 0x98]
mov dword [esp], ecx
mov esi, eax
sar esi, 0x1f
mov ebx, esi
mov esi, dword [esp + 0x2c]
mul esi
imul ebx, esi
mov dword [esp + 4], eax
add edx, ebx
mov dword [esp + 8], edx
call dword [ebp + 0x48]
jmp 0x665becb5
mov dword [ebp + 8], eax
jmp 0x665bee7e
mov eax, dword [ebx + 0x38]
mov edx, esi
call sym._sqlite3BitvecSet
jmp 0x665bed64
lea ecx, [esp + 0x38]
mov edx, esi
call sym._sqlite3WalFindFrame
test eax, eax
mov edx, eax
jne 0x665bedfe
jmp 0x665bed1b
movzx eax, word [ebx + 0x8c]
xor edx, edx
add eax, 0x28
call sym._sqlite3MallocZero
test eax, eax
mov edi, eax
je 0x665bef80
lea eax, [eax + 0x28]
mov word [edi + 0x18], 0x40
mov word [edi + 0x1a], 1
mov dword [edi + 0x10], ebx
mov dword [edi + 8], eax
jmp 0x665becab
mov edi, dword [ebx + 0x3c]
mov esi, dword [esp + 0x2c]
mov ecx, dword [edi]
mov dword [esp + 0xc], ebp
mov ebp, dword [ebx + 0x98]
mov dword [esp], edi
mov eax, ebp
cdq
mov eax, dword [esp + 0x2c]
imul esi, edx
mul ebp
add edx, esi
mov dword [esp + 4], eax
mov dword [esp + 8], edx
call dword [ecx + 0x48]
mov edx, 7
jmp 0x665beb53
mov ebp, dword [esp + 0x3c]
jmp 0x665bec6f