=head1 NAME

box64 - Linux Userspace x86_64 Emulator with a twist

=head1 SYNOPSIS

B<box64> [B<--help>] [B<--version>] I<executable>

=head1 DESCRIPTION

B<Box64> lets you run x86_64 Linux programs (such as games) on non-x86_64 Linux
systems, like ARM (host system needs to be 64-bit little-endian). Since B<Box64>
uses the native versions of some "system" libraries, like libc, libm, SDL, and
OpenGL, it's easy to integrate and use with most applications, and performance
can be surprisingly high in many cases. B<Box64> integrates with DynaRec (dynamic
recompiler) for the ARM64 platform, providing a speed boost between 5 to 10
times faster than using only the interpreter.

=head1 OPTIONS

=over 8

=item B<-h,--help>

Print box64 help and quit.

=item B<-v,--version>

Print box64 version and quit.

=back

=head1 BRIEF USAGE

There are many environment variables to control B<Box64>'s behaviour. In
addition to environment variables, B<Box64> also looks for 2 places for rcfile:
F</etc/box64.box64rc> and F<~/.box64rc>, in the format of .ini files.
Settings priority: F<~/.box64rc> > F</etc/box64.box64rc> > environment variables.
Example:

    [factorio]
    BOX64_DYNAREC_SAFEFLAGS=0
    BOX64_DYNAREC_BIGBLOCK=2
    BOX64_DYNAREC_FORWARD=1024
    BOX64_DYNAREC_CALLRET=1

The special C<[*]> section defines shared rcfile options for all applications.
More specific sections override only the options they define themselves.

=head1 ENVIRONMENT VARIABLES

=over 8


=item B<BOX64_ADDLIBS> =I<XXXX|XXXX:YYYY:ZZZZ>

Add extras to the needed libraries list, rarely needed.

 * XXXX : Add library XXXX to the needed libraries list. 
 * XXXX:YYYY:ZZZZ : Add library XXXX, YYYY and ZZZZ to the needed libraries list. 


=item B<BOX64_AES> =I<0|1>

Expose AES capabilities. Available in WowBox64.

 * 0 : Do not expose AES capabilities. 
 * 1 : Expose AES capabilities. [Default]


=item B<BOX64_ALLOWMISSINGLIBS> =I<0|1>

Allow missing libraries to be ignored.

 * 0 : Do not allow missing libraries. [Default]
 * 1 : Allow missing libraries. 


=item B<BOX64_ARCH> =I<`arm64`|`la64`|`rv64`|`<empty>`>

Specify the architecture in rcfiles to which the current entry applies. This option only takes effect when used inside rcfiles.

 * `arm64` : Only apply current entry for AArch64. 
 * `la64` : Only apply current entry for LoongArch64. 
 * `rv64` : Only apply current entry for RISC-V. 
 * `<empty>` : Apply current entry for all architectures, will be replaced by more specific entries. [Default]


=item B<BOX64_ARGS> =I<XXXX|XXXX YYYY ZZZZ>

Arguments to pass to the guest program, only valid if there is no existing arguments.

 * XXXX : Pass argument XXXX to the program. 
 * XXXX YYYY ZZZZ : Pass arguments XXXX, YYYY and ZZZZ to the guest program. 


=item B<BOX64_AVX> =I<0|1|2>

Expose AVX extension to CPUID and cpuinfo file. Default value is 2 on Arm64 and LoongArch64 because it's fully implemented in DynaRec, 0 otherwise. Available in WowBox64.

 * 0 : Do not expose AVX capabilities. 
 * 1 : Expose AVX, BMI1, F16C and VAES extensions to CPUID and cpuinfo file. 
 * 2 : All in 1, plus AVX2, BMI2, FMA, ADX,VPCLMULQDQ and RDRAND extensions. 


=item B<BOX64_BASH> =I<XXXX>

Path to the bash executable.

 * XXXX : Use bash executable at path XXXX. 


=item B<BOX64_CPUTYPE> =I<0|1>

Specify the CPU type to emulate. Available in WowBox64.

 * 0 : Emulate a Intel CPU Model. [Default]
 * 1 : Emulate a AMD CPU Model. 


=item B<BOX64_DLSYM_ERROR> =I<0|1>

Enable or disable the logging of dlsym errors.

 * 0 : Disable the logging of dlsym errors. [Default]
 * 1 : Enable the logging of dlsym errors. 


=item B<BOX64_DUMP> =I<0|1>

Dump elfloader debug information. Available in WowBox64.

 * 0 : Do not dump elfloader debug information. [Default]
 * 1 : Dump elfloader debug information. 


=item B<BOX64_DYNAREC> =I<0|1>

Enable/disable the Dynamic Recompiler (a.k.a DynaRec). This option defaults to 1 if it's enabled in the build options for a supported architecture. Available in WowBox64.

 * 0 : Disable DynaRec. 
 * 1 : Enable DynaRec. 


=item B<BOX64_DYNAREC_ALIGNED_ATOMICS> =I<0|1>

