Function at 0x4a5640
Capabilities:
Reference sql statements

Disassembly:
sub esp, 0x7c
mov eax, dword [0x63727c]
xor eax, esp
mov dword [esp + 0x78], eax
cmp dword [esp + 0x84], 2
mov eax, dword [esp + 0x88]
push ebx
push ebp
mov ebp, dword [esp + 0x88]
push esi
jl 0x4a5672
mov eax, dword [eax + 4]
mov dword [esp + 0x10], eax
jmp 0x4a567a
mov dword [esp + 0x10], str.main
xor ebx, ebx
mov esi, ebp
mov dword [esp + 0xc], 0
call fcn.004a5440
mov eax, dword [ebp]
test eax, eax
je 0x4a597c
push ebx
lea ecx, [esp + 0x10]
push ecx
push 0xffffffffffffffff
push str.SELECT_data_FROM_sqlite_dbpage__1__WHERE_pgno1
push eax
call fcn.00521340
mov edx, dword [esp + 0x24]
mov eax, dword [esp + 0x20]
push ebx
push 0xffffffffffffffff
push edx
push 1
push eax
call fcn.004ebf30
mov ecx, dword [esp + 0x34]
push ecx
call fcn.00527980
add esp, 0x2c
cmp eax, 0x64
jne 0x4a595c
mov edx, dword [esp + 0xc]
push ebx
push edx
call fcn.004cfef0
add esp, 8
cmp eax, 0x64
jle 0x4a595c
mov eax, dword [esp + 0xc]
push edi
push ebx
push eax
call fcn.004d5d00
mov esi, eax
mov ecx, 0x19
lea edi, [esp + 0x2c]
rep movsd dword es:[edi], dword [esi]
mov ecx, dword [esp + 0x18]
push ecx
call fcn.005127b0
movzx eax, byte [esp + 0x40]
movzx edx, byte [esp + 0x41]
shl eax, 8
add eax, edx
add esp, 0xc
cmp eax, 1
jne 0x4a5729
mov eax, 0x10000
push eax
mov eax, dword [ebp + 0x18]
push str.database_page_size:
push str.__20s__d_n
push eax
call fcn.00495e80
movzx ecx, byte [esp + 0x46]
mov edx, dword [ebp + 0x18]
push ecx
push str.write_format:
push str.__20s__d_n
push edx
call fcn.00495e80
movzx eax, byte [esp + 0x57]
mov ecx, dword [ebp + 0x18]
push eax
push str.read_format:
push str.__20s__d_n
push ecx
call fcn.00495e80
movzx edx, byte [esp + 0x68]
mov eax, dword [ebp + 0x18]
push edx
push str.reserved_bytes:
push str.__20s__d_n
push eax
call fcn.00495e80
add esp, 0x40
mov ebx, 0x5e4bc8
mov edi, dword [ebx + 4]
movzx esi, byte [esp + edi + 0x24]
movzx ecx, byte [esp + edi + 0x25]
movzx edx, byte [esp + edi + 0x26]
movzx eax, byte [esp + edi + 0x27]
shl esi, 8
add esi, ecx
mov ecx, dword [ebx]
shl esi, 8
add esi, edx
mov edx, dword [ebp + 0x18]
shl esi, 8
add esi, eax
push esi
push ecx
push str.__20s__u
push edx
call fcn.00495e80
add esp, 0x10
cmp edi, 0x38
jne 0x4a5806
cmp esi, 1
jne 0x4a57e0
mov eax, dword [ebp + 0x18]
push str.__utf8_
push eax
jmp 0x4a57fe
cmp esi, 2
jne 0x4a57f0
mov ecx, dword [ebp + 0x18]
push str.__utf16le_
push ecx
jmp 0x4a57fe
cmp esi, 3
jne 0x4a5806
mov edx, dword [ebp + 0x18]
push str.__utf16be_
push edx
call fcn.0058a18d
add esp, 8
mov eax, dword [ebp + 0x18]
push 0x5e3458
push eax
call fcn.0058a18d
add ebx, 8
add esp, 8
cmp ebx, 0x5e4c28
jl 0x4a5790
mov esi, dword [esp + 0x14]
test esi, esi
jne 0x4a583d
push str.main.sqlite_master
call fcn.004d32a0
add esp, 4
jmp 0x4a5887
mov ecx, 0x5e53b4
mov eax, esi
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x4a5864
test dl, dl
je 0x4a5860
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x4a5864
add eax, 2
add ecx, 2
test dl, dl
jne 0x4a5844
xor eax, eax
jmp 0x4a5869
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x4a5879
push str.sqlite_temp_master
push 0x5e35b8
jmp 0x4a587f
push esi
push str.__w_.sqlite_master
call fcn.004d32a0
add esp, 8
mov dword [esp + 0x18], eax
mov esi, 0x5e4c28
mov ecx, dword [esp + 0x18]
mov edx, dword [esi + 4]
push ecx
push edx
call fcn.004d32a0
mov ecx, dword [ebp]
mov edi, eax
xor ebx, ebx
push ebx
lea eax, [esp + 0x28]
push eax
push 0xffffffffffffffff
push edi
push ecx
call fcn.00521340
mov eax, dword [esp + 0x38]
add esp, 0x1c
test eax, eax
je 0x4a58dd
push eax
call fcn.00527980
add esp, 4
cmp eax, 0x64
jne 0x4a58dd
mov edx, dword [esp + 0x1c]
push ebx
push edx
call fcn.004c5d20
add esp, 8
mov ebx, eax
mov eax, dword [esp + 0x1c]
push eax
call fcn.005127b0
push edi
call fcn.004acb60
mov ecx, dword [esi]
mov edx, dword [ebp + 0x18]
push ebx
push ecx
push str.__20s__d_n
push edx
call fcn.00495e80
add esi, 8
add esp, 0x18
cmp esi, 0x5e4c50
jl 0x4a5890
mov eax, dword [esp + 0x18]
push eax
call fcn.004acb60
mov edx, dword [esp + 0x18]
mov eax, dword [ebp]
lea ecx, [esp + 0x24]
push ecx
push 0x23
push edx
push eax
call fcn.004cb580
mov ecx, dword [esp + 0x34]
mov edx, dword [ebp + 0x18]
push ecx
push 0x5e7954
push str.__20s__u_n
push edx
call fcn.00495e80
add esp, 0x24
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
mov ecx, dword [esp + 0x78]
xor ecx, esp
call fcn.00584447
add esp, 0x7c
ret
push str.unable_to_read_database_header_n
call fcn.0058bb1f
add eax, 0x40
push eax
call fcn.0058a18d
mov eax, dword [esp + 0x14]
push eax
call fcn.005127b0
add esp, 0xc
mov ecx, dword [esp + 0x84]
pop esi
pop ebp
pop ebx
xor ecx, esp
mov eax, 1
call fcn.00584447
add esp, 0x7c
ret