Function at 0x4039f0
Capabilities:
Check mutex on windows
Set environment variable

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xdc
mov eax, dword [0x40a040]
xor eax, ebp
mov dword [ebp - 4], eax
push esi
push str.LUNA_UPDATER_SINGLE
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateMutexW]
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x403a3c
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00403fc7
mov esp, ebp
pop ebp
ret 0x10
push ebx
mov ebx, dword [sym.imp.KERNEL32.dll_CloseHandle]
push esi
call ebx
push str.LUNA_UPDATER_BLOCK
push 0
push 0x40a1a4
call dword [sym.imp.KERNEL32.dll_CreateMutexA]
push str.LunaTranslator_runtime
lea ecx, [ebp - 0xdc]
mov esi, eax
call fcn.00401ac0
lea ecx, [ebp - 0xdc]
call fcn.004029a0
test eax, eax
je 0x403a9e
lea ecx, [ebp - 0xdc]
call fcn.00401e50
push esi
call ebx
pop ebx
mov eax, 3
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00403fc7
mov esp, ebp
pop ebp
ret 0x10
push edi
push 0xffffffffffffffff
call dword [sym.imp.KERNEL32.dll_AttachConsole]
test eax, eax
je 0x403b5b
push 1
call fcn.00405440
push eax
push 0x407f80
push str.CONOUT_
call sub.msvcrt.dll_freopen
push 2
call fcn.00405440
push eax
push 0x407f80
push str.CONOUT_
call sub.msvcrt.dll_freopen
push 1
call fcn.00405440
push eax
call sub.msvcrt.dll__fileno
mov edi, dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableA]
add esp, 0x28
test eax, eax
js 0x403b1f
push eax
lea eax, [ebp - 0x1c]
push eax
call fcn.00401640
add esp, 8
lea eax, [ebp - 0x1c]
cmp dword [ebp - 8], 0xf
cmova eax, dword [ebp - 0x1c]
push eax
push str.PYSTAND_STDOUT
call edi
lea ecx, [ebp - 0x1c]
call fcn.00401cc0
push 0
call fcn.00405440
push eax
call sub.msvcrt.dll__fileno
add esp, 8
test eax, eax
js 0x403b5b
push eax
lea eax, [ebp - 0x1c]
push eax
call fcn.00401640
add esp, 8
lea eax, [ebp - 0x1c]
cmp dword [ebp - 8], 0xf
cmova eax, dword [ebp - 0x1c]
push eax
push str.PYSTAND_STDIN
call edi
lea ecx, [ebp - 0x1c]
call fcn.00401cc0
push str._nimport_sys_nimport_os_nPYSTAND__os.environ_PYSTAND__nPYSTAND_HOME__os.environ_PYSTAND_HOME__nPYSTAND_RUNTIME__os.environ_PYSTAND_RUNTIME__nPYSTAND_SCRIPT__os.environ_PYSTAND_SCRIPT__nsys.path_origin___n_for_n_in_sys.path__nsys.PYSTAND__PYSTAND_nsys.PYSTAND_HOME__PYSTAND_HOME_nsys.PYSTAND_SCRIPT__PYSTAND_SCRIPT_ndef_MessageBox_msg__info__Message_:_n____import_ctypes_n____ctypes.windll.user32.MessageBoxW_None__str_msg___str_info___0__n____return_0_nos.MessageBox__MessageBox_nsys.stdoutsys.stderr_nsys.path.insert_0__._LunaTranslator__n_ntry:_n_tfd__os.open_CONOUT___os.O_RDWR__os.O_BINARY__n_tfp__os.fdopen_fd__w__n_tsys.stdout__fp_n_tsys.stderr__fp_n_tattached__True_nexcept_Exception_as_e:_n____try:_n________fp__open_os.devnull__w__errorsignore___sometimes_FileNotFound_Error:__Errno_2_No_such_file_or_directory:_nul_n________sys.stdout__fp_n________sys.stderr__fp_n________attached__False_n____except:_n________pass_n_nsys.argv___PYSTAND_SCRIPT___sys.argv_1:__ntext__open_PYSTAND_SCRIPT__rb_.read___nenviron____file__:_PYSTAND_SCRIPT____name__:___main___nenviron___package_____None_n_ntry:_n____code__compile_text__PYSTAND_SCRIPT__exec__n____exec_code__environ__nexcept_Exception:_n____if_attached:_n________raise_n____import_traceback__io_n____sio__io.StringIO___n____traceback.print_exc_file__sio__n____os.MessageBox_sio.getvalue____Error__n
lea ecx, [ebp - 0xdc]
call fcn.004030b0
lea ecx, [ebp - 0xdc]
mov edi, eax
call fcn.00401e50
push esi
call ebx
mov ecx, dword [ebp - 4]
mov eax, edi
pop edi
pop ebx
xor ecx, ebp
pop esi
call fcn.00403fc7
mov esp, ebp
pop ebp
ret 0x10