Generate aligned atomics only (only available on Arm64 for now). Available in WowBox64.

 * 0 : Generate unaligned atomics handling code. [Default]
 * 1 : Generate aligned atomics only, which is faster and smaller code size, but will cause SIGBUS for LOCK prefixed opcodes operating on unaligned data addresses. 


=item B<BOX64_DYNAREC_BIGBLOCK> =I<0|1|2|3>

Enable building bigger DynaRec code blocks for better performance. Available in WowBox64.

 * 0 : Do not try to build block as big as possible, suitable for programs using lots of threads and JIT, like Unity. 
 * 1 : Build DynaRec block as big as possible. 
 * 2 : Build DynaRec block bigger, do not stop when block overlaps, but only for blocks in elf memory. [Default]
 * 3 : Build DynaRec block bigger, do not stop when block overlaps, for all type of memory, useful for Wine programs. 


=item B<BOX64_DYNAREC_BLEEDING_EDGE> =I<0|1>

Detect MonoBleedingEdge and apply conservative settings (Linux only).

 * 0 : Do not detect MonoBleedingEdge. 
 * 1 : Detect MonoBleedingEdge and apply BOX64_DYNAREC_BIGBLOCK=0 BOX64_DYNAREC_STRONGMEM=1 when detected. [Default]


=item B<BOX64_DYNAREC_CALLRET> =I<0|1|2>

Optimize CALL/RET opcodes. Available in WowBox64.

 * 0 : Do not optimize CALL/RET, use jump table. 
 * 1 : Try to optimize CALL/RET, skipping the jump table when possible. 
 * 2 : Try to optimize CALL/RET, skipping the jump table when possible, adding code to handle return to dirty/modified block. Does not work on WowBox64. [Default]


=item B<BOX64_DYNAREC_SEP> =I<0|1|2>

Optimize CALL/RET further with Secondary Entry Points (SEP). Has no effect if CALLRET is not enabled Available in WowBox64.

 * 0 : Do not add SEP at CALLRET return [Default]
 * 1 : Add SEP at CALLRET return, on memory that are from known binary files 
 * 2 : Add SEP at CALLRET return for all type of memory. 


=item B<BOX64_DYNAREC_DF> =I<0|1>

Enable or disable the use of deferred flags. Available in WowBox64.

 * 0 : Disable the use of deferred flags. 
 * 1 : Enable the use of deferred flags. [Default]


=item B<BOX64_DYNAREC_DIRTY> =I<0|1|2>

Allow continue running a block that is unprotected and potentially dirty.

 * 0 : Do not allow continue running a block that is unprotected and potentially dirty. [Default]
 * 1 : Allow continue to run a DynaBlock that write data in the same page as code. It can gets faster in loading time of some game but can also get unexpected crashes. 
 * 2 : Will also, when it detects a HotPage, flag that page as NEVERCLEAN, and so it will not be write protected but blocks built from that page will always be tested. It can be faster that way (but some SMC case might not be trapped). 


=item B<BOX64_DYNAREC_NOHOTPAGE> =I<0|1>

Disable detection of hot page (where code is executed and data written at the same time).

 * 0 : Detect hot page [Default]
 * 1 : Do not detect hot page 


=item B<BOX64_DYNAREC_DIV0> =I<0|1>

Enable or disable the generation of division-by-zero exception. Available in WowBox64.

 * 0 : Do not generate the division-by-zero exception. [Default]
 * 1 : Generate the division-by-zero exception. 


=item B<BOX64_DYNAREC_DUMP> =I<0|1|2|3>

Enable DynaRec dump. Available in WowBox64.

 * 0 : Do not dump DynaRec blocks. [Default]
 * 1 : Dump DynaRec blocks. 
 * 2 : Dump DynaRec blocks with some colors. 
 * 3 : Dump only x86 and translated native instructions. 


=item B<BOX64_DYNAREC_DUMP_RANGE> =I<0xXXXXXXXX-0xYYYYYYYY>

Dump DynaRec blocks in the specified range. Available in WowBox64.

 * 0xXXXXXXXX-0xYYYYYYYY : Define the range where DynaBlock gets dumped (inclusive-exclusive). 


=item B<BOX64_DYNAREC_DISASM> =I<0|1>

Try to initialize libZydis for more readable x86 disassembly in dump, trace, crash report, etc.

 * 0 : Do not load Zydis for Dynarec. [Default]
 * 1 : Try to load Zydis for Dynarec. 


=item B<BOX64_DYNAREC_FASTNAN> =I<0|1>

Enable or disable fast NaN handling. Available in WowBox64.

 * 0 : Precisely emulate the -NaN generation like on x86. 
 * 1 : Do not do anything special with -NAN generation, faster. [Default]


=item B<BOX64_DYNAREC_FASTROUND> =I<0|1|2>

Enable or disable fast rounding. Available in WowBox64.

 * 0 : Generate float/double -> int rounding and use current rounding mode for float/double computation like on x86. 
 * 1 : Do not do anything special with edge case rounding, faster. [Default]
 * 2 : Generate float/double -> int rounding using current rounding mode for float/double computation like on x86, but use fast int -> float/double conversion. 


