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

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x6c
cmp byte [eax + 0x49], 4
mov ecx, dword [esp + 0x98]
mov esi, dword [esp + 0x80]
mov edi, dword [esp + 0x84]
mov dword [esp + 0x50], ecx
je 0x665c6ae0
mov ebp, dword [eax]
mov ecx, eax
mov dword [esp + 0x1c], edx
mov edx, dword [eax + 0x3c]
mov dword [esp + 0x2c], ecx
mov ebx, dword [ebp + 4]
mov eax, dword [ebx + 8]
call sym._saveAllCursors.isra.469
test eax, eax
mov dword [esp + 0x4c], eax
jne 0x665c6ad2
mov eax, dword [esp + 0x2c]
mov eax, dword [eax + 0x10]
test eax, eax
je 0x665c6e7d
mov ecx, dword [esp + 0x50]
test ecx, ecx
jne 0x665c6a1a
lea eax, [esp + 0x50]
mov edx, dword [esp + 0x1c]
mov dword [esp], esi
mov dword [esp + 4], edi
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x94]
mov dword [esp + 8], eax
mov eax, dword [esp + 0x2c]
call sym._btreeMoveto
test eax, eax
mov dword [esp + 0x4c], eax
jne 0x665c6ad2
mov edx, dword [esp + 0x2c]
mov dword [esp + 0x58], 0
movsx eax, word [edx + 0x4c]
mov eax, dword [edx + eax*4 + 0x78]
mov edx, dword [ebx + 0x50]
mov ebp, dword [eax + 0x34]
mov ecx, edx
mov dword [esp + 0x5c], 0
mov dword [esp + 0x34], edx
mov edx, dword [esp + 0x8c]
add edx, dword [esp + 0x90]
cmp byte [eax + 3], 0
mov dword [esp + 0x38], eax
movzx ebx, byte [eax + 7]
mov dword [esp + 0x10], edx
je 0x665c6a75
cmp edx, 0x7f
ja 0x665c6e32
mov eax, 1
mov byte [ecx + ebx], dl
add ebx, eax
mov eax, dword [esp + 0x34]
mov edx, esi
mov ecx, edi
add eax, ebx
cmp edi, 0
ja 0x665c6a89
cmp esi, 0x7f
jbe 0x665c6aeb
call sym._sqlite3PutVarint.part.9
mov edx, dword [esp + 0x38]
cmp byte [edx + 2], 0
jne 0x665c6afe
mov edx, dword [esp + 0x1c]
test edx, edx
je 0x665c6aa9
cmp edi, 0
jle 0x665c6fbe
mov dword [esp + 0xc], 0x6661a358
mov dword [esp + 8], 0xe615
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, 0x6c
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [eax + 0x44]
add esp, 0x6c
pop ebx
pop esi
pop edi
pop ebp
ret
mov edx, esi
mov byte [eax], dl
mov edx, dword [esp + 0x38]
mov eax, 1
cmp byte [edx + 2], 0
je 0x665c6a98
mov esi, dword [esp + 0x88]
mov dword [esp + 0x30], 0
mov dword [esp + 0x1c], esi
lea edi, [ebx + eax]
mov eax, dword [esp + 0x38]
movzx ebx, word [eax + 0xa]
mov eax, dword [esp + 0x10]
cmp ebx, eax
jl 0x665c6df9
lea esi, [edi + eax]
cmp esi, 3
mov dword [esp + 0x3c], esi
jle 0x665c6efd
mov esi, dword [esp + 0x34]
mov dword [esp + 0x24], esi
mov esi, eax
mov eax, dword [esp + 0x10]
add edi, dword [esp + 0x34]
test eax, eax
jle 0x665c6d1a
mov dword [esp + 0x20], 0
lea esi, [esi]
test esi, esi
jne 0x665c6ca8
cmp byte [ebp + 0x11], 0
mov eax, dword [esp + 0x5c]
mov ecx, eax
mov dword [esp + 0x28], eax
mov esi, eax
je 0x665c6bd5
mov eax, dword [0x66619164]
xor edx, edx
div dword [ebp + 0x20]
lea edi, [eax + 1]
mov esi, esi
lea edi, [edi]
lea esi, [ecx + 1]
cmp esi, 1
jbe 0x665c6bcd
mov eax, 0xcccccccd
mul dword [ebp + 0x24]
lea eax, [ecx - 1]
shr edx, 2
lea ebx, [edx + 1]
xor edx, edx
div ebx
imul ebx, eax
lea ecx, [ebx + 2]
add ebx, 3
cmp ecx, edi
cmove ecx, ebx
cmp esi, ecx
je 0x665c6b90
cmp esi, edi
jne 0x665c6bd1
mov ecx, edi
lea esi, [ecx + 1]
cmp esi, 1
ja 0x665c6b98
xor ecx, ecx
jmp 0x665c6bbb
mov dword [esp + 0x5c], esi
lea ecx, [esp + 0x5c]
lea edx, [esp + 0x58]
mov dword [esp + 4], 0
mov dword [esp], esi
mov eax, ebp
call sym._allocateBtreePage
cmp byte [ebp + 0x11], 0
mov dword [esp + 0x54], eax
je 0x665c6c40
test eax, eax
jne 0x665c6c40
mov esi, dword [esp + 0x28]
lea eax, [esp + 0x54]
mov edx, dword [esp + 0x5c]
mov dword [esp + 4], eax
mov eax, ebp
cmp esi, 1
mov dword [esp], esi
sbb ecx, ecx
add ecx, 4
call sym._ptrmapPut
mov eax, dword [esp + 0x54]
test eax, eax
je 0x665c6c48
mov eax, dword [esp + 0x58]
test eax, eax
je 0x665c6e50
mov eax, dword [eax + 0x44]
call sym._sqlite3PagerUnrefNotNull
mov eax, dword [esp + 0x54]
nop
test eax, eax
jne 0x665c6e50
mov eax, dword [esp + 0x5c]
mov edi, dword [esp + 0x24]
mov edx, eax
mov byte [edi + 3], al
shr edx, 0x18
mov byte [edi], dl
mov edx, eax
shr edx, 0x10
mov byte [edi + 1], dl
mov edx, eax
mov eax, dword [esp + 0x20]
shr edx, 8
mov byte [edi + 2], dl
test eax, eax
je 0x665c6c7a
mov eax, dword [eax + 0x44]
call sym._sqlite3PagerUnrefNotNull
mov eax, dword [esp + 0x58]
mov dword [esp + 0x20], eax
mov eax, dword [eax + 0x38]
mov byte [eax], 0
mov byte [eax + 1], 0
mov byte [eax + 2], 0
mov byte [eax + 3], 0
mov dword [esp + 0x24], eax
mov eax, dword [esp + 0x58]
mov edi, dword [eax + 0x38]
mov eax, dword [ebp + 0x24]
lea esi, [eax - 4]
add edi, 4
mov eax, dword [esp + 0x10]
cmp esi, eax
cmovle eax, esi
mov ebx, eax
mov eax, dword [esp + 0x8c]
test eax, eax
jle 0x665c6de0
cmp ebx, dword [esp + 0x8c]
mov eax, dword [esp + 0x1c]
cmovg ebx, dword [esp + 0x8c]
mov dword [esp], edi
mov dword [esp + 4], eax
mov dword [esp + 8], ebx
call sym._memcpy
sub dword [esp + 0x10], ebx
add edi, ebx
sub esi, ebx
sub dword [esp + 0x8c], ebx
je 0x665c6dc0
add dword [esp + 0x1c], ebx
mov ebx, dword [esp + 0x10]
test ebx, ebx
jg 0x665c6b60
mov eax, dword [esp + 0x20]
test eax, eax
je 0x665c6d1a
mov eax, dword [eax + 0x44]
call sym._sqlite3PagerUnrefNotNull
mov dword [esp + 0x4c], 0
mov esi, dword [esp + 0x2c]
mov ecx, dword [esp + 0x50]
movsx eax, word [esi + 0x4c]
test ecx, ecx
lea edx, [esi + eax*2]
movzx ebx, word [edx + 0x4e]
mov eax, ebx
je 0x665c6f16
lea esi, [esp + 0x4c]
js 0x665c6fa0
mov eax, dword [esp + 0x3c]
mov dword [esp + 0xc], esi
mov edx, ebx
mov esi, dword [esp + 0x38]
mov ecx, dword [esp + 0x34]
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], eax
mov eax, esi
call sym._insertCell
mov eax, dword [esp + 0x2c]
xor edx, edx
mov word [eax + 0x2c], dx
mov eax, dword [esp + 0x4c]
test eax, eax
jne 0x665c6ad2
cmp byte [esi + 1], 0
je 0x665c6ad2
mov esi, dword [esp + 0x2c]
and byte [esi + 0x48], 0xfd
mov eax, esi
call sym._balance
movsx edx, word [esi + 0x4c]
mov edx, dword [esi + edx*4 + 0x78]
mov byte [edx + 1], 0
mov byte [esi + 0x49], 0
jmp 0x665c6ad2
mov eax, dword [esp + 0x30]
mov dword [esp + 0x8c], eax
mov eax, dword [esp + 0x88]
mov dword [esp + 0x1c], eax
jmp 0x665c6cfe
mov dword [esp + 8], ebx
mov dword [esp + 4], 0
mov dword [esp], edi
call sym._memset
jmp 0x665c6ce5
mov edx, dword [esp + 0x38]
mov eax, dword [esp + 0x10]
movzx esi, word [edx + 0xc]
mov edx, dword [edx + 0x34]
mov ecx, dword [edx + 0x24]
xor edx, edx
sub eax, esi
sub ecx, 4
div ecx
add edx, esi
cmp ebx, edx
cmovge esi, edx
lea eax, [edi + esi]
lea edx, [eax + 4]
add eax, dword [esp + 0x34]
mov dword [esp + 0x3c], edx
mov dword [esp + 0x24], eax
jmp 0x665c6b42
mov edx, dword [esp + 0x10]
mov eax, dword [esp + 0x34]
mov ecx, edx
add eax, ebx
sar ecx, 0x1f
call sym._sqlite3PutVarint.part.9
movzx eax, al
add ebx, eax
jmp 0x665c6a75
mov eax, dword [esp + 0x20]
test eax, eax
je 0x665c6fe7
mov eax, dword [esp + 0x20]
mov eax, dword [eax + 0x44]
call sym._sqlite3PagerUnrefNotNull
mov eax, dword [esp + 0x54]
test eax, eax
mov dword [esp + 0x4c], eax
jne 0x665c6ad2
jmp 0x665c6d22
mov eax, dword [ebp + 4]
mov eax, dword [eax + 8]
test eax, eax
je 0x665c6ea1
test byte [eax + 0x48], 0x10
je 0x665c6e80
mov ecx, dword [eax + 0x1c]
mov edx, dword [eax + 0x18]
xor ecx, edi
xor edx, esi
or ecx, edx
jne 0x665c6e80
mov byte [eax + 0x49], 0
jmp 0x665c6e80
mov eax, dword [esp + 0x2c]
test byte [eax + 0x48], 2
je 0x665c69df
mov edx, edi
sar edx, 0x1f
mov eax, edx
sub eax, esi
sbb edx, edi
test edx, edx
jns 0x665c69df
mov eax, esi
mov edx, edi
add eax, 0xffffffff
adc edx, 0xffffffff
mov ecx, edx
mov edx, eax
mov eax, dword [esp + 0x2c]
mov dword [esp + 0x10], edx
mov dword [esp + 0x14], ecx
mov edx, dword [eax + 0x1c]
xor edx, ecx
mov ecx, dword [esp + 0x10]
xor ecx, dword [eax + 0x18]
or edx, ecx
jne 0x665c69df
mov dword [esp + 0x50], 0xffffffff
jmp 0x665c6a1a
mov eax, dword [esp + 0x34]
mov esi, dword [esp + 0x10]
mov dword [esp + 0x3c], 4
mov dword [esp + 0x24], eax
jmp 0x665c6b42
mov esi, dword [esp + 0x38]
mov eax, dword [esi + 0x44]
call sym._sqlite3PagerWrite
test eax, eax
mov dword [esp + 0x4c], eax
jne 0x665c6ad2
mov eax, dword [esi + 0x40]
movzx edx, byte [eax + ebx*2]
movzx eax, byte [eax + ebx*2 + 1]
shl edx, 8
or edx, eax
movzx eax, word [esi + 0x14]
and edx, eax
add edx, dword [esi + 0x38]
cmp byte [esi + 5], 0
jne 0x665c6f56
mov eax, dword [edx]
mov esi, dword [esp + 0x34]
mov dword [esi], eax
mov eax, dword [esp + 0x38]
lea ecx, [esp + 0x5c]
call sym._clearCell
test eax, eax
mov dword [esp + 0x4c], eax
jne 0x665c6ad2
movzx ecx, word [esp + 0x5c]
mov eax, dword [esp + 0x38]
lea esi, [esp + 0x4c]
mov edx, ebx
mov dword [esp], esi
call sym._dropCell.part.377
mov eax, dword [esp + 0x4c]
test eax, eax
je 0x665c6d49
jmp 0x665c6ad2
mov edi, dword [esp + 0x38]
cmp word [edi + 0x12], 0
je 0x665c6d49
add eax, 1
mov word [edx + 0x4e], ax
movzx ebx, ax
jmp 0x665c6d49
jl 0x665c6fcc
cmp esi, 0x7fffffff
ja 0x665c6aa9
mov edx, dword [esp + 0x8c]
mov dword [esp + 0x10], esi
mov dword [esp + 0x8c], esi
mov dword [esp + 0x30], edx
jmp 0x665c6b11
mov eax, dword [esp + 0x54]
jmp 0x665c6ad2