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

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x5c
cmp byte [eax + 0x49], 1
mov ebx, dword [esp + 0x70]
mov dword [esp + 0x38], ebx
mov ebx, dword [esp + 0x74]
mov dword [esp + 0x34], ebx
je 0x665c5ef0
test edx, edx
mov dword [esp + 0x28], 0
je 0x665c5cd8
mov ebx, dword [edx]
movzx esi, word [ebx + 6]
movzx ecx, word [ebx + 8]
add ecx, esi
cmp ecx, 0xd
jg 0x665c5ccc
mov esi, dword [ebx + 0x10]
mov ecx, dword [edx + 8]
cmp byte [esi], 0
movzx ecx, word [ecx + 8]
je 0x665c5f80
mov dword [edx + 0xc], 1
mov dword [edx + 0x10], 0xffffffff
test cl, 4
mov dword [esp + 0x28], sym._vdbeRecordCompareInt
jne 0x665c5cd4
and ecx, 0x19
jne 0x665c5ccc
mov ebx, dword [ebx + 0x14]
test ebx, ebx
je 0x665c60f0
mov dword [esp + 0x28], sym._sqlite3VdbeRecordCompare
mov byte [edx + 7], 0
mov dword [esp + 0x2c], edx
mov edi, eax
call sym._moveToRoot
test eax, eax
jne 0x665c5ee3
cmp byte [edi + 0x49], 0
je 0x665c5f43
mov eax, 1
sub eax, dword [esp + 0x78]
mov dword [esp + 0x1c], edi
mov dword [esp + 0x3c], eax
lea eax, [edi + 0x18]
mov dword [esp + 0x30], eax
mov edi, dword [esp + 0x1c]
movzx ecx, byte [esp + 0x3c]
movsx eax, word [edi + 0x4c]
mov ebx, dword [edi + eax*4 + 0x78]
movzx edx, word [ebx + 0x12]
lea esi, [edx - 1]
mov dword [esp + 0x20], esi
sar esi, cl
mov ecx, dword [esp + 0x28]
mov word [edi + eax*2 + 0x4e], si
test ecx, ecx
je 0x665c5ff0
mov dword [esp + 0x24], 0
jmp 0x665c5e01
movzx ecx, byte [edx + 1]
test cl, cl
js 0x665c5d6c
and eax, 0x7f
shl eax, 7
add eax, ecx
movzx ecx, word [ebx + 0xa]
cmp eax, ecx
jle 0x665c5f60
mov ecx, dword [esp + 0x30]
sub edx, edi
mov eax, ebx
call sym._btreeParseCellPtr
mov eax, dword [esp + 0x1c]
mov ebp, dword [eax + 0x18]
mov eax, ebp
cdq
call sym._sqlite3Malloc
test eax, eax
mov edi, eax
je 0x665c5f93
mov ecx, dword [esp + 0x1c]
xor edx, edx
movsx eax, word [ecx + 0x4c]
mov word [ecx + eax*2 + 0x4e], si
mov eax, dword [esp + 0x1c]
mov ecx, ebp
mov dword [esp + 4], 2
mov dword [esp], edi
call sym._accessPayload
test eax, eax
jne 0x665c5fa1
mov eax, dword [esp + 0x2c]
mov dword [esp], ebp
mov dword [esp + 4], edi
mov dword [esp + 8], eax
mov eax, dword [esp + 0x28]
call eax
mov dword [esp], edi
mov ebp, eax
call sym.libsqlite3_0.dll_sqlite3_free
test ebp, ebp
js 0x665c5e4d
je 0x665c5eb3
lea eax, [esi - 1]
mov dword [esp + 0x20], eax
mov eax, dword [esp + 0x24]
mov edi, dword [esp + 0x20]
cmp eax, edi
jg 0x665c5e60
mov esi, eax
add esi, edi
sar esi, 1
mov eax, dword [ebx + 0x40]
movzx edi, byte [ebx + 7]
movzx edx, byte [eax + esi*2]
movzx eax, byte [eax + esi*2 + 1]
shl edx, 8
or edx, eax
movzx eax, word [ebx + 0x14]
and edx, eax
add edx, edi
add edx, dword [ebx + 0x38]
movzx ecx, byte [edx]
cmp byte [ebx + 8], cl
mov eax, ecx
jb 0x665c5d50
mov eax, dword [esp + 0x2c]
add edx, 1
mov dword [esp], ecx
mov dword [esp + 4], edx
mov dword [esp + 8], eax
mov eax, dword [esp + 0x28]
call eax
mov ebp, eax
test ebp, ebp
jns 0x665c5de2
lea eax, [esi + 1]
mov edi, dword [esp + 0x20]
mov dword [esp + 0x24], eax
mov eax, dword [esp + 0x24]
cmp eax, edi
jle 0x665c5dfb
cmp byte [ebx + 5], 0
jne 0x665c610e
mov eax, dword [esp + 0x1c]
movzx edi, word [esp + 0x24]
movsx eax, word [eax + 0x4c]
add eax, 0x20
movzx edx, word [ebx + 0x12]
cmp dword [esp + 0x24], edx
jl 0x665c5fc0
movzx edx, byte [ebx + 6]
mov ecx, dword [ebx + 0x38]
mov edx, dword [ecx + edx + 8]
bswap edx
mov ebx, dword [esp + 0x1c]
mov word [ebx + eax*2 + 0xe], di
mov eax, ebx
call sym._moveToChild
test eax, eax
je 0x665c5d0d
mov edi, dword [esp + 0x1c]
jmp 0x665c5ed9
mov edi, dword [esp + 0x1c]
mov eax, dword [esp + 0x7c]
mov dword [eax], 0
movsx eax, word [edi + 0x4c]
mov word [edi + eax*2 + 0x4e], si
mov eax, dword [esp + 0x2c]
cmp byte [eax + 7], 1
sbb eax, eax
not eax
and eax, 0xb
and byte [edi + 0x48], 0xf9
xor edx, edx
mov word [edi + 0x2c], dx
add esp, 0x5c
pop ebx
pop esi
pop edi
pop ebp
ret
movzx ecx, byte [eax + 0x48]
test cl, 2
je 0x665c5c71
mov ebx, dword [eax + 0x78]
cmp byte [ebx + 2], 0
je 0x665c5c71
mov esi, dword [eax + 0x18]
mov ebx, dword [eax + 0x1c]
mov ebp, dword [esp + 0x34]
mov edi, dword [esp + 0x38]
xor ebp, ebx
xor edi, esi
or ebp, edi
je 0x665c60fd
and ecx, 8
je 0x665c5c71
cmp ebx, dword [esp + 0x34]
jl 0x665c5f43
jg 0x665c5c71
cmp esi, dword [esp + 0x38]
jae 0x665c5c71
mov eax, dword [esp + 0x7c]
mov dword [eax], 0xffffffff
add esp, 0x5c
xor eax, eax
pop ebx
pop esi
pop edi
pop ebp
ret
mov ecx, dword [esp + 0x2c]
add edx, 2
mov dword [esp], eax
mov dword [esp + 4], edx
mov eax, dword [esp + 0x28]
mov dword [esp + 8], ecx
call eax
mov ebp, eax
jmp 0x665c5dde
mov dword [edx + 0xc], 0xffffffff
mov dword [edx + 0x10], 1
jmp 0x665c5caf
mov edi, dword [esp + 0x1c]
mov eax, 7
jmp 0x665c5ed9
mov dword [esp + 0x20], eax
mov eax, edi
mov edi, dword [esp + 0x1c]
mov dword [esp], eax
call sym.libsqlite3_0.dll_sqlite3_free
mov eax, dword [esp + 0x20]
jmp 0x665c5ed9
mov esi, dword [ebx + 0x40]
mov edx, dword [esp + 0x24]
movzx ecx, byte [esi + edx*2]
movzx edx, byte [esi + edx*2 + 1]
shl ecx, 8
or ecx, edx
movzx edx, word [ebx + 0x14]
and edx, ecx
mov ecx, dword [ebx + 0x38]
mov edx, dword [ecx + edx]
bswap edx
jmp 0x665c5e95
mov ebp, dword [esp + 0x20]
xor edi, edi
mov edx, dword [ebx + 0x40]
movzx eax, byte [edx + esi*2]
movzx edx, byte [edx + esi*2 + 1]
shl eax, 8
or eax, edx
movzx edx, word [ebx + 0x14]
and eax, edx
movzx edx, byte [ebx + 7]
add eax, edx
add eax, dword [ebx + 0x38]
cmp byte [ebx + 3], 0
jne 0x665c6029
jmp 0x665c6032
cmp eax, dword [ebx + 0x3c]
jae 0x665c60a5
add eax, 1
cmp byte [eax - 1], 0
js 0x665c6020
lea edx, [esp + 0x48]
call sym._sqlite3GetVarint
mov eax, dword [esp + 0x4c]
cmp dword [esp + 0x34], eax
mov edx, dword [esp + 0x48]
jl 0x665c60d3
jg 0x665c6090
cmp dword [esp + 0x38], edx
ja 0x665c6090
cmp dword [esp + 0x34], eax
jl 0x665c60d3
cmp dword [esp + 0x38], edx
jb 0x665c60d3
mov ecx, dword [esp + 0x1c]
mov edi, esi
mov dword [ecx + 0x1c], eax
movsx eax, word [ecx + 0x4c]
or byte [ecx + 0x48], 2
mov dword [ecx + 0x18], edx
add eax, 0x20
mov word [ecx + eax*2 + 0xe], si
cmp byte [ebx + 5], 0
jne 0x665c6136
mov dword [esp + 0x24], esi
jmp 0x665c5e7a
lea edi, [esi + 1]
cmp ebp, edi
jl 0x665c6128
lea esi, [edi + ebp]
sar esi, 1
jmp 0x665c5ff6
mov dword [esp + 0xc], 0x6661a358
mov dword [esp + 8], 0xe255
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
jmp 0x665c5ee3
lea ebp, [esi - 1]
cmp edi, ebp
jle 0x665c609b
mov dword [esp + 0x24], edi
mov ebp, 1
jmp 0x665c5e60
mov dword [esp + 0x28], sym._vdbeRecordCompareString
jmp 0x665c5cd4
mov eax, dword [esp + 0x7c]
mov dword [eax], 0
xor eax, eax
jmp 0x665c5ee3
mov edi, dword [esp + 0x1c]
movsx eax, word [edi + 0x4c]
mov word [edi + eax*2 + 0x4e], si
mov eax, dword [esp + 0x7c]
mov dword [eax], ebp
xor eax, eax
jmp 0x665c5ed9
mov dword [esp + 0x24], edi
mov ebp, 0xffffffff
jmp 0x665c5e60
mov eax, dword [esp + 0x7c]
mov edi, dword [esp + 0x1c]
mov dword [eax], 0
xor eax, eax
jmp 0x665c5ed9