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

Disassembly:
sub esp, 0x2c
push ebx
mov ebx, dword [esp + 0x38]
push ebp
mov ebp, dword [esp + 0x38]
push esi
mov esi, dword [esp + 0x44]
push edi
mov edi, dword [esp + 0x4c]
test ebx, ebx
jne 0x10039879
cmp byte [ebp], 0
jne 0x1003986b
mov dl, byte [ebp + 1]
test dl, 2
je 0x1003986b
mov ecx, dword [ebp + 0x20]
mov eax, dword [ebp + 0x24]
cmp ecx, esi
jne 0x10039807
cmp eax, edi
jne 0x10039809
mov eax, dword [esp + 0x54]
pop edi
pop esi
pop ebp
mov dword [eax], 0
xor eax, eax
pop ebx
add esp, 0x2c
ret
cmp eax, edi
jg 0x1003986b
jl 0x10039811
cmp ecx, esi
jae 0x1003986b
mov ebx, dword [esp + 0x54]
test dl, 8
jne 0x100398f6
add ecx, 1
adc eax, 0
cmp ecx, esi
jne 0x1003986f
cmp eax, edi
jne 0x1003986f
push 0
push ebp
mov dword [ebx], 0
call fcn.10039d70
add esp, 8
test eax, eax
jne 0x1003985e
push ebp
call fcn.10024a30
add esp, 4
cmp dword [ebp + 0x20], esi
jne 0x1003986f
cmp dword [ebp + 0x24], edi
jne 0x1003986f
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x2c
ret
cmp eax, 0x65
je 0x1003986f
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x2c
ret
mov ebx, dword [esp + 0x54]
mov dword [esp + 0x14], 0
jmp 0x100398e0
mov ecx, dword [ebx]
cmp word [ecx + 8], 0xd
ja 0x100398d0
mov eax, dword [ebx + 4]
movzx edx, word [eax + 8]
mov eax, dword [ecx + 0x10]
mov al, byte [eax]
test al, al
sete cl
test al, al
setne al
lea ecx, [ecx*2 - 1]
lea eax, [eax*2 - 1]
mov byte [ebx + 0xc], al
mov byte [ebx + 0xd], cl
test dl, 4
je 0x100398bb
mov dword [esp + 0x14], 0x100749e0
jmp 0x100398d8
test dl, 0x39
jne 0x100398d0
mov eax, dword [ebx]
mov dword [esp + 0x14], 0x10074be0
cmp dword [eax + 0x14], 0
je 0x100398d8
mov dword [esp + 0x14], 0x10066950
mov byte [ebx + 0xb], 0
mov ebx, dword [esp + 0x54]
push ebp
call fcn.100286a0
add esp, 4
test eax, eax
je 0x10039906
cmp eax, 0x10
jne 0x10039d5e
pop edi
pop esi
pop ebp
mov dword [ebx], 0xffffffff
xor eax, eax
pop ebx
add esp, 0x2c
ret
mov ecx, 1
lea ebx, [ebp + 0x74]
sub ecx, dword [esp + 0x50]
mov dword [esp + 0x30], ecx
mov esi, dword [ebx]
xor eax, eax
mov dword [esp + 0x1c], eax
mov dword [esp + 0x18], esi
movzx ebx, word [esi + 0x18]
lea eax, [esi + 0x40]
dec ebx
mov dword [esp + 0x20], eax
mov edi, ebx
mov dword [esp + 0x28], ebx
sar edi, cl
lea edx, [esi + 0x1a]
cmp dword [esp + 0x14], 0
mov word [ebp + 0x46], di
mov dword [esp + 0x24], edx
jne 0x10039a50
movzx edx, word [edx]
mov cl, byte [esi + 3]
mov eax, dword [eax]
mov dword [esp + 0x28], eax
mov dword [esp + 0x2c], edx
mov byte [esp + 0x13], cl
mov ax, word [eax + edi*2]
mov ch, al
mov cl, ah
movzx eax, cx
movzx ecx, dx
and eax, ecx
add eax, dword [esi + 0x44]
cmp byte [esp + 0x13], 0
je 0x10039991
cmp byte [eax], 0x80
jb 0x10039990
mov ecx, dword [esi + 0x3c]
inc eax
cmp eax, ecx
jae 0x10039c26
cmp byte [eax], 0x80
jae 0x10039982
inc eax
lea ecx, [esp + 0x34]
push ecx
push eax
call fcn.10049360
mov ecx, dword [esp + 0x40]
add esp, 8
mov eax, dword [esp + 0x34]
cmp ecx, dword [esp + 0x4c]
jg 0x100399f9
jl 0x100399b7
mov edx, dword [esp + 0x48]
cmp eax, edx
jae 0x100399fd
lea edx, [edi + 1]
mov dword [esp + 0x1c], edx
cmp edx, ebx
jle 0x10039a14
or esi, 0xffffffff
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x20]
mov ebx, dword [esp + 0x24]
cmp byte [eax + 8], 0
jne 0x10039c84
mov esi, eax
movzx eax, word [esi + 0x18]
cmp edx, eax
jl 0x10039ba3
movzx ecx, byte [esi + 9]
mov eax, dword [esi + 0x38]
mov edx, dword [ecx + eax + 8]
jmp 0x10039bbb
mov edx, dword [esp + 0x48]
cmp ecx, dword [esp + 0x4c]
jl 0x10039a2d
jg 0x10039a09
cmp eax, edx
jbe 0x10039a2d
mov edx, dword [esp + 0x1c]
lea ebx, [edi - 1]
cmp edx, ebx
jg 0x10039a26
mov eax, dword [esp + 0x28]
lea edi, [ebx + edx]
mov edx, dword [esp + 0x2c]
sar edi, 1
jmp 0x10039960
mov esi, 1
jmp 0x100399c5
mov word [ebp + 0x46], di
cmp byte [esi + 8], 0
jne 0x10039c51
mov ecx, dword [esp + 0x20]
mov edx, edi
mov ebx, dword [esp + 0x24]
mov dword [esp + 0x1c], edx
jmp 0x100399dd
mov eax, dword [eax]
mov ax, word [eax + edi*2]
mov ch, al
mov cl, ah
movzx eax, word [edx]
movzx ecx, cx
and ecx, eax
mov eax, dword [esp + 0x18]
add ecx, dword [esi + 0x44]
movzx eax, byte [eax + 0xb]
movzx edx, byte [ecx]
lea esi, [ecx + 1]
cmp edx, eax
ja 0x10039a8b
push dword [esp + 0x44]
push esi
push edx
call dword [esp + 0x20]
add esp, 0xc
mov esi, eax
jmp 0x10039b67
mov al, byte [esi]
test al, al
js 0x10039abf
and edx, 0x7f
movzx eax, al
shl edx, 7
add edx, eax
mov eax, dword [esp + 0x18]
movzx eax, word [eax + 0xe]
cmp edx, eax
ja 0x10039abf
push dword [esp + 0x44]
lea eax, [ecx + 2]
push eax
push edx
call dword [esp + 0x20]
add esp, 0xc
mov esi, eax
jmp 0x10039b67
mov edx, dword [esp + 0x18]
lea esi, [ebp + 0x20]
push esi
movzx eax, byte [edx + 0xa]
sub ecx, eax
mov eax, dword [edx + 0x50]
push ecx
push edx
call eax
mov esi, dword [esi]
add esp, 0xc
cmp esi, 2
jl 0x10039d2f
mov ecx, dword [ebp + 0x14]
xor edx, edx
mov eax, esi
div dword [ecx + 0x24]
cmp eax, dword [ecx + 0x2c]
ja 0x10039d2f
lea eax, [esi + 0x12]
cdq
push edx
push eax
call fcn.1004d0c0
mov ebx, eax
add esp, 8
test ebx, ebx
je 0x10039d16
push 0
push ebx
push esi
push 0
push ebp
mov word [ebp + 0x46], di
call fcn.100120b0
mov ebp, eax
add esp, 0x14
xor eax, eax
mov dword [ebx + esi], eax
mov dword [ebx + esi + 4], eax
mov dword [ebx + esi + 8], eax
mov dword [ebx + esi + 0xc], eax
mov word [ebx + esi + 0x10], ax
mov eax, dword [esp + 0x40]
and byte [eax + 1], 0xfb
test ebp, ebp
jne 0x10039cf9
push ebp
push dword [esp + 0x48]
push ebx
push esi
call fcn.10066970
push ebx
mov esi, eax
call sym.sqlite3.dll_sqlite3_free
mov ebp, dword [esp + 0x54]
add esp, 0x14
mov ebx, dword [esp + 0x28]
test esi, esi
jns 0x10039b74
lea edx, [edi + 1]
mov dword [esp + 0x1c], edx
jmp 0x10039b85
jle 0x10039ca4
mov edx, dword [esp + 0x1c]
lea ebx, [edi - 1]
mov dword [esp + 0x28], ebx
cmp edx, ebx
jg 0x100399c5
mov esi, dword [esp + 0x18]
lea edi, [ebx + edx]
mov eax, dword [esp + 0x20]
mov edx, dword [esp + 0x24]
sar edi, 1
jmp 0x10039a50
mov eax, dword [ecx]
mov ax, word [eax + edx*2]
mov ch, al
mov cl, ah
movzx eax, word [ebx]
movzx ecx, cx
and ecx, eax
mov eax, dword [esi + 0x38]
mov edx, dword [ecx + eax]
mov eax, dword [esp + 0x1c]
mov esi, dword [ebp + 0x14]
movzx ecx, ax
mov al, byte [ebp + 0x44]
mov word [ebp + 0x46], cx
cmp al, 0x13
jge 0x10039c75
and byte [ebp + 1], 0xf9
lea ebx, [ebp + 0x74]
movsx eax, al
xor edi, edi
mov word [ebp + 0x32], di
bswap edx
mov word [ebp + eax*2 + 0x48], cx
movsx ecx, byte [ebp + 0x44]
mov eax, dword [ebx]
mov dword [ebp + ecx*4 + 0x78], eax
xor eax, eax
inc byte [ebp + 0x44]
mov word [ebp + 0x46], ax
movzx eax, byte [ebp + 2]
push eax
push ebp
push ebx
push edx
push esi
call fcn.10024940
mov ebp, eax
add esp, 0x14
test ebp, ebp
jne 0x10039d52
mov ebp, dword [esp + 0x40]
mov ecx, dword [esp + 0x30]
jmp 0x10039916
push 0x10091874
push 0x10c69
push str.database_corruption
push str._s_at_line__d_of___.10s_
push 0xb
call fcn.10010e10
add esp, 0x14
mov eax, 0xb
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x2c
ret
or byte [ebp + 1], 2
mov dword [ebp + 0x20], eax
xor eax, eax
mov word [ebp + 0x32], ax
mov eax, dword [esp + 0x54]
pop edi
pop esi
mov dword [ebp + 0x24], ecx
pop ebp
mov dword [eax], 0
xor eax, eax
pop ebx
add esp, 0x2c
ret
push 0x10091874
push 0x10acd
jmp 0x10039d39
mov eax, dword [esp + 0x54]
mov word [ebp + 0x46], di
xor ebp, ebp
pop edi
mov dword [eax], esi
xor eax, eax
mov esi, dword [esp + 0x3c]
mov word [esi + 0x32], ax
mov eax, ebp
pop esi
pop ebp
pop ebx
add esp, 0x2c
ret
mov eax, dword [esp + 0x54]
xor ebp, ebp
mov esi, dword [esp + 0x40]
mov dword [eax], 0
mov eax, dword [esp + 0x44]
mov word [esi + 0x46], di
cmp byte [eax + 0xb], 0
je 0x10039d56
push 0x10091874
push 0x10cd4
push str.database_corruption
push str._s_at_line__d_of___.10s_
push 0xb
call fcn.10010e10
add esp, 0x14
mov ebp, 0xb
xor eax, eax
mov word [esi + 0x32], ax
mov eax, ebp
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x2c
ret
push ebx
call sym.sqlite3.dll_sqlite3_free
mov esi, dword [esp + 0x44]
add esp, 4
xor eax, eax
pop edi
mov word [esi + 0x32], ax
mov eax, ebp
pop esi
pop ebp
pop ebx
add esp, 0x2c
ret
mov esi, dword [esp + 0x40]
xor eax, eax
pop edi
mov ebp, 7
mov word [esi + 0x32], ax
mov eax, ebp
pop esi
pop ebp
pop ebx
add esp, 0x2c
ret
push 0x10091874
push 0x10cb4
push str.database_corruption
push str._s_at_line__d_of___.10s_
push 0xb
call fcn.10010e10
mov ebp, 0xb
add esp, 0x14
mov esi, dword [esp + 0x40]
xor eax, eax
mov word [esi + 0x32], ax
mov eax, ebp
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x2c
ret