Function at 0x401540
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x274
mov eax, dword [section..data]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x10]
push ebx
push esi
mov esi, dword [ebp + 0xc]
push edi
mov dword [ebp - 0x210], eax
mov eax, dword [ebp + 0x14]
push str.XUL_APP_FILE
mov dword [ebp - 0x21c], esi
mov dword [ebp - 0x228], eax
mov dword [ebp - 0x214], 0
call dword [sym.imp.api_ms_win_crt_environment_l1_1_0.dll_getenv]
mov edi, eax
add esp, 4
test edi, edi
je 0x401630
cmp byte [edi], 0
je 0x401630
mov ecx, dword [ebp - 0x214]
mov dword [ebp - 0x214], 0
test ecx, ecx
je 0x4015b6
mov eax, dword [ecx]
push ecx
call dword [eax + 8]
lea eax, [ebp - 0x214]
push eax
push edi
call dword [0x4060a8]
shr eax, 0x1f
add esp, 8
test al, al
je 0x4015e6
push edi
push str.Invalid_path_found:__s
call fcn.00401490
add esp, 8
mov edi, 0xff
jmp 0x4019be
mov ebx, dword [ebp + 8]
mov dword [ebp - 0x220], ebx
mov eax, dword [ebp - 0x214]
test eax, eax
je 0x4017b6
lea ecx, [ebp - 0x210]
push ecx
push eax
call dword [0x4060ac]
shr eax, 0x1f
add esp, 8
test al, al
je 0x401768
push str.Couldnt_read_application.ini
call fcn.00401490
add esp, 4
mov edi, 0xff
jmp 0x4019be
mov ebx, dword [ebp + 8]
mov dword [ebp - 0x220], ebx
cmp ebx, 1
jle 0x4015ef
lea edi, [esi + 4]
push 0x40441c
push dword [edi]
call fcn.00401260
add esp, 8
test al, al
je 0x401723
cmp ebx, 2
jne 0x401674
push str.Incorrect_number_of_arguments_passed_to__app
call fcn.00401490
add esp, 4
mov edi, 0xff
jmp 0x4019be
mov ecx, dword [ebp - 0x214]
mov dword [ebp - 0x214], 0
test ecx, ecx
je 0x40168e
mov eax, dword [ecx]
push ecx
call dword [eax + 8]
lea eax, [ebp - 0x214]
push eax
push dword [esi + 8]
call dword [0x4060a8]
mov ecx, dword [esi + 8]
add esp, 8
shr eax, 0x1f
push ecx
test al, al
je 0x4016c3
push str.application.ini_path_not_recognized:__s
call fcn.00401490
add esp, 8
mov edi, 0xff
jmp 0x4019be
lea eax, [ebp - 0x108]
push str.XUL_APP_FILE_s
push eax
call fcn.00401000
lea eax, [ebp - 0x108]
push eax
call dword [sym.imp.mozglue.dll_strdup]
push eax
call dword [sym.imp.api_ms_win_crt_environment_l1_1_0.dll__putenv]
add esp, 0x14
test eax, eax
je 0x40170d
lea eax, [ebp - 0x108]
push eax
push str.Couldnt_set__s._n
call fcn.00401490
add esp, 8
mov edi, 0xff
jmp 0x4019be
mov eax, dword [esi]
mov dword [esi + 8], eax
add esi, 8
mov dword [ebp - 0x21c], esi
sub ebx, 2
jmp 0x4015e9
push str.xpcshell
push dword [edi]
call fcn.00401260
add esp, 8
test al, al
je 0x4015ef
cmp ebx, 1
jle 0x40174d
add esi, 8
lea ecx, [ebx - 1]
rep movsd dword es:[edi], dword [esi]
mov esi, dword [ebp - 0x21c]
push dword [ebp - 0x210]
lea eax, [ebx - 1]
push esi
push eax
call dword [0x4060a0]
add esp, 0xc
mov edi, eax
jmp 0x4019be
call dword [sym.imp.mozglue.dll_bool___cdecl_DllBlocklist_CheckStatus_void_]
movzx ecx, al
mov eax, dword [ebp - 0x210]
neg ecx
push 0
sbb ecx, ecx
and ecx, 4
or dword [eax + 0x24], ecx
mov eax, dword [ebp - 0x210]
mov ecx, dword [ebp - 0x228]
mov dword [eax + 0x28], ecx
push dword [ebp - 0x210]
push esi
push ebx
call dword [0x4060a4]
push dword [ebp - 0x210]
mov edi, eax
call dword [0x4060b0]
add esp, 0x14
jmp 0x4019be
push 0x404308
lea ecx, [ebp - 0x274]
call fcn.004022d0
push 0x104
lea eax, [ebp - 0x20c]
xor esi, esi
push eax
push esi
mov dword [ebp - 0x210], esi
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
mov ebx, eax
neg ebx
sbb ebx, ebx
and ebx, 0x7fffbffb
add ebx, 0x80004005
mov ecx, ebx
shr ecx, 0x1f
test cl, cl
je 0x401812
mov eax, dword [ebp - 0x210]
test eax, eax
je 0x40188f
mov ecx, dword [eax]
push eax
call dword [ecx + 8]
jmp 0x40188f
mov ecx, dword [ebp - 0x210]
mov dword [ebp - 0x210], esi
test ecx, ecx
je 0x401828
mov eax, dword [ecx]
push ecx
call dword [eax + 8]
lea eax, [ebp - 0x210]
push eax
push 1
push 2
push 0xffffffffffffffff
lea eax, [ebp - 0x20c]
push eax
lea eax, [ebp - 0x234]
push eax
call fcn.004021b0
add esp, 0x10
lea eax, [ebp - 0x234]
push eax
call fcn.00402150
mov ebx, eax
lea eax, [ebp - 0x234]
push eax
call fcn.00402170
mov eax, ebx
add esp, 0x10
shr eax, 0x1f
test al, al
jne 0x4017fc
mov esi, dword [ebp - 0x210]
push esi
mov eax, dword [esi]
call dword [eax + 4]
mov eax, dword [ebp - 0x210]
test eax, eax
je 0x40188d
mov ecx, dword [eax]
push eax
call dword [ecx + 8]
xor ebx, ebx
shr ebx, 0x1f
test bl, bl
je 0x4018ad
push str.Couldnt_find_the_application_directory._n
call fcn.00401490
add esp, 4
mov edi, 0xff
jmp 0x4019a9
mov dword [ebp - 0x224], 0
lea ecx, [ebp - 0x224]
mov eax, dword [esi]
push ecx
push esi
call dword [eax + 0xc0]
mov eax, dword [ebp - 0x224]
lea edx, [ebp - 0x218]
mov dword [ebp - 0x218], 0
push edx
push eax
mov ecx, dword [eax]
call dword [ecx + 0xb4]
mov edi, dword [ebp - 0x218]
lea eax, [ebp - 0x234]
push 2
push 7
push str.browser
push eax
call fcn.004021b0
mov eax, dword [edi]
lea ecx, [ebp - 0x234]
add esp, 0x10
push ecx
push edi
call dword [eax + 0xc]
lea eax, [ebp - 0x234]
push eax
call fcn.00402170
mov ecx, dword [ebp - 0x270]
add esp, 4
mov edi, dword [ebp - 0x218]
test ecx, ecx
je 0x401937
mov eax, dword [ecx]
push ecx
call dword [eax + 8]
mov dword [ebp - 0x270], edi
test edi, edi
je 0x401947
mov eax, dword [edi]
push edi
call dword [eax + 4]
mov ecx, dword [ebp - 0x228]
mov dword [ebp - 0x24c], ecx
call dword [sym.imp.mozglue.dll_bool___cdecl_DllBlocklist_CheckStatus_void_]
movzx eax, al
neg eax
push 0
sbb eax, eax
and eax, 4
or dword [ebp - 0x250], eax
lea eax, [ebp - 0x274]
push eax
push dword [ebp - 0x21c]
push dword [ebp - 0x220]
call dword [0x4060a4]
mov ecx, dword [ebp - 0x218]
add esp, 0x10
mov edi, eax
test ecx, ecx
je 0x401999
mov edx, dword [ecx]
push ecx
call dword [edx + 8]
mov eax, dword [ebp - 0x224]
test eax, eax
je 0x4019a9
mov ecx, dword [eax]
push eax
call dword [ecx + 8]
test esi, esi
je 0x4019b3
mov eax, dword [esi]
push esi
call dword [eax + 8]
lea ecx, [ebp - 0x274]
call fcn.00402500
mov eax, dword [ebp - 0x214]
test eax, eax
je 0x4019ce
mov ecx, dword [eax]
push eax
call dword [ecx + 8]
mov ecx, dword [ebp - 4]
mov eax, edi
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0040299f
mov esp, ebp
pop ebp
ret