=item B<BOX64_DYNAREC_FORWARD> =I<0|128|256|512|1024>

Define max allowed forward value when building block. Only 0, 128, 256, 512 and 1024 are valid; other values fall back to 128. Available in WowBox64.

 * 0 : No forward value. When current block ends, do not try to go further even if there are previous forward jumps. 
 * 128 : Allow up to 128 bytes of gap between end of the block and the next forward jump. [Default]
 * 256 : Allow up to 256 bytes of gap between end of the block and the next forward jump. 
 * 512 : Allow up to 512 bytes of gap between end of the block and the next forward jump. 
 * 1024 : Allow up to 1024 bytes of gap between end of the block and the next forward jump. 


=item B<BOX64_DYNAREC_GDBJIT> =I<0|1|2|3|0xXXXXXXX-0xYYYYYYY>

The GDBJIT debugging support, only available on build with `-DGDBJIT=ON`, enable it with gdb command: jit-reader-load /usr/local/lib/libbox64gdbjitreader.so.

 * 0 : DynaRec will not generate GDBJIT debuginfo. [Default]
 * 1 : DynaRec will generate GDBJIT debuginfo. 
 * 2 : DynaRec will generate detailed GDBJIT debuginfo with internal state. 
 * 3 : DynaRec will register detailed GDBJIT debuginfo only for DynaBlocks that the guest program trap into, greatly improving performance. 
 * 0xXXXXXXX-0xYYYYYYY : Define the range where DynaRec will generate detailed GDBJIT debuginfo with internal state. 


=item B<BOX64_DYNAREC_LOG> =I<0|1|2|3>

Disable or enable DynaRec logs. Available in WowBox64.

 * 0 : Disable DynaRec logs. [Default]
 * 1 : Enable minimal DynaRec logs. 
 * 2 : Enable debug level DynaRec logs. 
 * 3 : Enable verbose level DynaRec logs. 


=item B<BOX64_DYNAREC_MISSING> =I<0|1|2>

Print missing opcodes. Available in WowBox64.

 * 0 : Do not print the missing opcode. [Default]
 * 1 : Print missing opcodes. 
 * 2 : Print the fallback to scalar opcodes, only valid on RISC-V. 


=item B<BOX64_DYNAREC_NATIVEFLAGS> =I<0|1>

Enable or disable the use of native flags. Available in WowBox64.

 * 0 : Do not use native flags. 
 * 1 : Use native flags when possible. [Default]


=item B<BOX64_DYNAREC_NOHOSTEXT> =I<0|1|xxx,yyy,zzz>

Disable optional host extensions.

 * 0 : Disable nothing. [Default]
 * 1 : Disable all the optional extensions. 
 * xxx,yyy,zzz : Disable selected optional extensions, choices are Arm: `crc32,pmull,aes,atomics,sha1,sha2,uscat,flagm,flagm2,frintts,afp,rndr`, LoongArch: `lasx,lbt,frecipe,lam_bh,lamcas,scq`, and RISC-V: `zba,zbb,zbc,zbs,vector,xtheadba,xtheadbb,xtheadbs,xtheadmemidx,xtheadmempair,xtheadcondmov`. 


=item B<BOX64_DYNAREC_PAUSE> =I<0|1|2|3>

Enable x86 PAUSE emulation, may help the performance of spinlocks. Available in WowBox64.

 * 0 : Ignore x86 PAUSE instruction. [Default]
 * 1 : Use YIELD to emulate x86 PAUSE instruction. 
 * 2 : Use WFI to emulate x86 PAUSE instruction. 
 * 3 : Use SEVL+WFE to emulate x86 PAUSE instruction. 


=item B<BOX64_DYNAREC_PERFMAP> =I<0|1>

Generate map file for Linux perf tool.

 * 0 : DynaRec will not generate perf map. [Default]
 * 1 : DynaRec will generate perf map. 


=item B<BOX64_DYNAREC_PURGE> =I<0|1>

Purge DynaBlocks that haven't been executed recently, based on tick age threshold (BOX64_DYNAREC_PURGE_AGE).

 * 0 : DynaRec will not purge old unused DynaBlocks. [Default]
 * 1 : DynaRec will purge old unused DynaBlocks based on tick age. 


=item B<BOX64_DYNAREC_PURGE_AGE> =I<4096|XXXX>

Tick age threshold for DynaBlock purging (requires BOX64_DYNAREC_PURGE=1).

 * 4096 : Default age threshold. [Default]
 * XXXX : Custom age threshold (range: 10-65536). 


=item B<BOX64_DYNAREC_SAFEFLAGS> =I<0|1|2>

Behaviour of flags emulation on CALL/RET opcodes and other edge cases. Available in WowBox64.

 * 0 : Treat CALL/RET as if it never needs any flags. 
 * 1 : Most of RETs will need flags, most of CALLs will not. [Default]
 * 2 : All CALL/RET will need flags. All edge cases are also handled. 


=item B<BOX64_DYNAREC_STRONGMEM> =I<0|1|2|3|4>

