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

Disassembly:
push ebp
mov ebp, edx
push edi
push esi
push ebx
mov ebx, eax
sub esp, 0xbc
mov eax, dword [eax + 0x18]
test eax, eax
jle 0x665f4c88
mov eax, dword [ebx + 0x20]
mov eax, dword [eax]
mov dword [esp + 0x78], eax
test eax, eax
je 0x665f4c88
xor esi, esi
mov edx, ebp
mov eax, ebx
call fcn.6658f5c0
mov dword [esp + 0x24], eax
test eax, eax
je 0x665f4c54
cmp byte [ebx + 0x32], 0
jne 0x665f4b91
test byte [ebx + 0x2e], 2
jne 0x665f4d80
movzx eax, byte [ebx + 0x2c]
mov dword [esp + 0x28], eax
test eax, eax
jne 0x665f4cd1
cmp byte [ebx + 0x2b], 0
jne 0x665f4cd1
mov eax, dword [ebx + 4]
mov edx, dword [eax]
mov dword [esp + 0xc], 0xa
mov dword [esp + 8], 1
mov dword [esp + 4], 0
mov dword [esp], eax
call dword [edx + 0x38]
mov esi, eax
test eax, eax
je 0x665f4cd1
cmp byte [ebx + 0x32], 0
je 0x665f4c75
xor edx, edx
mov eax, ebx
call fcn.6658ae10
mov byte [ebx + 0x32], 0
cmp esi, 0x20a
jne 0x665f4c71
mov esi, 0xffffffff
jmp 0x665f4c71
lea ecx, [esp + 0x78]
xor edx, edx
mov eax, ebx
call fcn.6659d400
mov esi, eax
test eax, eax
je 0x665f4cf1
mov eax, dword [esp + 0x28]
test eax, eax
jne 0x665f4c61
cmp byte [ebx + 0x2b], 0
mov byte [ebx + 0x2c], 0
jne 0x665f4c61
mov eax, dword [ebx + 4]
mov edx, dword [eax]
mov dword [esp + 0xc], 9
mov dword [esp + 8], 1
mov dword [esp + 4], 0
mov dword [esp], eax
call dword [edx + 0x38]
mov ecx, dword [esp + 0x24]
test ecx, ecx
jne 0x665f4c61
cmp dword [ebx + 0x34], 0x2de218
jne 0x665f4d30
cmp byte [ebx + 0x32], 0
je 0x665f4c75
test esi, esi
jne 0x665f4be2
xor esi, esi
mov byte [ebx + 0x2b], 0
add esp, 0xbc
mov eax, esi
pop ebx
pop esi
pop edi
pop ebp
ret
lea ecx, [esp + 0x78]
xor edx, edx
mov eax, ebx
call fcn.6659d400
mov esi, eax
test eax, eax
je 0x665f4df8
cmp eax, 0x508
jne 0x665f4c75
mov eax, dword [esp + 0x78]
mov byte [ebx + 0x32], 1
mov byte [ebx + 0x2b], 2
mov dword [ebp], 1
test eax, eax
jne 0x665f4b6c
movzx eax, byte [ebx + 0x2c]
mov dword [esp + 0x24], 1
mov dword [esp + 0x28], eax
mov eax, dword [ebx + 0x18]
mov byte [ebx + 0x2c], 1
test eax, eax
jle 0x665f4c00
mov eax, dword [ebx + 0x20]
mov eax, dword [eax]
mov dword [esp + 0x78], eax
test eax, eax
je 0x665f4c00
mov edx, ebp
mov eax, ebx
call fcn.6658f5c0
mov dword [esp + 0x24], eax
test eax, eax
jne 0x665f4e18
mov edx, dword [esp + 0x28]
test edx, edx
je 0x665f5020
cmp dword [ebx + 0x34], 0x2de218
jne 0x665f4d30
xor esi, esi
cmp byte [ebx + 0x32], 0
je 0x665f4c75
jmp 0x665f4c6f
mov dword [esp + 0x10], 0x6667e21c
mov esi, 0xe
mov dword [esp + 0xc], 0xf310
mov dword [esp + 8], str.cannot_open_file
mov dword [esp + 4], str._s_at_line__d_of___.10s_
mov dword [esp], 0xe
call sym.libsqlite3_0.dll_sqlite3_log
cmp byte [ebx + 0x32], 0
je 0x665f4c75
xor edx, edx
mov eax, ebx
call fcn.6658ae10
mov byte [ebx + 0x32], 0
jmp 0x665f4c71
cmp byte [ebx + 0x2b], 0
jne 0x665f4de7
mov eax, dword [ebx + 4]
mov edx, dword [eax]
mov dword [esp + 0xc], 6
mov dword [esp + 8], 1
mov dword [esp + 4], 0
mov dword [esp], eax
call dword [edx + 0x38]
mov esi, eax
test eax, eax
jne 0x665f4bd8
cmp byte [ebx + 0x2b], 0
jne 0x665f4ddc
mov eax, dword [ebx + 4]
mov edx, dword [eax]
mov dword [esp + 0xc], 5
mov dword [esp + 8], 1
mov dword [esp + 4], 0
mov dword [esp], eax
call dword [edx + 0x38]
cmp byte [ebx + 0x32], 0
mov esi, 0x108
jne 0x665f4d6b
mov esi, 0x108
jmp 0x665f4c75
mov eax, dword [esp + 0x78]
test eax, eax
jne 0x665f4b6a
mov dword [esp + 0x24], 1
jmp 0x665f4b81
movzx eax, byte [ebx + 0x2d]
lea edi, [eax + 1]
mov eax, 3
sub eax, edi
cmp byte [ebx + 0x2b], 0
mov dword [esp + 0x2c], edi
mov dword [esp + 0x30], eax
jne 0x665f4e61
mov eax, dword [ebx + 4]
mov edi, dword [esp + 0x30]
mov edx, dword [eax]
mov dword [esp + 8], edi
mov edi, dword [esp + 0x2c]
mov dword [esp + 0xc], 0xa
mov dword [esp], eax
mov dword [esp + 4], edi
call dword [edx + 0x38]
mov esi, eax
test eax, eax
jne 0x665f5011
lea edi, [ebx + 0x38]
lea ecx, [ebx + 0x34]
xor eax, eax
mov dword [ebx + 0x34], 0
and edi, 0xfffffffc
mov dword [ebx + 0x60], 0
sub ecx, edi
add ecx, 0x30
shr ecx, 2
rep stosd dword es:[edi], eax
lea ecx, [esp + 0x88]
mov eax, dword [ebx + 8]
mov edx, dword [eax]
mov dword [esp + 4], ecx
mov dword [esp], eax
call dword [edx + 0x18]
mov esi, eax
test eax, eax
jne 0x665f4fe8
mov eax, 0x20
cmp eax, dword [esp + 0x88]
sbb esi, dword [esp + 0x8c]
jge 0x665f5050
mov eax, dword [ebx + 8]
lea edi, [esp + 0x90]
mov edx, dword [eax]
mov dword [esp + 0xc], 0
mov dword [esp + 0x10], 0
mov dword [esp + 8], 0x20
mov dword [esp + 4], edi
mov dword [esp], eax
call dword [edx + 8]
test eax, eax
jne 0x665f5149
mov eax, dword [esp + 0x90]
bswap eax
mov edx, eax
and edx, 0xfffffffe
cmp edx, 0x377f0682
jne 0x665f5050
mov esi, dword [esp + 0x98]
bswap esi
lea edx, [esi - 1]
test edx, esi
jne 0x665f5050
lea edx, [esi - 0x200]
cmp edx, 0xfe00
ja 0x665f5050
mov edx, dword [esp + 0x9c]
mov ecx, dword [esp + 0xa4]
and eax, 1
mov dword [ebx + 0x24], esi
mov byte [ebx + 0x41], al
xor eax, 1
bswap edx
mov dword [ebx + 0x70], edx
mov edx, dword [esp + 0xa0]
movzx eax, al
mov dword [ebx + 0x58], ecx
mov ecx, 0x18
mov dword [ebx + 0x54], edx
lea edx, [ebx + 0x4c]
mov dword [esp + 4], edx
mov edx, edi
mov dword [esp], 0
call fcn.66582750
mov eax, dword [esp + 0xa8]
bswap eax
cmp dword [ebx + 0x4c], eax
jne 0x665f5050
mov eax, dword [esp + 0xac]
bswap eax
cmp dword [ebx + 0x50], eax
jne 0x665f5050
cmp dword [esp + 0x94], 0x18e22d00
je 0x665f51a7
mov dword [esp + 0x10], 0x6667e21c
mov esi, 0xe
mov dword [esp + 0xc], 0xeea2
mov dword [esp + 8], str.cannot_open_file
mov dword [esp + 4], str._s_at_line__d_of___.10s_
mov dword [esp], 0xe
call sym.libsqlite3_0.dll_sqlite3_log
lea esi, [esi]
cmp byte [ebx + 0x2b], 0
jne 0x665f5011
mov eax, dword [ebx + 4]
mov edi, dword [esp + 0x30]
mov edx, dword [eax]
mov dword [esp + 8], edi
mov edi, dword [esp + 0x2c]
mov dword [esp + 0xc], 9
mov dword [esp], eax
mov dword [esp + 4], edi
call dword [edx + 0x38]
mov dword [ebp], 1
jmp 0x665f4c17
xor esi, esi
cmp byte [ebx + 0x2b], 0
mov byte [ebx + 0x2c], 0
je 0x665f4c29
cmp dword [ebx + 0x34], 0x2de218
jne 0x665f4d30
cmp byte [ebx + 0x32], 0
jne 0x665f4c6f
jmp 0x665f4c75
mov dword [esp + 0x38], 0
mov dword [esp + 0x34], 0
mov eax, dword [esp + 0x34]
mov esi, 2
mov dword [ebx + 0x4c], eax
mov eax, dword [esp + 0x38]
mov dword [ebx + 0x50], eax
mov eax, ebx
call fcn.6658f1b0
mov eax, dword [ebx + 0x20]
mov dword [esp + 0x38], ebp
lea ebp, [esi + 2]
mov edi, dword [eax]
mov eax, dword [ebx + 0x44]
mov dword [edi + 0x60], 0
mov dword [edi + 0x80], eax
mov dword [edi + 0x64], 0
movzx ecx, byte [ebx + 0x2b]
mov dword [esp + 0x34], edi
lea edi, [esi - 1]
test cl, cl
jne 0x665f5123
mov eax, dword [ebx + 4]
mov ecx, dword [eax]
mov dword [esp + 0xc], 0xa
mov dword [esp + 8], 1
mov dword [esp + 4], ebp
mov dword [esp], eax
call dword [ecx + 0x38]
test eax, eax
jne 0x665f5140
movzx ecx, byte [ebx + 0x2b]
cmp edi, 1
je 0x665f549e
mov edx, dword [esp + 0x34]
mov dword [edx + edi*4 + 0x64], 0xffffffff
test cl, cl
jne 0x665f510d
mov eax, dword [ebx + 4]
mov ecx, dword [eax]
mov dword [esp + 0xc], 9
mov dword [esp + 8], 1
mov dword [esp + 4], ebp
mov dword [esp], eax
call dword [ecx + 0x38]
xor eax, eax
cmp esi, 5
je 0x665f5150
movzx ecx, byte [ebx + 0x2b]
add esi, 1
lea edi, [esi - 1]
lea ebp, [esi + 2]
test cl, cl
je 0x665f50ac
cmp edi, 1
jne 0x665f5188
mov eax, dword [ebx + 0x44]
test eax, eax
jne 0x665f519b
mov eax, dword [esp + 0x34]
mov dword [eax + 0x68], 0xffffffff
test cl, cl
je 0x665f50ec
jmp 0x665f5112
cmp eax, 5
je 0x665f510d
mov ebp, dword [esp + 0x38]
mov esi, eax
jmp 0x665f4fe8
mov edi, dword [ebx + 0x48]
mov ebp, dword [esp + 0x38]
mov esi, eax
test edi, edi
je 0x665f4fe8
mov eax, dword [ebx + 0x6c]
mov dword [esp + 4], str.recovered__d_frames_from_WAL_file__s
mov dword [esp], 0x11b
mov dword [esp + 0xc], eax
mov eax, dword [ebx + 0x44]
mov dword [esp + 8], eax
call sym.libsqlite3_0.dll_sqlite3_log
jmp 0x665f4fe8
mov eax, dword [esp + 0x34]
mov dword [eax + edi*4 + 0x64], 0xffffffff
xor eax, eax
jmp 0x665f510d
mov edi, dword [esp + 0x34]
mov dword [edi + 0x68], eax
jmp 0x665f5112
lea eax, [esi + 0x18]
cmp dword [0x6667ced0], 0
mov dword [esp + 0x50], eax
jne 0x665f5494
call fcn.66587320
test eax, eax
jne 0x665f545e
call fcn.665cb300
test eax, eax
jne 0x665f545e
lea eax, [esi + 0x8018]
xor edx, edx
call fcn.6658bcf0
mov dword [esp + 0x3c], eax
test eax, eax
je 0x665f545e
add eax, 0x18
mov edx, dword [esp + 0x8c]
mov dword [esp + 0x54], eax
add eax, esi
mov dword [esp + 0x58], eax
lea eax, [esi + 0x18]
mov dword [esp + 0x40], eax
sar eax, 0x1f
mov dword [esp + 0x44], eax
mov eax, dword [esp + 0x88]
add eax, 0xffffffe0
adc edx, 0xffffffff
mov dword [esp], eax
mov eax, dword [esp + 0x40]
mov dword [esp + 4], edx
mov edx, dword [esp + 0x44]
mov dword [esp + 8], eax
mov dword [esp + 0xc], edx
call sub.libgcc_s_dw2_1.dll___divdi3
mov dword [esp + 0x38], 0
mov edi, eax
mov dword [esp + 0x64], eax
mov eax, esi
sar esi, 0x10
xor al, al
mov dword [esp + 0x34], 0
or eax, esi
mov dword [esp + 0x48], 0
mov word [esp + 0x5e], ax
lea eax, [edi + 0x21]
shr eax, 0xc
mov dword [esp + 0x6c], ebp
mov dword [esp + 0x68], eax
mov edi, dword [esp + 0x48]
mov ecx, dword [esp + 0x64]
mov ebp, 1
mov eax, edi
shl eax, 0xc
lea edx, [eax + 0xfde]
cmp edx, ecx
cmova edx, ecx
mov dword [esp + 0x4c], edx
test edi, edi
je 0x665f529b
lea ebp, [eax - 0x21]
mov eax, dword [esp + 0x48]
cmp eax, dword [ebx + 0x18]
jge 0x665f5423
mov eax, dword [ebx + 0x20]
mov edi, dword [esp + 0x48]
mov edx, dword [eax + edi*4]
mov dword [esp + 0x7c], edx
test edx, edx
je 0x665f5423
mov edi, dword [esp + 0x48]
lea ecx, [edi*4]
mov dword [esp + 0x60], ecx
mov ecx, dword [esp + 0x58]
mov dword [eax + edi*4], ecx
cmp dword [esp + 0x4c], ebp
jb 0x665f5443
mov edi, dword [esp + 0x44]
mov esi, dword [esp + 0x40]
lea eax, [ebp - 1]
mov ecx, edi
imul ecx, eax
mul esi
add edx, ecx
add eax, 0x20
adc edx, 0
mov esi, eax
mov edi, edx
jmp 0x665f5377
mov ecx, dword [esp + 0x3c]
mov eax, dword [esp + 0x54]
lea edx, [esp + 0x80]
mov dword [esp + 4], ecx
lea ecx, [esp + 0x84]
mov dword [esp], eax
mov eax, ebx
call fcn.66587840
test eax, eax
je 0x665f53a2
mov ecx, dword [esp + 0x80]
mov edx, ebp
mov eax, ebx
call fcn.665aff20
test eax, eax
jne 0x665f53a2
mov eax, dword [esp + 0x84]
test eax, eax
je 0x665f5362
mov dword [ebx + 0x48], eax
movzx eax, word [esp + 0x5e]
mov dword [ebx + 0x44], ebp
mov word [ebx + 0x42], ax
mov eax, dword [ebx + 0x4c]
mov dword [esp + 0x34], eax
mov eax, dword [ebx + 0x50]
mov dword [esp + 0x38], eax
add ebp, 1
add esi, dword [esp + 0x40]
adc edi, dword [esp + 0x44]
cmp dword [esp + 0x4c], ebp
jb 0x665f5440
mov eax, dword [ebx + 8]
mov ecx, dword [esp + 0x50]
mov edx, dword [eax]
mov dword [esp + 8], ecx
mov ecx, dword [esp + 0x3c]
mov dword [esp + 0xc], esi
mov dword [esp + 0x10], edi
mov dword [esp + 4], ecx
mov dword [esp], eax
call dword [edx + 8]
test eax, eax
je 0x665f52fe
mov esi, dword [esp + 0x7c]
mov edi, dword [esp + 0x60]
mov ecx, eax
mov eax, dword [ebx + 0x20]
cmp dword [esp + 0x48], 1
mov dword [eax + edi], esi
sbb eax, eax
and eax, 0x88
mov edx, 0x8000
add esi, eax
mov dword [esp + 0x60], ecx
sub edx, eax
add eax, dword [esp + 0x58]
mov dword [esp], esi
mov dword [esp + 8], edx
mov dword [esp + 4], eax
call sub.msvcrt.dll_memcpy
cmp dword [esp + 0x4c], ebp
mov ecx, dword [esp + 0x60]
jae 0x665f53fc
add dword [esp + 0x48], 1
mov eax, dword [esp + 0x48]
cmp eax, dword [esp + 0x68]
jbe 0x665f5273
mov eax, dword [esp + 0x3c]
mov ebp, dword [esp + 0x6c]
mov dword [esp + 0x48], ecx
mov dword [esp], eax
call sym.libsqlite3_0.dll_sqlite3_free
mov ecx, dword [esp + 0x48]
test ecx, ecx
je 0x665f5060
mov esi, ecx
jmp 0x665f4fe8
mov edx, dword [esp + 0x48]
lea ecx, [esp + 0x7c]
mov eax, ebx
call fcn.6659d400
mov ecx, eax
test eax, eax
jne 0x665f53fc
mov eax, dword [ebx + 0x20]
jmp 0x665f52be
mov eax, dword [ebx + 0x20]
mov esi, dword [esp + 0x7c]
mov edi, dword [esp + 0x60]
cmp dword [esp + 0x48], 0
mov dword [eax + edi], esi
je 0x665f546a
xor ecx, ecx
xor eax, eax
jmp 0x665f53be
mov eax, 7
mov esi, eax
jmp 0x665f4fe8
mov eax, dword [esp + 0x58]
add esi, 0x88
mov dword [esp + 8], 0x7f78
mov dword [esp], esi
add eax, 0x88
mov dword [esp + 4], eax
call sub.msvcrt.dll_memcpy
xor ecx, ecx
jmp 0x665f53e9
lock or dword [esp], 0
jmp 0x665f51d5
mov eax, dword [ebx + 0x44]
test eax, eax
je 0x665f512f
mov edi, dword [esp + 0x34]
mov dword [edi + 0x68], eax
test cl, cl
je 0x665f50ec
jmp 0x665f5112