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

Disassembly:
push ebp
push edi
push esi
mov esi, eax
push ebx
sub esp, 0xac
cmp byte [esi], 4
mov dword [esp + 0x30], eax
mov eax, dword [esp + 0xc0]
mov dword [esp + 0x4c], edx
mov dword [esp + 0x40], ecx
mov dword [esp + 0x6c], eax
je 0x665e63d0
mov eax, dword [esp + 0x30]
mov ebx, dword [eax + 8]
mov esi, dword [ebx + 4]
mov dword [esp + 0x44], esi
test byte [eax + 1], 0x20
jne 0x665e6350
mov eax, dword [esp + 0x30]
mov eax, dword [eax + 0x70]
test eax, eax
je 0x665e6200
mov ebp, dword [esp + 0x6c]
test ebp, ebp
jne 0x665e6150
test byte [esp + 0x40], 2
jne 0x665e63e0
mov ebx, dword [esp + 0x4c]
mov edi, dword [esp + 0x40]
xor ecx, ecx
movzx edx, word [ebx + 0x18]
test edi, edi
setne cl
test dx, dx
je 0x665e6860
mov dword [esp + 0x78], eax
mov eax, dword [ebx + 0x14]
mov dword [esp + 8], ecx
mov dword [esp + 0x7c], eax
lea eax, [esp + 0x6c]
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x30]
mov dword [esp], 0
mov dword [esp + 4], 0
mov word [esp + 0x80], dx
lea edx, [esp + 0x78]
mov dword [esp + 0x82], 0
mov byte [esp + 0x86], 0
call fcn.665e4f30
mov dword [esp + 0x68], eax
mov esi, eax
test esi, esi
jne 0x665e61f0
mov esi, dword [esp + 0x6c]
test esi, esi
je 0x665e63e0
nop
mov eax, dword [esp + 0x30]
mov eax, dword [eax + 0x74]
mov ebx, dword [eax + 0x14]
mov dword [esp + 0x3c], eax
test ebx, ebx
js 0x665e6380
mov eax, dword [esp + 0x44]
mov eax, dword [eax + 0x54]
mov dword [esp + 0x54], eax
mov eax, dword [esp + 0x40]
and eax, 0x80
je 0x665e65b0
mov esi, dword [esp + 0x44]
mov eax, 4
mov dword [esp + 0x68], 0
mov ebx, eax
cmp dword [esi + 0x58], 4
cmovge ebx, dword [esi + 0x58]
cmp byte [esi + 0x11], 0
mov dword [esp + 0x5c], ebx
je 0x665e62dc
mov ebp, dword [esp + 0x3c]
movzx eax, word [ebp + 0xe]
cmp eax, ebx
jge 0x665e62dc
mov edi, dword [esp + 0x54]
lea eax, [esp + 0x78]
mov dword [esp], ebp
mov dword [esp + 8], eax
mov dword [esp + 4], edi
call dword [ebp + 0x50]
movzx eax, word [esp + 0x88]
cmp dword [esp + 0x84], eax
jne 0x665e68a8
mov esi, dword [esp + 0x68]
test esi, esi
je 0x665e62dc
add esp, 0xac
mov eax, esi
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [esp + 0x4c]
cmp byte [ebx + 0xb], 0
mov esi, dword [eax + 8]
mov ecx, dword [eax + 0xc]
je 0x665e6260
mov eax, dword [esp + 0x30]
mov edx, dword [eax + 0x40]
mov eax, dword [ebx + 4]
mov byte [ebx + 0xb], 0
mov eax, dword [eax + 8]
test eax, eax
jne 0x665e6237
jmp 0x665e6260
mov eax, dword [eax + 0x18]
test eax, eax
je 0x665e6260
test byte [eax + 1], 0x10
je 0x665e6230
mov byte [ebx + 0xb], 1
cmp edx, dword [eax + 0x40]
jne 0x665e6230
mov edi, dword [eax + 0x20]
mov ebp, dword [eax + 0x24]
xor edi, esi
xor ebp, ecx
or ebp, edi
jne 0x665e6230
mov byte [eax], 1
jmp 0x665e6230
mov eax, dword [esp + 0x30]
test byte [eax + 1], 2
jne 0x665e6440
mov ebx, dword [esp + 0x6c]
test ebx, ebx
jne 0x665e6150
mov edx, dword [esp + 0x40]
lea eax, [esp + 0x6c]
mov dword [esp], esi
mov dword [esp + 0xc], eax
xor eax, eax
test edx, edx
mov dword [esp + 4], ecx
setne al
xor edx, edx
mov dword [esp + 8], eax
mov eax, dword [esp + 0x30]
call fcn.665e4f30
mov dword [esp + 0x68], eax
mov esi, eax
test eax, eax
je 0x665e6150
jmp 0x665e61f0
mov ebp, dword [esp + 0x48]
test ebp, ebp
je 0x665e62d4
mov eax, dword [esp + 0x48]
mov eax, dword [eax + 0x48]
call fcn.6658dc20
mov dword [esp + 0x68], 0
mov eax, dword [esp + 0x30]
mov edi, dword [esp + 0x6c]
movzx ebx, word [eax + 0x46]
mov eax, ebx
test edi, edi
je 0x665e6640
lea edi, [esp + 0x68]
js 0x665e64b0
mov eax, dword [esp + 0x5c]
mov edx, ebx
mov dword [esp + 0xc], edi
xor esi, esi
mov ebx, dword [esp + 0x3c]
mov ecx, dword [esp + 0x54]
mov dword [esp + 8], 0
mov dword [esp], eax
mov dword [esp + 4], 0
mov eax, ebx
call fcn.665e1860
mov eax, dword [esp + 0x30]
mov word [eax + 0x32], si
cmp byte [ebx + 0xc], 0
jne 0x665e64e0
mov esi, dword [esp + 0x68]
add esp, 0xac
pop ebx
mov eax, esi
pop esi
pop edi
pop ebp
ret
mov ecx, dword [esp + 0x30]
mov eax, dword [esp + 0x44]
mov edx, dword [ecx + 0x40]
mov eax, dword [eax + 8]
call fcn.665e4430
mov dword [esp + 0x68], eax
mov esi, eax
test eax, eax
je 0x665e60a4
jmp 0x665e61f0
mov eax, dword [esp + 0x30]
cmp byte [eax], 1
jbe 0x665e6490
mov dword [esp + 0x10], 0x6667e21c
mov dword [esp + 0xc], 0x12039
mov dword [esp + 8], str.database_corruption
mov esi, 0xb
mov dword [esp + 4], str._s_at_line__d_of___.10s_
mov dword [esp], 0xb
call sym.libsqlite3_0.dll_sqlite3_log
add esp, 0xac
mov eax, esi
pop ebx
pop esi
pop edi
pop ebp
ret
mov esi, dword [esi + 4]
add esp, 0xac
pop ebx
mov eax, esi
pop esi
pop edi
pop ebp
ret
mov esi, dword [esp + 0x30]
mov eax, esi
call fcn.66587740
mov eax, dword [esp + 0x4c]
mov ecx, dword [esi + 0x20]
mov edx, dword [eax + 8]
mov eax, dword [eax + 0xc]
xor eax, dword [esi + 0x24]
xor ecx, edx
or eax, ecx
jne 0x665e6150
mov eax, dword [esp + 0x4c]
mov dword [esp + 0x94], edx
lea edx, [esp + 0x78]
mov dword [esp + 0x98], 0
mov eax, dword [eax]
mov dword [esp + 0x88], eax
mov eax, dword [esp + 0x30]
call fcn.665dfa40
mov esi, eax
jmp 0x665e61f0
mov edx, dword [esp + 0x30]
mov eax, dword [edx + 0x20]
mov ebx, edx
mov edx, dword [edx + 0x24]
xor eax, esi
xor edx, ecx
or edx, eax
jne 0x665e626e
cmp word [ebx + 0x32], 0
je 0x665e6150
mov esi, dword [esp + 0x4c]
mov eax, dword [esi + 0x20]
add eax, dword [esi + 0x1c]
cmp dword [ebx + 0x2c], eax
jne 0x665e6150
mov edx, esi
mov eax, ebx
call fcn.665dfa40
mov esi, eax
jmp 0x665e61f0
mov eax, dword [esp + 0x3c]
call fcn.665b1600
mov dword [esp + 0x68], eax
mov esi, eax
test eax, eax
je 0x665e6166
jmp 0x665e61f0
mov esi, dword [esp + 0x3c]
cmp word [esi + 0x18], 0
je 0x665e62fc
mov esi, dword [esp + 0x30]
add eax, 1
movzx ebx, ax
and byte [esi + 1], 0xfd
mov word [esi + 0x46], ax
jmp 0x665e62fc
mov ebx, dword [esp + 0x30]
and byte [ebx + 1], 0xfd
mov eax, ebx
call fcn.665e3530
mov dword [esp + 0x68], eax
mov esi, eax
mov eax, dword [ebx + 0x74]
mov byte [eax + 0xc], 0
mov byte [ebx], 1
test byte [esp + 0x40], 2
je 0x665e61f0
test esi, esi
jne 0x665e61f0
cmp byte [ebx + 0x44], 0
mov esi, ebx
js 0x665e654e
je 0x665e653e
xor ebx, ebx
nop
mov eax, dword [esi + ebx*4 + 0x78]
add ebx, 1
mov eax, dword [eax + 0x48]
call fcn.6658dc20
movsx eax, byte [esi + 0x44]
cmp ebx, eax
jl 0x665e6520
mov eax, dword [esp + 0x30]
mov eax, dword [eax + 0x74]
mov eax, dword [eax + 0x48]
call fcn.6658dc20
mov eax, dword [esp + 0x30]
mov byte [eax + 0x44], 0xff
mov ebx, dword [esp + 0x30]
mov eax, dword [esp + 0x4c]
mov ecx, dword [ebx + 0x70]
mov edx, dword [eax + 0xc]
mov eax, dword [eax + 8]
test ecx, ecx
je 0x665e6596
call fcn.6658bcf0
mov ebx, dword [esp + 0x30]
mov dword [ebx + 0x10], eax
test eax, eax
je 0x665e6b73
mov ebx, dword [esp + 0x4c]
mov edx, dword [ebx]
mov ecx, dword [ebx + 8]
mov dword [esp], eax
mov dword [esp + 4], edx
mov dword [esp + 8], ecx
call sub.msvcrt.dll_memcpy
mov eax, dword [ebx + 8]
mov edx, dword [ebx + 0xc]
mov esi, dword [esp + 0x68]
mov ebx, dword [esp + 0x30]
mov byte [ebx], 3
mov dword [ebx + 0x38], eax
mov dword [ebx + 0x3c], edx
jmp 0x665e61f0
mov ecx, dword [esp + 0x3c]
mov edx, dword [esp + 0x54]
mov esi, dword [esp + 0x4c]
movzx ebp, byte [ecx + 0xa]
cmp byte [ecx + 2], 0
lea ebx, [edx + ebp]
je 0x665e66d8
mov ecx, dword [esi + 0x1c]
mov dword [esp + 0x34], ecx
add ecx, dword [esi + 0x20]
mov esi, dword [esi + 0x10]
mov dword [esp + 0x2c], ecx
mov dword [esp + 0x38], esi
cmp ecx, 0x7f
ja 0x665e6a94
mov byte [ebx], cl
mov eax, 1
add ebp, eax
mov eax, dword [esp + 0x4c]
mov edx, 0x7f
mov esi, dword [eax + 8]
mov edi, dword [eax + 0xc]
mov eax, dword [esp + 0x54]
lea ebx, [eax + ebp]
xor eax, eax
cmp edx, esi
mov ecx, eax
sbb ecx, edi
jae 0x665e6a84
mov edx, 0x3fff
cmp edx, esi
sbb eax, edi
jae 0x665e68dd
mov edx, esi
mov ecx, edi
mov eax, ebx
call fcn.66581dc0
add ebp, eax
jmp 0x665e6733
mov edi, dword [esp + 0x3c]
mov eax, dword [edi + 0x48]
call fcn.665dd740
mov dword [esp + 0x68], eax
mov esi, eax
test eax, eax
jne 0x665e61f0
mov eax, dword [edi + 0x40]
mov ecx, edi
movzx edi, word [eax + ebx*2]
rol di, 8
and di, word [ecx + 0x1a]
movzx edi, di
add edi, dword [ecx + 0x38]
cmp byte [ecx + 8], 0
je 0x665e68d0
mov eax, dword [esp + 0x3c]
lea ecx, [esp + 0x78]
mov edx, edi
call fcn.665e1670
mov ecx, dword [esp + 0x30]
mov dword [esp + 0x68], eax
and byte [ecx + 1], 0xfb
movzx ecx, word [esp + 0x8a]
cmp ecx, dword [esp + 0x5c]
je 0x665e6abf
mov esi, eax
test eax, eax
jne 0x665e61f0
lea edi, [esp + 0x68]
mov eax, dword [esp + 0x3c]
mov edx, ebx
mov dword [esp], edi
call fcn.665b1c10
mov esi, dword [esp + 0x68]
test esi, esi
je 0x665e62fc
jmp 0x665e61f0
mov edx, dword [esi + 8]
mov ecx, dword [esi]
mov dword [esp + 0x2c], edx
mov dword [esp + 0x38], ecx
cmp edx, 0x7f
jbe 0x665e6898
mov ecx, dword [esp + 0x2c]
mov edx, 0x7f
mov edi, ecx
mov esi, ecx
sar edi, 0x1f
cmp edx, ecx
mov ecx, eax
sbb ecx, edi
jae 0x665e6b2b
mov edx, 0x3fff
cmp edx, dword [esp + 0x2c]
sbb eax, edi
jae 0x665e6b39
mov edx, esi
mov ecx, edi
mov eax, ebx
call fcn.66581dc0
movzx eax, al
add ebp, eax
mov eax, dword [esp + 0x2c]
mov dword [esp + 0x34], eax
mov eax, dword [esp + 0x54]
lea ebx, [eax + ebp]
mov eax, dword [esp + 0x3c]
movzx ecx, word [eax + 0xe]
cmp ecx, dword [esp + 0x2c]
jge 0x665e6a30
mov eax, dword [esp + 0x3c]
mov dword [esp + 0x74], 0
mov esi, dword [eax + 0x34]
movzx edi, word [eax + 0x10]
mov eax, dword [esp + 0x2c]
mov edx, dword [esi + 0x28]
sub eax, edi
sub edx, 4
mov dword [esp + 0x48], edx
xor edx, edx
div dword [esp + 0x48]
mov dword [esp + 0x48], 0
add edx, edi
cmp ecx, edx
cmovl edx, edi
add ebp, edx
lea eax, [ebp + 4]
add ebp, dword [esp + 0x54]
mov dword [esp + 0x5c], eax
mov dword [esp + 0x50], ebp
mov ebp, edx
lea esi, [esi]
nop
mov eax, dword [esp + 0x2c]
cmp ebp, eax
mov edi, eax
cmovle edi, ebp
cmp edi, dword [esp + 0x34]
jle 0x665e67bf
mov eax, dword [esp + 0x34]
test eax, eax
jle 0x665e6910
mov edi, eax
mov eax, dword [esp + 0x38]
mov dword [esp + 8], edi
mov dword [esp], ebx
mov dword [esp + 4], eax
call sub.msvcrt.dll_memcpy
sub dword [esp + 0x2c], edi
mov eax, dword [esp + 0x2c]
test eax, eax
jle 0x665e62c0
add dword [esp + 0x38], edi
sub dword [esp + 0x34], edi
sub ebp, edi
jne 0x665e6900
mov eax, dword [esp + 0x74]
mov dword [esp + 0x78], 0
cmp byte [esi + 0x11], 0
mov dword [esp + 0x58], eax
mov ecx, eax
jne 0x665e69d0
mov dword [esp], ecx
lea edx, [esp + 0x78]
lea ecx, [esp + 0x74]
mov eax, esi
mov dword [esp + 4], 0
call fcn.665dfd00
cmp byte [esi + 0x11], 0
mov dword [esp + 0x70], eax
je 0x665e6978
test eax, eax
je 0x665e6930
mov eax, dword [esp + 0x48]
test eax, eax
je 0x665e6853
mov eax, dword [esp + 0x48]
mov eax, dword [eax + 0x48]
call fcn.6658dc20
mov esi, dword [esp + 0x70]
mov dword [esp + 0x68], esi
jmp 0x665e61e8
mov ebx, dword [esp + 0x4c]
lea eax, [esp + 0x6c]
mov dword [esp + 8], ecx
mov dword [esp + 0xc], eax
mov eax, dword [ebx + 8]
mov edx, dword [ebx + 0xc]
mov dword [esp], eax
mov eax, dword [esp + 0x30]
mov dword [esp + 4], edx
mov edx, dword [ebx]
call fcn.665e5530
mov dword [esp + 0x68], eax
mov esi, eax
jmp 0x665e613a
mov byte [ebx], dl
mov eax, 1
jmp 0x665e6729
mov edx, dword [edi + ebx - 4]
lea edi, [esp + 0x68]
mov ecx, 3
mov dword [esp + 4], edi
mov eax, dword [ebp + 4]
bswap edx
mov dword [esp], eax
mov eax, esi
call fcn.665e05c0
jmp 0x665e61e4
mov eax, dword [edi]
mov ecx, dword [esp + 0x54]
mov dword [ecx], eax
jmp 0x665e667b
mov eax, esi
mov edx, esi
shrd eax, edi, 7
and edx, 0x7f
or eax, 0xffffff80
mov byte [ebx + 1], dl
mov byte [ebx], al
mov eax, 2
add ebp, eax
jmp 0x665e6733
add ebx, edi
jmp 0x665e67a0
mov dword [esp + 8], edi
mov dword [esp + 4], 0
mov dword [esp], ebx
call sub.msvcrt.dll_memset
jmp 0x665e67d3
mov ebx, dword [esp + 0x58]
lea eax, [esp + 0x70]
mov edx, dword [esp + 0x74]
mov ecx, 3
mov dword [esp + 4], eax
mov eax, esi
mov dword [esp], ebx
cmp ebx, 1
sbb ecx, 0xffffffff
call fcn.665e05c0
mov eax, dword [esp + 0x70]
test eax, eax
je 0x665e6980
mov eax, dword [esp + 0x78]
test eax, eax
je 0x665e683f
mov eax, dword [eax + 0x48]
call fcn.6658dc20
mov eax, dword [esp + 0x70]
lea esi, [esi]
test eax, eax
jne 0x665e683f
mov eax, dword [esp + 0x74]
mov ebx, dword [esp + 0x50]
bswap eax
mov dword [ebx], eax
mov eax, dword [esp + 0x48]
test eax, eax
je 0x665e699c
mov eax, dword [eax + 0x48]
call fcn.6658dc20
mov eax, dword [esp + 0x78]
mov dword [esp + 0x48], eax
mov eax, dword [eax + 0x38]
mov dword [eax], 0
mov dword [esp + 0x50], eax
mov eax, dword [esp + 0x78]
mov ebx, dword [eax + 0x38]
mov eax, dword [esi + 0x28]
add ebx, 4
lea ebp, [eax - 4]
jmp 0x665e67a0
mov eax, dword [0x6667cdf0]
xor edx, edx
mov ebx, ecx
div dword [esi + 0x24]
mov edi, eax
nop
lea ecx, [ebx + 1]
xor ebp, ebp
cmp ecx, 1
jbe 0x665e6a10
mov eax, 0xcccccccd
mul dword [esi + 0x28]
lea eax, [ebx - 1]
shr edx, 2
lea ebp, [edx + 1]
xor edx, edx
div ebp
lea edx, [edi + 1]
imul eax, ebp
lea ebp, [eax + 2]
add eax, 3
cmp ebp, edx
cmove ebp, eax
cmp ecx, ebp
je 0x665e6a18
cmp edi, ebx
jne 0x665e6a20
mov ebx, ecx
jmp 0x665e69e0
mov dword [esp + 0x74], ecx
jmp 0x665e680f
mov edi, dword [esp + 0x2c]
mov eax, 4
mov esi, dword [esp + 0x34]
mov dword [esp], ebx
add ebp, edi
mov dword [esp + 8], esi
cmp ebp, 4
cmovge eax, ebp
add ebx, esi
mov dword [esp + 0x5c], eax
mov eax, dword [esp + 0x38]
mov dword [esp + 4], eax
call sub.msvcrt.dll_memcpy
mov eax, edi
mov dword [esp + 4], 0
sub eax, esi
mov dword [esp], ebx
mov dword [esp + 8], eax
call sub.msvcrt.dll_memset
mov dword [esp + 0x68], 0
jmp 0x665e62dc
mov eax, esi
mov byte [ebx], al
mov eax, 1
add ebp, eax
jmp 0x665e6733
mov ecx, dword [esp + 0x2c]
mov edx, 0x3fff
mov edi, ecx
sar edi, 0x1f
cmp edx, ecx
sbb eax, edi
jae 0x665e6b56
mov edx, ecx
mov eax, ebx
mov ecx, edi
call fcn.66581dc0
movzx eax, al
jmp 0x665e65f2
movzx edx, word [esp + 0x88]
cmp edx, dword [esp + 0x84]
jne 0x665e66a8
mov edx, dword [esp + 0x44]
cmp byte [edx + 0x11], 0
je 0x665e6af0
mov edx, dword [esp + 0x3c]
movzx edx, word [edx + 0x10]
cmp edx, dword [esp + 0x5c]
jle 0x665e66a8
mov ebx, dword [esp + 0x3c]
movzx eax, byte [ebx + 9]
mov edx, dword [ebx + 0x38]
lea eax, [edx + eax + 0xa]
cmp edi, eax
jb 0x665e6ba4
mov eax, dword [esp + 0x5c]
mov ebx, dword [esp + 0x3c]
add eax, edi
cmp dword [ebx + 0x3c], eax
jae 0x665e6b87
mov dword [esp + 0x10], 0x6667e21c
mov dword [esp + 0xc], 0x12078
jmp 0x665e639d
mov eax, esi
mov byte [ebx], al
mov eax, 1
jmp 0x665e6729
mov eax, esi
mov edx, esi
shrd eax, edi, 7
and edx, 0x7f
or eax, 0xffffff80
mov byte [ebx + 1], dl
mov byte [ebx], al
mov eax, 2
jmp 0x665e6729
mov eax, ecx
mov edx, ecx
shrd eax, edi, 7
and edx, 0x7f
or eax, 0xffffff80
mov byte [ebx + 1], dl
mov byte [ebx], al
mov eax, 2
jmp 0x665e65f2
mov eax, dword [esp + 0x4c]
mov esi, 7
mov edx, dword [eax + 0xc]
mov eax, dword [eax + 8]
jmp 0x665e659a
mov eax, dword [esp + 0x5c]
mov dword [esp], edi
mov dword [esp + 8], eax
mov eax, dword [esp + 0x54]
mov dword [esp + 4], eax
call sub.msvcrt.dll_memcpy
jmp 0x665e61f0
mov dword [esp + 0x10], 0x6667e21c
mov dword [esp + 0xc], 0x12075
jmp 0x665e639d