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

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x5c
movsx ebx, word [eax + 0x4c]
lea edi, [eax + ebx*4]
movzx ecx, word [eax + ebx*2 + 0x4e]
mov esi, dword [edi + 0x78]
cmp cx, word [esi + 0x12]
jae 0x665c66a0
mov edx, eax
mov eax, 1
cmp byte [edx + 0x49], 1
je 0x665c64c5
add esp, 0x5c
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [edx]
mov ebp, edx
cmp byte [esi + 5], 0
mov dword [esp + 0x38], eax
mov eax, dword [eax + 4]
mov dword [esp + 0x24], eax
movzx eax, cx
mov edx, eax
mov dword [esp + 0x34], eax
mov eax, dword [esi + 0x38]
mov dword [esp + 0x28], eax
movzx eax, word [esi + 0x14]
mov word [esp + 0x10], ax
mov eax, dword [esi + 0x40]
movzx ecx, byte [eax + edx*2]
movzx eax, byte [eax + edx*2 + 1]
mov byte [esp + 0x2c], cl
mov byte [esp + 0x33], al
je 0x665c66b0
mov eax, dword [esp + 0x24]
mov edx, dword [ebp + 0x3c]
mov ecx, ebp
mov eax, dword [eax + 8]
call sym._saveAllCursors.isra.469
test eax, eax
mov dword [esp + 0x48], eax
jne 0x665c64bd
mov eax, dword [ebp + 0x10]
test eax, eax
je 0x665c6710
mov eax, dword [esi + 0x44]
call sym._sqlite3PagerWrite
test eax, eax
mov dword [esp + 0x48], eax
jne 0x665c64bd
movzx edx, byte [esp + 0x2c]
movzx eax, byte [esp + 0x33]
lea ecx, [esp + 0x4c]
shl edx, 8
or edx, eax
and edx, dword [esp + 0x10]
mov eax, esi
add edx, dword [esp + 0x28]
call sym._clearCell
test eax, eax
mov dword [esp + 0x48], eax
jne 0x665c64bd
movzx ecx, word [esp + 0x4c]
lea eax, [esp + 0x48]
mov edx, dword [esp + 0x34]
mov dword [esp], eax
mov eax, esi
call sym._dropCell.part.377
mov eax, dword [esp + 0x48]
test eax, eax
jne 0x665c64bd
cmp byte [esi + 5], 0
jne 0x665c6669
movsx eax, word [ebp + 0x4c]
mov eax, dword [ebp + eax*4 + 0x78]
mov ecx, eax
mov eax, dword [edi + 0x7c]
mov edi, dword [ecx + 0x40]
mov dword [esp + 0x28], ecx
mov eax, dword [eax + 0x48]
mov dword [esp + 0x10], eax
movzx eax, word [ecx + 0x12]
sub eax, 1
movzx ecx, byte [edi + eax*2 + 1]
movzx edx, byte [edi + eax*2]
mov edi, dword [esp + 0x28]
movzx eax, word [edi + 0x14]
shl edx, 8
or edx, ecx
mov ecx, dword [edi + 0x38]
and edx, eax
mov eax, edi
add ecx, edx
mov edx, ecx
mov dword [esp + 0x2c], ecx
call sym._cellSizePtr
mov ecx, dword [esp + 0x24]
movzx edi, ax
mov eax, dword [esp + 0x28]
mov edx, dword [ecx + 0x50]
mov eax, dword [eax + 0x44]
mov dword [esp + 0x24], edx
call sym._sqlite3PagerWrite
lea edx, [esp + 0x48]
mov dword [esp + 0x48], eax
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0x2c]
mov dword [esp + 0xc], edx
mov edx, dword [esp + 0x24]
mov dword [esp + 8], eax
lea eax, [edi + 4]
sub ecx, 4
mov dword [esp + 4], edx
mov edx, dword [esp + 0x34]
mov dword [esp], eax
mov eax, esi
call sym._insertCell
mov eax, dword [esp + 0x48]
test eax, eax
jne 0x665c64bd
mov eax, dword [esp + 0x28]
lea esi, [esp + 0x48]
mov ecx, edi
movzx edx, word [eax + 0x12]
mov dword [esp], esi
sub edx, 1
call sym._dropCell.part.377
mov eax, dword [esp + 0x48]
test eax, eax
jne 0x665c64bd
mov eax, ebp
call sym._balance
test eax, eax
mov dword [esp + 0x48], eax
jne 0x665c64bd
movsx edx, word [ebp + 0x4c]
cmp ebx, edx
mov eax, edx
jl 0x665c66f2
mov eax, ebp
call sym._moveToRoot
mov eax, dword [esp + 0x48]
jmp 0x665c64bd
add esp, 0x5c
mov eax, 1
pop ebx
pop esi
pop edi
pop ebp
ret
lea eax, [esp + 0x4c]
mov dword [esp], ebp
mov dword [esp + 0x4c], 0
mov dword [esp + 4], eax
call sym._sqlite3BtreePrevious
test eax, eax
mov dword [esp + 0x48], eax
je 0x665c650b
jmp 0x665c64bd
mov ecx, dword [ebp + edx*4 + 0x78]
sub eax, 1
mov word [ebp + 0x4c], ax
movsx edx, ax
test ecx, ecx
jne 0x665c676e
cmp ebx, edx
jl 0x665c66e0
mov eax, ebp
call sym._balance
test eax, eax
mov dword [esp + 0x48], eax
jne 0x665c64bd
jmp 0x665c6686
mov eax, dword [ebp + 0x18]
mov ecx, eax
mov eax, dword [ebp + 0x1c]
mov edx, eax
mov eax, dword [esp + 0x38]
mov eax, dword [eax + 4]
mov eax, dword [eax + 8]
test eax, eax
je 0x665c652f
mov dword [esp + 0x38], ebx
mov dword [esp + 0x3c], esi
mov ebx, ecx
mov esi, edx
jmp 0x665c6747
mov eax, dword [eax + 8]
test eax, eax
je 0x665c6761
test byte [eax + 0x48], 0x10
je 0x665c6740
mov ecx, dword [eax + 0x1c]
mov edx, dword [eax + 0x18]
xor ecx, esi
xor edx, ebx
or ecx, edx
jne 0x665c6740
mov byte [eax + 0x49], 0
jmp 0x665c6740
mov ebx, dword [esp + 0x38]
mov esi, dword [esp + 0x3c]
jmp 0x665c652f
mov eax, dword [ecx + 0x44]
call sym._sqlite3PagerUnrefNotNull
movsx edx, word [ebp + 0x4c]
mov eax, edx
jmp 0x665c66f2