Enable the emulation of x86 strong memory model. Available in WowBox64.

 * 0 : Do not try anything special. [Default]
 * 1 : Enable some memory barriers when writing to memory to emulate the x86 strong memory model in a limited way. 
 * 2 : All in 1, plus memory barriers on SIMD instructions. 
 * 3 : All in 2, plus more memory barriers on a regular basis. 
 * 4 : Mimic x86 TSO similarly to QEMU's approach, for evaluation purposes. 


=item B<BOX64_DYNAREC_TBB> =I<0|1>

Enable or disable libtbb detection.

 * 0 : Do not detect libtbb. 
 * 1 : Detect libtbb and apply conservative settings. [Default]


=item B<BOX64_DYNAREC_TEST> =I<0|1|0xXXXXXXXX-0xYYYYYYYY>

Enable DynaRec execution comparison with the interpreter, very slow, only for testing. Available in WowBox64.

 * 0 : No comparison. [Default]
 * 1 : Each opcode runs on interpreter and on DynaRec, regs and memory are compared and printed when they differ. 
 * 0xXXXXXXXX-0xYYYYYYYY : Define the range where DynaRec is tested (inclusive-exclusive). 


=item B<BOX64_DYNAREC_TEST_NODUP> =I<0|1>

Enable deduplication of IP address where COSIM find a difference. Available in WowBox64.

 * 0 : Show all addresses in error. [Default]
 * 1 : Show address in error only 1 time, even if dump might differs. 


=item B<BOX64_DYNAREC_TEST_NODUMP> =I<0|1>

Do not dump test code when BOX64_DYNAREC_DUMP is enabled. Available in WowBox64.

 * 0 : Dump test code. 
 * 1 : Do not dump test code. [Default]


=item B<BOX64_DYNAREC_TRACE> =I<0|1>

Enable or disable DynaRec trace.

 * 0 : Do not trace DynaRec blocks. [Default]
 * 1 : Trace DynaRec blocks, will slow down the program a lot and generates huge logs. 


=item B<BOX64_DYNAREC_VOLATILE_METADATA> =I<0|1>

Use volatile metadata parsed from PE files, only valid for 64bit Windows games.

 * 0 : Do not use volatile metadata. 
 * 1 : Use volatile metadata, which will guide Box64 for better strong memory emulation. [Default]


=item B<BOX64_DYNAREC_WAIT> =I<0|1>

Wait or not for the building of a DynaRec code block to be ready. Available in WowBox64.

 * 0 : Do not wait and use interpreter instead, might speedup a bit on massive multithread or JIT programs. 
 * 1 : Wait for a DynaRec code block to be ready. [Default]


=item B<BOX64_DYNAREC_WEAKBARRIER> =I<0|1|2>

Tweak the memory barriers to reduce the performance impact by strong memory emulation. Available in WowBox64.

 * 0 : Use regular safe barrier. 
 * 1 : Use weak barriers to have more performance boost. [Default]
 * 2 : All in 1, plus disable the last write barriers. 


=item B<BOX64_DYNAREC_X87DOUBLE> =I<0|1|2>

Force the use of float/double for x87 emulation. Available in WowBox64.

 * 0 : Try to use float when possible for x87 emulation. [Default]
 * 1 : Only use Double for x87 emulation. 
 * 2 : Check Precision Control low precision on x87 emulation. 


=item B<BOX64_DYNAREC_INTERP_SIGNAL> =I<0|1>

Allow the use of DynaRec in Signal Handlers.

 * 0 : Allow the use of DynaRec in signal handlers. [Default]
 * 1 : Only use the Interpreter for signal handlers (as it was in v0.3.8 and earlier). 


=item B<BOX64_DYNACACHE> =I<0|1|2>

Enable/disable the Dynamic Recompiler Cache (a.k.a DynaCache). This option defaults to 1 (enable). DynaCache writes files to the home folder by default, and keeps its folder below BOX64_DYNACACHE_LIMIT when generating new cache files.

 * 0 : Disable DynaCache. 
 * 1 : Enable DynaCache. [Default]
 * 2 : Use DynaCache files if present, but do not generate new one. 


=item B<BOX64_DYNACACHE_FOLDER> =I<XXXX>

Set the folder for DynaCache files. Default is $XDG_CACHE_HOME/box64 or $HOME/.cache/box64 if $XDG_CACHE_HOME is not set.

 * XXXX : Use folder XXXX for DynaCache files. 


=item B<BOX64_DYNACACHE_LIMIT> =I<0|XXXX|2048>

Maximum size, in MiB, for the DynaCache folder. When the limit is exceeded, invalid DynaCache files are removed first, then the oldest valid files are removed if needed. Default size is 2048MiB.

 * 0 : Do not limit the DynaCache folder size. 
 * XXXX : Keep the DynaCache folder below XXXX MiB by removing invalid cache files first, then the oldest valid cache files. 
 * 2048 : A size of 2048 MiB is the default value. [Default]


=item B<BOX64_DYNACACHE_COMPRESS> =I<0|1|2>

