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

Disassembly:
push ebp
push edi
mov ebp, ecx
push esi
push ebx
mov ebx, eax
mov esi, edx
sub esp, 0x5c
movsx eax, word [eax + 0x4c]
cmp word [ebx + 0x2c], 0
mov edx, dword [ebx + 4]
mov edi, dword [ebx + eax*4 + 0x78]
mov dword [esp + 0x20], edx
je 0x665c5173
movzx edx, word [ebx + 0x28]
mov eax, dword [ebx + 0x20]
mov dword [esp + 0x24], eax
lea ecx, [eax + edx]
mov eax, dword [esp + 0x20]
mov eax, dword [eax + 0x24]
add eax, dword [edi + 0x38]
cmp ecx, eax
ja 0x665c5142
cmp edx, esi
ja 0x665c5100
mov edi, esi
mov ecx, 1
xor esi, esi
sub edi, edx
test ebp, ebp
mov eax, esi
setne dl
and dl, cl
mov byte [esp + 0x28], dl
je 0x665c516b
mov eax, dword [esp + 0x20]
movzx edx, word [ebx + 0x28]
mov eax, dword [eax + 0x24]
sub eax, 4
cmp dword [esp + 0x74], 2
mov esi, eax
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x24]
mov eax, dword [eax + edx]
bswap eax
mov dword [esp + 0x48], eax
je 0x665c51c0
movzx ecx, byte [ebx + 0x48]
test cl, 4
jne 0x665c52e0
mov eax, dword [ebx + 0x24]
lea eax, [esi + eax - 1]
sub eax, edx
xor edx, edx
div esi
cmp eax, dword [ebx + 0x40]
mov esi, eax
jg 0x665c53a0
mov eax, dword [ebx + 0x14]
shl esi, 2
mov dword [esp + 4], 0
mov dword [esp], eax
mov dword [esp + 8], esi
call sym._memset
movzx eax, byte [ebx + 0x48]
movzx ecx, byte [esp + 0x28]
mov dword [esp + 0x24], 0
or eax, 4
mov byte [ebx + 0x48], al
test al, 4
jne 0x665c5370
test cl, cl
je 0x665c52d4
mov edx, dword [esp + 0x48]
test edx, edx
je 0x665c5272
xor eax, eax
movzx ecx, byte [ebx + 0x48]
mov esi, dword [esp + 0x74]
and esi, 1
cmp esi, 1
mov dword [esp + 0x34], esi
sbb esi, esi
and esi, 2
mov dword [esp + 0x2c], esi
lea esi, [eax*4]
mov eax, ebx
mov ebx, esi
mov esi, eax
jmp 0x665c50a1
mov eax, dword [esi + 0x14]
mov eax, dword [eax + ebx + 4]
test eax, eax
je 0x665c5250
movzx ecx, byte [esp + 0x28]
mov dword [esp + 0x48], eax
xor edx, edx
sub edi, dword [esp + 0x1c]
test ebp, ebp
je 0x665c52d0
test cl, cl
je 0x665c52d0
mov edx, dword [esp + 0x48]
add ebx, 4
test edx, edx
je 0x665c5272
movzx ecx, byte [esi + 0x48]
and ecx, 4
je 0x665c50ac
mov eax, dword [esi + 0x14]
mov dword [eax + ebx], edx
cmp edi, dword [esp + 0x1c]
jae 0x665c5060
mov ecx, dword [esp + 0x1c]
lea edx, [edi + ebp]
mov eax, ecx
sub eax, edi
cmp ecx, edx
mov edx, dword [esp + 0x48]
cmovae eax, ebp
lea ecx, [esp + 0x4c]
mov dword [esp + 0x24], eax
mov eax, dword [esp + 0x2c]
mov dword [esp], eax
mov eax, dword [esp + 0x20]
mov eax, dword [eax]
call sym._sqlite3PagerAcquire
xor ecx, ecx
test eax, eax
mov edx, eax
je 0x665c51e0
mov eax, dword [esp + 0x24]
add dword [esp + 0x70], eax
sub ebp, eax
jmp 0x665c507e
lea ecx, [esi + ebp]
mov eax, edx
sub eax, esi
cmp edx, ecx
cmovae eax, ebp
test byte [esp + 0x74], 1
mov edx, eax
mov eax, dword [esp + 0x24]
lea ecx, [eax + esi]
je 0x665c5190
mov eax, dword [edi + 0x44]
mov dword [esp + 0x28], ecx
mov dword [esp + 0x1c], edx
call sym._sqlite3PagerWrite
test eax, eax
mov esi, eax
mov edx, dword [esp + 0x1c]
mov ecx, dword [esp + 0x28]
je 0x665c5344
xor ecx, ecx
jmp 0x665c51b3
mov dword [esp + 0xc], 0x6661a358
mov dword [esp + 8], 0xdfb9
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, 0x5c
pop ebx
pop esi
pop edi
pop ebp
ret
movzx edx, word [ebx + eax*2 + 0x4e]
lea ecx, [ebx + 0x18]
mov eax, edi
call sym._btreeParseCell
or byte [ebx + 0x48], 2
jmp 0x665c4f47
mov eax, dword [esp + 0x70]
mov dword [esp + 8], edx
xor esi, esi
mov dword [esp + 4], ecx
mov dword [esp + 0x1c], edx
mov dword [esp], eax
call sym._memcpy
mov edx, dword [esp + 0x1c]
mov ecx, 1
add dword [esp + 0x70], edx
sub ebp, edx
xor edi, edi
jmp 0x665c4f7a
movzx eax, byte [ebx + 0x48]
movzx ecx, byte [esp + 0x28]
mov dword [esp + 0x24], 0
jmp 0x665c500f
mov eax, dword [esp + 0x4c]
mov ecx, dword [eax + 4]
mov dword [esp + 0x30], eax
lea edi, [ecx + edi + 4]
mov eax, dword [ecx]
mov ecx, dword [esp + 0x34]
bswap eax
test ecx, ecx
mov dword [esp + 0x48], eax
je 0x665c52a3
mov eax, dword [esp + 0x30]
call sym._sqlite3PagerWrite
test eax, eax
mov edx, eax
je 0x665c5300
mov eax, dword [esp + 0x4c]
xor ecx, ecx
mov dword [esp + 0x30], eax
mov eax, dword [esp + 0x30]
xor edi, edi
test eax, eax
je 0x665c50ec
mov eax, dword [esp + 0x30]
mov dword [esp + 0x3c], edx
xor edi, edi
mov byte [esp + 0x38], cl
call sym._sqlite3PagerUnrefNotNull
mov edx, dword [esp + 0x3c]
movzx ecx, byte [esp + 0x38]
jmp 0x665c50ec
lea eax, [esp + 0x48]
mov edx, dword [esp + 0x48]
xor ecx, ecx
mov dword [esp], eax
mov eax, dword [esp + 0x20]
call sym._getOverflowPage
test eax, eax
mov edx, eax
sete cl
jmp 0x665c507a
mov dword [esp + 0xc], 0x6661a358
mov dword [esp + 8], 0xe054
mov dword [esp + 4], str.database_corruption_at_line__d_of___.10s_
mov dword [esp], 0xb
call sym.libsqlite3_0.dll_sqlite3_log
add esp, 0x5c
mov eax, 0xb
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [esp + 0x24]
mov dword [esp + 4], edi
mov dword [esp + 0x38], edx
mov dword [esp + 8], eax
mov eax, dword [esp + 0x70]
mov dword [esp], eax
call sym._memcpy
movzx ecx, byte [esp + 0x28]
mov edx, dword [esp + 0x38]
jmp 0x665c522e
mov dword [esp + 0x24], edx
mov eax, dword [esp + 0x24]
add esp, 0x5c
pop ebx
pop esi
pop edi
pop ebp
ret
xor edx, edx
mov eax, edi
div dword [esp + 0x1c]
mov esi, edx
mov edx, dword [ebx + 0x14]
mov edx, dword [edx + eax*4]
test edx, edx
je 0x665c5332
mov dword [esp + 0x48], edx
mov edi, esi
jmp 0x665c5031
mov dword [esp + 0x38], eax
mov eax, dword [esp + 0x24]
mov dword [esp], edi
mov dword [esp + 8], eax
mov eax, dword [esp + 0x70]
mov dword [esp + 4], eax
call sym._memcpy
mov eax, dword [esp + 0x4c]
movzx ecx, byte [esp + 0x28]
mov edx, dword [esp + 0x38]
mov dword [esp + 0x30], eax
jmp 0x665c5220
movzx ecx, byte [esp + 0x28]
mov dword [esp + 0x24], 0
jmp 0x665c5017
mov eax, dword [esp + 0x70]
mov dword [esp + 8], edx
mov dword [esp], ecx
mov dword [esp + 0x1c], edx
mov dword [esp + 4], eax
call sym._memcpy
mov ecx, 1
mov edx, dword [esp + 0x1c]
jmp 0x665c51b3
xor edx, edx
mov eax, edi
div dword [esp + 0x1c]
mov esi, edx
mov edx, dword [ebx + 0x14]
mov edx, dword [edx + eax*4]
test edx, edx
je 0x665c5017
test cl, cl
mov dword [esp + 0x48], edx
mov edi, esi
jne 0x665c502d
jmp 0x665c52d4
lea edx, [eax*8]
mov eax, dword [ebx + 0x14]
xor ecx, ecx
call sym._sqlite3Realloc
test eax, eax
je 0x665c53c3
lea edx, [esi + esi]
mov dword [ebx + 0x14], eax
mov dword [ebx + 0x40], edx
jmp 0x665c4fe1
movzx eax, byte [ebx + 0x48]
xor ecx, ecx
mov dword [esp + 0x24], 7
jmp 0x665c500f