Function at 0x4a0c87
Capabilities:
Reference sql statements
Resolve function by parsing pe exports

Disassembly:
sub esp, 0x7c
mov eax, dword [0x62f570]
xor eax, esp
mov dword [esp + 0x78], eax
cmp dword [esp + 0x84], 2
mov eax, dword [esp + 0x88]
push ebp
mov ebp, dword [esp + 0x84]
jl 0x4a0c40
mov eax, dword [eax + 4]
mov dword [esp + 8], eax
jmp 0x4a0c48
mov dword [esp + 8], str.main
push 0
mov eax, ebp
mov dword [esp + 8], 0
call fcn.0049f5a0
mov eax, dword [ebp]
add esp, 4
test eax, eax
jne 0x4a0c78
mov eax, 1
pop ebp
mov ecx, dword [esp + 0x78]
xor ecx, esp
call fcn.0057ffd2
add esp, 0x7c
ret
push ebx
push 0
lea ecx, [esp + 0xc]
push ecx
push 0
push 0x80
push 0xffffffffffffffff
push str.SELECT_data_FROM_sqlite_dbpage__1__WHERE_pgno1
call fcn.00501540
mov edx, dword [esp + 0x24]
mov ebx, dword [esp + 0x20]
push 1
push 0xffffffffffffffff
push edx
push 1
xor eax, eax
mov ecx, ebx
call fcn.004d2970
push ebx
call fcn.004d1cc0
add esp, 0x2c
cmp eax, 0x64
jne 0x4a0fd4
push 0
push ebx
call fcn.004d2240
add esp, 8
cmp eax, 0x64
jle 0x4a0fd4
push esi
push edi
push 0
push ebx
call fcn.004d21e0
mov esi, eax
mov ecx, 0x19
lea edi, [esp + 0x2c]
push ebx
rep movsd dword es:[edi], dword [esi]
call fcn.004d0dd0
movzx eax, byte [esp + 0x40]
movzx ecx, byte [esp + 0x41]
shl eax, 8
add eax, ecx
add esp, 0xc
cmp eax, 1
jne 0x4a0d0a
mov eax, 0x10000
mov ebx, dword [ebp + 0x18]
push eax
push str.database_page_size:
push str.__20s__d_n
call fcn.004904d0
movzx edx, byte [esp + 0x42]
mov ebx, dword [ebp + 0x18]
push edx
push str.write_format:
push str.__20s__d_n
call fcn.004904d0
movzx eax, byte [esp + 0x4f]
mov ebx, dword [ebp + 0x18]
push eax
push str.read_format:
push str.__20s__d_n
call fcn.004904d0
movzx ecx, byte [esp + 0x5c]
mov ebx, dword [ebp + 0x18]
push ecx
push str.reserved_bytes:
push str.__20s__d_n
call fcn.004904d0
mov eax, 0x5e8fe0
add esp, 0x30
mov dword [esp + 0x10], eax
jmp 0x4a0d77
mov eax, dword [esp + 0x10]
mov edi, dword [eax + 4]
movzx esi, byte [esp + edi + 0x24]
movzx edx, byte [esp + edi + 0x25]
movzx ecx, byte [esp + edi + 0x26]
mov eax, dword [eax]
mov ebx, dword [ebp + 0x18]
shl esi, 8
add esi, edx
movzx edx, byte [esp + edi + 0x27]
shl esi, 8
add esi, ecx
shl esi, 8
add esi, edx
push esi
push eax
push str.__20s__u
call fcn.004904d0
add esp, 0xc
cmp edi, 0x38
jne 0x4a0dec
cmp esi, 1
jne 0x4a0dc6
mov ecx, dword [ebp + 0x18]
push str.__utf8_
push ecx
jmp 0x4a0de4
cmp esi, 2
jne 0x4a0dd6
mov edx, dword [ebp + 0x18]
push str.__utf16le_
push edx
jmp 0x4a0de4
cmp esi, 3
jne 0x4a0dec
mov eax, dword [ebp + 0x18]
push str.__utf16be_
push eax
call fcn.00585612
add esp, 8
mov ecx, dword [ebp + 0x18]
push 0x5f7930
push ecx
call fcn.00585612
mov eax, dword [esp + 0x18]
add eax, 8
add esp, 8
cmp eax, 0x5e9040
mov dword [esp + 0x10], eax
jl 0x4a0d73
mov esi, dword [esp + 0x14]
test esi, esi
jne 0x4a0e2a
push str.main.sqlite_master
call fcn.004ad880
add esp, 4
jmp 0x4a0e74
mov ecx, str.temp
mov eax, esi
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x4a0e51
test dl, dl
je 0x4a0e4d
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x4a0e51
add eax, 2
add ecx, 2
test dl, dl
jne 0x4a0e31
xor eax, eax
jmp 0x4a0e56
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x4a0e66
push str.sqlite_temp_master
push 0x5f7c60
jmp 0x4a0e6c
push esi
push str.__w_.sqlite_master
call fcn.004ad880
add esp, 8
mov dword [esp + 0x10], eax
mov esi, 0x5e9040
lea ecx, [ecx]
mov edx, dword [esp + 0x10]
mov eax, dword [esi + 4]
push edx
push eax
call fcn.004ad880
push 0
lea ecx, [esp + 0x24]
push ecx
push 0
push 0x80
mov edi, eax
mov eax, dword [ebp]
push 0xffffffffffffffff
push edi
mov dword [esp + 0x3c], 0
call fcn.00501540
mov ebx, dword [esp + 0x38]
add esp, 0x20
test ebx, ebx
je 0x4a0ed9
push ebx
call fcn.004d1cc0
add esp, 4
cmp eax, 0x64
jne 0x4a0ed9
push 0
push ebx
call fcn.004d2400
add esp, 8
mov dword [esp + 0x1c], eax
push ebx
call fcn.004d0dd0
push edi
call fcn.004ab490
mov edx, dword [esp + 0x24]
mov eax, dword [esi]
mov ebx, dword [ebp + 0x18]
push edx
push eax
push str.__20s__d_n
call fcn.004904d0
add esi, 8
add esp, 0x14
cmp esi, 0x5e9068
jl 0x4a0e80
mov ecx, dword [esp + 0x10]
push ecx
call fcn.004ab490
mov esi, dword [ebp]
mov eax, dword [esi + 0xc]
add esp, 4
mov dword [esp + 0x18], esi
test eax, eax
je 0x4a0f31
push eax
call dword [0x631984]
add esp, 4
mov ebx, dword [esp + 0x14]
test ebx, ebx
je 0x4a0fcd
mov ecx, esi
call fcn.004ec470
test eax, eax
jl 0x4a0f8d
mov edx, dword [esi + 0x10]
shl eax, 4
mov edi, dword [eax + edx + 4]
test edi, edi
je 0x4a0f8d
cmp byte [edi + 9], 0
je 0x4a0f6a
inc dword [edi + 0xc]
cmp byte [edi + 0xa], 0
jne 0x4a0f6a
call fcn.004be580
mov eax, dword [edi + 4]
mov ecx, dword [eax]
mov edx, dword [ecx + 0x64]
mov dword [esp + 0x20], edx
cmp byte [edi + 9], 0
je 0x4a0f8d
add dword [edi + 0xc], 0xffffffff
jne 0x4a0f8d
mov esi, edi
call fcn.004be540
mov esi, dword [esp + 0x18]
mov esi, dword [esi + 0xc]
test esi, esi
je 0x4a0f9e
push esi
call dword [0x63198c]
add esp, 4
mov eax, dword [esp + 0x20]
mov ebx, dword [ebp + 0x18]
push eax
push 0x5faa18
push str.__20s__u_n
call fcn.004904d0
add esp, 0xc
pop edi
pop esi
pop ebx
xor eax, eax
pop ebp
mov ecx, dword [esp + 0x78]
xor ecx, esp
call fcn.0057ffd2
add esp, 0x7c
ret
xor eax, eax
jmp 0x4a0f48
push str.unable_to_read_database_header_n
call fcn.00587376
add eax, 0x40
push eax
call fcn.00585612
push ebx
call fcn.004d0dd0
mov ecx, dword [esp + 0x8c]
add esp, 0xc
pop ebx
pop ebp
xor ecx, esp
mov eax, 1
call fcn.0057ffd2
add esp, 0x7c
ret