Compress or not DynaCache files on disk

 * 0 : Do not compress dynacache files 
 * 1 : Compress dynacache files using Zlib with fastest compression. [Default]
 * 2 : Compress dynacache files using ZLib with default compression. 


=item B<BOX64_DYNACACHE_MIN> =I<XXXX|30>

Minimum size, in KB, for a DynaCache to be written to disk. Default size is 30KB

 * XXXX : Set a minimum size of XXXX KB of DynaRec code to write the dynacache to disk. Will not be saved to disk else. 
 * 30 : A size of 30 KB is the default value. [Default]


=item B<BOX64_EMULATED_LIBS> =I<XXXX|XXXX:YYYY:ZZZZ>

Force the use of emulated libraries.

 * XXXX : Force the use of emulated library XXXX. 
 * XXXX:YYYY:ZZZZ : Force the use of emulated libraries XXXX, YYYY and ZZZZ. 


=item B<BOX64_ENV> =I<XXXX=yyyy>

Add an environment variable.

 * XXXX=yyyy : Add environment variable XXXX with value yyyy. 


=item B<BOX64_ENV[1-5]> =I<XXXX=yyyy>

Add an environment variable.

 * XXXX=yyyy : Add environment variable XXXX with value yyyy. 


=item B<BOX64_EXIT> =I<0|1>

Just exit, do not try to run the program.

 * 0 : Does nothing. [Default]
 * 1 : Just exit. 


=item B<BOX64_FIX_64BIT_INODES> =I<0|1>

Fix 64bit inodes.

 * 0 : Do not fix 64bit inodes. [Default]
 * 1 : Fix 64bit inodes. 


=item B<BOX64_FORCE_LD_PRELOAD> =I<0|1>

Force symbols from BOX64_LD_PRELOAD libraries to be resolved by RTLD_NEXT.

 * 0 : Do nothing. [Default]
 * 1 : Force symbols from BOX64_LD_PRELOAD libraries to be resolved by RTLD_NEXT. 


=item B<BOX64_IGNOREINT3> =I<0|1>

Ignore INT3 instructions.

 * 0 : Trigger a TRAP signal if a handler is present. [Default]
 * 1 : Skip the opcode silently. 


=item B<BOX64_INSERT_ARGS> =I<XXXX|XXXX YYYY ZZZZ>

Prepend arguments to the command line.

 * XXXX : Prepend argument XXXX to the program. 
 * XXXX YYYY ZZZZ : Prepend arguments XXXX, YYYY and ZZZZ to the guest program. 


=item B<BOX64_INPROCESSGPU> =I<0|1>

Add --in-process-gpu argument to the guest program.

 * 0 : Does nothing. [Default]
 * 1 : Add --in-process-gpu argument to the guest program. 


=item B<BOX64_JITGDB> =I<0|1|2|3>

Launch gdb or not for SIGSEGV, SIGILL, and SIGBUS.

 * 0 : Just print the message when the signal is caught. [Default]
 * 1 : Launch gdb when a SIGSEGV, SIGILL or SIGBUS signal is trapped, attached to the offending process and go in an endless loop, waiting. Inside gdb, you need to find the correct thread yourself (the one with `my_box64signalhandler` in its stack), then probably need to `finish` 1 or 2 functions (inside `usleep(..)`) and then you'll be in `my_box64signalhandler`, just before the printf of the Segfault message. Then `set waiting=0` to exit the infinite loop. 
 * 2 : Launch gdbserver when a SIGSEGV, SIGILL or SIGBUS signal is trapped, attached to the offending process, and go in an endless loop, waiting. Use `gdb /PATH/TO/box64` and then `target remote 127.0.0.1: 1234` to connect to the gdbserver (or use actual IP if not on the machine). After that, the procedure is the same as with `BOX64_JITGDB=1`. 
 * 3 : Launch lldb when a SIGSEGV, SIGILL or SIGBUS signal is trapped, attached to the offending process and go in an endless loop, waiting. 


=item B<BOX64_JVM> =I<0|1>

Detect libjvm and apply conservative settings.

 * 0 : Does nothing. 
 * 1 : Detect libjvm, and apply BOX64_DYNAREC_BIGBLOCK=0 BOX64_DYNAREC_STRONGMEM=1 BOX64_SSE42=0 when detected. [Default]


=item B<BOX64_LD_LIBRARY_PATH> =I<XXXX>

Path to look for x86_64 libraries.

 * XXXX : Add path XXXX to the library path. 


=item B<BOX64_LD_PRELOAD> =I<XXXX|XXXX:YYYY>

Force loading libraries with the binary.

 * XXXX : Force the loading of library XXXX. 
 * XXXX:YYYY : Force the loading of libraries XXXX and YYYY. 


=item B<BOX64_LIBCEF> =I<0|1>

Detect libcef and apply BOX64_MALLOC_HACK settings.

 * 0 : Does nothing. [Default]
 * 1 : Detect libcef, and apply BOX64_MALLOC_HACK=2 if detected. 


=item B<BOX64_LIBGL> =I<libXXXX|/path/to/libXXXX>

