Function at 0x401000
Capabilities:
Query environment variable
Set environment variable

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x20
mov eax, dword [0x43600c]
mov ebx, dword [ebp + 8]
xor eax, ebp
mov dword [ebp - 0x10], eax
xor eax, eax
push eax
push eax
push 0x4329fc
call dword [sym.imp.kernel32.dll_GetEnvironmentVariableW]
test eax, eax
je 0x4010ae
xor ecx, ecx
mov edi, eax
dec ecx
add eax, edi
cmovb eax, ecx
push eax
call dword [sym.imp.mozglue.dll_moz_xmalloc]
add esp, 4
mov esi, edi
mov ebx, eax
dec esi
push edi
push eax
push 0x4329fc
call dword [sym.imp.kernel32.dll_GetEnvironmentVariableW]
cmp esi, eax
jne 0x4010a1
xor eax, eax
push eax
push eax
push ebx
call dword [sym.imp.kernel32.dll_ExpandEnvironmentStringsW]
test eax, eax
je 0x4010a1
mov edi, eax
mov ecx, 0xffffffff
add eax, edi
cmovb eax, ecx
push eax
call dword [sym.imp.mozglue.dll_moz_xmalloc]
add esp, 4
mov esi, eax
push edi
push eax
push ebx
call dword [sym.imp.kernel32.dll_ExpandEnvironmentStringsW]
test eax, eax
je 0x401097
push esi
push 0x4329fc
call dword [sym.imp.kernel32.dll_SetEnvironmentVariableW]
push esi
call dword [sym.imp.mozglue.dll_free]
add esp, 4
push ebx
call dword [sym.imp.mozglue.dll_free]
add esp, 4
mov ebx, dword [ebp + 8]
push 0x432b9e
call dword [sym.imp.kernel32.dll_SetDllDirectoryW]
xor ecx, ecx
lea eax, [ebx + 1]
mov edx, 4
dec ecx
mul edx
mov esi, eax
cmovo esi, ecx
push esi
call dword [sym.imp.mozglue.dll_moz_xmalloc]
add esp, 4
test ebx, ebx
mov dword [ebp - 0x24], eax
jle 0x401162
mov dword [ebp - 0x20], esi
xor esi, esi
mov eax, dword [ebp + 0xc]
mov eax, dword [eax + esi*4]
mov dword [ebp - 0x28], eax
push eax
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_wcslen]
add esp, 4
mov ebx, eax
lea eax, [eax + eax*2 + 2]
push eax
call dword [sym.imp.mozglue.dll_moz_xmalloc]
add esp, 4
xor ecx, ecx
mov edi, eax
lea eax, [ebx + ebx*2 + 1]
push ecx
push ecx
push eax
push edi
push ebx
mov ebx, dword [ebp + 8]
push dword [ebp - 0x28]
push ecx
push 0xfde9
call dword [sym.imp.kernel32.dll_WideCharToMultiByte]
mov ecx, dword [ebp - 0x24]
mov byte [edi + eax], 0
mov dword [ecx + esi*4], edi
inc esi
cmp ebx, esi
jne 0x4010e5
mov esi, dword [ebp - 0x24]
mov dword [esi + ebx*4], 0
push dword [ebp - 0x20]
call dword [sym.imp.mozglue.dll_moz_xmalloc]
add esp, 4
mov edi, eax
lea eax, [ebx*4]
push eax
push esi
push edi
call sub.VCRUNTIME140.dll_memcpy
add esp, 0xc
jmp 0x401175
mov dword [eax + ebx*4], 0
push esi
call dword [sym.imp.mozglue.dll_moz_xmalloc]
add esp, 4
mov edi, eax
lea esi, [ebp - 0x1c]
mov dword [esi], 0
push esi
call sub.xul.dll_XRE_GetBootstrap
add esp, 4
mov eax, dword [esi]
mov dword [ebp - 0x28], eax
push 1
call dword [sym.imp.mozglue.dll_void___cdecl_DllBlocklist_Initialize_unsigned_int_]
add esp, 4
test ebx, ebx
jle 0x401282
xor eax, eax
mov esi, dword [ebp - 0x24]
cmp dword [sym.plugin_container.exe_g_shared_section], eax
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x14], eax
jne 0x40128e
mov edx, dword [esi + ebx*4 - 4]
mov esi, dword [ebp - 0x28]
lea eax, [ebx - 1]
mov dword [ebp - 0x20], eax
mov ecx, dword [esi]
mov dword [ebp - 0x2c], edx
mov ebx, dword [ecx + 0x28]
mov ecx, ebx
call dword [section..00cfg]
mov ecx, esi
push dword [ebp - 0x2c]
call ebx
mov eax, dword [esi]
mov ebx, dword [eax + 0x24]
mov ecx, ebx
call dword [section..00cfg]
mov ecx, esi
call ebx
cmp eax, 9
je 0x4012a9
mov eax, dword [esi]
mov ebx, dword [eax + 0x2c]
mov ecx, ebx
call dword [section..00cfg]
lea eax, [ebp - 0x1c]
mov ecx, esi
push eax
mov esi, dword [ebp - 0x24]
push esi
push dword [ebp - 0x20]
call ebx
shr eax, 0x1f
mov ebx, dword [ebp + 8]
mov ecx, esi
mov dword [ebp - 0x20], eax
mov esi, dword [ebp - 0x28]
test esi, esi
je 0x40123c
mov eax, dword [esi]
mov ebx, dword [eax + 4]
mov ecx, ebx
call dword [section..00cfg]
mov ecx, esi
call ebx
mov ecx, dword [ebp - 0x24]
mov ebx, dword [ebp + 8]
push ecx
call dword [sym.imp.mozglue.dll_free]
add esp, 4
test ebx, ebx
je 0x401263
mov esi, dword [sym.imp.mozglue.dll_free]
mov eax, dword [edi + ebx*4 - 4]
dec ebx
test eax, eax
je 0x40125f
push eax
call esi
add esp, 4
test ebx, ebx
jne 0x401250
push edi
call dword [sym.imp.mozglue.dll_free]
add esp, 4
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0042ee00
mov eax, dword [ebp - 0x20]
add esp, 0x20
pop esi
pop edi
pop ebx
pop ebp
ret
mov ecx, dword [ebp - 0x24]
mov dword [ebp - 0x20], 3
jmp 0x40121e
call fcn.0042b3f0
test eax, eax
mov dword [ebp - 0x1c], eax
je 0x4012b6
mov ebx, dword [ebp + 8]
mov dword [ebp - 0x18], 0x405230
jmp 0x4011b9
call fcn.0042b500
mov dword [ebp - 0x14], eax
jmp 0x4011f7
xor eax, eax
inc eax
jmp 0x401216