Function at 0x401140
Capabilities:
Create thread
Query environment variable
Read file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x10640
call fcn.00406050
mov eax, dword [0x42d008]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
mov ebx, edx
mov esi, ecx
mov dword [ebp - 0x1062c], esi
test ebx, ebx
je 0x4060f5
push edi
push 0x5c
push ebx
call dword [sym.imp.VCRUNTIME140.dll_strrchr]
mov edi, eax
add esp, 8
test edi, edi
je 0x406102
sub edi, ebx
inc edi
lea eax, [edi + 8]
push eax
call dword [sym.imp.mozglue.dll_malloc]
push edi
mov esi, eax
push ebx
push esi
mov dword [ebp - 0x10620], esi
call sub.VCRUNTIME140.dll_memcpy
mov eax, dword [str.xul.dll]
add esp, 0x10
mov dword [esi + edi], eax
mov ecx, esi
mov eax, dword [0x427620]
mov dword [esi + edi + 4], eax
xor edi, edi
mov dl, byte [esi]
test dl, dl
je 0x40610f
mov ebx, 0x4267cc
mov dh, 0x2f
cmp dh, dl
lea ebx, [ebx + 1]
mov dh, byte [ebx]
mov eax, ecx
cmovne eax, edi
mov edi, eax
test dh, dh
jne 0x4011c8
mov dl, byte [ecx + 1]
inc ecx
test dl, dl
jne 0x4011c1
test edi, edi
je 0x40610f
sub edi, esi
cmp edi, 0xf0
ja 0x40617a
push edi
lea eax, [ebp - 0x108]
push esi
push eax
call sub.VCRUNTIME140.dll_memcpy
movups xmm0, xmmword [0x427608]
mov eax, dword [0x427618]
lea ebx, [ebp - 0x107]
add esp, 0xc
add ebx, edi
movups xmmword [ebp + edi - 0x108], xmm0
mov dword [ebp + edi - 0xf8], eax
push str.MOZ_RUN_GTEST
mov dword [ebp - 0x10624], ebx
call dword [sym.imp.api_ms_win_crt_environment_l1_1_0.dll_getenv]
add esp, 4
test eax, eax
jne 0x406140
push 0x104
lea eax, [ebp - 0x61c]
push eax
push 0xffffffffffffffff
lea eax, [ebp - 0x108]
push eax
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
lea eax, [ebp - 0x61c]
push 0x4267e4
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__wfopen]
add esp, 8
mov dword [ebp - 0x10620], eax
test eax, eax
je 0x40617a
push eax
lea eax, [ebp - 0x20c]
mov byte [ebx], 0
push 0x104
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fgets]
mov edi, dword [ebp - 0x10620]
add esp, 0xc
test eax, eax
je 0x40145f
lea ecx, [ebp - 0x20c]
lea edx, [ecx + 1]
nop dword [eax]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x4012c0
sub ecx, edx
je 0x401441
cmp byte [ebp - 0x20c], 0x23
je 0x401441
cmp byte [ebp + ecx - 0x20d], 0xa
jne 0x4012fc
lea eax, [ecx - 1]
cmp eax, 0x104
jae 0x4014cb
mov byte [ebp + eax - 0x20c], 0
lea eax, [ebp - 0x108]
sub ecx, eax
add ecx, ebx
cmp ecx, 0x104
ja 0x406170
lea ecx, [ebp - 0x20c]
mov edx, ebx
mov eax, ecx
sub edx, eax
nop
mov al, byte [ecx]
lea ecx, [ecx + 1]
mov byte [edx + ecx - 1], al
test al, al
jne 0x401320
push 0x104
lea eax, [ebp - 0x414]
push eax
push 0xffffffffffffffff
lea eax, [ebp - 0x108]
push eax
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
push 0
push 0x8000000
push 3
push 0
push 1
push 0x80000000
lea eax, [ebp - 0x414]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x4013fb
push 1
lea eax, [ebp - 0x10640]
xorps xmm0, xmm0
push eax
movlpd qword [ebp - 0x10638], xmm0
push dword [ebp - 0x10634]
push dword [ebp - 0x10638]
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
je 0x4013f4
xor edi, edi
push 0
lea eax, [ebp - 0x10630]
push eax
push 0x10000
lea eax, [ebp - 0x1061c]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x4013dd
cmp dword [ebp - 0x10630], 0x10000
jne 0x4013dd
add edi, 0x10000
cmp edi, 0xffffffff
jb 0x4013a6
push 0
push 0
push dword [ebp - 0x1063c]
push dword [ebp - 0x10640]
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 8
push 0
lea eax, [ebp - 0x414]
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryExW]
mov edi, eax
test edi, edi
je 0x406163
push 8
call dword [sym.imp.mozglue.dll_moz_xmalloc]
mov ebx, dword [ebp - 0x10624]
add esp, 4
test eax, eax
je 0x40143b
mov ecx, dword [0x42e27c]
mov dword [eax + 4], ecx
mov dword [eax], edi
mov dword [0x42e27c], eax
mov edi, dword [ebp - 0x10620]
push edi
lea eax, [ebp - 0x20c]
push 0x104
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fgets]
add esp, 0xc
test eax, eax
jne 0x4012b4
push edi
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
mov eax, dword [0x42e27c]
add esp, 4
push str.XRE_GetBootstrap
push dword [eax]
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
je 0x40617a
lea ecx, [ebp - 0x10628]
mov dword [ebp - 0x10628], 0
push ecx
call eax
mov edi, dword [ebp - 0x1062c]
mov eax, dword [ebp - 0x10628]
push esi
mov dword [ebp - 0x10628], 0
mov dword [edi], eax
call dword [sym.imp.mozglue.dll_free]
add esp, 8
mov eax, edi
pop edi
mov ecx, dword [ebp - 4]
pop esi
xor ecx, ebp
pop ebx
call fcn.00405160
mov esp, ebp
pop ebp
ret
call fcn.004057b6
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x14
push ebx
push esi
mov esi, ecx
mov eax, dword [esi + 4]
push edi
lea edi, [esi + 4]
test eax, eax
jne 0x406195
cmp dword [esi + 0x28], 0
jne 0x40619e
lea eax, [esi + 0x10]
push eax
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
push 0
push 0
push 0
push 0xffffffffffffffff
call dword [sym.imp.KERNEL32.dll_CreateIoCompletionPort]
mov ebx, eax
cmp dword [edi], ebx
je 0x40156f
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [edi]
mov dword [esp + 0x10], eax
mov dword [esp + 0x14], ecx
test ecx, ecx
jne 0x4061a8
test ebx, ebx
je 0x401568
cmp ebx, 0xffffffff
je 0x401568
mov dword [edi], ebx
call fcn.00401784
mov dword [esp + 0x1c], eax
mov eax, dword [ebp + 4]
mov ecx, dword [0x42e280]
mov dword [esp + 0x18], eax
test ecx, ecx
je 0x40621d
push dword [esp + 0x1c]
mov eax, dword [ecx]
push dword [esp + 0x1c]
push edi
push ebx
call dword [eax + 4]
mov eax, dword [esp + 0x10]
push eax
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, dword [edi]
test eax, eax
je 0x40167a
cmp eax, 0xffffffff
je 0x40167a
push 0
push 0
push 1
push 0
call dword [sym.imp.KERNEL32.dll_CreateEventW]
mov edi, eax
lea ebx, [esi + 8]
cmp dword [ebx], edi
je 0x4015f4
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [ebx]
mov dword [esp + 0x10], eax
mov dword [esp + 0x1c], ecx
test ecx, ecx
jne 0x40622d
test edi, edi
je 0x4015ed
cmp edi, 0xffffffff
je 0x4015ed
mov dword [ebx], edi
call fcn.00401784
mov dword [esp + 0x1c], eax
mov eax, dword [ebp + 4]
mov ecx, dword [0x42e280]
mov dword [esp + 0x18], eax
test ecx, ecx
je 0x4062a2
push dword [esp + 0x1c]
mov eax, dword [ecx]
push dword [esp + 0x1c]
push ebx
push edi
call dword [eax + 4]
mov eax, dword [esp + 0x10]
push eax
call dword [sym.imp.KERNEL32.dll_SetLastError]
push 0
push 0
push esi
push 0x4036f0
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateThread]
add esi, 0xc
mov edi, eax
cmp dword [esi], edi
je 0x401666
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
mov eax, dword [esi]
mov dword [esp + 0x14], eax
test eax, eax
jne 0x4062b2
test edi, edi
je 0x40165f
cmp edi, 0xffffffff
je 0x40165f
mov dword [esi], edi
call fcn.00401784
mov dword [esp + 0x1c], eax
mov eax, dword [ebp + 4]
mov ecx, dword [0x42e280]
mov dword [esp + 0x18], eax
test ecx, ecx
je 0x406320
push dword [esp + 0x1c]
mov eax, dword [ecx]
push dword [esp + 0x1c]
push esi
push edi
call dword [eax + 4]
push ebx
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, dword [esi]
test eax, eax
je 0x40167a
cmp eax, 0xffffffff
je 0x40167a
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, 1
jmp 0x401673
mov dword [esi], 0
mov eax, esi
jmp 0x4014bb
mov dword [esi], 0
mov eax, esi
jmp 0x4014ba
mov ax, word [0x42770c]
lea ebx, [ebp - 0x108]
movups xmm0, xmmword [str.dependentlibs.list]
mov word [ebp - 0xf8], ax
mov al, byte [0x42770e]
movups xmmword [ebp - 0x108], xmm0
mov byte [ebp - 0xf6], al
jmp 0x40122c
lea edi, [ebp - 0x108]
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x406147
mov esi, str..gtest
movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
movsb byte es:[edi], byte [esi]
mov esi, dword [ebp - 0x10620]
jmp 0x401248
call fcn.004256ac
push dword [ebp - 0x10620]
jmp 0x406171
push edi
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
add esp, 4
mov edi, dword [ebp - 0x1062c]
push esi
mov dword [edi], 0
call dword [sym.imp.mozglue.dll_free]
add esp, 4
jmp 0x4014b8
cmp eax, 0xffffffff
je 0x4014ec
mov eax, 8
jmp 0x401673
cmp ecx, 0xffffffff
je 0x40152c
call fcn.00401784
mov dword [esp + 0x18], eax
mov eax, dword [ebp + 4]
mov edx, dword [0x42e280]
mov dword [esp + 0x1c], eax
test edx, edx
jne 0x4061da
call fcn.0040e105
mov edx, dword [0x42e280]
mov ecx, dword [esp + 0x14]
push dword [esp + 0x18]
mov eax, dword [edx]
push dword [esp + 0x20]
push edi
push ecx
mov ecx, edx
call dword [eax + 8]
mov ecx, dword [0x42e280]
mov eax, dword [edi]
mov dword [esp + 0x1c], eax
test ecx, ecx
jne 0x406206
call fcn.0040e105
mov ecx, dword [0x42e280]
mov eax, dword [ecx]
push dword [esp + 0x1c]
call dword [eax]
mov eax, dword [esp + 0x10]
mov dword [edi], 0
jmp 0x40152c
call fcn.0040e105
mov ecx, dword [0x42e280]
jmp 0x401555
cmp ecx, 0xffffffff
je 0x4015b1
call fcn.00401784
mov dword [esp + 0x18], eax
mov eax, dword [ebp + 4]
mov edx, dword [0x42e280]
mov dword [esp + 0x14], eax
test edx, edx
jne 0x40625f
call fcn.0040e105
mov edx, dword [0x42e280]
mov ecx, dword [esp + 0x1c]
push dword [esp + 0x18]
mov eax, dword [edx]
push dword [esp + 0x18]
push ebx
push ecx
mov ecx, edx
call dword [eax + 8]
mov ecx, dword [0x42e280]
mov eax, dword [ebx]
mov dword [esp + 0x1c], eax
test ecx, ecx
jne 0x40628b
call fcn.0040e105
mov ecx, dword [0x42e280]
mov eax, dword [ecx]
push dword [esp + 0x1c]
call dword [eax]
mov eax, dword [esp + 0x10]
mov dword [ebx], 0
jmp 0x4015b1
call fcn.0040e105
mov ecx, dword [0x42e280]
jmp 0x4015da
cmp eax, 0xffffffff
je 0x401627
call fcn.00401784
mov dword [esp + 0x1c], eax
mov eax, dword [ebp + 4]
mov ecx, dword [0x42e280]
mov dword [esp + 0x18], eax
test ecx, ecx
jne 0x4062e0
call fcn.0040e105
mov ecx, dword [0x42e280]
push dword [esp + 0x1c]
mov eax, dword [ecx]
push dword [esp + 0x1c]
push esi
push dword [esp + 0x20]
call dword [eax + 8]
mov ecx, dword [0x42e280]
mov eax, dword [esi]
mov dword [esp + 0x1c], eax
test ecx, ecx
jne 0x40630d
call fcn.0040e105
mov ecx, dword [0x42e280]
mov eax, dword [ecx]
push dword [esp + 0x1c]
call dword [eax]
mov dword [esi], 0
jmp 0x401627
call fcn.0040e105
mov ecx, dword [0x42e280]
jmp 0x401650