Set the name for libGL.

 * libXXXX : Set the name for libGL to libXXXX. 
 * /path/to/libXXXX : Set the name and path for libGL to /path/to/libXXXX, you can also use SDL_VIDEO_GL_DRIVER. 


=item B<BOX64_LOAD_ADDR> =I<0xXXXXXXXX>

Set the address where the program is loaded, only active for PIE guest programs.

 * 0xXXXXXXXX : Set the address where the program is loaded. 


=item B<BOX64_LOG> =I<0|1|2|3>

Enable or disable Box64 logs, default value is 0 if stdout is not terminal, 1 otherwise. Available in WowBox64.

 * 0 : Disable Box64 logs. 
 * 1 : Enable minimal Box64 logs. 
 * 2 : Enable debug level Box64 logs. 
 * 3 : Enable verbose level Box64 logs. 


=item B<BOX64_MALLOC_HACK> =I<0|1|2>

Behaviour when hooking malloc operators.

 * 0 : Don't allow malloc operator to be redirected, rewriting code to use regular function. [Default]
 * 1 : Allow malloc operator to be redirected. 
 * 2 : Like 0, but track special mmap/free (some redirected functions are inlined and cannot be redirected). 


=item B<BOX64_MAXCPU> =I<0|XXXX>

Maximum CPU cores exposed. Available in WowBox64.

 * 0 : Use the actual number of CPU cores. [Default]
 * XXXX : Use XXXX CPU cores. 


=item B<BOX64_SKIPCPU> =I<0|XXXX>

Skip N first CPU cores (Is apply before MAXCPU) Available in WowBox64.

 * 0 : Do not skip any CPU cores. [Default]
 * XXXX : Skip XXXX first CPU cores (usefull for big.LITTLE configurations). 


=item B<BOX64_MMAP32> =I<0|1>

Force 32-bit compatible memory mappings on 64-bit programs that run 32-bit code (like Wine WOW64), can improve performance.

 * 0 : Do not force 32-bit memory mappings. 
 * 1 : Force 32-bit memory mappings. [Default]


=item B<BOX64_NOBANNER> =I<0|1>

Disable the Box64 banner. Available in WowBox64.

 * 0 : Show the Box64 banner. 
 * 1 : Do not show the Box64 banner. 


=item B<BOX64_NODYNAREC> =I<0xXXXXXXXX-0xYYYYYYYY>

Forbid DynaBlock creation in the address range specified, helpful for debugging behaviour difference between DynaRec and Interpreter. Available in WowBox64.

 * 0xXXXXXXXX-0xYYYYYYYY : Define the range where DynaBlock creation is forbidden (inclusive-exclusive). 


=item B<BOX64_NODYNAREC_DELAY> =I<0|1>

Remove NoDynaRec range after a delay. Available in WowBox64.

 * 0 : Do not remove NoDynaRec range. [Default]
 * 1 : Remove the NoDynaRec range once 2 threads have been created. 


=item B<BOX64_DYNAREC_NOARCH> =I<0|1|2>

Remove Architecture metadata from DynaRec blocks (used on signal). Available in WowBox64.

 * 0 : Generate all architecture metadata for each blocks, including x87/mmx/SSE/AVX regs tracking. Will use some more memory. [Default]
 * 1 : Generate only essential metadata for each blocks (flags, alignments), saving some memory, but some encrypted software might fail. 
 * 2 : Do not generate metadata for blocks. Saving a bit more memory but might fail on signal handling. 


=item B<BOX64_NOGTK> =I<0|1>

Do not load wrapped GTK libraries.

 * 0 : Load wrapped GTK libraries. [Default]
 * 1 : Do not load wrapped GTK libraries. 


=item B<BOX64_NOPULSE> =I<0|1>

Do not load PulseAudio libraries (both native and x86_64).

 * 0 : Load PulseAudio libraries. [Default]
 * 1 : Do not load PulseAudio libraries. 


=item B<BOX64_NORCFILES> =I<0|1>

Do not load any rc files.

 * 0 : Load rc files. [Default]
 * 1 : Do not load any rc files. 


=item B<BOX64_NOSANDBOX> =I<0|1>

Add --no-sandbox argument to the guest program.

 * 0 : Does nothing. [Default]
 * 1 : Add --no-sandbox argument to the guest program. 


=item B<BOX64_NOSIGSEGV> =I<0|1>

Disable the handling of SIGSEGV.

 * 0 : Let the x86 program set sighandler for SIGSEGV. [Default]
 * 1 : Disable the handling of SIGSEGV. 


=item B<BOX64_NOSIGILL> =I<0|1>

Disable the handling of SIGILL.

 * 0 : Let the x86 program set sighandler for SIGILL. [Default]
 * 1 : Disable the handling of SIGILL. 


=item B<BOX64_NOVULKAN> =I<0|1>

Do not load Vulkan libraries.

 * 0 : Load Vulkan libraries. [Default]
 * 1 : Do not load Vulkan libraries, both native and x86_64. 


=item B<BOX64_NOVULKANOVERLAY> =I<0|1>

