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.00403fac
mov esp, ebp
pop ebp
ret 0x10
push edi
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
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 0x403a81
mov edi, 3
jmp 0x403b4f
push 0xffffffffffffffff
call dword [sym.imp.KERNEL32.dll_AttachConsole]
test eax, eax
je 0x403b3d
push 1
call fcn.00405430
push eax
push 0x407e20
push str.CONOUT_
call sub.msvcrt.dll_freopen
push 2
call fcn.00405430
push eax
push 0x407e20
push str.CONOUT_
call sub.msvcrt.dll_freopen
push 1
call fcn.00405430
push eax
call sub.msvcrt.dll__fileno
mov edi, dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableA]
add esp, 0x28
test eax, eax
js 0x403b01
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.00405430
push eax
call sub.msvcrt.dll__fileno
add esp, 8
test eax, eax
js 0x403b3d
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.import_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_ntry:_n____fd__os.open_CONOUT___os.O_RDWR__os.O_BINARY__n____fp__os.fdopen_fd__w__n____sys.stdout__fp_n____sys.stderr__fp_n____attached__True_nexcept_Exception_as_e:_n____fp__open_os.devnull__w__errorsignore__n____sys.stdout__fp_n____sys.stderr__fp_n____attached__False_nsys.argv___PYSTAND_SCRIPT___sys.argv_1:__ntext__open_PYSTAND_SCRIPT__rb_.read___nenviron____file__:_PYSTAND_SCRIPT____name__:___main___nenviron___package_____None_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
mov edi, eax
lea ecx, [ebp - 0xdc]
call fcn.00401e50
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 4]
mov eax, edi
pop edi
xor ecx, ebp
pop esi
call fcn.00403fac
mov esp, ebp
pop ebp
ret 0x10