Function at 0x4c3860
Capabilities:
Reference sql statements

Disassembly:
sub esp, 0xd8
push ebx
mov ebx, dword [esp + 0xe4]
push ebp
push esi
push edi
push ebx
lea eax, [esp + 0xcc]
push 0x53c768
push eax
mov dword [esp + 0x2c], 0x549bbc
mov dword [esp + 0x30], str.sqlite_master
mov dword [esp + 0x34], 0x549ba8
mov dword [esp + 0x38], str.CREATE_TABLE_sqlite_master__n__type_text__n__name_text__n__tbl_name_text__n__rootpage_integer__n__sql_text_n_
call fcn.004e8361
mov esi, dword [esp + 0xf8]
mov edx, dword [esp + 0x100]
lea ecx, [esp + 0xd4]
lea eax, [esp + 0x2c]
mov dword [esp + 0x3c], ecx
push 0
push eax
lea ecx, [esp + 0x2c]
push 5
push ecx
mov dword [esp + 0x50], 0
mov dword [esp + 0x34], esi
mov dword [esp + 0x38], edx
call fcn.004c33b0
push str.main
push str.sqlite_master
push esi
call fcn.004c6020
add esp, 0x28
test eax, eax
je 0x4c38fb
mov byte [eax + 0x1c], 1
test ebx, ebx
jne 0x4c3944
lea edx, [esp + 0x20]
push ebx
push edx
lea eax, [esp + 0x20]
push 5
push eax
mov dword [esp + 0x34], str.sqlite_temp_master
mov dword [esp + 0x3c], str.CREATE_TEMP_TABLE_sqlite_temp_master__n__type_text__n__name_text__n__tbl_name_text__n__rootpage_integer__n__sql_text_n_
mov dword [esp + 0x40], 0x549b88
call fcn.004c33b0
push str.temp
push str.sqlite_temp_master
push esi
call fcn.004c6020
add esp, 0x1c
test eax, eax
je 0x4c3944
mov byte [eax + 0x1c], 1
mov ecx, dword [esi + 4]
lea ebp, [ebx + ebx*2]
shl ebp, 5
mov eax, dword [ecx + ebp + 4]
test eax, eax
jne 0x4c3960
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xd8
ret
mov edx, dword [eax]
lea ecx, [esp + 0x10]
push ecx
push 0
push 2
push eax
call dword [edx + 0x34]
mov edi, eax
add esp, 0x10
test edi, edi
je 0x4c39a1
push 0
push edi
call fcn.004c4120
mov edx, dword [esp + 0xfc]
add esp, 4
push eax
push edx
call fcn.004c45d0
add esp, 0xc
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xd8
ret
mov eax, dword [esi + 4]
lea edx, [esp + 0x38]
push edx
mov eax, dword [eax + ebp + 4]
push eax
mov ecx, dword [eax]
call dword [ecx + 0x38]
mov edi, eax
add esp, 8
test edi, edi
je 0x4c39ef
push 0
push edi
call fcn.004c4120
add esp, 4
push eax
mov eax, dword [esp + 0xfc]
push eax
call fcn.004c45d0
mov eax, dword [esp + 0x1c]
push eax
mov ecx, dword [eax]
call dword [ecx + 0x30]
add esp, 0x10
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xd8
ret
mov edx, dword [esi + 4]
mov eax, dword [esp + 0x3c]
test ebx, ebx
mov dword [edx + ebp + 8], eax
jne 0x4c3a7d
mov ecx, dword [esp + 0x3c]
mov eax, dword [esp + 0x44]
mov dword [esi + 0xd0], ecx
mov cl, byte [esp + 0x40]
test eax, eax
mov byte [esi + 0xcc], cl
jne 0x4c3a1f
mov eax, 0x7d0
mov dword [esi + 0xd4], eax
mov al, byte [esp + 0x48]
test al, al
mov byte [esi + 0xcd], al
jne 0x4c3a3a
mov byte [esi + 0xcd], 2
test cl, cl
jne 0x4c3a47
mov byte [esi + 0xcc], 4
jmp 0x4c3a9f
cmp cl, 4
jbe 0x4c3a9f
mov eax, dword [esp + 0x10]
push eax
mov edx, dword [eax]
call dword [edx + 0x30]
mov eax, dword [esp + 0xf8]
push 0
push str.unsupported_file_format
push eax
call fcn.004c45d0
add esp, 0x10
mov eax, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xd8
ret
mov al, byte [esi + 0xcc]
mov ecx, dword [esp + 0x40]
mov edx, eax
and edx, 0xff
cmp edx, ecx
jne 0x4c3c15
cmp al, 4
jb 0x4c3c15
mov eax, dword [esi + 4]
mov edx, dword [esi + 0xd4]
push edx
mov eax, dword [eax + ebp + 4]
push eax
mov ecx, dword [eax]
call dword [ecx + 4]
mov ecx, dword [esp + 0x50]
add esp, 8
test ecx, ecx
jne 0x4c3ac3
mov ecx, 2
mov eax, dword [esi + 4]
push ecx
mov eax, dword [eax + ebp + 4]
push eax
mov edx, dword [eax]
call dword [edx + 8]
mov ecx, 0x1a
xor eax, eax
lea edi, [esp + 0x68]
add esp, 8
rep stosd dword es:[edi], eax
lea eax, [esp + 0x18]
mov dword [esp + 0x60], esi
test ebx, ebx
mov dword [esp + 0x68], fcn.004c33b0
mov dword [esp + 0x6c], eax
mov byte [esp + 0x9a], 1
mov byte [esp + 0x9e], 1
jne 0x4c3b35
mov al, byte [esi + 0xcc]
cmp al, 2
mov eax, str.SELECT_type__name__rootpage__sql__1_FROM_sqlite_temp_master_UNION_ALL_SELECT_type__name__rootpage__sql__0_FROM_sqlite_master
jae 0x4c3b1d
mov eax, str.SELECT_type__name__rootpage__sql__1_FROM_sqlite_temp_master_UNION_ALL_SELECT_type__name__rootpage__sql__0_FROM_sqlite_master_WHERE_typetable_UNION_ALL_SELECT_type__name__rootpage__sql__0_FROM_sqlite_master_WHERE_typeindex
mov ecx, dword [esp + 0xf4]
lea edx, [esp + 0x60]
push ecx
push eax
push edx
call fcn.004c9790
add esp, 0xc
jmp 0x4c3b8e
mov eax, dword [esi + 4]
mov dword [esp + 0x14], 0
push 0
push str._.sqlite_master
mov ecx, dword [eax + ebp]
lea edx, [esp + 0xd0]
push ecx
push str._FROM__
push edx
lea eax, [esp + 0x28]
push str.SELECT_type__name__rootpage__sql_
push eax
call fcn.004c45d0
mov ecx, dword [esp + 0x110]
mov edx, dword [esp + 0x30]
push ecx
lea eax, [esp + 0x80]
push edx
push eax
call fcn.004c9790
mov ecx, dword [esp + 0x3c]
push ecx
call fcn.004c4480
add esp, 0x2c
mov eax, dword [esp + 0x10]
push eax
mov edx, dword [eax]
call dword [edx + 0x30]
mov eax, dword [0x582830]
add esp, 4
test eax, eax
je 0x4c3bcb
mov eax, dword [esp + 0xf4]
push 0
push str.out_of_memory
push eax
call fcn.004c45d0
push 0
push esi
mov dword [esp + 0x78], 7
call fcn.004c6270
add esp, 0x14
mov eax, dword [esp + 0x64]
test eax, eax
jne 0x4c3bfc
mov ecx, dword [esi + 4]
or byte [ecx + ebp + 0x5e], 4
test ebx, ebx
lea eax, [ecx + ebp + 0x5e]
jne 0x4c3c06
mov esi, dword [esi + 4]
pop edi
or byte [esi + 0xbe], 4
mov eax, dword [esp + 0x60]
pop esi
pop ebp
pop ebx
add esp, 0xd8
ret
push ebx
push esi
call fcn.004c6270
add esp, 8
mov eax, dword [esp + 0x64]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xd8
ret
mov edx, dword [esi + 4]
push 0
test ecx, ecx
mov eax, dword [edx + ebp]
mov ecx, dword [esp + 0xf8]
push eax
jne 0x4c3c30
push str.cannot_attach_empty_database:
jmp 0x4c3c35
push str.incompatible_file_format_in_auxiliary_database:
push ecx
call fcn.004c45d0
mov edx, dword [esi + 4]
add esp, 0x10
mov eax, dword [edx + ebp + 4]
push eax
mov ecx, dword [eax]
call dword [ecx]
mov edx, dword [esi + 4]
add esp, 4
mov eax, 0x18
pop edi
mov dword [edx + ebp + 4], 0
pop esi
pop ebp
pop ebx
add esp, 0xd8
ret