Do not load x64 Vulkan overlay.

 * 0 : Try to load x64 Vulkan overlay. [Default]
 * 1 : Do not load x64 Vulkan overlay. 


=item B<BOX64_PATH> =I<XXXX>

Path to look for x86_64 binaries.

 * XXXX : Add path XXXX to the binary path. 


=item B<BOX64_PCLMULQDQ> =I<0|1>

Expose PCLMULQDQ capabilities. Available in WowBox64.

 * 0 : Do not expose PCLMULQDQ capabilities. 
 * 1 : Expose PCLMULQDQ capabilities. [Default]


=item B<BOX64_PREFER_EMULATED> =I<0|1>

Prefer emulated libraries over native ones.

 * 0 : Prefer native libraries over emulated ones. [Default]
 * 1 : Prefer emulated libraries over native ones. 


=item B<BOX64_PREFER_WRAPPED> =I<0|1>

Prefer wrapped libs first even if the lib is specified with absolute path.

 * 0 : Prefer libs with absolute path over wrapped ones. [Default]
 * 1 : Prefer wrapped libs first even if the lib is specified with absolute path. 


=item B<BOX64_PROFILE> =I<safest|safe|default|fast|fastest>

Predefined sets of environment variables with compatibility or performance in mind. Available in WowBox64.

 * safest : Profile with all the unsafe DynaRec optimizations disabled. 
 * safe : Well, less safer than safest. 
 * default : The default settings that most programs runs fine with a handy performance. [Default]
 * fast : Enable many unsafe optimizations, but also enable strongmem emulation. 
 * fastest : Enable many unsafe optimizations to have a better performance. 


=item B<BOX64_PYTHON3> =I<XXXX>

Path to a python3 executable.

 * XXXX : Use python3 executable at path XXXX. 


=item B<BOX64_RCFILE> =I<XXXX>

Path to the rc file to load.

 * XXXX : Load the rc file XXXX, default rc files will not be loaded. 


=item B<BOX64_RDTSC_1GHZ> =I<0|1>

Use hardware counter for rdtsc if available.

 * 0 : Use hardware counter for rdtsc opcode if available. [Default]
 * 1 : Use hardware counter for rdtsc if and only if precision is at least 1GHz. 


=item B<BOX64_RDTSC_INV> =I<0|1>

Report Invariant TSC bit in CPUID for Intel CPU type. Available in WowBox64.

 * 0 : Do not report Invariant TSC for Intel CPU type (default). [Default]
 * 1 : Report Invariant TSC bit in CPUID leaf 0x80000007 for Intel CPU type. 


=item B<BOX64_RESERVE_HIGH> =I<0|1>

Reserve high memory area for the program, always enabled on Box32.

 * 0 : Do not reserve high memory area for the program. [Default]
 * 1 : Reserve high memory area for the program. 


=item B<BOX64_ROLLING_LOG> =I<0|1|XXXX>

Show last few wrapped function call when a signal is caught.

 * 0 : Does nothing. [Default]
 * 1 : Show last 16 wrapped function call when a signal is caught. 
 * XXXX : Show last XXXX wrapped function call when a signal is caught. 


=item B<BOX64_SDL2_JGUID> =I<0|1>

Use a workaround for SDL_GetJoystickGUIDInfo function for wrapped SDL2.

 * 0 : Does nothing. [Default]
 * 1 : Use a workaround for SDL_GetJoystickGUIDInfo function for wrapped SDL2. 


=item B<BOX64_SHAEXT> =I<0|1>

Expose SHAEXT (a.k.a. SHA_NI) capabilities. Available in WowBox64.

 * 0 : Do not expose SHAEXT capabilities. 
 * 1 : Expose SHAEXT capabilities. [Default]


=item B<BOX64_SHOWBT> =I<0|1>

Show native and emulated backtrace when a signal is caught.

 * 0 : Does nothing. [Default]
 * 1 : Show native and emulated backtrace when a signal is caught. 


=item B<BOX64_SHOWSEGV> =I<0|1>

Always show SIGSEGV signal details.

 * 0 : Does nothing. [Default]
 * 1 : Always show SIGSEGV signal details. 


=item B<BOX64_SSE_FLUSHTO0> =I<0|1>

Behaviour of SSE Flush to 0 flags. Also tracking SSE exception flags. Available in WowBox64.

 * 0 : Just track the flag. [Default]
 * 1 : Apply SSE Flush to 0 flag directly. Also reflect SSE exception flags in DynaRec (if available) 


=item B<BOX64_SSE42> =I<0|1>

Expose SSE4.2 capabilities. Available in WowBox64.

 * 0 : Do not expose SSE4.2 capabilities. 
 * 1 : Expose SSE4.2 capabilities. [Default]


=item B<BOX64_STEAM_VULKAN> =I<0|1>

Force Vulkan for Linux Steam UI.

 * 0 : Do nothing. [Default]
 * 1 : Force Vulkan for Linux Steam UI. 


=item B<BOX64_SYNC_ROUNDING> =I<0|1>

Synchronize rounding mode between x86 and native.

 * 0 : Do not synchronize rounding mode. [Default]
 * 1 : Synchronize rounding mode between x86 and native. 


=item B<BOX64_TRACE_COLOR> =I<0|1>

Enable or disable colored trace output.

 * 0 : Disable colored trace output. [Default]
 * 1 : Enable colored trace output. 


=item B<BOX64_TRACE_EMM> =I<0|1>

Enable or disable EMM (i.e. MMX) trace output.

 * 0 : Disable EMM trace output. [Default]
 * 1 : Enable EMM trace output. 


=item B<BOX64_TRACE_FILE> =I<XXXX|XXXX%pid|stderr|stdout>

Send all log and trace to a file instead of `stdout`.

 * XXXX : Send all log and trace to file XXXX. 
 * XXXX%pid : Send all log and trace to file XXXX with pid appended. 
 * stderr : Send all log and trace to `stderr`. [Default]
 * stdout : Send all log and trace to `stdout`. 


=item B<BOX64_TRACE_INIT> =I<0|1|symbolname|0xXXXXXXX-0xYYYYYYY|0xXXXXXXX:0xYYYYYYY:0xZZZZZZZ>

Same as BOX64_TRACE but starts the trace immediately.

 * 0 : Disable trace output. [Default]
 * 1 : Enable trace output. Trace starts before the initialization of dependencies. 
 * symbolname : Enable trace output for `symbolname` only. Trace starts before the initialization of dependencies. 
 * 0xXXXXXXX-0xYYYYYYY : Enable trace output for the range of address (inclusive-exclusive). Trace starts before the initialization of dependencies. 
 * 0xXXXXXXX:0xYYYYYYY:0xZZZZZZZ : Enable trace output only for the specified address list. Trace starts before the initialization of dependencies. 


=item B<BOX64_TRACE_START> =I<0|1|XXXX>

Start trace after N opcodes executed.

 * 0 : Start trace immediately. [Default]
 * 1 : Start trace after 1 opcode executed. 
 * XXXX : Start trace after XXXX opcodes executed. 


=item B<BOX64_TRACE_XMM> =I<0|1>

Enable or disable XMM (i.e. SSE) trace output.

 * 0 : Disable XMM trace output. [Default]
 * 1 : Enable XMM trace output. 


=item B<BOX64_TRACE> =I<0|1|symbolname|0xXXXXXXX-0xYYYYYYY|0xXXXXXXX:0xYYYYYYY:0xZZZZZZZ>

Only available on box64 build with trace. Adds trace of all instructions executed, along with a register dump.

 * 0 : Disable trace output. [Default]
 * 1 : Enable trace output. 
 * symbolname : Enable trace output for `symbolname` only. 
 * 0xXXXXXXX-0xYYYYYYY : Enable trace output for the range of address (inclusive-exclusive). 
 * 0xXXXXXXX:0xYYYYYYY:0xZZZZZZZ : Enable trace output only for the specified address list. 


=item B<BOX64_UNITYPLAYER> =I<0|1>

Detect UnityPlayer and apply conservative settings.

 * 0 : Does nothing. 
 * 1 : Detect UnityPlayer (Windows or Linux), and apply BOX64_UNITY=1 when detected. [Default]


=item B<BOX64_UNITY> =I<0|1>

Games is a Unity one.

 * 0 : Does nothing. 
 * 1 : Unity Game, use special detecting code for Windows, apply BOX64_DYNAREC_STRONGMEM=1 for Linux. [Default]


=item B<BOX64_WRAP_EGL> =I<0|1>

Prefer wrapped libs for EGL and GLESv2.

 * 0 : Prefer emulated libs for EGL and GLESv2. [Default]
 * 1 : Prefer wrapped libs for EGL and GLESv2. 


=item B<BOX64_X11GLX> =I<0|1>

Force Xorg GLX extension to be present.

 * 0 : Do not force Xorg GLX extension to be present. [Default]
 * 1 : Require Xorg GLX extension when using XQueryExtension. 


=item B<BOX64_X11SYNC> =I<0|1>

Force synchronized operation on X11 display.

 * 0 : Do not force synchronized operation on X11 display. [Default]
 * 1 : Force synchronized operation on X11 display. 


=item B<BOX64_X11THREADS> =I<0|1>

Call XInitThreads when loading X11. This is mostly for old Loki games with the Loki_Compat library.

 * 0 : Do not call XInitThreads. [Default]
 * 1 : Call XInitThreads as soon as libX11 is loaded. 


=item B<BOX64_X87_NO80BITS> =I<0|1>

Behaviour of x87 80bits long double. Available in WowBox64.

 * 0 : Try to handle 80bits long double as precise as possible. [Default]
 * 1 : Use 64bits double for x87. 


=item B<BOX64_NOPERSONA32BITS> =I<0|1>

Disable the automatic switch of personality for 32-bit binaries (always enabled on Box32).

 * 0 : Switch personality for 32-bit binaries (if not already tried). [Default]
 * 1 : Do not switch personality for 32-bit binaries. 


=back

=cut
