├── CppCheckSuppressions.txt ├── kernel └── src │ ├── OrbisOS │ ├── SelfStructs.hpp │ ├── asm │ │ ├── entrypoint_trigger │ │ ├── prx.asm │ │ ├── entrypoint_trigger.asm │ │ └── rpcldr.asm │ └── KernelDebug.hpp │ ├── Driver │ └── v1 │ │ ├── Processes │ │ ├── PrisonCtrl.hpp │ │ └── ProcessCtrl.hpp │ │ ├── Trainers │ │ └── TrainerCtrl.hpp │ │ ├── v1.hpp │ │ └── Mira │ │ └── MiraCtrl.hpp │ ├── Boot │ ├── TrainerLoader.S │ ├── Patches │ │ └── Patches650.cpp │ ├── OptionsBlock.cpp │ ├── OptionsBlock.hpp │ └── Patches.cpp │ ├── Utils │ ├── SelfHeader.hpp │ ├── IModule.hpp │ └── _Syscall.s │ ├── Plugins │ ├── SyscallGuard │ │ └── SyscallGuardPlugin.hpp │ └── LogServer │ │ └── LogManager.hpp │ └── Messaging │ └── MessageManager.hpp ├── daemon ├── .gitignore ├── src │ ├── Rpc │ │ ├── Protos │ │ │ ├── PROTOBUF.md │ │ │ ├── Rpc.proto │ │ │ └── Orbis.proto │ │ ├── Status.hpp │ │ ├── Connection.hpp │ │ ├── FileManagerListener.hpp │ │ └── Listener.hpp │ ├── Entry.hpp │ ├── Debugging │ │ ├── Debugger.cpp │ │ ├── Debugger.hpp │ │ └── Instance.hpp │ ├── Utils │ │ ├── IModule.hpp │ │ └── Logger.cpp │ ├── Daemon.hpp │ ├── Daemon.cpp │ └── Entry.cpp └── CMakeLists.txt ├── external ├── freebsd-headers │ ├── include │ │ ├── openssl │ │ │ ├── fips.h │ │ │ ├── fips_rand.h │ │ │ ├── ebcdic.h │ │ │ └── bio_lcl.h │ │ ├── .gitattributes │ │ ├── md5.h │ │ ├── hdb.h │ │ ├── kafs.h │ │ ├── krb5.h │ │ ├── vgl.h │ │ ├── com_err.h │ │ ├── fetch.h │ │ ├── hx509.h │ │ ├── roken.h │ │ ├── sys │ │ │ ├── ata.h │ │ │ ├── cdrio.h │ │ │ ├── dvdio.h │ │ │ ├── consio.h │ │ │ ├── imgact_elf.h │ │ │ ├── termios.h │ │ │ ├── snoop.h │ │ │ ├── dataacq.h │ │ │ ├── fnv_hash.h │ │ │ ├── ptio.h │ │ │ └── _stack.h │ │ ├── com_right.h │ │ ├── heim_asn1.h │ │ ├── heimntlm.h │ │ ├── heim_threads.h │ │ ├── kadm5 │ │ │ ├── admin.h │ │ │ └── private.h │ │ ├── roken-common.h │ │ ├── krb5-v4compat.h │ │ ├── dev │ │ │ ├── ieee488 │ │ │ │ └── upd7210.h │ │ │ ├── ic │ │ │ │ └── i8237.h │ │ │ ├── ppbus │ │ │ │ └── lptio.h │ │ │ └── speaker │ │ │ │ └── speaker.h │ │ ├── gssapi │ │ │ └── gssapi_krb5.h │ │ ├── machine │ │ │ ├── bus.h │ │ │ ├── _align.h │ │ │ ├── apm_bios.h │ │ │ ├── _inttypes.h │ │ │ ├── pci_cfgreg.h │ │ │ ├── clock.h │ │ │ ├── pc │ │ │ │ └── display.h │ │ │ ├── stack.h │ │ │ ├── bus_dma.h │ │ │ ├── mp_watchdog.h │ │ │ └── metadata.h │ │ ├── malloc.h │ │ ├── netinet6 │ │ │ ├── ip6.h │ │ │ └── icmp6.h │ │ ├── gssapi.h │ │ ├── netncp │ │ │ └── ncp_cfg.h │ │ ├── krb5-types.h │ │ ├── netinet │ │ │ ├── ipl.h │ │ │ └── ip_rules.h │ │ ├── ieeefp.h │ │ ├── crypto │ │ │ ├── cast.h │ │ │ └── skipjack.h │ │ ├── k524_err.h │ │ ├── altq │ │ │ └── altqconf.h │ │ ├── security │ │ │ └── openpam_attr.h │ │ ├── nfs │ │ │ └── krpc.h │ │ ├── hdb_err.h │ │ ├── mp.h │ │ ├── asn1_err.h │ │ ├── netatalk │ │ │ ├── endian.h │ │ │ └── phase2.h │ │ ├── hdb-private.h │ │ ├── netgraph │ │ │ ├── ng_sppp.h │ │ │ └── ng_ipfw.h │ │ ├── lwres │ │ │ ├── lang.h │ │ │ ├── version.h │ │ │ ├── int.h │ │ │ └── result.h │ │ ├── cam │ │ │ └── scsi │ │ │ │ └── scsi_iu.h │ │ ├── rpcsvc │ │ │ ├── yppasswd.h │ │ │ ├── crypt.h │ │ │ └── spray.h │ │ ├── clang │ │ │ └── 3.0 │ │ │ │ ├── x86intrin.h │ │ │ │ └── nmmintrin.h │ │ ├── fs │ │ │ └── udf │ │ │ │ ├── osta.h │ │ │ │ └── udf_mount.h │ │ ├── heim_err.h │ │ ├── c++ │ │ │ └── 4.2 │ │ │ │ ├── bits │ │ │ │ └── c++locale_internal.h │ │ │ │ ├── backward │ │ │ │ ├── stream.h │ │ │ │ ├── istream.h │ │ │ │ ├── ostream.h │ │ │ │ ├── streambuf.h │ │ │ │ ├── queue.h │ │ │ │ └── new.h │ │ │ │ └── tr1 │ │ │ │ ├── ctime │ │ │ │ ├── fenv.h │ │ │ │ ├── cstdarg │ │ │ │ ├── ctgmath │ │ │ │ ├── ctype.h │ │ │ │ ├── float.h │ │ │ │ ├── stdio.h │ │ │ │ ├── wchar.h │ │ │ │ ├── limits.h │ │ │ │ ├── stdarg.h │ │ │ │ ├── stdint.h │ │ │ │ ├── tgmath.h │ │ │ │ ├── wctype.h │ │ │ │ ├── stdbool.h │ │ │ │ └── inttypes.h │ │ ├── osreldate.h │ │ ├── nfsserver │ │ │ └── nfs_fha.h │ │ ├── net │ │ │ ├── if_tun.h │ │ │ └── if_enc.h │ │ ├── bitstring.h │ │ ├── gpib │ │ │ └── gpib.h │ │ ├── readline │ │ │ └── rlstdc.h │ │ ├── md2.h │ │ ├── search.h │ │ ├── gnuregex.h │ │ └── kenv.h │ ├── .gitattributes │ └── .gitignore └── mira │ ├── Kernel │ ├── Utils │ │ ├── Stack.hpp │ │ ├── New.hpp │ │ ├── Types.hpp │ │ ├── Dynlib.hpp │ │ ├── Stack.cpp │ │ ├── Dynlib.cpp │ │ ├── Logger.cpp │ │ ├── New.cpp │ │ └── Kdlsym.hpp │ └── Boot │ │ ├── Patches.hpp │ │ └── InitParams.hpp │ ├── Driver │ ├── Prison │ │ └── PrisonStructs.hpp │ ├── Trainers │ │ └── TrainerStructs.hpp │ ├── Ioc.hpp │ └── Mira │ │ └── MiraStructs.hpp │ └── Trainers │ ├── Api.hpp │ ├── ApiDefs.hpp │ └── TrainerUtils.hpp ├── example_trainer ├── README.md └── src │ ├── trainer.cpp │ └── _syscalls.s ├── .gitignore ├── tests ├── README.md ├── src │ └── tests.h └── CMakeLists.txt ├── loader ├── src │ ├── Utils │ │ ├── __Crt0.S │ │ └── Syscall.s │ ├── Boot │ │ ├── Patches │ │ │ └── Patches650.cpp │ │ └── Patches.cpp │ └── link.ld ├── README.md └── CMakeLists.txt ├── mira_module ├── src │ ├── Trainers │ │ ├── Mono │ │ │ └── MonoApi.cpp │ │ ├── SubstituteHook.hpp │ │ ├── SubstituteHook.cpp │ │ └── SubstituteManager.hpp │ ├── main.cpp │ ├── Utils │ │ └── Logger.cpp │ └── Processes │ │ ├── Process.hpp │ │ └── Thread.hpp ├── README.md └── CMakeLists.txt ├── scripts └── check_trainer_loader.cmake ├── trainer_loader ├── src │ ├── __crt0.S │ ├── link.ld │ └── _syscalls.s └── CMakeLists.txt ├── CONTRIBUTION.md └── Dockerfile /CppCheckSuppressions.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /kernel/src/OrbisOS/SelfStructs.hpp: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /daemon/.gitignore: -------------------------------------------------------------------------------- 1 | *.bin 2 | *.elf 3 | *.o 4 | x64/* -------------------------------------------------------------------------------- /external/freebsd-headers/include/openssl/fips.h: -------------------------------------------------------------------------------- 1 | /* dummy fips.h */ 2 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/openssl/fips_rand.h: -------------------------------------------------------------------------------- 1 | /* dummy fips_rand.h */ 2 | -------------------------------------------------------------------------------- /external/freebsd-headers/.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/md5.h: -------------------------------------------------------------------------------- 1 | #ifndef _MD5_H_ 2 | #define _MD5_H_ 3 | #include 4 | #endif /* _MD5_H_ */ 5 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/hdb.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kiwidoggie/mira-project/HEAD/external/freebsd-headers/include/hdb.h -------------------------------------------------------------------------------- /external/freebsd-headers/include/kafs.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kiwidoggie/mira-project/HEAD/external/freebsd-headers/include/kafs.h -------------------------------------------------------------------------------- /external/freebsd-headers/include/krb5.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kiwidoggie/mira-project/HEAD/external/freebsd-headers/include/krb5.h -------------------------------------------------------------------------------- /external/freebsd-headers/include/vgl.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kiwidoggie/mira-project/HEAD/external/freebsd-headers/include/vgl.h -------------------------------------------------------------------------------- /external/freebsd-headers/include/com_err.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kiwidoggie/mira-project/HEAD/external/freebsd-headers/include/com_err.h -------------------------------------------------------------------------------- /external/freebsd-headers/include/fetch.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kiwidoggie/mira-project/HEAD/external/freebsd-headers/include/fetch.h -------------------------------------------------------------------------------- /external/freebsd-headers/include/hx509.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kiwidoggie/mira-project/HEAD/external/freebsd-headers/include/hx509.h -------------------------------------------------------------------------------- /external/freebsd-headers/include/roken.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kiwidoggie/mira-project/HEAD/external/freebsd-headers/include/roken.h -------------------------------------------------------------------------------- /external/freebsd-headers/include/sys/ata.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kiwidoggie/mira-project/HEAD/external/freebsd-headers/include/sys/ata.h -------------------------------------------------------------------------------- /kernel/src/OrbisOS/asm/entrypoint_trigger: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kiwidoggie/mira-project/HEAD/kernel/src/OrbisOS/asm/entrypoint_trigger -------------------------------------------------------------------------------- /external/freebsd-headers/include/com_right.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kiwidoggie/mira-project/HEAD/external/freebsd-headers/include/com_right.h -------------------------------------------------------------------------------- /external/freebsd-headers/include/heim_asn1.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kiwidoggie/mira-project/HEAD/external/freebsd-headers/include/heim_asn1.h -------------------------------------------------------------------------------- /external/freebsd-headers/include/heimntlm.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kiwidoggie/mira-project/HEAD/external/freebsd-headers/include/heimntlm.h -------------------------------------------------------------------------------- /external/freebsd-headers/include/sys/cdrio.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kiwidoggie/mira-project/HEAD/external/freebsd-headers/include/sys/cdrio.h -------------------------------------------------------------------------------- /external/freebsd-headers/include/sys/dvdio.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kiwidoggie/mira-project/HEAD/external/freebsd-headers/include/sys/dvdio.h -------------------------------------------------------------------------------- /external/freebsd-headers/include/heim_threads.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kiwidoggie/mira-project/HEAD/external/freebsd-headers/include/heim_threads.h -------------------------------------------------------------------------------- /external/freebsd-headers/include/kadm5/admin.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kiwidoggie/mira-project/HEAD/external/freebsd-headers/include/kadm5/admin.h -------------------------------------------------------------------------------- /external/freebsd-headers/include/roken-common.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kiwidoggie/mira-project/HEAD/external/freebsd-headers/include/roken-common.h -------------------------------------------------------------------------------- /external/freebsd-headers/include/sys/consio.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kiwidoggie/mira-project/HEAD/external/freebsd-headers/include/sys/consio.h -------------------------------------------------------------------------------- /external/freebsd-headers/include/kadm5/private.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kiwidoggie/mira-project/HEAD/external/freebsd-headers/include/kadm5/private.h -------------------------------------------------------------------------------- /external/freebsd-headers/include/krb5-v4compat.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kiwidoggie/mira-project/HEAD/external/freebsd-headers/include/krb5-v4compat.h -------------------------------------------------------------------------------- /external/freebsd-headers/include/sys/imgact_elf.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kiwidoggie/mira-project/HEAD/external/freebsd-headers/include/sys/imgact_elf.h -------------------------------------------------------------------------------- /external/freebsd-headers/include/dev/ieee488/upd7210.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kiwidoggie/mira-project/HEAD/external/freebsd-headers/include/dev/ieee488/upd7210.h -------------------------------------------------------------------------------- /external/freebsd-headers/include/gssapi/gssapi_krb5.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kiwidoggie/mira-project/HEAD/external/freebsd-headers/include/gssapi/gssapi_krb5.h -------------------------------------------------------------------------------- /daemon/src/Rpc/Protos/PROTOBUF.md: -------------------------------------------------------------------------------- 1 | protoc -I . --grpc_out=. --plugin=protoc-gen-grpc=`which grpc_cpp_plugin` FileManager.proto 2 | protoc -I . --cpp_out=. FileManager.proto -------------------------------------------------------------------------------- /example_trainer/README.md: -------------------------------------------------------------------------------- 1 | # Trainer Example 2 | 3 | This will be the testing bed for the example trainer. All trainer features should be excersized in this project. 4 | 5 | This is currently WIP. -------------------------------------------------------------------------------- /external/mira/Kernel/Utils/Stack.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern "C" void __stack_chk_fail(void); 4 | extern "C" unsigned long __stack_chk_guard; 5 | extern "C" void __stack_chk_guard_setup(void); -------------------------------------------------------------------------------- /external/freebsd-headers/include/machine/bus.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * This file is in the public domain. 3 | */ 4 | /* $FreeBSD: release/9.0.0/sys/amd64/include/bus.h 216592 2010-12-20 16:39:43Z tijl $ */ 5 | 6 | #include 7 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/machine/_align.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * This file is in the public domain. 3 | */ 4 | /* $FreeBSD: release/9.0.0/sys/amd64/include/_align.h 215856 2010-11-26 10:59:20Z tijl $ */ 5 | 6 | #include 7 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/machine/apm_bios.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * This file is in the public domain. 3 | */ 4 | /* $FreeBSD: release/9.0.0/sys/amd64/include/apm_bios.h 215140 2010-11-11 19:36:21Z jkim $ */ 5 | 6 | #include 7 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/machine/_inttypes.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * This file is in the public domain. 3 | */ 4 | /* $FreeBSD: release/9.0.0/sys/amd64/include/_inttypes.h 217157 2011-01-08 18:09:48Z tijl $ */ 5 | 6 | #include 7 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/machine/pci_cfgreg.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * This file is in the public domain. 3 | */ 4 | /* $FreeBSD: release/9.0.0/sys/amd64/include/pci_cfgreg.h 223440 2011-06-22 21:04:13Z jhb $ */ 5 | 6 | #include 7 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/malloc.h: -------------------------------------------------------------------------------- 1 | /* $FreeBSD: release/9.0.0/include/malloc.h 86178 2001-11-07 23:14:31Z obrien $ */ 2 | #if __STDC__ 3 | #error " has been replaced by " 4 | #else 5 | #include 6 | #endif 7 | -------------------------------------------------------------------------------- /daemon/src/Entry.hpp: -------------------------------------------------------------------------------- 1 | // Main entry point 2 | extern "C" int main(void); 3 | 4 | /* 5 | /data/mira 6 | |->installed_plugins.ext 7 | |->config_plugins.ext 8 | |->plugins/ 9 | | |->XXXX/ 10 | | | |->XXX.sprx 11 | | | |->XXX.ext 12 | | |... 13 | */ -------------------------------------------------------------------------------- /daemon/src/Rpc/Status.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Mira 4 | { 5 | namespace Rpc 6 | { 7 | enum class Status 8 | { 9 | OK, 10 | SKIPPED, 11 | CANCELLED 12 | }; 13 | } 14 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.bin 2 | *.o 3 | *.elf 4 | *.a 5 | *.so 6 | *SteamLink* 7 | *steam_link* 8 | src/GitHash.hpp 9 | build/* 10 | reeee/* 11 | # PVS-Studio Ignores 12 | project.log 13 | report.tasks 14 | strace_out 15 | maneja/** 16 | .vscode/* 17 | *.prx 18 | *.oprx -------------------------------------------------------------------------------- /external/freebsd-headers/include/netinet6/ip6.h: -------------------------------------------------------------------------------- 1 | /* $FreeBSD: release/9.0.0/sys/netinet6/ip6.h 62587 2000-07-04 16:35:15Z itojun $ */ 2 | /* $KAME: ip6.h,v 1.7 2000/03/25 07:23:36 sumikawa Exp $ */ 3 | 4 | #error "netinet6/ip6.h is obsolete. use netinet/ip6.h" 5 | -------------------------------------------------------------------------------- /tests/README.md: -------------------------------------------------------------------------------- 1 | # Mira testing application 2 | 3 | This application will be used to ensure functionality does not break while developing for Mira's various components. 4 | 5 | This will be filled in once it's actually being used, but currently isn't even being built. -------------------------------------------------------------------------------- /daemon/src/Debugging/Debugger.cpp: -------------------------------------------------------------------------------- 1 | #include "Debugger.hpp" 2 | 3 | using namespace Mira::Debugging; 4 | 5 | Debugger::Debugger() 6 | { 7 | 8 | } 9 | 10 | Debugger::~Debugger() 11 | { 12 | 13 | } 14 | 15 | bool Debugger::OnLoad() 16 | { 17 | return true; 18 | } -------------------------------------------------------------------------------- /external/freebsd-headers/include/netinet6/icmp6.h: -------------------------------------------------------------------------------- 1 | /* $FreeBSD: release/9.0.0/sys/netinet6/icmp6.h 62587 2000-07-04 16:35:15Z itojun $ */ 2 | /* $KAME: icmp6.h,v 1.17 2000/06/11 17:23:40 jinmei Exp $ */ 3 | 4 | #error "netinet6/icmp6.h is obsolete. use netinet/icmp6.h" 5 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/sys/termios.h: -------------------------------------------------------------------------------- 1 | /* $FreeBSD: release/9.0.0/sys/sys/termios.h 199898 2009-11-28 23:50:48Z ed $ */ 2 | #ifdef __GNUC__ 3 | #warning "this file includes which is deprecated, use instead" 4 | #endif 5 | #include 6 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/gssapi.h: -------------------------------------------------------------------------------- 1 | /* $FreeBSD: release/9.0.0/include/gssapi.h 153838 2005-12-29 14:40:22Z dfr $ */ 2 | #ifdef __GNUC__ 3 | #warning "this file includes which is deprecated, use instead" 4 | #endif 5 | #include 6 | -------------------------------------------------------------------------------- /kernel/src/Driver/v1/Processes/PrisonCtrl.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Mira 4 | { 5 | namespace Driver 6 | { 7 | namespace Processes 8 | { 9 | class PrisonCtrl 10 | { 11 | 12 | }; 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /kernel/src/Boot/TrainerLoader.S: -------------------------------------------------------------------------------- 1 | .intel_syntax noprefix 2 | .text 3 | 4 | .global _trainer_loader_start, _trainer_loader_end 5 | 6 | .org 0x10 7 | _padding: 8 | nop 9 | nop 10 | nop 11 | nop 12 | 13 | _trainer_loader_start: 14 | .incbin TRAINER_LOADER_BIN_PATH 15 | _trainer_loader_end: -------------------------------------------------------------------------------- /external/freebsd-headers/include/netncp/ncp_cfg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * static configuration for libncp 3 | * 4 | * $FreeBSD: release/9.0.0/sys/netncp/ncp_cfg.h 52153 1999-10-12 11:56:41Z bp $ 5 | */ 6 | 7 | #define NCP_NLS_KOI2CP866 8 | #define NCP_NLS_DEFAULT NCP_NLS_KOI_866 9 | #define NCP_PREFIX "" 10 | -------------------------------------------------------------------------------- /kernel/src/Utils/SelfHeader.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Types.hpp" 3 | 4 | namespace Mira 5 | { 6 | namespace Utils 7 | { 8 | typedef struct _SelfHeader 9 | { 10 | uint8_t Unknown00[0x18]; 11 | uint16_t EntityCount; 12 | } SelfHeader; 13 | } 14 | } -------------------------------------------------------------------------------- /loader/src/Utils/__Crt0.S: -------------------------------------------------------------------------------- 1 | .intel_syntax noprefix 2 | .text 3 | 4 | .global _start, _mira_elf_start, _mira_elf_end, _start 5 | 6 | .org 0 7 | _start: 8 | jmp mira_entry 9 | 10 | .org 0x10 11 | _padding: 12 | nop 13 | nop 14 | nop 15 | nop 16 | 17 | _mira_elf_start: 18 | .incbin MIRA_ELF_PATH 19 | _mira_elf_end: -------------------------------------------------------------------------------- /mira_module/src/Trainers/Mono/MonoApi.cpp: -------------------------------------------------------------------------------- 1 | #include "MonoApi.hpp" 2 | 3 | using namespace Mira::Mono; 4 | 5 | bool MonoApi::Init() 6 | { 7 | // TODO: Get firmware version from nvs/registry or somewhere that can't easily be spoofed 8 | // TODO: If above fails, just pull the spoofable version 9 | 10 | // TODO: Assign all of the function pointers 11 | return true; 12 | } -------------------------------------------------------------------------------- /scripts/check_trainer_loader.cmake: -------------------------------------------------------------------------------- 1 | message("check_trainer_loader called") 2 | 3 | set(TRAINER_LOADER_BIN ${CMAKE_BINARY_DIR}/trainer_loader/libtrainer_loader.so) 4 | if (EXISTS ${TRAINER_LOADER_BIN}) 5 | message("trainer loader found") 6 | add_compile_definitions(TRAINER_LOADER_BIN_PATH="${TRAINER_LOADER_BIN}") 7 | else() 8 | message(FATAL_ERROR "could not find built trainer_loader.") 9 | endif() -------------------------------------------------------------------------------- /external/mira/Kernel/Utils/New.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // new 4 | void * operator new(unsigned long int cbSize); 5 | 6 | // new[] 7 | void* operator new[](unsigned long int cbSize); 8 | 9 | // placement new 10 | void * operator new(unsigned long int cbSize, void * pv); 11 | 12 | // delete 13 | void operator delete(void* p) noexcept; 14 | 15 | // delete[] 16 | void operator delete[] (void* p) noexcept; -------------------------------------------------------------------------------- /kernel/src/OrbisOS/KernelDebug.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace Mira 6 | { 7 | namespace Debug 8 | { 9 | class KernelDebug 10 | { 11 | public: 12 | static void EnableTrap(int index, void* address, char dr_len, char dr_breaktype); 13 | static void DisableTrap(int index); 14 | }; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /trainer_loader/src/__crt0.S: -------------------------------------------------------------------------------- 1 | .intel_syntax noprefix 2 | .text 3 | 4 | .global _start, _g_rdi, _g_rsi, _g_consoleHandle, _g_launchMode 5 | 6 | .org 0 7 | _start: 8 | jmp loader_entry 9 | 10 | # This is the launch mode 11 | # 0 = normal 12 | # 1 = injected 13 | _g_launchMode: .byte 0x00 14 | 15 | .org 0x10 16 | _padding: 17 | nop 18 | nop 19 | nop 20 | nop 21 | 22 | 23 | _g_rdi: .quad 0 24 | _g_rsi: .quad 0 25 | _g_consoleHandle: .int 0 26 | -------------------------------------------------------------------------------- /daemon/src/Debugging/Debugger.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace Mira 6 | { 7 | namespace Debugging 8 | { 9 | class Debugger : 10 | public Utils::IModule 11 | { 12 | private: 13 | 14 | 15 | public: 16 | Debugger(); 17 | virtual ~Debugger(); 18 | 19 | virtual bool OnLoad() override; 20 | }; 21 | } 22 | } -------------------------------------------------------------------------------- /external/mira/Kernel/Utils/Types.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "Stack.hpp" 4 | 5 | #ifndef NULL 6 | #define NULL 0 7 | #endif 8 | 9 | #ifndef true 10 | #define true 1 11 | #endif 12 | 13 | #ifndef false 14 | #define false 0 15 | #endif 16 | 17 | #ifndef ARRAYSIZE 18 | #define ARRAYSIZE(a) (sizeof(a) / sizeof(*(a))) 19 | #endif 20 | 21 | #ifndef MSGPACK 22 | #define MSGPACK __attribute__((__packed__)) 23 | #endif 24 | 25 | typedef uint32_t u_int32_t; -------------------------------------------------------------------------------- /external/freebsd-headers/.gitignore: -------------------------------------------------------------------------------- 1 | 2 | #Ignore thumbnails created by Windows 3 | Thumbs.db 4 | #Ignore files built by Visual Studio 5 | *.obj 6 | *.exe 7 | *.pdb 8 | *.user 9 | *.aps 10 | *.pch 11 | *.vspscc 12 | *_i.c 13 | *_p.c 14 | *.ncb 15 | *.suo 16 | *.tlb 17 | *.tlh 18 | *.bak 19 | *.cache 20 | *.ilk 21 | *.log 22 | [Bb]in 23 | [Dd]ebug*/ 24 | *.lib 25 | *.sbr 26 | obj/ 27 | [Rr]elease*/ 28 | _ReSharper*/ 29 | [Tt]est[Rr]esult* 30 | .vs/ 31 | #Nuget packages folder 32 | packages/ 33 | -------------------------------------------------------------------------------- /kernel/src/Driver/v1/Trainers/TrainerCtrl.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | struct thread; 5 | struct cdev; 6 | 7 | namespace Mira 8 | { 9 | namespace Driver 10 | { 11 | namespace v1 12 | { 13 | class TrainerCtrl 14 | { 15 | public: 16 | static int32_t OnIoctl(struct cdev* p_Device, u_long p_Command, caddr_t p_Data, int32_t p_FFlag, struct thread* p_Thread); 17 | }; 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /external/freebsd-headers/include/dev/ic/i8237.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Intel 8237 DMA Controller 3 | * 4 | * $FreeBSD: release/9.0.0/sys/dev/ic/i8237.h 146214 2005-05-14 10:14:56Z nyan $ 5 | */ 6 | 7 | #define DMA37MD_SINGLE 0x40 /* single pass mode */ 8 | #define DMA37MD_CASCADE 0xc0 /* cascade mode */ 9 | #define DMA37MD_AUTO 0x50 /* autoinitialise single pass mode */ 10 | #define DMA37MD_WRITE 0x04 /* read the device, write memory operation */ 11 | #define DMA37MD_READ 0x08 /* write the device, read memory operation */ 12 | -------------------------------------------------------------------------------- /loader/src/Boot/Patches/Patches650.cpp: -------------------------------------------------------------------------------- 1 | // This is an open source non-commercial project. Dear PVS-Studio, please check it. 2 | // PVS-Studio Static Code Analyzer for C, C++, C#, and Java: http://www.viva64.com 3 | 4 | #include 5 | 6 | /* 7 | Please, please, please! 8 | Keep patches consistent with the used patch style for readability. 9 | TODO: YOU MUST VERIFY THESE OFFSETS 10 | thx: Fire30 11 | */ 12 | void Mira::Boot::Patches::install_prerunPatches_650() 13 | { 14 | // TODO: Implement 15 | } 16 | -------------------------------------------------------------------------------- /external/mira/Kernel/Utils/Dynlib.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace Mira 6 | { 7 | namespace Utils 8 | { 9 | class Dynlib 10 | { 11 | public: 12 | static int64_t LoadPrx(const char* p_PrxPath, int* p_OutModuleId); 13 | static int64_t UnloadPrx(int64_t p_PrxId); 14 | static int64_t Dlsym(int64_t p_PrxId, const char* p_FunctionName, void *p_DestinationFunctionOffset); 15 | }; 16 | } 17 | } -------------------------------------------------------------------------------- /mira_module/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | extern "C" int testLibraryFunction() 5 | { 6 | printf("This is a print from a test library function!"); 7 | 8 | for (;;) 9 | printf("This is a print from a test library function!"); 10 | 11 | return 0x1337; 12 | } 13 | 14 | extern "C" bool trainer_load() 15 | { 16 | printf("trainer_load()\n"); 17 | return true; 18 | } 19 | 20 | extern "C" bool trainer_unload() 21 | { 22 | printf("trainer_unload()\n"); 23 | return true; 24 | } -------------------------------------------------------------------------------- /external/mira/Driver/Prison/PrisonStructs.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../Ioc.hpp" 3 | 4 | typedef struct _PrisonList 5 | { 6 | uint32_t PrisonsCount; 7 | void* Prisons[0]; 8 | } PrisonList; 9 | #define MIRA_PRISON_LIST _IOC(IOC_INOUT, MIRA_IOCTL_BASE, (uint32_t)(MiraIoctlCmds::CMD_PrisonList), sizeof(PrisonList)) 10 | 11 | typedef struct _PrisonInfo 12 | { 13 | // TODO: Implement 14 | } PrisonInfo; 15 | #define MIRA_PRISON_INFO _IOC(IOC_INOUT, MIRA_IOCTL_BASE, (uint32_t)(MiraIoctlCmds::CMD_PrisonInfo), sizeof(PrisonInfo)) 16 | -------------------------------------------------------------------------------- /kernel/src/Driver/v1/v1.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | 6 | struct cdev; 7 | struct thread; 8 | 9 | namespace Mira 10 | { 11 | namespace Driver 12 | { 13 | namespace v1 14 | { 15 | class v1Ctrl 16 | { 17 | public: 18 | static int32_t OnIoctl(struct cdev* p_Device, u_long p_Command, caddr_t p_Data, int32_t p_FFlag, struct thread* p_Thread); 19 | }; 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /kernel/src/OrbisOS/asm/prx.asm: -------------------------------------------------------------------------------- 1 | ; prx.s 2 | ; Mira 3 | ; Use NASM for compile and edit Utilities 4 | 5 | BITS 64 6 | DEFAULT REL 7 | 8 | magic: db 'MIRA' 9 | entrypoint: dq loadprx 10 | prxdone: dd 0 11 | prx_path: dq 0 12 | sceKernelLoadStartModule: dq 0 13 | 14 | str_rpcstub: db 'prxstub', 0 15 | 16 | loadprx: 17 | ;load prx 18 | mov rdi, qword [prx_path] 19 | xor rsi, rsi 20 | xor rdx, rdx 21 | xor rcx, rcx 22 | xor r8, r8 23 | xor r9, r9 24 | mov r12, qword [sceKernelLoadStartModule] 25 | call r12 26 | mov dword [prxdone], 1 27 | xor eax, eax 28 | ret 29 | -------------------------------------------------------------------------------- /external/mira/Kernel/Utils/Stack.cpp: -------------------------------------------------------------------------------- 1 | #include "Stack.hpp" 2 | #include "Kdlsym.hpp" 3 | 4 | const unsigned long c_StackCheckGuard = 0xDEADBABE; 5 | unsigned long __stack_chk_guard = c_StackCheckGuard; 6 | 7 | void __stack_chk_guard_setup(void) 8 | { 9 | __stack_chk_guard = c_StackCheckGuard; //provide some magic numbers 10 | } 11 | 12 | void __stack_chk_fail(void) 13 | { 14 | auto printf = (void(*)(const char *format, ...))kdlsym(printf); 15 | printf("!!!!!!!!!!\n\n__stack_chk_fail: stack_corruption detected!!!!!!!!!!!\n\n"); 16 | for (;;) 17 | __asm__("nop"); 18 | } -------------------------------------------------------------------------------- /kernel/src/Boot/Patches/Patches650.cpp: -------------------------------------------------------------------------------- 1 | // This is an open source non-commercial project. Dear PVS-Studio, please check it. 2 | // PVS-Studio Static Code Analyzer for C, C++, C#, and Java: http://www.viva64.com 3 | 4 | #include 5 | 6 | /* 7 | Please, please, please! 8 | Keep patches consistent with the used patch style for readability. 9 | TODO: YOU MUST VERIFY THESE OFFSETS 10 | thx: Fire30 11 | */ 12 | void Mira::Boot::Patches::install_prerunPatches_650() 13 | { 14 | #if MIRA_PLATFORM == MIRA_PLATFORM_ORBIS_BSD_650 15 | // TODO: Implement 16 | #endif 17 | } 18 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/krb5-types.h: -------------------------------------------------------------------------------- 1 | /* krb5-types.h -- this file was generated for i386-unknown-freebsd5.0 by 2 | $Id: bits.c,v 1.22 2002/08/28 16:08:44 joda Exp $ */ 3 | 4 | /* $FreeBSD: release/9.0.0/kerberos5/include/krb5-types.h 102649 2002-08-30 21:33:20Z nectar $ */ 5 | 6 | #ifndef __krb5_types_h__ 7 | #define __krb5_types_h__ 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | typedef socklen_t krb5_socklen_t; 14 | #include 15 | typedef ssize_t krb5_ssize_t; 16 | 17 | #endif /* __krb5_types_h__ */ 18 | -------------------------------------------------------------------------------- /external/mira/Driver/Trainers/TrainerStructs.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../Ioc.hpp" 3 | 4 | typedef struct _TrainerLoad 5 | { 6 | } TrainerLoad; 7 | #define MIRA_TRAINER_LOAD _IOC(IOC_INOUT, MIRA_IOCTL_BASE, (uint32_t)(MiraIoctlCmds::CMD_TrainerLoad), sizeof(TrainerLoad)) 8 | 9 | 10 | typedef struct _TrainerGetEntryPoint 11 | { 12 | // Original entry point that had been stored before 13 | uint64_t OriginalEntryPoint; 14 | } TrainerGetEntryPoint; 15 | #define MIRA_TRAINER_GET_ENTRY_POINT _IOC(IOC_INOUT, MIRA_IOCTL_BASE, (uint32_t)(MiraIoctlCmds::CMD_TrainerGetEntryPoint), sizeof(TrainerGetEntryPoint)) 16 | -------------------------------------------------------------------------------- /daemon/src/Utils/IModule.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Mira 4 | { 5 | namespace Utils 6 | { 7 | class IModule 8 | { 9 | public: 10 | IModule() { } 11 | virtual ~IModule() { } 12 | 13 | virtual bool OnLoad() { return true; } 14 | virtual bool OnUnload() { return true; } 15 | virtual bool OnSuspend() { return true; } 16 | virtual bool OnResume() { return true; } 17 | 18 | virtual const char* GetName() { return ""; }; 19 | virtual const char* GetDescription() { return ""; }; 20 | }; 21 | } 22 | } -------------------------------------------------------------------------------- /external/mira/Driver/Ioc.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #if defined(__cplusplus) 4 | extern "C" { 5 | #endif 6 | 7 | #if defined(_KERNEL) 8 | #include 9 | #else 10 | #include 11 | #define IOC_VOID 0x20000000 /* no parameters */ 12 | #define IOC_OUT 0x40000000 /* copy out parameters */ 13 | #define IOC_IN 0x80000000 /* copy in parameters */ 14 | #define IOC_INOUT (IOC_IN|IOC_OUT) 15 | #endif 16 | 17 | #include 18 | 19 | #if !defined(_MAX_PATH) 20 | #define _MAX_PATH 260 21 | #endif 22 | 23 | #define MIRA_IOCTL_BASE 'M' 24 | 25 | #include "DriverCmds.hpp" 26 | 27 | #if defined(__cplusplus) 28 | }; 29 | #endif -------------------------------------------------------------------------------- /external/freebsd-headers/include/netinet/ipl.h: -------------------------------------------------------------------------------- 1 | /* $FreeBSD: release/9.0.0/sys/contrib/ipfilter/netinet/ipl.h 172776 2007-10-18 21:52:14Z darrenr $ */ 2 | 3 | /* 4 | * Copyright (C) 1993-2001, 2003 by Darren Reed. 5 | * 6 | * See the IPFILTER.LICENCE file for details on licencing. 7 | * 8 | * @(#)ipl.h 1.21 6/5/96 9 | * $FreeBSD: release/9.0.0/sys/contrib/ipfilter/netinet/ipl.h 172776 2007-10-18 21:52:14Z darrenr $ 10 | * Id: ipl.h,v 2.52.2.30 2007/10/16 09:41:00 darrenr Exp $ 11 | */ 12 | 13 | #ifndef __IPL_H__ 14 | #define __IPL_H__ 15 | 16 | #define IPL_VERSION "IP Filter: v4.1.28" 17 | 18 | #define IPFILTER_VERSION 4012800 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /daemon/src/Rpc/Protos/Rpc.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package Mira.Rpc; 4 | 5 | import "google/protobuf/any.proto"; 6 | 7 | message RpcMessage { 8 | enum Magic { 9 | NO_MAGIC = 0; 10 | V1 = 1; 11 | V2 = 2; 12 | V3 = 3; 13 | MAGIC_COUNT = 4; 14 | } 15 | 16 | enum RpcCategory { 17 | NO_CATEGORY = 0; 18 | SYSTEM = 1; 19 | LOG = 2; 20 | DEBUG = 3; 21 | FILE = 4; 22 | COMMAND = 5; 23 | RPC_COUNT = 6; 24 | } 25 | 26 | Magic magic = 1; 27 | RpcCategory category = 2; 28 | google.protobuf.Any inner_message = 3; 29 | int32 error = 5; 30 | } -------------------------------------------------------------------------------- /daemon/src/Utils/Logger.cpp: -------------------------------------------------------------------------------- 1 | // This is an open source non-commercial project. Dear PVS-Studio, please check it. 2 | // PVS-Studio Static Code Analyzer for C, C++, C#, and Java: http://www.viva64.com 3 | #include "Logger.hpp" 4 | 5 | using namespace Mira::Utils; 6 | 7 | Logger* Logger::m_Instance = nullptr; 8 | Logger* Logger::GetInstance() 9 | { 10 | if (m_Instance == nullptr) 11 | m_Instance = new Logger(); 12 | 13 | return m_Instance; 14 | } 15 | 16 | Logger::Logger() : 17 | m_LogLevel(LL_None) 18 | { 19 | #ifdef _DEBUG 20 | m_LogLevel = LL_Debug; 21 | #else 22 | m_LogLevel = LL_Error; 23 | #endif 24 | } 25 | 26 | Logger::~Logger() 27 | { 28 | 29 | } -------------------------------------------------------------------------------- /external/freebsd-headers/include/openssl/ebcdic.h: -------------------------------------------------------------------------------- 1 | /* crypto/ebcdic.h */ 2 | 3 | #ifndef HEADER_EBCDIC_H 4 | #define HEADER_EBCDIC_H 5 | 6 | #include 7 | 8 | /* Avoid name clashes with other applications */ 9 | #define os_toascii _openssl_os_toascii 10 | #define os_toebcdic _openssl_os_toebcdic 11 | #define ebcdic2ascii _openssl_ebcdic2ascii 12 | #define ascii2ebcdic _openssl_ascii2ebcdic 13 | 14 | extern const unsigned char os_toascii[256]; 15 | extern const unsigned char os_toebcdic[256]; 16 | void *ebcdic2ascii(void *dest, const void *srce, size_t count); 17 | void *ascii2ebcdic(void *dest, const void *srce, size_t count); 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /mira_module/src/Utils/Logger.cpp: -------------------------------------------------------------------------------- 1 | // This is an open source non-commercial project. Dear PVS-Studio, please check it. 2 | // PVS-Studio Static Code Analyzer for C, C++, C#, and Java: http://www.viva64.com 3 | #include "Logger.hpp" 4 | 5 | using namespace Mira::Utils; 6 | 7 | Logger* Logger::m_Instance = nullptr; 8 | Logger* Logger::GetInstance() 9 | { 10 | if (m_Instance == nullptr) 11 | m_Instance = new Logger(); 12 | 13 | return m_Instance; 14 | } 15 | 16 | Logger::Logger() : 17 | m_LogLevel(LL_None) 18 | { 19 | #ifdef _DEBUG 20 | m_LogLevel = LL_Debug; 21 | #else 22 | m_LogLevel = LL_Error; 23 | #endif 24 | } 25 | 26 | Logger::~Logger() 27 | { 28 | 29 | } -------------------------------------------------------------------------------- /external/freebsd-headers/include/netinet/ip_rules.h: -------------------------------------------------------------------------------- 1 | /* $FreeBSD: release/9.0.0/sys/contrib/ipfilter/netinet/ip_rules.h 145517 2005-04-25 18:15:41Z darrenr $ */ 2 | 3 | extern int ipfrule_add __P((void)); 4 | extern int ipfrule_remove __P((void)); 5 | 6 | extern frentry_t *ipfrule_match_out_ __P((fr_info_t *, u_32_t *)); 7 | extern frentry_t *ipf_rules_out_[1]; 8 | 9 | extern int ipfrule_add_out_ __P((void)); 10 | extern int ipfrule_remove_out_ __P((void)); 11 | 12 | extern frentry_t *ipfrule_match_in_ __P((fr_info_t *, u_32_t *)); 13 | extern frentry_t *ipf_rules_in_[1]; 14 | 15 | extern int ipfrule_add_in_ __P((void)); 16 | extern int ipfrule_remove_in_ __P((void)); 17 | -------------------------------------------------------------------------------- /kernel/src/Driver/v1/Mira/MiraCtrl.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | struct cdev; 5 | struct thread; 6 | 7 | namespace Mira 8 | { 9 | namespace Driver 10 | { 11 | namespace v1 12 | { 13 | class MiraCtrl 14 | { 15 | protected: 16 | static int32_t OnMiraMountInSandbox(struct cdev* p_Device, u_long p_Command, caddr_t p_Data, int32_t p_FFlag, struct thread* p_Thread); 17 | 18 | public: 19 | static int32_t OnIoctl(struct cdev* p_Device, u_long p_Command, caddr_t p_Data, int32_t p_FFlag, struct thread* p_Thread); 20 | }; 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /mira_module/README.md: -------------------------------------------------------------------------------- 1 | # MiraModule 2 | 3 | This is a shared library (prx) that will maintain an API with the `kernel` component and provide hooking, patching, and trainer capabilities to all trainers that are loaded reducing the amount of duplicate code that is needed per trainer. It also will provide many helper functions that trainers would be able to use. 4 | 5 | ## Substitute 6 | Substitute is used for import table hooking, function hooking chains, and vtable hooks. It originally lived in the `kernel` component but has since been removed in order to be ported to usermode. This way all hooking/patching stays within the process that it's operating on and will no longer cross ring boundaries. 7 | 8 | TODO: Fill out more later -------------------------------------------------------------------------------- /mira_module/src/Trainers/SubstituteHook.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | // Driver includes 5 | #include 6 | #include 7 | 8 | namespace Mira 9 | { 10 | class SubstituteHook 11 | { 12 | public: 13 | /** 14 | * @brief Find the Jumpslot address for a given function 15 | * 16 | * @param module Process Id of the target process to read 17 | * @param p_ProcessAddress Address in the target process to read 18 | * @return address of the function offset inside the process, NULL if not found (or error) 19 | */ 20 | static void* FindJmpslotAddress(char* p_Module, char* p_Function, bool p_isNid); 21 | 22 | }; 23 | } -------------------------------------------------------------------------------- /kernel/src/Boot/OptionsBlock.cpp: -------------------------------------------------------------------------------- 1 | // This is an open source non-commercial project. Dear PVS-Studio, please check it. 2 | // PVS-Studio Static Code Analyzer for C, C++, C#, and Java: http://www.viva64.com 3 | 4 | #include "OptionsBlock.hpp" 5 | 6 | using namespace Mira::Boot; 7 | 8 | void OptionsBlock::SetDefaults() 9 | { 10 | IsAdvancedMode = false; 11 | 12 | RpcValidationEnabled = true; 13 | SyscallGuardEnabled = true; 14 | FakeSelfEnabled = true; 15 | FakePkgEnabled = true; 16 | 17 | DebuggerBreakOnAttach = false; 18 | AslrEnabled = true; 19 | FuseEnabled = false; 20 | 21 | LogServerEnabled = false; 22 | LogServerPort = 9998; 23 | 24 | RpcServerEnabled = false; 25 | RpcServerPort = 9999; 26 | } -------------------------------------------------------------------------------- /external/freebsd-headers/include/openssl/bio_lcl.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #if BIO_FLAGS_UPLINK==0 4 | /* Shortcut UPLINK calls on most platforms... */ 5 | #define UP_stdin stdin 6 | #define UP_stdout stdout 7 | #define UP_stderr stderr 8 | #define UP_fprintf fprintf 9 | #define UP_fgets fgets 10 | #define UP_fread fread 11 | #define UP_fwrite fwrite 12 | #undef UP_fsetmod 13 | #define UP_feof feof 14 | #define UP_fclose fclose 15 | 16 | #define UP_fopen fopen 17 | #define UP_fseek fseek 18 | #define UP_ftell ftell 19 | #define UP_fflush fflush 20 | #define UP_ferror ferror 21 | #define UP_fileno fileno 22 | 23 | #define UP_open open 24 | #define UP_read read 25 | #define UP_write write 26 | #define UP_lseek lseek 27 | #define UP_close close 28 | #endif 29 | -------------------------------------------------------------------------------- /example_trainer/src/trainer.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | #include "_syscalls.hpp" 8 | 9 | int64_t debug_log(const char* debug_message) { 10 | 11 | return (int64_t)syscall3(601, (void*)0x7, reinterpret_cast(const_cast(debug_message)), (void*)0x0); 12 | } 13 | 14 | void PrintThread() 15 | { 16 | for (;;) 17 | { 18 | debug_log("[=] PrintThread\n"); 19 | sceKernelSleep(1000); 20 | } 21 | } 22 | 23 | extern "C" void trainer_load() 24 | { 25 | debug_log("[+] trainer_load has been reached\n"); 26 | 27 | for (uint32_t i = 0; i < 4; ++i) 28 | debug_log("[=] InsideShellUI\n\n"); 29 | 30 | debug_log("[+] detached thread\n"); 31 | } -------------------------------------------------------------------------------- /external/freebsd-headers/include/ieeefp.h: -------------------------------------------------------------------------------- 1 | /* $NetBSD: ieeefp.h,v 1.4 1998/01/09 08:03:43 perry Exp $ */ 2 | /* $FreeBSD: release/9.0.0/include/ieeefp.h 109520 2003-01-19 06:01:33Z marcel $ */ 3 | 4 | /* 5 | * Written by J.T. Conklin, Apr 6, 1995 6 | * Public domain. 7 | */ 8 | 9 | #ifndef _IEEEFP_H_ 10 | #define _IEEEFP_H_ 11 | 12 | #include 13 | #include 14 | 15 | #if !defined(_IEEEFP_INLINED_) 16 | __BEGIN_DECLS 17 | extern fp_rnd_t fpgetround(void); 18 | extern fp_rnd_t fpsetround(fp_rnd_t); 19 | extern fp_except_t fpgetmask(void); 20 | extern fp_except_t fpsetmask(fp_except_t); 21 | extern fp_except_t fpgetsticky(void); 22 | extern fp_except_t fpsetsticky(fp_except_t); 23 | __END_DECLS 24 | #endif /* !_IEEEFP_INLINED_ */ 25 | 26 | #endif /* _IEEEFP_H_ */ 27 | -------------------------------------------------------------------------------- /external/mira/Driver/Mira/MiraStructs.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../Ioc.hpp" 3 | 4 | // WE already have a definition of this in external/mira/MiraConfig.hpp 5 | /*typedef struct _MiraConfig 6 | { 7 | 8 | } MiraConfig;*/ 9 | #define MIRA_READ_CONFIG _IOC(IOC_INOUT, MIRA_IOCTL_BASE, (uint32_t)(MiraIoctlCmds::CMD_MiraReadConfig), sizeof(MiraConfig)) 10 | #define MIRA_WRITE_CONFIG _IOC(IOC_INOUT, MIRA_IOCTL_BASE, (uint32_t)(MiraIoctlCmds::CMD_MiraWriteConfig), sizeof(MiraConfig)) 11 | 12 | typedef struct __attribute__((packed)) _MiraMountInSandbox 13 | { 14 | int32_t Permissions; 15 | char HostPath[_MAX_PATH]; 16 | char SandboxPath[_MAX_PATH]; 17 | } MiraMountInSandbox; 18 | #define MIRA_MOUNT_IN_SANDBOX _IOC(IOC_IN, MIRA_IOCTL_BASE, (uint32_t)(MiraIoctlCmds::CMD_MiraMountInSandbox), sizeof(MiraMountInSandbox)) 19 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/crypto/cast.h: -------------------------------------------------------------------------------- 1 | /* $FreeBSD: release/9.0.0/sys/opencrypto/cast.h 139825 2005-01-07 02:29:27Z imp $ */ 2 | /* $OpenBSD: cast.h,v 1.2 2002/03/14 01:26:51 millert Exp $ */ 3 | 4 | /*- 5 | * CAST-128 in C 6 | * Written by Steve Reid 7 | * 100% Public Domain - no warranty 8 | * Released 1997.10.11 9 | */ 10 | 11 | #ifndef _CAST_H_ 12 | #define _CAST_H_ 13 | 14 | typedef struct { 15 | u_int32_t xkey[32]; /* Key, after expansion */ 16 | int rounds; /* Number of rounds to use, 12 or 16 */ 17 | } cast_key; 18 | 19 | void cast_setkey(cast_key * key, u_int8_t * rawkey, int keybytes); 20 | void cast_encrypt(cast_key * key, u_int8_t * inblock, u_int8_t * outblock); 21 | void cast_decrypt(cast_key * key, u_int8_t * inblock, u_int8_t * outblock); 22 | 23 | #endif /* ifndef _CAST_H_ */ 24 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/crypto/skipjack.h: -------------------------------------------------------------------------------- 1 | /* $FreeBSD: release/9.0.0/sys/opencrypto/skipjack.h 139825 2005-01-07 02:29:27Z imp $ */ 2 | /* $OpenBSD: skipjack.h,v 1.3 2002/03/14 01:26:51 millert Exp $ */ 3 | 4 | /*- 5 | * Further optimized test implementation of SKIPJACK algorithm 6 | * Mark Tillotson , 25 June 98 7 | * Optimizations suit RISC (lots of registers) machine best. 8 | * 9 | * based on unoptimized implementation of 10 | * Panu Rissanen 960624 11 | * 12 | * SKIPJACK and KEA Algorithm Specifications 13 | * Version 2.0 14 | * 29 May 1998 15 | */ 16 | 17 | extern void skipjack_forwards(u_int8_t *plain, u_int8_t *cipher, u_int8_t **key); 18 | extern void skipjack_backwards(u_int8_t *cipher, u_int8_t *plain, u_int8_t **key); 19 | extern void subkey_table_gen(u_int8_t *key, u_int8_t **key_tables); 20 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/dev/ppbus/lptio.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 1994 Geoffrey M. Rehmet 3 | * 4 | * This program is free software; you may redistribute it and/or 5 | * modify it, provided that it retain the above copyright notice 6 | * and the following disclaimer. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 11 | * 12 | * Geoff Rehmet, Rhodes University, South Africa 13 | * 14 | * $FreeBSD: release/9.0.0/sys/dev/ppbus/lptio.h 139749 2005-01-06 01:43:34Z imp $ 15 | */ 16 | 17 | #ifndef _DEV_PPBUS_LPT_H_ 18 | #define _DEV_PPBUS_LPT_H_ 19 | 20 | #include 21 | 22 | #define LPT_IRQ _IOW('p', 1, long) /* set interrupt status */ 23 | 24 | #endif /* !_DEV_PPBUS_LPT_H_ */ 25 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/k524_err.h: -------------------------------------------------------------------------------- 1 | /* Generated from /usr/src/kerberos5/lib/libkrb5/../../../crypto/heimdal/lib/krb5/k524_err.et */ 2 | /* $Id: k524_err.et 10141 2001-06-20 02:45:58Z joda $ */ 3 | 4 | #ifndef __k524_err_h__ 5 | #define __k524_err_h__ 6 | 7 | struct et_list; 8 | 9 | void initialize_k524_error_table_r(struct et_list **); 10 | 11 | void initialize_k524_error_table(void); 12 | #define init_k524_err_tbl initialize_k524_error_table 13 | 14 | typedef enum k524_error_number{ 15 | KRB524_BADKEY = -1750206208, 16 | KRB524_BADADDR = -1750206207, 17 | KRB524_BADPRINC = -1750206206, 18 | KRB524_BADREALM = -1750206205, 19 | KRB524_V4ERR = -1750206204, 20 | KRB524_ENCFULL = -1750206203, 21 | KRB524_DECEMPTY = -1750206202, 22 | KRB524_NOTRESP = -1750206201 23 | } k524_error_number; 24 | 25 | #define ERROR_TABLE_BASE_k524 -1750206208 26 | 27 | #endif /* __k524_err_h__ */ 28 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/altq/altqconf.h: -------------------------------------------------------------------------------- 1 | /* $OpenBSD: altqconf.h,v 1.1 2001/06/27 05:28:36 kjc Exp $ */ 2 | /* $NetBSD: altqconf.h,v 1.2 2001/05/30 11:57:16 mrg Exp $ */ 3 | 4 | #if defined(_KERNEL_OPT) || defined(__OpenBSD__) 5 | 6 | #if defined(_KERNEL_OPT) 7 | #include "opt_altq_enabled.h" 8 | #endif 9 | 10 | #include 11 | 12 | #ifdef ALTQ 13 | #define NALTQ 1 14 | #else 15 | #define NALTQ 0 16 | #endif 17 | 18 | cdev_decl(altq); 19 | 20 | #ifdef __OpenBSD__ 21 | #define cdev_altq_init(c,n) { \ 22 | dev_init(c,n,open), dev_init(c,n,close), (dev_type_read((*))) enodev, \ 23 | (dev_type_write((*))) enodev, dev_init(c,n,ioctl), \ 24 | (dev_type_stop((*))) enodev, 0, (dev_type_select((*))) enodev, \ 25 | (dev_type_mmap((*))) enodev } 26 | #else 27 | #define cdev_altq_init(x,y) cdev__oci_init(x,y) 28 | #endif 29 | #endif /* defined(_KERNEL_OPT) || defined(__OpenBSD__) */ 30 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/security/openpam_attr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: openpam_attr.h 405 2007-12-19 11:38:27Z des $ 3 | */ 4 | 5 | #ifndef SECURITY_PAM_ATTRIBUTES_H_INCLUDED 6 | #define SECURITY_PAM_ATTRIBUTES_H_INCLUDED 7 | 8 | /* GCC attributes */ 9 | #if defined(__GNUC__) && defined(__GNUC_MINOR__) && !defined(__STRICT_ANSI__) 10 | # define OPENPAM_GNUC_PREREQ(maj, min) \ 11 | ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) 12 | #else 13 | # define OPENPAM_GNUC_PREREQ(maj, min) 0 14 | #endif 15 | 16 | #if OPENPAM_GNUC_PREREQ(2,5) 17 | # define OPENPAM_FORMAT(params) __attribute__((__format__ params)) 18 | #else 19 | # define OPENPAM_FORMAT(params) 20 | #endif 21 | 22 | #if OPENPAM_GNUC_PREREQ(3,3) 23 | # define OPENPAM_NONNULL(params) __attribute__((__nonnull__ params)) 24 | #else 25 | # define OPENPAM_NONNULL(params) 26 | #endif 27 | 28 | #endif /* !SECURITY_PAM_ATTRIBUTES_H_INCLUDED */ 29 | -------------------------------------------------------------------------------- /tests/src/tests.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace Mira 6 | { 7 | class Tests 8 | { 9 | private: 10 | int32_t m_Device; 11 | std::stringstream m_Log; 12 | 13 | protected: 14 | bool Initialize(); 15 | bool Cleanup(); 16 | 17 | void AddLog(std::string p_Message); 18 | 19 | // TESTS START 20 | bool TestThreadCredentials(); 21 | bool TestPidList(); 22 | bool TestProcInformation(); 23 | bool TestMountInSandbox(); 24 | bool TestTrainerShm(); 25 | bool TestTrainers(); 26 | bool TestMemory(); 27 | bool TestConfig(); 28 | bool TestPrivCheck(); 29 | // TESTS END 30 | 31 | public: 32 | Tests(); 33 | ~Tests(); 34 | 35 | bool RunAll(); 36 | 37 | std::string GetLog() { return m_Log.str(); } 38 | }; 39 | } -------------------------------------------------------------------------------- /external/mira/Kernel/Utils/Dynlib.cpp: -------------------------------------------------------------------------------- 1 | // This is an open source non-commercial project. Dear PVS-Studio, please check it. 2 | // PVS-Studio Static Code Analyzer for C, C++, C#, and Java: http://www.viva64.com 3 | 4 | extern "C" 5 | { 6 | #include 7 | }; 8 | 9 | #include 10 | #include "Dynlib.hpp" 11 | 12 | using namespace Mira::Utils; 13 | 14 | int64_t Dynlib::LoadPrx(const char* p_PrxPath, int* p_OutModuleId) 15 | { 16 | return (int64_t)syscall4(594, reinterpret_cast(const_cast(p_PrxPath)), 0, p_OutModuleId, 0); 17 | } 18 | 19 | int64_t Dynlib::UnloadPrx(int64_t p_PrxId) 20 | { 21 | return (int64_t)syscall1(595, (void*)p_PrxId); 22 | } 23 | 24 | int64_t Dynlib::Dlsym(int64_t p_PrxId, const char* p_FunctionName, void* p_DestinationFunctionOffset) 25 | { 26 | return (int64_t)syscall3(591, (void*)p_PrxId, (void*)p_FunctionName, p_DestinationFunctionOffset); 27 | } -------------------------------------------------------------------------------- /kernel/src/Utils/IModule.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | struct proc; 4 | 5 | namespace Mira 6 | { 7 | namespace Utils 8 | { 9 | class IModule 10 | { 11 | public: 12 | IModule() { } 13 | virtual ~IModule() { } 14 | 15 | virtual bool OnLoad() { return true; } 16 | virtual bool OnUnload() { return true; } 17 | virtual bool OnSuspend() { return true; } 18 | virtual bool OnResume() { return true; } 19 | 20 | virtual bool OnProcessExec(struct proc* p_Process) { return true; } 21 | virtual bool OnProcessExecEnd(struct proc* p_Process) { return true; } 22 | 23 | virtual bool OnProcessExit(struct proc* p_Process) { return true; } 24 | 25 | virtual const char* GetName() { return ""; }; 26 | virtual const char* GetDescription() { return ""; }; 27 | }; 28 | } 29 | } -------------------------------------------------------------------------------- /daemon/src/Daemon.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | namespace Mira 8 | { 9 | namespace Debugging 10 | { 11 | class Debugger; 12 | } 13 | 14 | namespace Rpc 15 | { 16 | class Manager; 17 | class Server; 18 | } 19 | 20 | class Daemon : 21 | public Utils::IModule 22 | { 23 | private: 24 | 25 | std::shared_ptr m_Debugger; 26 | std::shared_ptr m_FtpServer; 27 | 28 | // RPC 29 | std::shared_ptr m_RpcManager; 30 | 31 | public: 32 | static std::shared_ptr GetInstance(); 33 | 34 | Daemon(); 35 | virtual ~Daemon(); 36 | 37 | virtual bool OnLoad() override; 38 | 39 | std::shared_ptr GetMessageManager() const { return m_RpcManager; } 40 | }; 41 | }; -------------------------------------------------------------------------------- /external/freebsd-headers/include/dev/speaker/speaker.h: -------------------------------------------------------------------------------- 1 | /* 2 | * speaker.h -- interface definitions for speaker ioctl() 3 | * 4 | * v1.4 by Eric S. Raymond (esr@snark.thyrsus.com) Aug 1993 5 | * modified for FreeBSD by Andrew A. Chernov 6 | * 7 | * $FreeBSD: release/9.0.0/sys/dev/speaker/speaker.h 152306 2005-11-11 09:57:32Z ru $ 8 | */ 9 | 10 | #ifndef _DEV_SPEAKER_SPEAKER_H_ 11 | #define _DEV_SPEAKER_SPEAKER_H_ 12 | 13 | #include 14 | 15 | #define SPKRTONE _IOW('S', 1, tone_t) /* emit tone */ 16 | #define SPKRTUNE _IO('S', 2) /* emit tone sequence*/ 17 | 18 | typedef struct 19 | { 20 | int frequency; /* in hertz */ 21 | int duration; /* in 1/100ths of a second */ 22 | } tone_t; 23 | 24 | /* 25 | * Strings written to the speaker device are interpreted as tunes and played; 26 | * see the spkr(4) man page for details. 27 | */ 28 | 29 | #endif /* !_DEV_SPEAKER_SPEAKER_H_ */ 30 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/nfs/krpc.h: -------------------------------------------------------------------------------- 1 | /* $NetBSD: krpc.h,v 1.4 1995/12/19 23:07:11 cgd Exp $ */ 2 | /* $FreeBSD: release/9.0.0/sys/nfs/krpc.h 221032 2011-04-25 22:22:51Z rmacklem $ */ 3 | 4 | #include 5 | 6 | struct mbuf; 7 | struct thread; 8 | struct sockaddr; 9 | struct sockaddr_in; 10 | 11 | int krpc_call(struct sockaddr_in *_sin, 12 | u_int prog, u_int vers, u_int func, 13 | struct mbuf **data, struct sockaddr **from, struct thread *td); 14 | 15 | int krpc_portmap(struct sockaddr_in *_sin, 16 | u_int prog, u_int vers, u_int16_t *portp, struct thread *td); 17 | 18 | struct mbuf *xdr_string_encode(char *str, int len); 19 | 20 | /* 21 | * RPC definitions for the portmapper 22 | */ 23 | #define PMAPPORT 111 24 | #define PMAPPROG 100000 25 | #define PMAPVERS 2 26 | #define PMAPPROC_NULL 0 27 | #define PMAPPROC_SET 1 28 | #define PMAPPROC_UNSET 2 29 | #define PMAPPROC_GETPORT 3 30 | #define PMAPPROC_DUMP 4 31 | #define PMAPPROC_CALLIT 5 32 | -------------------------------------------------------------------------------- /daemon/src/Rpc/Protos/Orbis.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package Mira.Rpc.Orbis; 4 | 5 | service OrbisService { 6 | rpc DecryptSelf (DecryptSelfRequest) returns (stream DecryptSelfResponse); 7 | rpc DecryptPup (DecryptPupRequest) returns (stream DecryptPupResponse); 8 | 9 | // Console Information 10 | rpc GetConsoleInfo (ConsoleInfoRequest) returns (ConsoleInfoResponse); 11 | } 12 | 13 | message DecryptSelfRequest { 14 | string path = 1; 15 | } 16 | 17 | message DecryptSelfResponse { 18 | int32 error = 1; 19 | uint64 offset = 2; 20 | bytes data = 3; 21 | } 22 | 23 | message DecryptPupRequest { 24 | string path = 1; 25 | } 26 | 27 | message DecryptPupResponse { 28 | int32 error = 1; 29 | uint64 offset = 2; 30 | bytes data = 3; 31 | } 32 | 33 | message ConsoleInfoRequest { 34 | } 35 | 36 | message ConsoleInfoResponse { 37 | int32 error = 1; 38 | uint64 firmware_version = 2; 39 | string logged_in_username = 3; 40 | bytes hdd_encryption_key = 4; 41 | bytes psid = 5; 42 | } -------------------------------------------------------------------------------- /kernel/src/OrbisOS/asm/entrypoint_trigger.asm: -------------------------------------------------------------------------------- 1 | ; entrypoint_trigger.s 2 | ; Mira - OpenOrbis Team 3 | ; Detect the end of preload module and execute action 4 | ; Use NASM for compile and edit Substitute 5 | 6 | BITS 64 7 | DEFAULT REL 8 | 9 | magic: db 'MIRA' 10 | entrypoint: dq preload_prx_hook 11 | epdone: dd 0 12 | sceSysmodulePreloadModuleForLibkernel: dq 0 13 | fakeReturnAddress: dq 0 14 | 15 | doSubstitute: db 'doSubstituteLoadPRX', 0 16 | 17 | preload_prx_hook: 18 | ; Save R9 19 | push r9 20 | 21 | ; Call the preload module function 22 | mov r9, qword [sceSysmodulePreloadModuleForLibkernel] 23 | call r9 24 | 25 | ; Restore R9 26 | pop r9 27 | 28 | ; Save register 29 | push rdi 30 | push rsi 31 | push rdx 32 | push rax 33 | 34 | ; Call dynlib_dlsym with custom name 35 | mov rdi, 0 36 | lea rsi, [doSubstitute] 37 | lea rdx, [fakeReturnAddress] 38 | mov rax, 591 39 | syscall 40 | 41 | ; restore register 42 | pop rax 43 | pop rdx 44 | pop rsi 45 | pop rdi 46 | ret 47 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/hdb_err.h: -------------------------------------------------------------------------------- 1 | /* Generated from /usr/src/kerberos5/lib/libhdb/../../../crypto/heimdal/lib/hdb/hdb_err.et */ 2 | /* $Id: hdb_err.et 15878 2005-08-11 13:17:22Z lha $ */ 3 | 4 | #ifndef __hdb_err_h__ 5 | #define __hdb_err_h__ 6 | 7 | struct et_list; 8 | 9 | void initialize_hdb_error_table_r(struct et_list **); 10 | 11 | void initialize_hdb_error_table(void); 12 | #define init_hdb_err_tbl initialize_hdb_error_table 13 | 14 | typedef enum hdb_error_number{ 15 | HDB_ERR_UK_SERROR = 36150273, 16 | HDB_ERR_UK_RERROR = 36150274, 17 | HDB_ERR_NOENTRY = 36150275, 18 | HDB_ERR_DB_INUSE = 36150276, 19 | HDB_ERR_DB_CHANGED = 36150277, 20 | HDB_ERR_RECURSIVELOCK = 36150278, 21 | HDB_ERR_NOTLOCKED = 36150279, 22 | HDB_ERR_BADLOCKMODE = 36150280, 23 | HDB_ERR_CANT_LOCK_DB = 36150281, 24 | HDB_ERR_EXISTS = 36150282, 25 | HDB_ERR_BADVERSION = 36150283, 26 | HDB_ERR_NO_MKEY = 36150284, 27 | HDB_ERR_MANDATORY_OPTION = 36150285 28 | } hdb_error_number; 29 | 30 | #define ERROR_TABLE_BASE_hdb 36150272 31 | 32 | #endif /* __hdb_err_h__ */ 33 | -------------------------------------------------------------------------------- /external/mira/Trainers/Api.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file Api.hpp 3 | * @author kd (@kd_tech_) 4 | * @brief 5 | * @version 0.1 6 | * @date 2021-01-10 7 | * 8 | * @copyright Copyright (c) 2021 OpenOrbis 9 | * 10 | */ 11 | #pragma once 12 | #include "Apis/v1.hpp" 13 | 14 | #if __cplusplus 15 | extern "C" { 16 | #endif // __cplusplus 17 | 18 | struct Trainer_t 19 | { 20 | // Version of this trainer, this is so we can maintain compatibility with old trainers 21 | uint32_t ApiVersion; 22 | 23 | union 24 | { 25 | struct v1Trainer_t v1; 26 | }; 27 | }; 28 | 29 | /** 30 | * @brief Entrypoint called for when a trainer loads 31 | * 32 | * @return enum SubstituteError return error 33 | */ 34 | extern int32_t trainer_load(); 35 | 36 | /** 37 | * @brief Entrypoint called for when a trainer unloads 38 | * 39 | * @return enum SubstituteError return error 40 | */ 41 | extern int32_t trainer_unload(); 42 | 43 | extern int32_t trainer_hookiat(); 44 | extern int32_t trainer_hook(); 45 | 46 | #if __cplusplus 47 | } 48 | #endif // __cplusplus -------------------------------------------------------------------------------- /external/freebsd-headers/include/machine/clock.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Kernel interface to machine-dependent clock driver. 3 | * Garrett Wollman, September 1994. 4 | * This file is in the public domain. 5 | * 6 | * $FreeBSD: release/9.0.0/sys/amd64/include/clock.h 221703 2011-05-09 17:34:00Z jkim $ 7 | */ 8 | 9 | #ifndef _MACHINE_CLOCK_H_ 10 | #define _MACHINE_CLOCK_H_ 11 | 12 | #ifdef _KERNEL 13 | /* 14 | * i386 to clock driver interface. 15 | * XXX large parts of the driver and its interface are misplaced. 16 | */ 17 | extern int clkintr_pending; 18 | extern u_int i8254_freq; 19 | extern int i8254_max_count; 20 | extern uint64_t tsc_freq; 21 | extern int tsc_is_invariant; 22 | extern int tsc_perf_stat; 23 | 24 | void i8254_init(void); 25 | 26 | /* 27 | * Driver to clock driver interface. 28 | */ 29 | 30 | void startrtclock(void); 31 | void init_TSC(void); 32 | 33 | #define HAS_TIMER_SPKR 1 34 | int timer_spkr_acquire(void); 35 | int timer_spkr_release(void); 36 | void timer_spkr_setfreq(int freq); 37 | 38 | #endif /* _KERNEL */ 39 | 40 | #endif /* !_MACHINE_CLOCK_H_ */ 41 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/mp.h: -------------------------------------------------------------------------------- 1 | /* $FreeBSD: release/9.0.0/lib/libmp/mp.h 189092 2009-02-26 21:43:15Z ed $ */ 2 | 3 | #ifndef _MP_H_ 4 | #define _MP_H_ 5 | 6 | #ifndef HEADER_BN_H_ 7 | #include 8 | #endif 9 | 10 | typedef struct _mint { 11 | BIGNUM *bn; 12 | } MINT; 13 | 14 | void mp_gcd(const MINT *, const MINT *, MINT *); 15 | MINT *mp_itom(short); 16 | void mp_madd(const MINT *, const MINT *, MINT *); 17 | int mp_mcmp(const MINT *, const MINT *); 18 | void mp_mdiv(const MINT *, const MINT *, MINT *, MINT *); 19 | void mp_mfree(MINT *); 20 | void mp_min(MINT *); 21 | void mp_mout(const MINT *); 22 | void mp_move(const MINT *, MINT *); 23 | void mp_msqrt(const MINT *, MINT *, MINT *); 24 | void mp_msub(const MINT *, const MINT *, MINT *); 25 | char *mp_mtox(const MINT *); 26 | void mp_mult(const MINT *, const MINT *, MINT *); 27 | void mp_pow(const MINT *, const MINT *, const MINT *, MINT *); 28 | void mp_rpow(const MINT *, short, MINT *); 29 | void mp_sdiv(const MINT *, short, MINT *, short *); 30 | MINT *mp_xtom(const char *); 31 | 32 | #endif /* !_MP_H_ */ 33 | -------------------------------------------------------------------------------- /kernel/src/Boot/OptionsBlock.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Mira 5 | { 6 | namespace Boot 7 | { 8 | class OptionsBlock 9 | { 10 | private: 11 | /** 12 | * @brief IsAdvancedMode allows super-users to enable more dangerous features on their consoles 13 | * 14 | * This will allow to configure automatic syscall hooking, rpc validation, and other features 15 | */ 16 | bool IsAdvancedMode; 17 | 18 | // Advanced Mode Settings 19 | bool RpcValidationEnabled; 20 | bool SyscallGuardEnabled; 21 | bool FakeSelfEnabled; 22 | bool FakePkgEnabled; 23 | bool DebuggerBreakOnAttach; 24 | bool AslrEnabled; 25 | bool FuseEnabled; 26 | 27 | bool LogServerEnabled; 28 | uint16_t LogServerPort; 29 | 30 | bool RpcServerEnabled; 31 | uint16_t RpcServerPort; 32 | 33 | public: 34 | void SetDefaults(); 35 | }; 36 | } 37 | } -------------------------------------------------------------------------------- /mira_module/src/Processes/Process.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace Mira 6 | { 7 | namespace Processes 8 | { 9 | class Thread; 10 | 11 | class Process 12 | { 13 | private: 14 | std::unordered_map m_Threads; 15 | 16 | protected: 17 | int32_t m_ProcessId; 18 | int32_t m_Signal; 19 | 20 | std::string m_Name; 21 | std::string m_ElfPath; 22 | std::string m_RandomizedPath; 23 | 24 | private: 25 | bool Internal_UpdateProcess(); 26 | 27 | public: 28 | Process(int32_t p_ProcessId); 29 | 30 | bool ReadMemory(void* p_Address, uint8_t* p_OutData, uint32_t p_Size); 31 | bool WriteMemory(void* p_Address, uint8_t* p_InData, uint32_t p_Size); 32 | 33 | static Process* GetCurrentProcess(); 34 | static Process* GetProcessById(int32_t p_ProcessId); 35 | static Process* GetProcessByName(const char* p_ProcessName); 36 | }; 37 | } 38 | } -------------------------------------------------------------------------------- /external/mira/Kernel/Boot/Patches.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace Mira 6 | { 7 | namespace Boot 8 | { 9 | class Patches 10 | { 11 | public: 12 | static void install_prePatches(); 13 | static void install_prerunPatches_176(); 14 | static void install_prerunPatches_405(); 15 | static void install_prerunPatches_455(); 16 | static void install_prerunPatches_474(); 17 | static void install_prerunPatches_501(); 18 | static void install_prerunPatches_503(); 19 | static void install_prerunPatches_505(); 20 | static void install_prerunPatches_620(); 21 | static void install_prerunPatches_650(); 22 | static void install_prerunPatches_672(); 23 | static void install_prerunPatches_755(); 24 | // static void install_prerunPatches_SteamLink(); // got both versions booting off the same code 25 | static void install_prerunPatches_SteamLink2(); 26 | }; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /kernel/src/Utils/_Syscall.s: -------------------------------------------------------------------------------- 1 | .intel_syntax noprefix 2 | .text 3 | 4 | .global syscall1, syscall2, syscall3, syscall4, syscall5, syscall6, _mmap 5 | 6 | syscall: 7 | mov rax,rdi 8 | syscall 9 | ret 10 | 11 | syscall1: 12 | mov rax,rdi 13 | mov rdi,rsi 14 | syscall 15 | ret 16 | 17 | syscall2: 18 | mov rax,rdi 19 | mov rdi,rsi 20 | mov rsi,rdx 21 | syscall 22 | ret 23 | 24 | syscall3: 25 | mov rax,rdi 26 | mov rdi,rsi 27 | mov rsi,rdx 28 | mov rdx,rcx 29 | syscall 30 | ret 31 | 32 | syscall4: 33 | mov rax,rdi 34 | mov rdi,rsi 35 | mov rsi,rdx 36 | mov rdx,rcx 37 | mov r10,r8 38 | syscall 39 | ret 40 | 41 | syscall5: 42 | mov rax,rdi 43 | mov rdi,rsi 44 | mov rsi,rdx 45 | mov rdx,rcx 46 | mov r10,r8 47 | mov r8,r9 48 | syscall 49 | ret 50 | 51 | syscall6: 52 | mov rax,rdi 53 | mov rdi,rsi 54 | mov rsi,rdx 55 | mov rdx,rcx 56 | mov r10,r8 57 | mov r8,r9 58 | mov r9, [rsp] 59 | syscall 60 | ret 61 | 62 | _mmap: 63 | mov rax, 477 64 | mov r10, rcx 65 | syscall 66 | ret 67 | -------------------------------------------------------------------------------- /loader/src/Utils/Syscall.s: -------------------------------------------------------------------------------- 1 | .intel_syntax noprefix 2 | .text 3 | 4 | .global syscall1, syscall2, syscall3, syscall4, syscall5, syscall6, _mmap 5 | 6 | syscall: 7 | mov rax,rdi 8 | syscall 9 | ret 10 | 11 | syscall1: 12 | mov rax,rdi 13 | mov rdi,rsi 14 | syscall 15 | ret 16 | 17 | syscall2: 18 | mov rax,rdi 19 | mov rdi,rsi 20 | mov rsi,rdx 21 | syscall 22 | ret 23 | 24 | syscall3: 25 | mov rax,rdi 26 | mov rdi,rsi 27 | mov rsi,rdx 28 | mov rdx,rcx 29 | syscall 30 | ret 31 | 32 | syscall4: 33 | mov rax,rdi 34 | mov rdi,rsi 35 | mov rsi,rdx 36 | mov rdx,rcx 37 | mov r10,r8 38 | syscall 39 | ret 40 | 41 | syscall5: 42 | mov rax,rdi 43 | mov rdi,rsi 44 | mov rsi,rdx 45 | mov rdx,rcx 46 | mov r10,r8 47 | mov r8,r9 48 | syscall 49 | ret 50 | 51 | syscall6: 52 | mov rax,rdi 53 | mov rdi,rsi 54 | mov rsi,rdx 55 | mov rdx,rcx 56 | mov r10,r8 57 | mov r8,r9 58 | mov r9, [rsp] 59 | syscall 60 | ret 61 | 62 | _mmap: 63 | mov rax, 477 64 | mov r10, rcx 65 | syscall 66 | ret 67 | -------------------------------------------------------------------------------- /loader/src/link.ld: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT("elf64-x86-64") 2 | OUTPUT_ARCH(i386:x86-64) 3 | 4 | ENTRY(_start) 5 | 6 | PHDRS 7 | { 8 | /* 9 | * PF_X = 0x1 10 | * PF_W = 0x2 11 | * PF_R = 0x4 12 | */ 13 | 14 | ph_text PT_LOAD FLAGS (0x1 | 0x4); 15 | ph_data PT_LOAD FLAGS (0x2 | 0x4); 16 | } 17 | 18 | SECTIONS 19 | { 20 | __payload_base = .; 21 | 22 | .text : 23 | { 24 | KEEP (*(.init)) 25 | KEEP (*(.fini)) 26 | 27 | *(.text .text.*) 28 | 29 | . = ALIGN(4); 30 | } : ph_text = 0x90909090 31 | 32 | . = ALIGN(0x4000); 33 | 34 | .rodata : 35 | { 36 | *(.rodata .rodata.*) 37 | 38 | . = ALIGN(4); 39 | } 40 | 41 | . = ALIGN(0x4000); 42 | 43 | .data : 44 | { 45 | *(.data .data.*) 46 | 47 | . = ALIGN(0x10); 48 | 49 | __imports_start = .; 50 | KEEP(*(.imports .imports.*)) 51 | __imports_end = .; 52 | 53 | __patches_start = .; 54 | KEEP(*(.patches .patches.*)) 55 | QUAD(0); BYTE(0); BYTE(0); 56 | __patches_end = .; 57 | 58 | __bss_start = .; 59 | *(.bss .bss.*) *(COMMON) 60 | __bss_end = .; 61 | 62 | . = . + 4; 63 | . = ALIGN(4); 64 | } : ph_data 65 | 66 | . = ALIGN(0x4000); 67 | } 68 | 69 | -------------------------------------------------------------------------------- /trainer_loader/src/link.ld: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT("elf64-x86-64") 2 | OUTPUT_ARCH(i386:x86-64) 3 | 4 | ENTRY(_start) 5 | 6 | PHDRS 7 | { 8 | /* 9 | * PF_X = 0x1 10 | * PF_W = 0x2 11 | * PF_R = 0x4 12 | */ 13 | 14 | ph_text PT_LOAD FLAGS (0x1 | 0x4); 15 | ph_data PT_LOAD FLAGS (0x2 | 0x4); 16 | } 17 | 18 | SECTIONS 19 | { 20 | __payload_base = .; 21 | 22 | .text : 23 | { 24 | KEEP (*(.init)) 25 | KEEP (*(.fini)) 26 | 27 | *(.text .text.*) 28 | 29 | . = ALIGN(4); 30 | } : ph_text = 0x90909090 31 | 32 | . = ALIGN(0x4000); 33 | 34 | .rodata : 35 | { 36 | *(.rodata .rodata.*) 37 | 38 | . = ALIGN(4); 39 | } 40 | 41 | . = ALIGN(0x4000); 42 | 43 | .data : 44 | { 45 | *(.data .data.*) 46 | 47 | . = ALIGN(0x10); 48 | 49 | __imports_start = .; 50 | KEEP(*(.imports .imports.*)) 51 | __imports_end = .; 52 | 53 | __patches_start = .; 54 | KEEP(*(.patches .patches.*)) 55 | QUAD(0); BYTE(0); BYTE(0); 56 | __patches_end = .; 57 | 58 | __bss_start = .; 59 | *(.bss .bss.*) *(COMMON) 60 | __bss_end = .; 61 | 62 | . = . + 4; 63 | . = ALIGN(4); 64 | } : ph_data 65 | 66 | . = ALIGN(0x4000); 67 | } 68 | 69 | -------------------------------------------------------------------------------- /external/mira/Trainers/ApiDefs.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file ApiDefs.hpp 3 | * @author kd (@kd_tech_) 4 | * @brief This file is used for structures that won't change based on API version 5 | * @version 0.1 6 | * @date 2021-01-10 7 | * 8 | * @copyright Copyright (c) 2021 OpenOrbis 9 | * 10 | */ 11 | #pragma once 12 | #include 13 | 14 | #if __cplusplus 15 | extern "C" { 16 | #endif // __cplusplus 17 | 18 | /** 19 | * @brief Describes how the underlying data type should be interpreted 20 | * 21 | */ 22 | enum OptionType_t 23 | { 24 | OT_None, 25 | OT_Boolean, 26 | OT_UInt8, 27 | OT_Int8, 28 | OT_UInt16, 29 | OT_Int16, 30 | OT_UInt32, 31 | OT_Int32, 32 | OT_UInt64, 33 | OT_Int64, 34 | OT_Float, 35 | OT_Double, 36 | OT_COUNT 37 | }; 38 | 39 | /** 40 | * @brief How the underlying data type should be shown to the end-user 41 | * 42 | */ 43 | enum DisplayType_t 44 | { 45 | DT_None, 46 | DT_Checkbox, 47 | DT_Slider, 48 | DT_Textbox, 49 | DT_ProgressBar, 50 | DT_Label, 51 | DT_NumberBox, 52 | DT_COUNT 53 | }; 54 | 55 | #if __cplusplus 56 | } 57 | #endif // __cplusplus -------------------------------------------------------------------------------- /external/freebsd-headers/include/asn1_err.h: -------------------------------------------------------------------------------- 1 | /* Generated from /usr/src/kerberos5/lib/libasn1/../../../crypto/heimdal/lib/asn1/asn1_err.et */ 2 | /* $Id: asn1_err.et 21394 2007-07-02 10:14:43Z lha $ */ 3 | 4 | #ifndef __asn1_err_h__ 5 | #define __asn1_err_h__ 6 | 7 | struct et_list; 8 | 9 | void initialize_asn1_error_table_r(struct et_list **); 10 | 11 | void initialize_asn1_error_table(void); 12 | #define init_asn1_err_tbl initialize_asn1_error_table 13 | 14 | typedef enum asn1_error_number{ 15 | ASN1_BAD_TIMEFORMAT = 1859794432, 16 | ASN1_MISSING_FIELD = 1859794433, 17 | ASN1_MISPLACED_FIELD = 1859794434, 18 | ASN1_TYPE_MISMATCH = 1859794435, 19 | ASN1_OVERFLOW = 1859794436, 20 | ASN1_OVERRUN = 1859794437, 21 | ASN1_BAD_ID = 1859794438, 22 | ASN1_BAD_LENGTH = 1859794439, 23 | ASN1_BAD_FORMAT = 1859794440, 24 | ASN1_PARSE_ERROR = 1859794441, 25 | ASN1_EXTRA_DATA = 1859794442, 26 | ASN1_BAD_CHARACTER = 1859794443, 27 | ASN1_MIN_CONSTRAINT = 1859794444, 28 | ASN1_MAX_CONSTRAINT = 1859794445, 29 | ASN1_EXACT_CONSTRAINT = 1859794446 30 | } asn1_error_number; 31 | 32 | #define ERROR_TABLE_BASE_asn1 1859794432 33 | 34 | #endif /* __asn1_err_h__ */ 35 | -------------------------------------------------------------------------------- /daemon/src/Rpc/Connection.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | extern "C" 5 | { 6 | #include 7 | } 8 | 9 | namespace Mira 10 | { 11 | namespace Rpc 12 | { 13 | class Connection 14 | { 15 | private: 16 | uint64_t m_Id; 17 | int32_t m_Socket; 18 | struct sockaddr_in m_Address; 19 | 20 | std::function OnDisconnectCallback; 21 | 22 | public: 23 | Connection(uint64_t p_Id, int32_t p_Socket, struct sockaddr_in& p_Address, std::function p_DisconnectCallback) : 24 | m_Id(p_Id), 25 | m_Socket(p_Socket), 26 | m_Address { 0 }, 27 | OnDisconnectCallback(p_DisconnectCallback) 28 | { 29 | // Copy over our client address 30 | memcpy(&m_Address, &p_Address, sizeof(m_Address)); 31 | } 32 | 33 | uint64_t GetId() const { return m_Id; } 34 | int32_t GetSocket() const { return m_Socket; } 35 | const struct sockaddr_in& GetAddress() const { return m_Address; } 36 | }; 37 | } 38 | } -------------------------------------------------------------------------------- /external/freebsd-headers/include/netatalk/endian.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 1990,1991 Regents of The University of Michigan. 3 | * All Rights Reserved. 4 | * 5 | * Permission to use, copy, modify, and distribute this software and 6 | * its documentation for any purpose and without fee is hereby granted, 7 | * provided that the above copyright notice appears in all copies and 8 | * that both that copyright notice and this permission notice appear 9 | * in supporting documentation, and that the name of The University 10 | * of Michigan not be used in advertising or publicity pertaining to 11 | * distribution of the software without specific, written prior 12 | * permission. This software is supplied as is without expressed or 13 | * implied warranties of any kind. 14 | * 15 | * Research Systems Unix Group 16 | * The University of Michigan 17 | * c/o Mike Clark 18 | * 535 W. William Street 19 | * Ann Arbor, Michigan 20 | * +1-313-763-0525 21 | * netatalk@itd.umich.edu 22 | * 23 | * $FreeBSD: release/9.0.0/sys/netatalk/endian.h 139827 2005-01-07 02:35:34Z imp $ 24 | */ 25 | 26 | #ifndef _ATALK_ENDIAN_H_ 27 | #define _ATALK_ENDIAN_H_ 28 | 29 | #include 30 | 31 | #endif /* !_ATALK_ENDIAN_H_ */ 32 | -------------------------------------------------------------------------------- /CONTRIBUTION.md: -------------------------------------------------------------------------------- 1 | Shamelessly Stolen and Modified from RPCS3's Repo: https://github.com/RPCS3/rpcs3/wiki/coding-style 2 | 3 | We recommend to follow these guidelines when writing code for Mira-Project. They aren't very strict rules since we want to be flexible and we understand that under certain circumstances some of them can be counterproductive. Just try to follow as many of them as possible: 4 | 5 | ### General coding style 6 | * Variable naming: *Prefix + CamelCase* 7 | * Globals: _g__* 8 | * Class members: _m__* 9 | * Scoped: _s__* 10 | * Looped: _l__* 11 | * Constants: _c__* 12 | * Template parameter names: *CamelCase*, or just T, U, V... 13 | * Avoid `#defines`, use constant variables instead, preferrably in an enum class. 14 | * Put curly-brackets (`{` and `}`) on the next line. 15 | * Eliminate all compiler warnings from your code. 16 | * Comment *every* hack you do, *every* snippet you comment out and *every* improvable code. 17 | * If you have to comment or place a commented code snippet, include the reasons to do that in the comment. 18 | * Ensure that every source file you modify has the newline at the end of file. Every line ends with "newline" and the end of file must have "newline" too, GitHub usually warns about it. -------------------------------------------------------------------------------- /external/freebsd-headers/include/machine/pc/display.h: -------------------------------------------------------------------------------- 1 | /* 2 | * IBM PC display definitions 3 | * 4 | * $FreeBSD: release/9.0.0/sys/amd64/include/pc/display.h 139730 2005-01-05 20:11:13Z imp $ 5 | */ 6 | 7 | /* Color attributes for foreground text */ 8 | 9 | #define FG_BLACK 0 10 | #define FG_BLUE 1 11 | #define FG_GREEN 2 12 | #define FG_CYAN 3 13 | #define FG_RED 4 14 | #define FG_MAGENTA 5 15 | #define FG_BROWN 6 16 | #define FG_LIGHTGREY 7 17 | #define FG_DARKGREY 8 18 | #define FG_LIGHTBLUE 9 19 | #define FG_LIGHTGREEN 10 20 | #define FG_LIGHTCYAN 11 21 | #define FG_LIGHTRED 12 22 | #define FG_LIGHTMAGENTA 13 23 | #define FG_YELLOW 14 24 | #define FG_WHITE 15 25 | #define FG_BLINK 0x80 26 | 27 | /* Color attributes for text background */ 28 | 29 | #define BG_BLACK 0x00 30 | #define BG_BLUE 0x10 31 | #define BG_GREEN 0x20 32 | #define BG_CYAN 0x30 33 | #define BG_RED 0x40 34 | #define BG_MAGENTA 0x50 35 | #define BG_BROWN 0x60 36 | #define BG_LIGHTGREY 0x70 37 | 38 | /* Monochrome attributes for foreground text */ 39 | 40 | #define FG_UNDERLINE 0x01 41 | #define FG_INTENSE 0x08 42 | 43 | /* Monochrome attributes for text background */ 44 | 45 | #define BG_INTENSE 0x10 46 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/hdb-private.h: -------------------------------------------------------------------------------- 1 | /* This is a generated file */ 2 | #ifndef __hdb_private_h__ 3 | #define __hdb_private_h__ 4 | 5 | #include 6 | 7 | krb5_error_code 8 | _hdb_fetch ( 9 | krb5_context /*context*/, 10 | HDB */*db*/, 11 | krb5_const_principal /*principal*/, 12 | unsigned /*flags*/, 13 | hdb_entry_ex */*entry*/); 14 | 15 | hdb_master_key 16 | _hdb_find_master_key ( 17 | uint32_t */*mkvno*/, 18 | hdb_master_key /*mkey*/); 19 | 20 | int 21 | _hdb_mkey_decrypt ( 22 | krb5_context /*context*/, 23 | hdb_master_key /*key*/, 24 | krb5_key_usage /*usage*/, 25 | void */*ptr*/, 26 | size_t /*size*/, 27 | krb5_data */*res*/); 28 | 29 | int 30 | _hdb_mkey_encrypt ( 31 | krb5_context /*context*/, 32 | hdb_master_key /*key*/, 33 | krb5_key_usage /*usage*/, 34 | const void */*ptr*/, 35 | size_t /*size*/, 36 | krb5_data */*res*/); 37 | 38 | int 39 | _hdb_mkey_version (hdb_master_key /*mkey*/); 40 | 41 | krb5_error_code 42 | _hdb_remove ( 43 | krb5_context /*context*/, 44 | HDB */*db*/, 45 | krb5_const_principal /*principal*/); 46 | 47 | krb5_error_code 48 | _hdb_store ( 49 | krb5_context /*context*/, 50 | HDB */*db*/, 51 | unsigned /*flags*/, 52 | hdb_entry_ex */*entry*/); 53 | 54 | #endif /* __hdb_private_h__ */ 55 | -------------------------------------------------------------------------------- /external/mira/Kernel/Utils/Logger.cpp: -------------------------------------------------------------------------------- 1 | // This is an open source non-commercial project. Dear PVS-Studio, please check it. 2 | // PVS-Studio Static Code Analyzer for C, C++, C#, and Java: http://www.viva64.com 3 | 4 | #include 5 | #include 6 | 7 | extern "C" 8 | { 9 | #include 10 | }; 11 | 12 | using namespace Mira::Utils; 13 | 14 | Logger* Logger::m_Instance = nullptr; 15 | Logger* Logger::GetInstance() 16 | { 17 | if (m_Instance == nullptr) 18 | m_Instance = new Logger(); 19 | 20 | return m_Instance; 21 | } 22 | 23 | Logger::Logger() : 24 | m_LogLevel(LL_None), 25 | m_Buffer{0}, 26 | m_FinalBuffer{0}, 27 | m_Handle(-1) 28 | { 29 | #ifdef _DEBUG 30 | m_LogLevel = LL_Debug; 31 | #else 32 | m_LogLevel = LL_Error; 33 | #endif 34 | m_Handle = -1; 35 | 36 | memset(m_Buffer, 0, sizeof(m_Buffer)); 37 | memset(m_FinalBuffer, 0, sizeof(m_FinalBuffer)); 38 | 39 | // Initialize a mutex to prevent overlapping spam 40 | auto sx_init_flags = (void(*)(struct sx* sx, const char* description, int opts))kdlsym(_sx_init_flags); 41 | sx_init_flags(&m_Mutex, "logsx", 0); 42 | } 43 | 44 | Logger::~Logger() 45 | { 46 | // auto mtx_destroy = (void(*)(struct mtx* mutex))kdlsym(mtx_destroy); 47 | // mtx_destroy(&m_Mutex); 48 | } -------------------------------------------------------------------------------- /daemon/src/Daemon.cpp: -------------------------------------------------------------------------------- 1 | #include "Daemon.hpp" 2 | 3 | #include 4 | 5 | #include 6 | #include 7 | 8 | using namespace Mira; 9 | 10 | std::shared_ptr Daemon::GetInstance() 11 | { 12 | static std::shared_ptr s_Instance = std::make_shared(); 13 | return s_Instance; 14 | } 15 | 16 | Daemon::Daemon() : 17 | m_Debugger(nullptr), 18 | m_FtpServer(nullptr), 19 | m_RpcManager(nullptr) 20 | { 21 | 22 | } 23 | 24 | Daemon::~Daemon() 25 | { 26 | if (m_RpcManager) 27 | m_RpcManager.reset(); 28 | 29 | if (m_Debugger) 30 | m_Debugger.reset(); 31 | 32 | if (m_FtpServer) 33 | m_FtpServer.reset(); 34 | } 35 | 36 | bool Daemon::OnLoad() 37 | { 38 | // Create the message manager if it isn't already 39 | if (!m_RpcManager) 40 | m_RpcManager = std::make_shared(); 41 | 42 | // Create the debugger if it isn't already 43 | if (!m_Debugger) 44 | m_Debugger = std::make_shared(); 45 | 46 | // Load the debugger 47 | if (!m_Debugger->OnLoad()) 48 | { 49 | WriteLog(LL_Error, "could not load debugger."); 50 | return false; 51 | } 52 | 53 | return true; 54 | } -------------------------------------------------------------------------------- /mira_module/src/Trainers/SubstituteHook.cpp: -------------------------------------------------------------------------------- 1 | #include "SubstituteHook.hpp" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | void* Mira::SubstituteHook::FindJmpslotAddress(char* p_Module, char* p_Function, bool p_isNid) 10 | { 11 | // TODO: Reimplement 12 | /*// Open mira device 13 | auto s_Device = open("/dev/mira", O_RDWR); 14 | if (s_Device == -1) 15 | return NULL; 16 | 17 | // Cast the header and set the needed values 18 | MiraFindJMPSlot s_Request; 19 | 20 | // Zero out the entire buffer to prevent garbage from being read back 21 | memset(&s_Request, 0, sizeof(MiraFindJMPSlot)); 22 | 23 | void* result = NULL; 24 | 25 | snprintf(s_Request.module, _MAX_PATH, "%s", p_Module); 26 | snprintf(s_Request.function, _MAX_PATH, "%s", p_Function); 27 | 28 | s_Request.is_nid = p_isNid; 29 | s_Request.value = (void*)&result; 30 | 31 | // Call Substitute 32 | auto s_Ret = ioctl(s_Device, MIRA_FIND_JMPSLOT, s_Request); 33 | if (s_Ret != 0) 34 | { 35 | close(s_Device); 36 | return NULL; 37 | } 38 | 39 | close(s_Device); 40 | return result;*/ 41 | return nullptr; 42 | } -------------------------------------------------------------------------------- /kernel/src/Driver/v1/Processes/ProcessCtrl.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | struct thread; 5 | struct cdev; 6 | 7 | namespace Mira 8 | { 9 | namespace Driver 10 | { 11 | namespace v1 12 | { 13 | class ProcessCtrl 14 | { 15 | public: 16 | static int32_t OnIoctl(struct cdev* p_Device, u_long p_Command, caddr_t p_Data, int32_t p_FFlag, struct thread* p_Thread); 17 | 18 | private: 19 | static bool GetProcessList(); 20 | static bool GetProcessMainThread(); 21 | 22 | protected: 23 | static int32_t OnProcessAllocateMemory(struct cdev* p_Device, u_long p_Command, caddr_t p_Data, int32_t p_FFlag, struct thread* p_Thread); 24 | static int32_t OnProcessFreeMemory(struct cdev* p_Device, u_long p_Command, caddr_t p_Data, int32_t p_FFlag, struct thread* p_Thread); 25 | static int32_t OnProcessReadMemory(struct cdev* p_Device, u_long p_Command, caddr_t p_Data, int32_t p_FFlag, struct thread* p_Thread); 26 | static int32_t OnProcessWriteMemory(struct cdev* p_Device, u_long p_Command, caddr_t p_Data, int32_t p_FFlag, struct thread* p_Thread); 27 | }; 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /external/freebsd-headers/include/sys/snoop.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 1995 Ugen J.S.Antsilevich 3 | * 4 | * Redistribution and use in source forms, with and without modification, 5 | * are permitted provided that this entire comment appears intact. 6 | * 7 | * Redistribution in binary form may occur without any restrictions. 8 | * Obviously, it would be nice if you gave credit where credit is due 9 | * but requiring it would be too onerous. 10 | * 11 | * This software is provided ``AS IS'' without any warranties of any kind. 12 | * 13 | * Snoop stuff. 14 | * 15 | * $FreeBSD: release/9.0.0/sys/sys/snoop.h 150298 2005-09-18 19:23:35Z cognet $ 16 | */ 17 | 18 | #ifndef _SYS_SNOOP_H_ 19 | #define _SYS_SNOOP_H_ 20 | 21 | #ifndef _KERNEL 22 | #include 23 | #endif 24 | #include 25 | 26 | /* 27 | * These are snoop io controls 28 | * SNPSTTY accepts a file descriptor as input. 29 | */ 30 | 31 | #define SNPSTTY _IOW('T', 90, int) 32 | #define SNPGTTY _IOR('T', 89, dev_t) 33 | 34 | /* 35 | * These values would be returned by FIONREAD ioctl 36 | * instead of number of characters in buffer in case 37 | * of specific errors. 38 | */ 39 | #define SNP_OFLOW -1 40 | #define SNP_TTYCLOSE -2 41 | #define SNP_DETACH -3 42 | 43 | #endif /* !_SYS_SNOOP_H_ */ 44 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/sys/dataacq.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Header for general data acquisition definitions. 3 | * 4 | * $FreeBSD: release/9.0.0/sys/sys/dataacq.h 59874 2000-05-01 20:32:07Z peter $ 5 | */ 6 | 7 | #ifndef _SYS_DATAACQ_H_ 8 | #define _SYS_DATAACQ_H_ 9 | 10 | #include 11 | 12 | /* Period in microseconds between analog I/O samples. 13 | */ 14 | #define AD_MICRO_PERIOD_SET _IOW('A', 1, long) 15 | #define AD_MICRO_PERIOD_GET _IOR('A', 2, long) 16 | 17 | /* Gain list support. Initially all gains are 1. If the board 18 | * supports no gains at all then AD_NGAINS_GET will return a 0. 19 | * 20 | * AD_NGAINS_GET: Return the number of gains the board supports 21 | * 22 | * AD_SUPPORTED_GAINS: Get the supported gains. 23 | * The driver will copy out "ngains" doubles, 24 | * where "ngains" is obtained with AD_NGAINS_GET. 25 | * 26 | * AD_GAINS_SET: Set the gain list. The driver will copy in "ngains" ints. 27 | * 28 | * AD_GAINS_GET: Get the gain list. The driver will copy out "ngains" ints. 29 | */ 30 | 31 | #define AD_NGAINS_GET _IOR('A', 3, int) 32 | #define AD_NCHANS_GET _IOR('A', 4, int) 33 | #define AD_SUPPORTED_GAINS _IO('A', 5) 34 | #define AD_GAINS_SET _IO('A', 6) 35 | #define AD_GAINS_GET _IO('A', 7) 36 | 37 | #endif /* !_SYS_DATAACQ_H_ */ 38 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/netgraph/ng_sppp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ng_sppp.h Netgraph to Sppp module. 3 | */ 4 | 5 | /*- 6 | * Copyright (C) 2002-2004 Cronyx Engineering. 7 | * Copyright (C) 2002-2004 Roman Kurakin 8 | * 9 | * This software is distributed with NO WARRANTIES, not even the implied 10 | * warranties for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 11 | * 12 | * Authors grant any other persons or organisations a permission to use, 13 | * modify and redistribute this software in source and binary forms, 14 | * as long as this message is kept with the software, all derivative 15 | * works or modified versions. 16 | * 17 | * $FreeBSD: release/9.0.0/sys/netgraph/ng_sppp.h 141197 2005-02-03 13:03:31Z ru $ 18 | * Cronyx Id: ng_sppp.h,v 1.1.2.6 2004/03/01 15:17:21 rik Exp $ 19 | */ 20 | 21 | #ifndef _NETGRAPH_SPPP_H_ 22 | #define _NETGRAPH_SPPP_H_ 23 | 24 | /* Node type name and magic cookie */ 25 | #define NG_SPPP_NODE_TYPE "sppp" 26 | #define NGM_SPPP_COOKIE 1040804655 27 | 28 | /* Interface base name */ 29 | #define NG_SPPP_IFACE_NAME "sppp" 30 | 31 | /* My hook names */ 32 | #define NG_SPPP_HOOK_DOWNSTREAM "downstream" 33 | 34 | /* Netgraph commands */ 35 | enum { 36 | NGM_SPPP_GET_IFNAME = 1, /* returns struct ng_sppp_ifname */ 37 | }; 38 | 39 | #endif /* _NETGRAPH_SPPP_H_ */ 40 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/lwres/lang.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") 3 | * Copyright (C) 2000, 2001 Internet Software Consortium. 4 | * 5 | * Permission to use, copy, modify, and/or distribute this software for any 6 | * purpose with or without fee is hereby granted, provided that the above 7 | * copyright notice and this permission notice appear in all copies. 8 | * 9 | * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH 10 | * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 11 | * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, 12 | * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 13 | * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 14 | * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 15 | * PERFORMANCE OF THIS SOFTWARE. 16 | */ 17 | 18 | /* $Id: lang.h,v 1.13 2007-06-19 23:47:23 tbox Exp $ */ 19 | 20 | #ifndef LWRES_LANG_H 21 | #define LWRES_LANG_H 1 22 | 23 | /*! \file lwres/lang.h */ 24 | 25 | #ifdef __cplusplus 26 | #define LWRES_LANG_BEGINDECLS extern "C" { 27 | #define LWRES_LANG_ENDDECLS } 28 | #else 29 | #define LWRES_LANG_BEGINDECLS 30 | #define LWRES_LANG_ENDDECLS 31 | #endif 32 | 33 | #endif /* LWRES_LANG_H */ 34 | -------------------------------------------------------------------------------- /daemon/src/Rpc/FileManagerListener.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Listener.hpp" 3 | 4 | namespace Mira 5 | { 6 | namespace Rpc 7 | { 8 | class FileManagerListener : 9 | public Listener 10 | { 11 | private: 12 | enum 13 | { 14 | MaxBufferSize = 0xFFFF 15 | }; 16 | 17 | public: 18 | #ifdef _PROTOBUF 19 | FileManagerListener(google::protobuf::Arena* p_Arena); 20 | #else 21 | FileManagerListener(); 22 | #endif 23 | virtual ~FileManagerListener(); 24 | virtual Status OnMessage(RpcMessage* p_Request, RpcMessage* p_Response) override; 25 | 26 | Status OnEcho(RpcMessage* p_Request, RpcMessage* p_Response); 27 | Status OnOpen(RpcMessage* p_Request, RpcMessage* p_Response); 28 | Status OnClose(RpcMessage* p_Request, RpcMessage* p_Response); 29 | Status OnRead(RpcMessage* p_Request, RpcMessage* p_Response); 30 | Status OnList(RpcMessage* p_Request, RpcMessage* p_Response); 31 | Status OnStat(RpcMessage* p_Request, RpcMessage* p_Response); 32 | Status OnMkdir(RpcMessage* p_Request, RpcMessage* p_Response); 33 | Status OnUnlink(RpcMessage* p_Request, RpcMessage* p_Response); 34 | }; 35 | } 36 | } -------------------------------------------------------------------------------- /external/freebsd-headers/include/cam/scsi/scsi_iu.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * This file is in the public domain. 3 | * $FreeBSD: release/9.0.0/sys/cam/scsi/scsi_iu.h 139743 2005-01-05 22:34:37Z imp $ 4 | */ 5 | #ifndef _SCSI_SCSI_IU_H 6 | #define _SCSI_SCSI_IU_H 1 7 | 8 | struct scsi_status_iu_header 9 | { 10 | u_int8_t reserved[2]; 11 | u_int8_t flags; 12 | #define SIU_SNSVALID 0x2 13 | #define SIU_RSPVALID 0x1 14 | u_int8_t status; 15 | u_int8_t sense_length[4]; 16 | u_int8_t pkt_failures_length[4]; 17 | u_int8_t pkt_failures[1]; 18 | }; 19 | 20 | #define SIU_PKTFAIL_OFFSET(siu) 12 21 | #define SIU_PKTFAIL_CODE(siu) (scsi_4btoul((siu)->pkt_failures) & 0xFF) 22 | #define SIU_PFC_NONE 0 23 | #define SIU_PFC_CIU_FIELDS_INVALID 2 24 | #define SIU_PFC_TMF_NOT_SUPPORTED 4 25 | #define SIU_PFC_TMF_FAILED 5 26 | #define SIU_PFC_INVALID_TYPE_CODE 6 27 | #define SIU_PFC_ILLEGAL_REQUEST 7 28 | #define SIU_SENSE_OFFSET(siu) \ 29 | (12 + (((siu)->flags & SIU_RSPVALID) \ 30 | ? scsi_4btoul((siu)->pkt_failures_length) \ 31 | : 0)) 32 | 33 | #define SIU_TASKMGMT_NONE 0x00 34 | #define SIU_TASKMGMT_ABORT_TASK 0x01 35 | #define SIU_TASKMGMT_ABORT_TASK_SET 0x02 36 | #define SIU_TASKMGMT_CLEAR_TASK_SET 0x04 37 | #define SIU_TASKMGMT_LUN_RESET 0x08 38 | #define SIU_TASKMGMT_TARGET_RESET 0x20 39 | #define SIU_TASKMGMT_CLEAR_ACA 0x40 40 | #endif /*_SCSI_SCSI_IU_H*/ 41 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/lwres/version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") 3 | * Copyright (C) 2001 Internet Software Consortium. 4 | * 5 | * Permission to use, copy, modify, and/or distribute this software for any 6 | * purpose with or without fee is hereby granted, provided that the above 7 | * copyright notice and this permission notice appear in all copies. 8 | * 9 | * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH 10 | * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 11 | * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, 12 | * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 13 | * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 14 | * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 15 | * PERFORMANCE OF THIS SOFTWARE. 16 | */ 17 | 18 | /* $Id: version.h,v 1.9 2007-06-19 23:47:23 tbox Exp $ */ 19 | 20 | /*! \file lwres/version.h */ 21 | 22 | #include 23 | 24 | LIBLWRES_EXTERNAL_DATA extern const char lwres_version[]; 25 | 26 | LIBLWRES_EXTERNAL_DATA extern const unsigned int lwres_libinterface; 27 | LIBLWRES_EXTERNAL_DATA extern const unsigned int lwres_librevision; 28 | LIBLWRES_EXTERNAL_DATA extern const unsigned int lwres_libage; 29 | -------------------------------------------------------------------------------- /kernel/src/Plugins/SyscallGuard/SyscallGuardPlugin.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | extern "C" 6 | { 7 | #include 8 | #include 9 | #include 10 | }; 11 | 12 | namespace Mira 13 | { 14 | namespace Plugins 15 | { 16 | enum class CallStatus : uint8_t 17 | { 18 | Status_Disabled, 19 | Status_Reserved, 20 | Status_Enabled, 21 | Status_COUNT 22 | }; 23 | 24 | class SyscallGuard : 25 | public Mira::Utils::IModule 26 | { 27 | private: 28 | uint32_t m_SyscallCount; 29 | CallStatus* m_CallStatuses; 30 | sy_call_t** m_SyCalls; 31 | 32 | enum { SyscallCount_Max = 1024 }; 33 | 34 | public: 35 | SyscallGuard(); 36 | virtual ~SyscallGuard(); 37 | 38 | virtual bool OnLoad() { return true; } 39 | virtual bool OnUnload() { return true; } 40 | virtual bool OnSuspend() { return true; } 41 | virtual bool OnResume() { return true; } 42 | 43 | bool SetReservedSyscall(int p_SyscallNumber, sy_call_t p_Call); 44 | 45 | protected: 46 | static int SyscallHandler(struct thread * p_Thread, void * p_Uap); 47 | }; 48 | } 49 | } -------------------------------------------------------------------------------- /daemon/src/Debugging/Instance.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace Mira 6 | { 7 | namespace Debugging 8 | { 9 | class Instance 10 | { 11 | private: 12 | /* Number of registers. */ 13 | enum 14 | { 15 | NUMREGS = 14, 16 | NUMREGBYTES = (NUMREGS * 8), 17 | }; 18 | 19 | enum regnames 20 | { 21 | RAX, 22 | RCX, 23 | RDX, 24 | RBX, 25 | RSP, 26 | RBP, 27 | RSI, 28 | RDI, 29 | RIP, 30 | EFLAGS, 31 | CS, 32 | SS, 33 | DS, 34 | ES, 35 | R8, 36 | R9, 37 | R10, 38 | R11, 39 | R12, 40 | R13, 41 | R14, 42 | R15, 43 | FS, 44 | GS, 45 | REGS_COUNT 46 | }; 47 | 48 | int32_t m_Socket; 49 | struct sockaddr_in m_Connection; 50 | 51 | protected: 52 | void putDebugChar(); 53 | int getDebugChar(); 54 | void exceptionHandler(); 55 | }; 56 | } 57 | } -------------------------------------------------------------------------------- /kernel/src/Boot/Patches.cpp: -------------------------------------------------------------------------------- 1 | // This is an open source non-commercial project. Dear PVS-Studio, please check it. 2 | // PVS-Studio Static Code Analyzer for C, C++, C#, and Java: http://www.viva64.com 3 | 4 | #include 5 | 6 | using namespace Mira::Boot; 7 | 8 | void Patches::install_prePatches() 9 | { 10 | switch (MIRA_PLATFORM) 11 | { 12 | case MIRA_PLATFORM_ORBIS_BSD_176: 13 | install_prerunPatches_176(); 14 | break; 15 | case MIRA_PLATFORM_ORBIS_BSD_405: 16 | install_prerunPatches_405(); 17 | break; 18 | case MIRA_PLATFORM_ORBIS_BSD_455: 19 | install_prerunPatches_455(); 20 | break; 21 | case MIRA_PLATFORM_ORBIS_BSD_474: 22 | install_prerunPatches_474(); 23 | break; 24 | case MIRA_PLATFORM_ORBIS_BSD_501: 25 | install_prerunPatches_501(); 26 | break; 27 | case MIRA_PLATFORM_ORBIS_BSD_503: 28 | install_prerunPatches_503(); 29 | break; 30 | case MIRA_PLATFORM_ORBIS_BSD_505: 31 | install_prerunPatches_505(); 32 | break; 33 | case MIRA_PLATFORM_ORBIS_BSD_620: 34 | install_prerunPatches_620(); 35 | break; 36 | case MIRA_PLATFORM_ORBIS_BSD_650: 37 | install_prerunPatches_650(); 38 | break; 39 | case MIRA_PLATFORM_ORBIS_BSD_672: 40 | install_prerunPatches_672(); 41 | break; 42 | case MIRA_PLATFORM_ORBIS_BSD_755: 43 | install_prerunPatches_755(); 44 | break; 45 | default: 46 | break; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /loader/src/Boot/Patches.cpp: -------------------------------------------------------------------------------- 1 | // This is an open source non-commercial project. Dear PVS-Studio, please check it. 2 | // PVS-Studio Static Code Analyzer for C, C++, C#, and Java: http://www.viva64.com 3 | 4 | #include 5 | 6 | using namespace Mira::Boot; 7 | 8 | void Patches::install_prePatches() 9 | { 10 | switch (MIRA_PLATFORM) 11 | { 12 | case MIRA_PLATFORM_ORBIS_BSD_176: 13 | install_prerunPatches_176(); 14 | break; 15 | case MIRA_PLATFORM_ORBIS_BSD_405: 16 | install_prerunPatches_405(); 17 | break; 18 | case MIRA_PLATFORM_ORBIS_BSD_455: 19 | install_prerunPatches_455(); 20 | break; 21 | case MIRA_PLATFORM_ORBIS_BSD_474: 22 | install_prerunPatches_474(); 23 | break; 24 | case MIRA_PLATFORM_ORBIS_BSD_501: 25 | install_prerunPatches_501(); 26 | break; 27 | case MIRA_PLATFORM_ORBIS_BSD_503: 28 | install_prerunPatches_503(); 29 | break; 30 | case MIRA_PLATFORM_ORBIS_BSD_505: 31 | install_prerunPatches_505(); 32 | break; 33 | case MIRA_PLATFORM_ORBIS_BSD_620: 34 | install_prerunPatches_620(); 35 | break; 36 | case MIRA_PLATFORM_ORBIS_BSD_650: 37 | install_prerunPatches_650(); 38 | break; 39 | case MIRA_PLATFORM_ORBIS_BSD_672: 40 | install_prerunPatches_672(); 41 | break; 42 | case MIRA_PLATFORM_ORBIS_BSD_755: 43 | install_prerunPatches_755(); 44 | break; 45 | default: 46 | break; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /external/mira/Kernel/Boot/InitParams.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | struct proc; 5 | struct _ElfLoader_t; 6 | 7 | namespace MiraLoader 8 | { 9 | class Loader; 10 | } 11 | namespace Mira 12 | { 13 | namespace Boot 14 | { 15 | typedef struct InitParms_t 16 | { 17 | // Payload base address, can be allocated dynamically 18 | uint64_t payloadBase; 19 | 20 | // Payload size 21 | uint64_t payloadSize; 22 | 23 | uint64_t allocatedBase; 24 | 25 | // Kernel process handle 26 | struct proc* process; 27 | 28 | // Entrypoint 29 | // Userland should set this to NULL 30 | void(*entrypoint)(void*); 31 | 32 | // ElfLoader 33 | MiraLoader::Loader* elfLoader; 34 | 35 | // If this is an elf launch or not 36 | uint8_t isElf : 1; 37 | 38 | // If the kproc is currently running 39 | uint8_t isRunning : 1; 40 | #if 0 41 | // Additional, old mira loader will not handle these 42 | uint64_t kernelTextBase; 43 | uint64_t kernelTextSize; 44 | uint64_t kernelDataBase; 45 | uint64_t kernelDataSize; 46 | uint64_t kernelprison0; 47 | uint64_t kernelrootvnode; 48 | #endif 49 | } InitParams; 50 | } 51 | } -------------------------------------------------------------------------------- /external/freebsd-headers/include/rpcsvc/yppasswd.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Please do not edit this file. 3 | * It was generated using rpcgen. 4 | */ 5 | 6 | #ifndef _YPPASSWD_H_RPCGEN 7 | #define _YPPASSWD_H_RPCGEN 8 | 9 | #include 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | 16 | struct x_passwd { 17 | char *pw_name; 18 | char *pw_passwd; 19 | int pw_uid; 20 | int pw_gid; 21 | char *pw_gecos; 22 | char *pw_dir; 23 | char *pw_shell; 24 | }; 25 | typedef struct x_passwd x_passwd; 26 | 27 | struct yppasswd { 28 | char *oldpass; 29 | x_passwd newpw; 30 | }; 31 | typedef struct yppasswd yppasswd; 32 | #include 33 | extern int _yppasswd( char * , struct x_passwd * ); 34 | #define yppasswd(x,y) _yppasswd(x,y) 35 | 36 | #define YPPASSWDPROG ((unsigned long)(100009)) 37 | #define YPPASSWDVERS ((unsigned long)(1)) 38 | 39 | extern void yppasswdprog_1(struct svc_req *rqstp, SVCXPRT *transp); 40 | #define YPPASSWDPROC_UPDATE ((unsigned long)(1)) 41 | extern int * yppasswdproc_update_1(yppasswd *, CLIENT *); 42 | extern int * yppasswdproc_update_1_svc(yppasswd *, struct svc_req *); 43 | extern int yppasswdprog_1_freeresult(SVCXPRT *, xdrproc_t, caddr_t); 44 | 45 | /* the xdr functions */ 46 | extern bool_t xdr_x_passwd(XDR *, x_passwd*); 47 | extern bool_t xdr_yppasswd(XDR *, yppasswd*); 48 | 49 | #ifdef __cplusplus 50 | } 51 | #endif 52 | 53 | #endif /* !_YPPASSWD_H_RPCGEN */ 54 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:focal 2 | 3 | # Version to build 4 | ENV MIRA_PLATFORM MIRA_PLATFORM_ORBIS_BSD_672 5 | 6 | # Install key 7 | RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add - 8 | 9 | # Install dependencies 10 | RUN apt-get -qq update && \ 11 | apt-get install -qqy --install-recommends \ 12 | ca-certificates \ 13 | autoconf automake cmake dpkg-dev file git make patch \ 14 | libc-dev libc++-dev libgcc-10-dev libstdc++-10-dev \ 15 | dirmngr gnupg2 lbzip2 wget xz-utils libtinfo5 clang-13 lldb-13 lld-13 git tar && \ 16 | rm -rf /var/lib/apt/lists/* 17 | 18 | # TODO: Prep OOSDK Toolchain 19 | RUN mkdir /toolchain && cd /toolchain && wget https://github.com/OpenOrbis/OpenOrbis-PS4-Toolchain/releases/download/v0.5.2/v0.5.2.tar.gz && \ 20 | tar -zxvf v0.5.2.tar.gz && mv OpenOrbis/PS4Toolchain/* /toolchain && rm -rf /toolchain/OpenOrbis && \ 21 | export OO_PS4_TOOLCHAIN=/toolchain 22 | 23 | # Build Mira 24 | RUN export MIRA_PLATFORM=${MIRA_PLATFORM} && mkdir /build && cd /build && \ 25 | git clone https://github.com/kiwidoggie/mira-project.git && \ 26 | /usr/local/bin/cmake --no-warn-unused-cli -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_BUILD_TYPE:STRING=Debug -DMIRA_PLATFORM=${MIRA_PLATFORM} -H/build/mira-project -B/build/mira-project/build -G "Unix Makefiles" \ 27 | /usr/local/bin/cmake --build /build/mira-project --config Debug --target clean -j 34 -- -------------------------------------------------------------------------------- /mira_module/src/Processes/Thread.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "x86_64regs.hpp" 3 | 4 | #include 5 | 6 | namespace Mira 7 | { 8 | namespace Processes 9 | { 10 | class Thread 11 | { 12 | protected: 13 | int32_t m_ThreadId; 14 | 15 | int32_t m_Error; 16 | 17 | int64_t m_ReturnValue; 18 | 19 | // Name of this thrad 20 | std::string m_Name; 21 | 22 | // General purpose registers (GPRs) 23 | GPRegisters m_GpRegisters; 24 | 25 | // Floating point registers (FPRs) 26 | FPRegisters m_FpRegisters; 27 | 28 | // Debug registers (DBRs) 29 | DBRegisters m_DbRegisters; 30 | 31 | private: 32 | // Update general purpose registers 33 | bool Internal_UpdateGprs(); 34 | 35 | // Update floating point registers 36 | bool Intenral_UpdateFprs(); 37 | 38 | // Update debug registers 39 | bool Internal_UpdateDbrs(); 40 | 41 | // Update all current thread information 42 | bool Internal_UpdateThread(); 43 | 44 | public: 45 | Thread(int32_t p_ProcessId); 46 | ~Thread(); 47 | 48 | bool Step(); 49 | bool Continue(); 50 | bool Kill(); 51 | bool Suspend(); 52 | bool Resume(); 53 | }; 54 | } 55 | } -------------------------------------------------------------------------------- /trainer_loader/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Set the project to be a C CXX ASM 2 | project(trainer_loader) 3 | 4 | # Include all of the OOSDK defaults 5 | include(${CMAKE_SOURCE_DIR}/scripts/payload.cmake) 6 | 7 | enable_language(ASM) 8 | 9 | # Set the include directories 10 | include_directories(${CMAKE_SOURCE_DIR}/external ${CMAKE_SOURCE_DIR}/external/mira ${CMAKE_SOURCE_DIR}/external/freebsd-headers/include) 11 | 12 | add_link_options(-T ${PROJECT_SOURCE_DIR}/src/link.ld) 13 | 14 | # Get all of the source files that need to be compiled 15 | file(GLOB_RECURSE PROJ_SRC_FILES ${PROJECT_SOURCE_DIR}/*.cpp ${PROJECT_SOURCE_DIR}/*.cc ${PROJECT_SOURCE_DIR}/*.cxx ${PROJECT_SOURCE_DIR}/*.h ${PROJECT_SOURCE_DIR}/*.hpp ${PROJECT_SOURCE_DIR}/*.hxx) 16 | file(GLOB_RECURSE PROJ_S_FILES ${PROJECT_SOURCE_DIR}/*.s ${PROJECT_SOURCE_DIR}/*.S) 17 | 18 | # Set all assembler flags 19 | set_source_files_properties(${PROJECT_SOURCE_DIR}/src/__crt0.S PROPERTIES COMPILE_FLAGS "-x assembler-with-cpp") 20 | set_source_files_properties(${PROJ_S_FILES} PROPERTIES COMPILE_FLAGS "-x assembler-with-cpp") 21 | 22 | add_executable(trainer_loader ${PROJECT_SOURCE_DIR}/src/__crt0.S ${PROJ_S_FILES} ${PROJ_SRC_FILES}) 23 | 24 | get_target_property(LIBA_INCLUDES trainer_loader INCLUDE_DIRECTORIES) 25 | 26 | set(LOADER_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/trainer_loader) 27 | add_custom_command(TARGET trainer_loader POST_BUILD COMMAND objcopy -O binary ${LOADER_OUTPUT_PATH} ${LOADER_OUTPUT_PATH}.bin) 28 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/lwres/int.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") 3 | * Copyright (C) 2000, 2001 Internet Software Consortium. 4 | * 5 | * Permission to use, copy, modify, and/or distribute this software for any 6 | * purpose with or without fee is hereby granted, provided that the above 7 | * copyright notice and this permission notice appear in all copies. 8 | * 9 | * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH 10 | * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 11 | * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, 12 | * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 13 | * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 14 | * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 15 | * PERFORMANCE OF THIS SOFTWARE. 16 | */ 17 | 18 | /* $Id: int.h,v 1.14 2007-06-19 23:47:23 tbox Exp $ */ 19 | 20 | #ifndef LWRES_INT_H 21 | #define LWRES_INT_H 1 22 | 23 | /*! \file lwres/int.h */ 24 | 25 | typedef char lwres_int8_t; 26 | typedef unsigned char lwres_uint8_t; 27 | typedef short lwres_int16_t; 28 | typedef unsigned short lwres_uint16_t; 29 | typedef int lwres_int32_t; 30 | typedef unsigned int lwres_uint32_t; 31 | typedef long long lwres_int64_t; 32 | typedef unsigned long long lwres_uint64_t; 33 | 34 | #endif /* LWRES_INT_H */ 35 | -------------------------------------------------------------------------------- /trainer_loader/src/_syscalls.s: -------------------------------------------------------------------------------- 1 | .intel_syntax noprefix 2 | .text 3 | 4 | .global syscall1, syscall2, syscall3, syscall4, syscall5, syscall6, _mmap 5 | .extern __error 6 | 7 | syscall: 8 | mov rax,rdi 9 | syscall 10 | jb _error 11 | ret 12 | 13 | syscall1: 14 | mov rax,rdi 15 | mov rdi,rsi 16 | syscall 17 | jb _error 18 | ret 19 | 20 | syscall2: 21 | mov rax,rdi 22 | mov rdi,rsi 23 | mov rsi,rdx 24 | syscall 25 | jb _error 26 | ret 27 | 28 | syscall3: 29 | mov rax,rdi 30 | mov rdi,rsi 31 | mov rsi,rdx 32 | mov rdx,rcx 33 | syscall 34 | jb _error 35 | ret 36 | 37 | syscall4: 38 | mov rax,rdi 39 | mov rdi,rsi 40 | mov rsi,rdx 41 | mov rdx,rcx 42 | mov r10,r8 43 | syscall 44 | jb _error 45 | ret 46 | 47 | syscall5: 48 | mov rax,rdi 49 | mov rdi,rsi 50 | mov rsi,rdx 51 | mov rdx,rcx 52 | mov r10,r8 53 | mov r8,r9 54 | syscall 55 | jb _error 56 | ret 57 | 58 | syscall6: 59 | mov rax,rdi 60 | mov rdi,rsi 61 | mov rsi,rdx 62 | mov rdx,rcx 63 | mov r10,r8 64 | mov r8,r9 65 | mov r9, [rsp] 66 | syscall 67 | jb _error 68 | ret 69 | 70 | _mmap: 71 | mov rax, 477 72 | mov r10, rcx 73 | syscall 74 | ret 75 | 76 | # Copy pasted from ps4-payload-sdk 77 | _error: 78 | cmp qword ptr __error[rip], 0 79 | jz _end 80 | push rax 81 | call __error[rip] 82 | pop rcx 83 | mov [rax], ecx 84 | mov rax, -1 85 | mov rdx, -1 86 | 87 | _end: 88 | ret -------------------------------------------------------------------------------- /external/freebsd-headers/include/netatalk/phase2.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 1990,1991 Regents of The University of Michigan. 3 | * All Rights Reserved. 4 | * 5 | * Permission to use, copy, modify, and distribute this software and 6 | * its documentation for any purpose and without fee is hereby granted, 7 | * provided that the above copyright notice appears in all copies and 8 | * that both that copyright notice and this permission notice appear 9 | * in supporting documentation, and that the name of The University 10 | * of Michigan not be used in advertising or publicity pertaining to 11 | * distribution of the software without specific, written prior 12 | * permission. This software is supplied as is without expressed or 13 | * implied warranties of any kind. 14 | * 15 | * This product includes software developed by the University of 16 | * California, Berkeley and its contributors. 17 | * 18 | * Research Systems Unix Group 19 | * The University of Michigan 20 | * c/o Wesley Craig 21 | * 535 W. William Street 22 | * Ann Arbor, Michigan 23 | * +1-313-764-2278 24 | * netatalk@umich.edu 25 | * $FreeBSD: release/9.0.0/sys/netatalk/phase2.h 139827 2005-01-07 02:35:34Z imp $ 26 | */ 27 | 28 | #include 29 | 30 | #define llc_org_code llc_un.type_snap.org_code 31 | #define llc_ether_type llc_un.type_snap.ether_type 32 | 33 | #define SIOCPHASE1 _IOW('i', 100, struct ifreq) /* AppleTalk phase 1 */ 34 | #define SIOCPHASE2 _IOW('i', 101, struct ifreq) /* AppleTalk phase 2 */ 35 | -------------------------------------------------------------------------------- /daemon/src/Rpc/Listener.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Status.hpp" 3 | 4 | #ifdef _PROTOBUF 5 | #include "Protos/Rpc.pb.h" 6 | #endif 7 | 8 | #include 9 | 10 | namespace Mira 11 | { 12 | namespace Rpc 13 | { 14 | class RpcMessage; 15 | enum class Status; 16 | 17 | class Listener 18 | { 19 | protected: 20 | #ifdef _PROTOBUF 21 | google::protobuf::Arena* m_Arena; 22 | #endif 23 | 24 | public: 25 | #ifdef _PROTOBUF 26 | Listener(google::protobuf::Arena* p_Arena) : 27 | m_Arena(p_Arena) 28 | #endif 29 | Listener(void* p_Pointer) 30 | { 31 | 32 | } 33 | 34 | virtual ~Listener() { } 35 | virtual Status OnMessage(RpcMessage* p_Request, RpcMessage* p_Response) = 0; 36 | 37 | template 38 | void SetInnerMessage(RpcMessage* p_Message, T& p_InnerMessage) 39 | { 40 | #if _PROTOBUF 41 | auto s_Any = google::protobuf::Arena::CreateMessage(m_Arena); 42 | if (!s_Any) 43 | { 44 | WriteLog(LL_Error, "could not create new any."); 45 | return; 46 | } 47 | 48 | s_Any->PackFrom(p_InnerMessage); 49 | 50 | p_Message->set_allocated_inner_message(s_Any); 51 | #endif 52 | } 53 | }; 54 | } 55 | } -------------------------------------------------------------------------------- /loader/README.md: -------------------------------------------------------------------------------- 1 | # Mira Loader Component 2 | 3 | MiraLoader is designed to embed multi-stage elf's or payloads internally and start their execution from *anywhere* in memory. The code has been compiled in a way that as long as the payload is loaded into memory at any random address with proper execution permission flags that it will run. 4 | 5 | ## Support for 6 | - Usermode ELF's 7 | - Usermode payloads 8 | - Kernel ELF's (change interpreter string to begin with `kern` to execute entrypoint as new kernel process) 9 | 10 | ### Behavior 11 | When the loader first starts depending on how it was compiled. If it was compiled with `_SOCKET_LOADER` defined it will wait on port `9021` for a payload (first instruction at :0 is `jmp`) or ELF. If the ELF header is found in the first 4 bytes, the ElfLoader will check for the .interp section in the ELF then check the data to see if it begins with `kern`. If it does it will execute as a kernel process, otherwise it will relocate the ELF in current memory space in the current process and jump to it. 12 | 13 | If the loader was not compiled with `_SOCKET_LOADER` defined, then it will use some linker and compiler magic to embed trainer_loader and mira's elf into itself for a all-in-one loader binary file that you can use with any payload loader. No need for sockets or waiting for payloads! 14 | 15 | The entrypoint is `mira_entry` which is determined by the linker script. Using MiraLoader you *MUST NOT* use any `static` variables, they will not be relocated and cause out of memory errors or kernel panics. 16 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/clang/3.0/x86intrin.h: -------------------------------------------------------------------------------- 1 | /*===---- x86intrin.h - X86 intrinsics -------------------------------------=== 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | * 21 | *===-----------------------------------------------------------------------=== 22 | */ 23 | 24 | #ifndef __X86INTRIN_H 25 | #define __X86INTRIN_H 26 | 27 | #include 28 | 29 | // FIXME: SSE4A, 3dNOW, FMA4, XOP, LWP, ABM, POPCNT 30 | 31 | #endif /* __X86INTRIN_H */ 32 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/fs/udf/osta.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Prototypes for the OSTA functions 3 | * 4 | * $FreeBSD: release/9.0.0/sys/fs/udf/osta.h 162255 2006-09-12 19:02:34Z imp $ 5 | */ 6 | 7 | /*- 8 | ********************************************************************** 9 | * OSTA compliant Unicode compression, uncompression routines. 10 | * Copyright 1995 Micro Design International, Inc. 11 | * Written by Jason M. Rinn. 12 | * Micro Design International gives permission for the free use of the 13 | * following source code. 14 | */ 15 | 16 | /* 17 | * Various routines from the OSTA 2.01 specs. Copyrights are included with 18 | * each code segment. Slight whitespace modifications have been made for 19 | * formatting purposes. Typos/bugs have been fixed. 20 | */ 21 | 22 | #ifndef UNIX 23 | #define UNIX 24 | #endif 25 | 26 | #ifndef MAXLEN 27 | #define MAXLEN 255 28 | #endif 29 | 30 | /*********************************************************************** 31 | * The following two typedef's are to remove compiler dependancies. 32 | * byte needs to be unsigned 8-bit, and unicode_t needs to be 33 | * unsigned 16-bit. 34 | */ 35 | typedef unsigned short unicode_t; 36 | typedef unsigned char byte; 37 | 38 | int udf_UncompressUnicode(int, byte *, unicode_t *); 39 | int udf_UncompressUnicodeByte(int, byte *, byte *); 40 | int udf_CompressUnicode(int, int, unicode_t *, byte *); 41 | unsigned short udf_cksum(unsigned char *, int); 42 | unsigned short udf_unicode_cksum(unsigned short *, int); 43 | int UDFTransName(unicode_t *, unicode_t *, int); 44 | -------------------------------------------------------------------------------- /example_trainer/src/_syscalls.s: -------------------------------------------------------------------------------- 1 | .intel_syntax noprefix 2 | .text 3 | 4 | .global syscall1, syscall2, syscall3, syscall4, syscall5, syscall6, _mmap 5 | .extern __error 6 | 7 | syscall: 8 | mov rax,rdi 9 | syscall 10 | jb _error 11 | ret 12 | 13 | syscall1: 14 | mov rax,rdi 15 | mov rdi,rsi 16 | syscall 17 | jb _error 18 | ret 19 | 20 | syscall2: 21 | mov rax,rdi 22 | mov rdi,rsi 23 | mov rsi,rdx 24 | syscall 25 | jb _error 26 | ret 27 | 28 | syscall3: 29 | mov rax,rdi 30 | mov rdi,rsi 31 | mov rsi,rdx 32 | mov rdx,rcx 33 | syscall 34 | jb _error 35 | ret 36 | 37 | syscall4: 38 | mov rax,rdi 39 | mov rdi,rsi 40 | mov rsi,rdx 41 | mov rdx,rcx 42 | mov r10,r8 43 | syscall 44 | jb _error 45 | ret 46 | 47 | syscall5: 48 | mov rax,rdi 49 | mov rdi,rsi 50 | mov rsi,rdx 51 | mov rdx,rcx 52 | mov r10,r8 53 | mov r8,r9 54 | syscall 55 | jb _error 56 | ret 57 | 58 | syscall6: 59 | mov rax,rdi 60 | mov rdi,rsi 61 | mov rsi,rdx 62 | mov rdx,rcx 63 | mov r10,r8 64 | mov r8,r9 65 | mov r9, [rsp] 66 | syscall 67 | jb _error 68 | ret 69 | 70 | _mmap: 71 | mov rax, 477 72 | mov r10, rcx 73 | syscall 74 | ret 75 | 76 | # Copy pasted from ps4-payload-sdk 77 | _error: 78 | cmp qword ptr __error[rip], 0 79 | jz _end 80 | push rax 81 | call __error[rip] 82 | pop rcx 83 | mov [rax], ecx 84 | mov rax, -1 85 | mov rdx, -1 86 | 87 | _end: 88 | ret -------------------------------------------------------------------------------- /external/freebsd-headers/include/heim_err.h: -------------------------------------------------------------------------------- 1 | /* Generated from /usr/src/kerberos5/lib/libkrb5/../../../crypto/heimdal/lib/krb5/heim_err.et */ 2 | /* $Id: heim_err.et 13352 2004-02-13 16:23:40Z lha $ */ 3 | 4 | #ifndef __heim_err_h__ 5 | #define __heim_err_h__ 6 | 7 | struct et_list; 8 | 9 | void initialize_heim_error_table_r(struct et_list **); 10 | 11 | void initialize_heim_error_table(void); 12 | #define init_heim_err_tbl initialize_heim_error_table 13 | 14 | typedef enum heim_error_number{ 15 | HEIM_ERR_LOG_PARSE = -1980176640, 16 | HEIM_ERR_V4_PRINC_NO_CONV = -1980176639, 17 | HEIM_ERR_SALTTYPE_NOSUPP = -1980176638, 18 | HEIM_ERR_NOHOST = -1980176637, 19 | HEIM_ERR_OPNOTSUPP = -1980176636, 20 | HEIM_ERR_EOF = -1980176635, 21 | HEIM_ERR_BAD_MKEY = -1980176634, 22 | HEIM_ERR_SERVICE_NOMATCH = -1980176633, 23 | HEIM_PKINIT_NO_CERTIFICATE = -1980176576, 24 | HEIM_PKINIT_NO_PRIVATE_KEY = -1980176575, 25 | HEIM_PKINIT_NO_VALID_CA = -1980176574, 26 | HEIM_PKINIT_CERTIFICATE_INVALID = -1980176573, 27 | HEIM_PKINIT_PRIVATE_KEY_INVALID = -1980176572, 28 | HEIM_EAI_UNKNOWN = -1980176512, 29 | HEIM_EAI_ADDRFAMILY = -1980176511, 30 | HEIM_EAI_AGAIN = -1980176510, 31 | HEIM_EAI_BADFLAGS = -1980176509, 32 | HEIM_EAI_FAIL = -1980176508, 33 | HEIM_EAI_FAMILY = -1980176507, 34 | HEIM_EAI_MEMORY = -1980176506, 35 | HEIM_EAI_NODATA = -1980176505, 36 | HEIM_EAI_NONAME = -1980176504, 37 | HEIM_EAI_SERVICE = -1980176503, 38 | HEIM_EAI_SOCKTYPE = -1980176502, 39 | HEIM_EAI_SYSTEM = -1980176501 40 | } heim_error_number; 41 | 42 | #define ERROR_TABLE_BASE_heim -1980176640 43 | 44 | #endif /* __heim_err_h__ */ 45 | -------------------------------------------------------------------------------- /external/mira/Kernel/Utils/New.cpp: -------------------------------------------------------------------------------- 1 | // This is an open source non-commercial project. Dear PVS-Studio, please check it. 2 | // PVS-Studio Static Code Analyzer for C, C++, C#, and Java: http://www.viva64.com 3 | 4 | #include "New.hpp" 5 | #include 6 | 7 | extern "C" 8 | { 9 | #include 10 | #include 11 | 12 | #include 13 | }; 14 | 15 | void * operator new(unsigned long int p_Size) 16 | { 17 | auto malloc = (void*(*)(unsigned long size, struct malloc_type* type, int flags))kdlsym(malloc); 18 | auto M_TEMP = (struct malloc_type*)kdlsym(M_TEMP); 19 | 20 | // Sanity check 21 | if (p_Size >= 0x10000000 || p_Size == 0) 22 | { 23 | auto printf = (void(*)(const char *format, ...))kdlsym(printf); 24 | printf("op_new error: requested (%llx) data\n\n\n", p_Size); 25 | 26 | for (;;) 27 | __asm__("nop"); 28 | } 29 | 30 | return malloc(p_Size, M_TEMP, M_ZERO | M_NOWAIT); 31 | } 32 | 33 | // placement new 34 | void * operator new(unsigned long int p_Size, void * p_Pointer) 35 | { 36 | return p_Pointer; 37 | } 38 | 39 | // operator new[] 40 | void * operator new[] (unsigned long int p_Size) 41 | { 42 | return ::operator new(p_Size); 43 | } 44 | 45 | // Delete 46 | void operator delete(void* p_Pointer) noexcept 47 | { 48 | if (p_Pointer == nullptr) 49 | return; 50 | 51 | auto free = (void(*)(void* addr, struct malloc_type* type))kdlsym(free); 52 | auto M_TEMP = (struct malloc_type*)kdlsym(M_TEMP); 53 | 54 | free(p_Pointer, M_TEMP); 55 | } 56 | 57 | void operator delete[](void* p_Pointer) noexcept 58 | { 59 | ::operator delete(p_Pointer); 60 | } 61 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/fs/udf/udf_mount.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2003 Ryuichiro Imura 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 | * SUCH DAMAGE. 25 | * 26 | * $FreeBSD: release/9.0.0/sys/fs/udf/udf_mount.h 122102 2003-11-05 06:56:08Z scottl $ 27 | */ 28 | 29 | #define UDFMNT_KICONV 0x00000001 30 | -------------------------------------------------------------------------------- /daemon/src/Entry.cpp: -------------------------------------------------------------------------------- 1 | #include "Daemon.hpp" 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | #if defined(PS4) 10 | #include 11 | #endif 12 | 13 | std::thread g_LaunchThread; 14 | 15 | extern "C" void trainer_load() 16 | { 17 | g_LaunchThread = std::thread([]() 18 | { 19 | WriteLog(LL_Debug, "MiraDaemon Entry Point."); 20 | 21 | // Create a new instance of our daemon 22 | auto s_Daemon = Mira::Daemon::GetInstance(); 23 | if (s_Daemon == nullptr) 24 | { 25 | WriteLog(LL_Error, "could not create daemon."); 26 | return -1; 27 | } 28 | 29 | // Try and load the daemon 30 | if (!s_Daemon->OnLoad()) 31 | { 32 | WriteLog(LL_Error, "could not load daemon."); 33 | return -2; 34 | } 35 | 36 | for (;;) 37 | __asm__("nop"); 38 | }); 39 | 40 | g_LaunchThread.detach(); 41 | } 42 | 43 | 44 | // Entry point 45 | int daemon_entry(void) 46 | { 47 | WriteLog(LL_Debug, "MiraDaemon Entry Point."); 48 | 49 | // Create a new instance of our daemon 50 | auto s_Daemon = Mira::Daemon::GetInstance(); 51 | if (s_Daemon == nullptr) 52 | { 53 | WriteLog(LL_Error, "could not create daemon."); 54 | return -1; 55 | } 56 | 57 | // Try and load the daemon 58 | if (!s_Daemon->OnLoad()) 59 | { 60 | WriteLog(LL_Error, "could not load daemon."); 61 | return -2; 62 | } 63 | 64 | for (;;) 65 | __asm__("nop"); 66 | 67 | return 0; 68 | } -------------------------------------------------------------------------------- /kernel/src/OrbisOS/asm/rpcldr.asm: -------------------------------------------------------------------------------- 1 | ; rpcldr.s 2 | ; From golden a.k.a jogolden 3 | ; Edited for Mira 4 | ; Use NASM for compile and edit Utilities 5 | 6 | BITS 64 7 | DEFAULT REL 8 | 9 | magic: db 'MIRA' 10 | entrypoint: dq rpcldr 11 | ldrdone: dd 0 12 | stubentry: dq 0 13 | scePthreadAttrInit: dq 0 14 | scePthreadAttrSetstacksize: dq 0 15 | scePthreadCreate: dq 0 16 | thr_initial: dq 0 17 | 18 | hthread: dq 0 19 | scePthreadAttr: dq 0 20 | str_rpcstub: db 'rpcstub', 0 21 | 22 | rpcldr: 23 | ; load pthread data into fs 24 | mov rdi, qword [thr_initial] 25 | mov rsi, qword [rdi] 26 | mov rdi, qword [rsi + 0x1E0] 27 | call amd64_set_fsbase 28 | 29 | ; create attr 30 | lea rdi, [scePthreadAttr] 31 | mov r12, qword [scePthreadAttrInit] 32 | call r12 33 | 34 | ; set stack size 35 | mov rsi, 0x80000 ; 512 kb 36 | lea rdi, [scePthreadAttr] 37 | mov r12, qword [scePthreadAttrSetstacksize] 38 | call r12 39 | 40 | ; create thread 41 | lea r8, [str_rpcstub] 42 | mov rcx, 0 43 | mov rdx, qword [stubentry] 44 | lea rsi, [scePthreadAttr] 45 | lea rdi, [hthread] 46 | mov r12, qword [scePthreadCreate] 47 | call r12 48 | 49 | mov dword [ldrdone], 1 50 | 51 | mov rdi, 0 52 | call sys_thr_exit 53 | retn 54 | 55 | sys_thr_exit: 56 | mov rax, 431 57 | mov r10, rcx 58 | syscall 59 | retn 60 | 61 | sys_sysarch: 62 | mov rax, 165 63 | mov r10, rcx 64 | syscall 65 | retn 66 | 67 | amd64_set_fsbase: 68 | push rbp 69 | mov rbp, rsp 70 | push rbx 71 | sub rsp, 0x18 72 | 73 | mov [rbp - 0x18], rdi 74 | 75 | lea rsi, [rbp - 0x18] 76 | mov edi, 129 77 | call sys_sysarch 78 | 79 | add rsp, 0x18 80 | pop rbx 81 | pop rbp 82 | retn 83 | -------------------------------------------------------------------------------- /kernel/src/Plugins/LogServer/LogManager.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | #define DEFAULT_PATH "/dev/klog" 10 | 11 | struct thread; 12 | 13 | namespace Mira 14 | { 15 | namespace Plugins 16 | { 17 | namespace LogManagerExtent 18 | { 19 | class LogManager : public Mira::Utils::IModule 20 | { 21 | private: 22 | // Server address 23 | struct sockaddr_in m_Address; 24 | 25 | // Socket 26 | int32_t m_Socket; 27 | 28 | // Server port 29 | uint16_t m_Port; 30 | 31 | // Thread 32 | void* m_Thread; 33 | 34 | // Device path 35 | char m_Device[PATH_MAX]; 36 | 37 | // Running 38 | volatile bool m_Running; 39 | 40 | public: 41 | LogManager(uint16_t p_Port = 9998, char* p_Device = nullptr); 42 | virtual ~LogManager(); 43 | 44 | bool Startup(); 45 | bool Teardown(); 46 | virtual const char* GetName() override { return "LogServer"; } 47 | virtual bool OnLoad() override; 48 | virtual bool OnUnload() override; 49 | virtual bool OnSuspend() override; 50 | virtual bool OnResume() override; 51 | 52 | private: 53 | static void ServerThread(void* p_UserData); 54 | }; 55 | } 56 | } 57 | } -------------------------------------------------------------------------------- /external/freebsd-headers/include/c++/4.2/bits/c++locale_internal.h: -------------------------------------------------------------------------------- 1 | // Locale internal implementation header -*- C++ -*- 2 | 3 | // Copyright (C) 2002 Free Software Foundation, Inc. 4 | // 5 | // This file is part of the GNU ISO C++ Library. This library is free 6 | // software; you can redistribute it and/or modify it under the 7 | // terms of the GNU General Public License as published by the 8 | // Free Software Foundation; either version 2, or (at your option) 9 | // any later version. 10 | 11 | // This library is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | 16 | // You should have received a copy of the GNU General Public License along 17 | // with this library; see the file COPYING. If not, write to the Free 18 | // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 19 | // USA. 20 | 21 | // As a special exception, you may use this file as part of a free software 22 | // library without restriction. Specifically, if other files instantiate 23 | // templates or use macros or inline functions from this file, or you compile 24 | // this file and link it with other files to produce an executable, this 25 | // file does not by itself cause the resulting executable to be covered by 26 | // the GNU General Public License. This exception does not however 27 | // invalidate any other reasons why the executable file might be covered by 28 | // the GNU General Public License. 29 | 30 | // The generic locale code doesn't need to do anything here (yet) 31 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/machine/stack.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Mach Operating System 3 | * Copyright (c) 1991,1990 Carnegie Mellon University 4 | * All Rights Reserved. 5 | * 6 | * Permission to use, copy, modify and distribute this software and its 7 | * documentation is hereby granted, provided that both the copyright 8 | * notice and this permission notice appear in all copies of the 9 | * software, derivative works or modified versions, and any portions 10 | * thereof, and that both notices appear in supporting documentation. 11 | * 12 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS 13 | * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR 14 | * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. 15 | * 16 | * Carnegie Mellon requests users of this software to return to 17 | * 18 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 19 | * School of Computer Science 20 | * Carnegie Mellon University 21 | * Pittsburgh PA 15213-3890 22 | * 23 | * any improvements or extensions that they make and grant Carnegie the 24 | * rights to redistribute these changes. 25 | * 26 | * $FreeBSD: release/9.0.0/sys/amd64/include/stack.h 179886 2008-06-20 05:22:09Z alc $ 27 | */ 28 | 29 | #ifndef _MACHINE_STACK_H_ 30 | #define _MACHINE_STACK_H_ 31 | 32 | /* 33 | * Stack trace. 34 | */ 35 | #define INKERNEL(va) (((va) >= DMAP_MIN_ADDRESS && (va) < DMAP_MAX_ADDRESS) \ 36 | || ((va) >= VM_MIN_KERNEL_ADDRESS && (va) < VM_MAX_KERNEL_ADDRESS)) 37 | 38 | struct amd64_frame { 39 | struct amd64_frame *f_frame; 40 | long f_retaddr; 41 | long f_arg0; 42 | }; 43 | 44 | #endif /* !_MACHINE_STACK_H_ */ 45 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/c++/4.2/backward/stream.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2000 Free Software Foundation, Inc. 2 | // 3 | // This file is part of the GNU ISO C++ Library. This library is free 4 | // software; you can redistribute it and/or modify it under the 5 | // terms of the GNU General Public License as published by the 6 | // Free Software Foundation; either version 2, or (at your option) 7 | // any later version. 8 | 9 | // This library is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License along 15 | // with this library; see the file COPYING. If not, write to the Free 16 | // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 17 | // USA. 18 | 19 | // As a special exception, you may use this file as part of a free software 20 | // library without restriction. Specifically, if other files instantiate 21 | // templates or use macros or inline functions from this file, or you compile 22 | // this file and link it with other files to produce an executable, this 23 | // file does not by itself cause the resulting executable to be covered by 24 | // the GNU General Public License. This exception does not however 25 | // invalidate any other reasons why the executable file might be covered by 26 | // the GNU General Public License. 27 | 28 | #ifndef _BACKWARD_STREAM_H 29 | #define _BACKWARD_STREAM_H 1 30 | 31 | #include "backward_warning.h" 32 | #include "iostream.h" 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/rpcsvc/crypt.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Please do not edit this file. 3 | * It was generated using rpcgen. 4 | */ 5 | 6 | #ifndef _CRYPT_H_RPCGEN 7 | #define _CRYPT_H_RPCGEN 8 | 9 | #include 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | 16 | enum des_dir { 17 | ENCRYPT_DES = 0, 18 | DECRYPT_DES = 1 19 | }; 20 | typedef enum des_dir des_dir; 21 | 22 | enum des_mode { 23 | CBC_DES = 0, 24 | ECB_DES = 1 25 | }; 26 | typedef enum des_mode des_mode; 27 | 28 | struct desargs { 29 | u_char des_key[8]; 30 | des_dir des_dir; 31 | des_mode des_mode; 32 | u_char des_ivec[8]; 33 | struct { 34 | u_int desbuf_len; 35 | char *desbuf_val; 36 | } desbuf; 37 | }; 38 | typedef struct desargs desargs; 39 | 40 | struct desresp { 41 | struct { 42 | u_int desbuf_len; 43 | char *desbuf_val; 44 | } desbuf; 45 | u_char des_ivec[8]; 46 | int stat; 47 | }; 48 | typedef struct desresp desresp; 49 | 50 | #define CRYPT_PROG ((unsigned long)(600100029)) 51 | #define CRYPT_VERS ((unsigned long)(1)) 52 | 53 | extern void crypt_prog_1(struct svc_req *rqstp, SVCXPRT *transp); 54 | #define DES_CRYPT ((unsigned long)(1)) 55 | extern desresp * des_crypt_1(desargs *, CLIENT *); 56 | extern desresp * des_crypt_1_svc(desargs *, struct svc_req *); 57 | extern int crypt_prog_1_freeresult(SVCXPRT *, xdrproc_t, caddr_t); 58 | 59 | /* the xdr functions */ 60 | extern bool_t xdr_des_dir(XDR *, des_dir*); 61 | extern bool_t xdr_des_mode(XDR *, des_mode*); 62 | extern bool_t xdr_desargs(XDR *, desargs*); 63 | extern bool_t xdr_desresp(XDR *, desresp*); 64 | 65 | #ifdef __cplusplus 66 | } 67 | #endif 68 | 69 | #endif /* !_CRYPT_H_RPCGEN */ 70 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/c++/4.2/backward/istream.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2000 Free Software Foundation, Inc. 2 | // 3 | // This file is part of the GNU ISO C++ Library. This library is free 4 | // software; you can redistribute it and/or modify it under the 5 | // terms of the GNU General Public License as published by the 6 | // Free Software Foundation; either version 2, or (at your option) 7 | // any later version. 8 | 9 | // This library is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License along 15 | // with this library; see the file COPYING. If not, write to the Free 16 | // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 17 | // USA. 18 | 19 | // As a special exception, you may use this file as part of a free software 20 | // library without restriction. Specifically, if other files instantiate 21 | // templates or use macros or inline functions from this file, or you compile 22 | // this file and link it with other files to produce an executable, this 23 | // file does not by itself cause the resulting executable to be covered by 24 | // the GNU General Public License. This exception does not however 25 | // invalidate any other reasons why the executable file might be covered by 26 | // the GNU General Public License. 27 | 28 | #ifndef _BACKWARD_ISTREAM_H 29 | #define _BACKWARD_ISTREAM_H 1 30 | 31 | #include "backward_warning.h" 32 | #include "iostream.h" 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/c++/4.2/backward/ostream.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2000 Free Software Foundation, Inc. 2 | // 3 | // This file is part of the GNU ISO C++ Library. This library is free 4 | // software; you can redistribute it and/or modify it under the 5 | // terms of the GNU General Public License as published by the 6 | // Free Software Foundation; either version 2, or (at your option) 7 | // any later version. 8 | 9 | // This library is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License along 15 | // with this library; see the file COPYING. If not, write to the Free 16 | // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 17 | // USA. 18 | 19 | // As a special exception, you may use this file as part of a free software 20 | // library without restriction. Specifically, if other files instantiate 21 | // templates or use macros or inline functions from this file, or you compile 22 | // this file and link it with other files to produce an executable, this 23 | // file does not by itself cause the resulting executable to be covered by 24 | // the GNU General Public License. This exception does not however 25 | // invalidate any other reasons why the executable file might be covered by 26 | // the GNU General Public License. 27 | 28 | #ifndef _BACKWARD_OSTREAM_H 29 | #define _BACKWARD_OSTREAM_H 1 30 | 31 | #include "backward_warning.h" 32 | #include "iostream.h" 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/osreldate.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 1992-2012 The FreeBSD Project. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 | * SUCH DAMAGE. 25 | * 26 | */ 27 | 28 | #ifdef _KERNEL 29 | #error " cannot be used in the kernel, use " 30 | #else 31 | #undef __FreeBSD_version 32 | #define __FreeBSD_version 900044 33 | #endif 34 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/nfsserver/nfs_fha.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2008 Isilon Inc http://www.isilon.com/ 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 1. Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * 2. Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * 13 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 14 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 17 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23 | * SUCH DAMAGE. 24 | */ 25 | /* $FreeBSD: release/9.0.0/sys/nfsserver/nfs_fha.h 184588 2008-11-03 10:38:00Z dfr $ */ 26 | 27 | void fha_nd_complete(SVCTHREAD *, struct svc_req *); 28 | SVCTHREAD *fha_assign(SVCTHREAD *, struct svc_req *); 29 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/net/if_tun.h: -------------------------------------------------------------------------------- 1 | /* $NetBSD: if_tun.h,v 1.5 1994/06/29 06:36:27 cgd Exp $ */ 2 | 3 | /*- 4 | * Copyright (c) 1988, Julian Onions 5 | * Nottingham University 1987. 6 | * 7 | * This source may be freely distributed, however I would be interested 8 | * in any changes that are made. 9 | * 10 | * This driver takes packets off the IP i/f and hands them up to a 11 | * user process to have its wicked way with. This driver has it's 12 | * roots in a similar driver written by Phil Cockcroft (formerly) at 13 | * UCL. This driver is based much more on read/write/select mode of 14 | * operation though. 15 | * 16 | * $FreeBSD: release/9.0.0/sys/net/if_tun.h 139823 2005-01-07 01:45:51Z imp $ 17 | */ 18 | 19 | #ifndef _NET_IF_TUN_H_ 20 | #define _NET_IF_TUN_H_ 21 | 22 | /* Refer to if_tunvar.h for the softc stuff */ 23 | 24 | /* Maximum transmit packet size (default) */ 25 | #define TUNMTU 1500 26 | 27 | /* Maximum receive packet size (hard limit) */ 28 | #define TUNMRU 16384 29 | 30 | struct tuninfo { 31 | int baudrate; /* linespeed */ 32 | short mtu; /* maximum transmission unit */ 33 | u_char type; /* ethernet, tokenring, etc. */ 34 | u_char dummy; /* place holder */ 35 | }; 36 | 37 | /* ioctl's for get/set debug */ 38 | #define TUNSDEBUG _IOW('t', 90, int) 39 | #define TUNGDEBUG _IOR('t', 89, int) 40 | #define TUNSIFINFO _IOW('t', 91, struct tuninfo) 41 | #define TUNGIFINFO _IOR('t', 92, struct tuninfo) 42 | #define TUNSLMODE _IOW('t', 93, int) 43 | #define TUNSIFMODE _IOW('t', 94, int) 44 | #define TUNSIFPID _IO('t', 95) 45 | #define TUNSIFHEAD _IOW('t', 96, int) 46 | #define TUNGIFHEAD _IOR('t', 97, int) 47 | 48 | #endif /* !_NET_IF_TUN_H_ */ 49 | -------------------------------------------------------------------------------- /external/mira/Kernel/Utils/Kdlsym.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | //#include 3 | #include 4 | #include 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | #if defined(_KERNEL) 11 | #ifndef MIRA_PLATFORM 12 | #error MIRA_PLATFORM not set 13 | #endif 14 | #endif 15 | 16 | #if MIRA_PLATFORM==ONI_UNKNOWN_PLATFORM 17 | #error "No Platform Set" 18 | #elif MIRA_PLATFORM==MIRA_PLATFORM_ORBIS_BSD_176 19 | #include "Kdlsym/Orbis176.hpp" 20 | #elif MIRA_PLATFORM==MIRA_PLATFORM_ORBIS_BSD_405 21 | #include "Kdlsym/Orbis405.hpp" 22 | #elif MIRA_PLATFORM==MIRA_PLATFORM_ORBIS_BSD_455 23 | #include "Kdlsym/Orbis455.hpp" 24 | #elif MIRA_PLATFORM==MIRA_PLATFORM_ORBIS_BSD_474 25 | #include "Kdlsym/Orbis474.hpp" 26 | #elif MIRA_PLATFORM==MIRA_PLATFORM_ORBIS_BSD_501 27 | #include "Kdlsym/Orbis501.hpp" 28 | #elif MIRA_PLATFORM==MIRA_PLATFORM_ORBIS_BSD_503 29 | #include "Kdlsym/Orbis503.hpp" 30 | #elif MIRA_PLATFORM==MIRA_PLATFORM_ORBIS_BSD_505 31 | #include "Kdlsym/Orbis505.hpp" 32 | #elif MIRA_PLATFORM==MIRA_PLATFORM_ORBIS_BSD_620 33 | #include "Kdlsym/Orbis620.hpp" 34 | #elif MIRA_PLATFORM==MIRA_PLATFORM_ORBIS_BSD_650 35 | #include "Kdlsym/Orbis650.hpp" 36 | #elif MIRA_PLATFORM==MIRA_PLATFORM_ORBIS_BSD_672 37 | #include "Kdlsym/Orbis672.hpp" 38 | #elif MIRA_PLATFORM==MIRA_PLATFORM_ORBIS_BSD_755 39 | #include "Kdlsym/Orbis755.hpp" 40 | #endif 41 | 42 | // Kernel base address, this must be filled out on-startup (normally done in oni_initializeKernel) 43 | extern uint8_t* gKernelBase; 44 | 45 | // Define kdlsym macro 46 | #ifndef kdlsym 47 | #define kdlsym(x) ((void*)((uint8_t *)&gKernelBase[kdlsym_addr_ ## x])) 48 | #endif 49 | 50 | #ifdef __cplusplus 51 | } 52 | #endif 53 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/rpcsvc/spray.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Please do not edit this file. 3 | * It was generated using rpcgen. 4 | */ 5 | 6 | #ifndef _SPRAY_H_RPCGEN 7 | #define _SPRAY_H_RPCGEN 8 | 9 | #include 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | #define SPRAYMAX 8845 16 | 17 | struct spraytimeval { 18 | u_int sec; 19 | u_int usec; 20 | }; 21 | typedef struct spraytimeval spraytimeval; 22 | 23 | struct spraycumul { 24 | u_int counter; 25 | spraytimeval clock; 26 | }; 27 | typedef struct spraycumul spraycumul; 28 | 29 | typedef struct { 30 | u_int sprayarr_len; 31 | char *sprayarr_val; 32 | } sprayarr; 33 | 34 | #define SPRAYPROG ((unsigned long)(100012)) 35 | #define SPRAYVERS ((unsigned long)(1)) 36 | 37 | extern void sprayprog_1(struct svc_req *rqstp, SVCXPRT *transp); 38 | #define SPRAYPROC_SPRAY ((unsigned long)(1)) 39 | extern void * sprayproc_spray_1(sprayarr *, CLIENT *); 40 | extern void * sprayproc_spray_1_svc(sprayarr *, struct svc_req *); 41 | #define SPRAYPROC_GET ((unsigned long)(2)) 42 | extern spraycumul * sprayproc_get_1(void *, CLIENT *); 43 | extern spraycumul * sprayproc_get_1_svc(void *, struct svc_req *); 44 | #define SPRAYPROC_CLEAR ((unsigned long)(3)) 45 | extern void * sprayproc_clear_1(void *, CLIENT *); 46 | extern void * sprayproc_clear_1_svc(void *, struct svc_req *); 47 | extern int sprayprog_1_freeresult(SVCXPRT *, xdrproc_t, caddr_t); 48 | 49 | /* the xdr functions */ 50 | extern bool_t xdr_spraytimeval(XDR *, spraytimeval*); 51 | extern bool_t xdr_spraycumul(XDR *, spraycumul*); 52 | extern bool_t xdr_sprayarr(XDR *, sprayarr*); 53 | 54 | #ifdef __cplusplus 55 | } 56 | #endif 57 | 58 | #endif /* !_SPRAY_H_RPCGEN */ 59 | -------------------------------------------------------------------------------- /kernel/src/Messaging/MessageManager.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "MessageListener.hpp" 3 | 4 | extern "C" 5 | { 6 | #include 7 | #include 8 | #include 9 | } 10 | 11 | namespace Mira 12 | { 13 | namespace Messaging 14 | { 15 | namespace Rpc 16 | { 17 | class Connection; 18 | } 19 | 20 | enum 21 | { 22 | MessageManager_MaxCategories = 14, 23 | MessageManager_MaxListeners = 64, 24 | MessageManager_MaxMessageSize = 0x4000000, 25 | }; 26 | 27 | class MessageManager 28 | { 29 | private: 30 | Messaging::MessageListener m_Listeners[MessageManager_MaxListeners]; 31 | struct mtx m_Mutex; 32 | 33 | public: 34 | MessageManager(); 35 | ~MessageManager(); 36 | 37 | bool RegisterCallback(RpcCategory p_Category, int32_t p_Type, void(*p_Callback)(Rpc::Connection*, const RpcTransport*)); 38 | bool UnregisterCallback(RpcCategory p_Category, int32_t p_Type, void(*p_Callback)(Rpc::Connection*, const RpcTransport*)); 39 | void UnregisterAllCallbacks(); 40 | 41 | void SendErrorResponse(Rpc::Connection* p_Connection, RpcCategory p_Category, int32_t p_Error); 42 | 43 | void SendResponse(Rpc::Connection* p_Connection, const RpcTransport* p_Message); 44 | void SendResponse(Rpc::Connection* p_Connection, RpcCategory p_Category, uint32_t p_Type, int64_t p_Error, void* p_Data, uint32_t p_DataSize); 45 | 46 | void OnRequest(Rpc::Connection* p_Connection, const RpcTransport* p_Message); 47 | }; 48 | } 49 | } -------------------------------------------------------------------------------- /external/freebsd-headers/include/bitstring.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2003 Poul-Henning Kamp 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 | * SUCH DAMAGE. 25 | * 26 | * $FreeBSD: release/9.0.0/include/bitstring.h 116306 2003-06-13 19:40:13Z phk $ 27 | */ 28 | 29 | #ifndef _BITSTRING_H_ 30 | #define _BITSTRING_H_ 31 | 32 | #include 33 | 34 | #endif /* _BITSTRING_H_ */ 35 | 36 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/c++/4.2/backward/streambuf.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2000 Free Software Foundation, Inc. 2 | // 3 | // This file is part of the GNU ISO C++ Library. This library is free 4 | // software; you can redistribute it and/or modify it under the 5 | // terms of the GNU General Public License as published by the 6 | // Free Software Foundation; either version 2, or (at your option) 7 | // any later version. 8 | 9 | // This library is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License along 15 | // with this library; see the file COPYING. If not, write to the Free 16 | // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 17 | // USA. 18 | 19 | // As a special exception, you may use this file as part of a free software 20 | // library without restriction. Specifically, if other files instantiate 21 | // templates or use macros or inline functions from this file, or you compile 22 | // this file and link it with other files to produce an executable, this 23 | // file does not by itself cause the resulting executable to be covered by 24 | // the GNU General Public License. This exception does not however 25 | // invalidate any other reasons why the executable file might be covered by 26 | // the GNU General Public License. 27 | 28 | #ifndef _BACKWARD_STREAMBUF_H 29 | #define _BACKWARD_STREAMBUF_H 1 30 | 31 | #include "backward_warning.h" 32 | #include 33 | 34 | using std::streambuf; 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/clang/3.0/nmmintrin.h: -------------------------------------------------------------------------------- 1 | /*===---- nmmintrin.h - SSE4 intrinsics ------------------------------------=== 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | * 21 | *===-----------------------------------------------------------------------=== 22 | */ 23 | 24 | #ifndef _NMMINTRIN_H 25 | #define _NMMINTRIN_H 26 | 27 | #ifndef __SSE4_2__ 28 | #error "SSE4.2 instruction set not enabled" 29 | #else 30 | 31 | /* To match expectations of gcc we put the sse4.2 definitions into smmintrin.h, 32 | just include it now then. */ 33 | #include 34 | #endif /* __SSE4_2__ */ 35 | #endif /* _NMMINTRIN_H */ 36 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/net/if_enc.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2008 The FreeBSD Project. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 16 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 19 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 | * SUCH DAMAGE. 26 | * 27 | * $FreeBSD: release/9.0.0/sys/net/if_enc.h 181627 2008-08-12 09:05:01Z vanhu $ 28 | */ 29 | 30 | #ifndef _NET_IF_ENC_H 31 | #define _NET_IF_ENC_H 32 | 33 | extern struct ifnet *encif; 34 | 35 | #endif /* _NET_IF_ENC_H */ 36 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/gpib/gpib.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2005 Poul-Henning Kamp 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 | * SUCH DAMAGE. 25 | * 26 | * This file merely redirects to the file in 27 | * 28 | * $FreeBSD: release/9.0.0/lib/libgpib/gpib.h 141768 2005-02-12 21:07:09Z phk $ 29 | */ 30 | 31 | #include 32 | 33 | #define ibcntl ibcnt 34 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/c++/4.2/backward/queue.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2001 Free Software Foundation, Inc. 2 | // 3 | // This file is part of the GNU ISO C++ Library. This library is free 4 | // software; you can redistribute it and/or modify it under the 5 | // terms of the GNU General Public License as published by the 6 | // Free Software Foundation; either version 2, or (at your option) 7 | // any later version. 8 | 9 | // This library is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License along 15 | // with this library; see the file COPYING. If not, write to the Free 16 | // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 17 | // USA. 18 | 19 | // As a special exception, you may use this file as part of a free software 20 | // library without restriction. Specifically, if other files instantiate 21 | // templates or use macros or inline functions from this file, or you compile 22 | // this file and link it with other files to produce an executable, this 23 | // file does not by itself cause the resulting executable to be covered by 24 | // the GNU General Public License. This exception does not however 25 | // invalidate any other reasons why the executable file might be covered by 26 | // the GNU General Public License. 27 | 28 | #ifndef _BACKWARD_QUEUE_H 29 | #define _BACKWARD_QUEUE_H 1 30 | 31 | #include "backward_warning.h" 32 | #include 33 | 34 | using std::queue; 35 | using std::priority_queue; 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/machine/bus_dma.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2005 Scott Long 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 | * SUCH DAMAGE. 25 | * 26 | * $FreeBSD: release/9.0.0/sys/amd64/include/bus_dma.h 148275 2005-07-22 04:03:25Z obrien $ 27 | */ 28 | 29 | #ifndef _AMD64_BUS_DMA_H_ 30 | #define _AMD64_BUS_DMA_H_ 31 | 32 | #include 33 | 34 | #endif /* _AMD64_BUS_DMA_H_ */ 35 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/readline/rlstdc.h: -------------------------------------------------------------------------------- 1 | /* stdc.h -- macros to make source compile on both ANSI C and K&R C 2 | compilers. */ 3 | 4 | /* Copyright (C) 1993 Free Software Foundation, Inc. 5 | 6 | This file is part of GNU Bash, the Bourne Again SHell. 7 | 8 | Bash is free software; you can redistribute it and/or modify it 9 | under the terms of the GNU General Public License as published by 10 | the Free Software Foundation; either version 2, or (at your option) 11 | any later version. 12 | 13 | Bash is distributed in the hope that it will be useful, but WITHOUT 14 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 15 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 16 | License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with Bash; see the file COPYING. If not, write to the Free 20 | Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ 21 | 22 | #if !defined (_RL_STDC_H_) 23 | #define _RL_STDC_H_ 24 | 25 | /* Adapted from BSD /usr/include/sys/cdefs.h. */ 26 | 27 | /* A function can be defined using prototypes and compile on both ANSI C 28 | and traditional C compilers with something like this: 29 | extern char *func PARAMS((char *, char *, int)); */ 30 | 31 | #if !defined (PARAMS) 32 | # if defined (__STDC__) || defined (__GNUC__) || defined (__cplusplus) 33 | # define PARAMS(protos) protos 34 | # else 35 | # define PARAMS(protos) () 36 | # endif 37 | #endif 38 | 39 | #ifndef __attribute__ 40 | # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) 41 | # define __attribute__(x) 42 | # endif 43 | #endif 44 | 45 | #endif /* !_RL_STDC_H_ */ 46 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/c++/4.2/tr1/ctime: -------------------------------------------------------------------------------- 1 | // TR1 ctime -*- C++ -*- 2 | 3 | // Copyright (C) 2006 Free Software Foundation, Inc. 4 | // 5 | // This file is part of the GNU ISO C++ Library. This library is free 6 | // software; you can redistribute it and/or modify it under the 7 | // terms of the GNU General Public License as published by the 8 | // Free Software Foundation; either version 2, or (at your option) 9 | // any later version. 10 | 11 | // This library is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | 16 | // You should have received a copy of the GNU General Public License along 17 | // with this library; see the file COPYING. If not, write to the Free 18 | // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 19 | // USA. 20 | 21 | // As a special exception, you may use this file as part of a free software 22 | // library without restriction. Specifically, if other files instantiate 23 | // templates or use macros or inline functions from this file, or you compile 24 | // this file and link it with other files to produce an executable, this 25 | // file does not by itself cause the resulting executable to be covered by 26 | // the GNU General Public License. This exception does not however 27 | // invalidate any other reasons why the executable file might be covered by 28 | // the GNU General Public License. 29 | 30 | /** @file tr1/ctime 31 | * This is a TR1 C++ Library header. 32 | */ 33 | 34 | #ifndef _TR1_CTIME 35 | #define _TR1_CTIME 1 36 | 37 | #include 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/lwres/result.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") 3 | * Copyright (C) 2000, 2001 Internet Software Consortium. 4 | * 5 | * Permission to use, copy, modify, and/or distribute this software for any 6 | * purpose with or without fee is hereby granted, provided that the above 7 | * copyright notice and this permission notice appear in all copies. 8 | * 9 | * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH 10 | * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 11 | * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, 12 | * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 13 | * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 14 | * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 15 | * PERFORMANCE OF THIS SOFTWARE. 16 | */ 17 | 18 | /* $Id: result.h,v 1.21 2007-06-19 23:47:23 tbox Exp $ */ 19 | 20 | #ifndef LWRES_RESULT_H 21 | #define LWRES_RESULT_H 1 22 | 23 | /*! \file lwres/result.h */ 24 | 25 | typedef unsigned int lwres_result_t; 26 | 27 | #define LWRES_R_SUCCESS 0 28 | #define LWRES_R_NOMEMORY 1 29 | #define LWRES_R_TIMEOUT 2 30 | #define LWRES_R_NOTFOUND 3 31 | #define LWRES_R_UNEXPECTEDEND 4 /* unexpected end of input */ 32 | #define LWRES_R_FAILURE 5 /* generic failure */ 33 | #define LWRES_R_IOERROR 6 34 | #define LWRES_R_NOTIMPLEMENTED 7 35 | #define LWRES_R_UNEXPECTED 8 36 | #define LWRES_R_TRAILINGDATA 9 37 | #define LWRES_R_INCOMPLETE 10 38 | #define LWRES_R_RETRY 11 39 | #define LWRES_R_TYPENOTFOUND 12 40 | #define LWRES_R_TOOLARGE 13 41 | 42 | #endif /* LWRES_RESULT_H */ 43 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/md2.h: -------------------------------------------------------------------------------- 1 | /* MD2.H - header file for MD2C.C 2 | * $FreeBSD: release/9.0.0/lib/libmd/md2.h 154479 2006-01-17 15:35:57Z phk $ 3 | */ 4 | 5 | /* Copyright (C) 1990-2, RSA Data Security, Inc. Created 1990. All 6 | rights reserved. 7 | 8 | License to copy and use this software is granted for 9 | non-commercial Internet Privacy-Enhanced Mail provided that it is 10 | identified as the "RSA Data Security, Inc. MD2 Message Digest 11 | Algorithm" in all material mentioning or referencing this software 12 | or this function. 13 | 14 | RSA Data Security, Inc. makes no representations concerning either 15 | the merchantability of this software or the suitability of this 16 | software for any particular purpose. It is provided "as is" 17 | without express or implied warranty of any kind. 18 | 19 | These notices must be retained in any copies of any part of this 20 | documentation and/or software. 21 | */ 22 | 23 | #ifndef _MD2_H_ 24 | #define _MD2_H_ 25 | 26 | typedef struct MD2Context { 27 | unsigned char state[16]; /* state */ 28 | unsigned char checksum[16]; /* checksum */ 29 | unsigned int count; /* number of bytes, modulo 16 */ 30 | unsigned char buffer[16]; /* input buffer */ 31 | } MD2_CTX; 32 | 33 | #include 34 | 35 | __BEGIN_DECLS 36 | void MD2Init(MD2_CTX *); 37 | void MD2Update(MD2_CTX *, const void *, unsigned int); 38 | void MD2Pad(MD2_CTX *); 39 | void MD2Final(unsigned char [16], MD2_CTX *); 40 | char * MD2End(MD2_CTX *, char *); 41 | char * MD2File(const char *, char *); 42 | char * MD2FileChunk(const char *, char *, off_t, off_t); 43 | char * MD2Data(const void *, unsigned int, char *); 44 | __END_DECLS 45 | 46 | #endif /* _MD2_H_ */ 47 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/c++/4.2/tr1/fenv.h: -------------------------------------------------------------------------------- 1 | // TR1 fenv.h -*- C++ -*- 2 | 3 | // Copyright (C) 2006 Free Software Foundation, Inc. 4 | // 5 | // This file is part of the GNU ISO C++ Library. This library is free 6 | // software; you can redistribute it and/or modify it under the 7 | // terms of the GNU General Public License as published by the 8 | // Free Software Foundation; either version 2, or (at your option) 9 | // any later version. 10 | 11 | // This library is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | 16 | // You should have received a copy of the GNU General Public License along 17 | // with this library; see the file COPYING. If not, write to the Free 18 | // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 19 | // USA. 20 | 21 | // As a special exception, you may use this file as part of a free software 22 | // library without restriction. Specifically, if other files instantiate 23 | // templates or use macros or inline functions from this file, or you compile 24 | // this file and link it with other files to produce an executable, this 25 | // file does not by itself cause the resulting executable to be covered by 26 | // the GNU General Public License. This exception does not however 27 | // invalidate any other reasons why the executable file might be covered by 28 | // the GNU General Public License. 29 | 30 | /** @file tr1/fenv.h 31 | * This is a TR1 C++ Library header. 32 | */ 33 | 34 | #ifndef _TR1_FENV_H 35 | #define _TR1_FENV_H 1 36 | 37 | #include 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/c++/4.2/tr1/cstdarg: -------------------------------------------------------------------------------- 1 | // TR1 cstdarg -*- C++ -*- 2 | 3 | // Copyright (C) 2006 Free Software Foundation, Inc. 4 | // 5 | // This file is part of the GNU ISO C++ Library. This library is free 6 | // software; you can redistribute it and/or modify it under the 7 | // terms of the GNU General Public License as published by the 8 | // Free Software Foundation; either version 2, or (at your option) 9 | // any later version. 10 | 11 | // This library is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | 16 | // You should have received a copy of the GNU General Public License along 17 | // with this library; see the file COPYING. If not, write to the Free 18 | // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 19 | // USA. 20 | 21 | // As a special exception, you may use this file as part of a free software 22 | // library without restriction. Specifically, if other files instantiate 23 | // templates or use macros or inline functions from this file, or you compile 24 | // this file and link it with other files to produce an executable, this 25 | // file does not by itself cause the resulting executable to be covered by 26 | // the GNU General Public License. This exception does not however 27 | // invalidate any other reasons why the executable file might be covered by 28 | // the GNU General Public License. 29 | 30 | /** @file tr1/cstdarg 31 | * This is a TR1 C++ Library header. 32 | */ 33 | 34 | #ifndef _TR1_CSTDARG 35 | #define _TR1_CSTDARG 1 36 | 37 | #include 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/c++/4.2/tr1/ctgmath: -------------------------------------------------------------------------------- 1 | // TR1 ctgmath -*- C++ -*- 2 | 3 | // Copyright (C) 2006 Free Software Foundation, Inc. 4 | // 5 | // This file is part of the GNU ISO C++ Library. This library is free 6 | // software; you can redistribute it and/or modify it under the 7 | // terms of the GNU General Public License as published by the 8 | // Free Software Foundation; either version 2, or (at your option) 9 | // any later version. 10 | 11 | // This library is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | 16 | // You should have received a copy of the GNU General Public License along 17 | // with this library; see the file COPYING. If not, write to the Free 18 | // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 19 | // USA. 20 | 21 | // As a special exception, you may use this file as part of a free software 22 | // library without restriction. Specifically, if other files instantiate 23 | // templates or use macros or inline functions from this file, or you compile 24 | // this file and link it with other files to produce an executable, this 25 | // file does not by itself cause the resulting executable to be covered by 26 | // the GNU General Public License. This exception does not however 27 | // invalidate any other reasons why the executable file might be covered by 28 | // the GNU General Public License. 29 | 30 | /** @file tr1/ctgmath 31 | * This is a TR1 C++ Library header. 32 | */ 33 | 34 | #ifndef _TR1_CTGMATH 35 | #define _TR1_CTGMATH 1 36 | 37 | #include 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/c++/4.2/tr1/ctype.h: -------------------------------------------------------------------------------- 1 | // TR1 ctype.h -*- C++ -*- 2 | 3 | // Copyright (C) 2006 Free Software Foundation, Inc. 4 | // 5 | // This file is part of the GNU ISO C++ Library. This library is free 6 | // software; you can redistribute it and/or modify it under the 7 | // terms of the GNU General Public License as published by the 8 | // Free Software Foundation; either version 2, or (at your option) 9 | // any later version. 10 | 11 | // This library is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | 16 | // You should have received a copy of the GNU General Public License along 17 | // with this library; see the file COPYING. If not, write to the Free 18 | // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 19 | // USA. 20 | 21 | // As a special exception, you may use this file as part of a free software 22 | // library without restriction. Specifically, if other files instantiate 23 | // templates or use macros or inline functions from this file, or you compile 24 | // this file and link it with other files to produce an executable, this 25 | // file does not by itself cause the resulting executable to be covered by 26 | // the GNU General Public License. This exception does not however 27 | // invalidate any other reasons why the executable file might be covered by 28 | // the GNU General Public License. 29 | 30 | /** @file tr1/ctype.h 31 | * This is a TR1 C++ Library header. 32 | */ 33 | 34 | #ifndef _TR1_CTYPE_H 35 | #define _TR1_CTYPE_H 1 36 | 37 | #include 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/c++/4.2/tr1/float.h: -------------------------------------------------------------------------------- 1 | // TR1 float.h -*- C++ -*- 2 | 3 | // Copyright (C) 2006 Free Software Foundation, Inc. 4 | // 5 | // This file is part of the GNU ISO C++ Library. This library is free 6 | // software; you can redistribute it and/or modify it under the 7 | // terms of the GNU General Public License as published by the 8 | // Free Software Foundation; either version 2, or (at your option) 9 | // any later version. 10 | 11 | // This library is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | 16 | // You should have received a copy of the GNU General Public License along 17 | // with this library; see the file COPYING. If not, write to the Free 18 | // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 19 | // USA. 20 | 21 | // As a special exception, you may use this file as part of a free software 22 | // library without restriction. Specifically, if other files instantiate 23 | // templates or use macros or inline functions from this file, or you compile 24 | // this file and link it with other files to produce an executable, this 25 | // file does not by itself cause the resulting executable to be covered by 26 | // the GNU General Public License. This exception does not however 27 | // invalidate any other reasons why the executable file might be covered by 28 | // the GNU General Public License. 29 | 30 | /** @file tr1/float.h 31 | * This is a TR1 C++ Library header. 32 | */ 33 | 34 | #ifndef _TR1_FLOAT_H 35 | #define _TR1_FLOAT_H 1 36 | 37 | #include 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/c++/4.2/tr1/stdio.h: -------------------------------------------------------------------------------- 1 | // TR1 stdio.h -*- C++ -*- 2 | 3 | // Copyright (C) 2006 Free Software Foundation, Inc. 4 | // 5 | // This file is part of the GNU ISO C++ Library. This library is free 6 | // software; you can redistribute it and/or modify it under the 7 | // terms of the GNU General Public License as published by the 8 | // Free Software Foundation; either version 2, or (at your option) 9 | // any later version. 10 | 11 | // This library is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | 16 | // You should have received a copy of the GNU General Public License along 17 | // with this library; see the file COPYING. If not, write to the Free 18 | // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 19 | // USA. 20 | 21 | // As a special exception, you may use this file as part of a free software 22 | // library without restriction. Specifically, if other files instantiate 23 | // templates or use macros or inline functions from this file, or you compile 24 | // this file and link it with other files to produce an executable, this 25 | // file does not by itself cause the resulting executable to be covered by 26 | // the GNU General Public License. This exception does not however 27 | // invalidate any other reasons why the executable file might be covered by 28 | // the GNU General Public License. 29 | 30 | /** @file tr1/stdio.h 31 | * This is a TR1 C++ Library header. 32 | */ 33 | 34 | #ifndef _TR1_STDIO_H 35 | #define _TR1_STDIO_H 1 36 | 37 | #include 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/c++/4.2/tr1/wchar.h: -------------------------------------------------------------------------------- 1 | // TR1 wchar.h -*- C++ -*- 2 | 3 | // Copyright (C) 2006 Free Software Foundation, Inc. 4 | // 5 | // This file is part of the GNU ISO C++ Library. This library is free 6 | // software; you can redistribute it and/or modify it under the 7 | // terms of the GNU General Public License as published by the 8 | // Free Software Foundation; either version 2, or (at your option) 9 | // any later version. 10 | 11 | // This library is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | 16 | // You should have received a copy of the GNU General Public License along 17 | // with this library; see the file COPYING. If not, write to the Free 18 | // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 19 | // USA. 20 | 21 | // As a special exception, you may use this file as part of a free software 22 | // library without restriction. Specifically, if other files instantiate 23 | // templates or use macros or inline functions from this file, or you compile 24 | // this file and link it with other files to produce an executable, this 25 | // file does not by itself cause the resulting executable to be covered by 26 | // the GNU General Public License. This exception does not however 27 | // invalidate any other reasons why the executable file might be covered by 28 | // the GNU General Public License. 29 | 30 | /** @file tr1/wchar.h 31 | * This is a TR1 C++ Library header. 32 | */ 33 | 34 | #ifndef _TR1_WCHAR_H 35 | #define _TR1_WCHAR_H 1 36 | 37 | #include 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /external/mira/Trainers/TrainerUtils.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Mira 4 | { 5 | namespace Trainers 6 | { 7 | class TrainerUtils 8 | { 9 | private: 10 | static bool CompareByteArray(const unsigned char* p_Data, const char* p_Signature) 11 | { 12 | for (; *p_Signature; ++p_Signature, ++p_Data) 13 | { 14 | if (*p_Signature == '\x00') 15 | continue; 16 | if (*p_Data != *p_Signature) 17 | return false; 18 | } 19 | return true; 20 | } 21 | 22 | static unsigned int my_strlen(const char *s) 23 | { 24 | unsigned int count = 0; 25 | 26 | while(*s!='\0') 27 | { 28 | count++; 29 | s++; 30 | } 31 | return count; 32 | } 33 | public: 34 | static const unsigned char* FindSignature(const unsigned char* p_StartAddress, unsigned long long p_Size, const char* p_Signature) 35 | { 36 | char s_First = p_Signature[0]; 37 | const unsigned char* p_MaxAddress = (p_StartAddress + p_Size) - my_strlen(p_Signature); 38 | 39 | for (; p_StartAddress < p_MaxAddress; ++p_StartAddress) 40 | { 41 | if (*p_StartAddress != s_First) 42 | continue; 43 | if (CompareByteArray(p_StartAddress, p_Signature)) 44 | return p_StartAddress; 45 | } 46 | 47 | return nullptr; 48 | } 49 | } 50 | } 51 | } -------------------------------------------------------------------------------- /external/freebsd-headers/include/c++/4.2/tr1/limits.h: -------------------------------------------------------------------------------- 1 | // TR1 limits.h -*- C++ -*- 2 | 3 | // Copyright (C) 2006 Free Software Foundation, Inc. 4 | // 5 | // This file is part of the GNU ISO C++ Library. This library is free 6 | // software; you can redistribute it and/or modify it under the 7 | // terms of the GNU General Public License as published by the 8 | // Free Software Foundation; either version 2, or (at your option) 9 | // any later version. 10 | 11 | // This library is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | 16 | // You should have received a copy of the GNU General Public License along 17 | // with this library; see the file COPYING. If not, write to the Free 18 | // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 19 | // USA. 20 | 21 | // As a special exception, you may use this file as part of a free software 22 | // library without restriction. Specifically, if other files instantiate 23 | // templates or use macros or inline functions from this file, or you compile 24 | // this file and link it with other files to produce an executable, this 25 | // file does not by itself cause the resulting executable to be covered by 26 | // the GNU General Public License. This exception does not however 27 | // invalidate any other reasons why the executable file might be covered by 28 | // the GNU General Public License. 29 | 30 | /** @file tr1/limits.h 31 | * This is a TR1 C++ Library header. 32 | */ 33 | 34 | #ifndef _TR1_LIMITS_H 35 | #define _TR1_LIMITS_H 1 36 | 37 | #include 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/c++/4.2/tr1/stdarg.h: -------------------------------------------------------------------------------- 1 | // TR1 stdarg.h -*- C++ -*- 2 | 3 | // Copyright (C) 2006 Free Software Foundation, Inc. 4 | // 5 | // This file is part of the GNU ISO C++ Library. This library is free 6 | // software; you can redistribute it and/or modify it under the 7 | // terms of the GNU General Public License as published by the 8 | // Free Software Foundation; either version 2, or (at your option) 9 | // any later version. 10 | 11 | // This library is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | 16 | // You should have received a copy of the GNU General Public License along 17 | // with this library; see the file COPYING. If not, write to the Free 18 | // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 19 | // USA. 20 | 21 | // As a special exception, you may use this file as part of a free software 22 | // library without restriction. Specifically, if other files instantiate 23 | // templates or use macros or inline functions from this file, or you compile 24 | // this file and link it with other files to produce an executable, this 25 | // file does not by itself cause the resulting executable to be covered by 26 | // the GNU General Public License. This exception does not however 27 | // invalidate any other reasons why the executable file might be covered by 28 | // the GNU General Public License. 29 | 30 | /** @file tr1/stdarg.h 31 | * This is a TR1 C++ Library header. 32 | */ 33 | 34 | #ifndef _TR1_STDARG_H 35 | #define _TR1_STDARG_H 1 36 | 37 | #include 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/c++/4.2/tr1/stdint.h: -------------------------------------------------------------------------------- 1 | // TR1 stdint.h -*- C++ -*- 2 | 3 | // Copyright (C) 2006 Free Software Foundation, Inc. 4 | // 5 | // This file is part of the GNU ISO C++ Library. This library is free 6 | // software; you can redistribute it and/or modify it under the 7 | // terms of the GNU General Public License as published by the 8 | // Free Software Foundation; either version 2, or (at your option) 9 | // any later version. 10 | 11 | // This library is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | 16 | // You should have received a copy of the GNU General Public License along 17 | // with this library; see the file COPYING. If not, write to the Free 18 | // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 19 | // USA. 20 | 21 | // As a special exception, you may use this file as part of a free software 22 | // library without restriction. Specifically, if other files instantiate 23 | // templates or use macros or inline functions from this file, or you compile 24 | // this file and link it with other files to produce an executable, this 25 | // file does not by itself cause the resulting executable to be covered by 26 | // the GNU General Public License. This exception does not however 27 | // invalidate any other reasons why the executable file might be covered by 28 | // the GNU General Public License. 29 | 30 | /** @file tr1/stdint.h 31 | * This is a TR1 C++ Library header. 32 | */ 33 | 34 | #ifndef _TR1_STDINT_H 35 | #define _TR1_STDINT_H 1 36 | 37 | #include 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/c++/4.2/tr1/tgmath.h: -------------------------------------------------------------------------------- 1 | // TR1 tgmath.h -*- C++ -*- 2 | 3 | // Copyright (C) 2006 Free Software Foundation, Inc. 4 | // 5 | // This file is part of the GNU ISO C++ Library. This library is free 6 | // software; you can redistribute it and/or modify it under the 7 | // terms of the GNU General Public License as published by the 8 | // Free Software Foundation; either version 2, or (at your option) 9 | // any later version. 10 | 11 | // This library is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | 16 | // You should have received a copy of the GNU General Public License along 17 | // with this library; see the file COPYING. If not, write to the Free 18 | // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 19 | // USA. 20 | 21 | // As a special exception, you may use this file as part of a free software 22 | // library without restriction. Specifically, if other files instantiate 23 | // templates or use macros or inline functions from this file, or you compile 24 | // this file and link it with other files to produce an executable, this 25 | // file does not by itself cause the resulting executable to be covered by 26 | // the GNU General Public License. This exception does not however 27 | // invalidate any other reasons why the executable file might be covered by 28 | // the GNU General Public License. 29 | 30 | /** @file tr1/tgmath.h 31 | * This is a TR1 C++ Library header. 32 | */ 33 | 34 | #ifndef _TR1_TGMATH_H 35 | #define _TR1_TGMATH_H 1 36 | 37 | #include 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/c++/4.2/tr1/wctype.h: -------------------------------------------------------------------------------- 1 | // TR1 wctype.h -*- C++ -*- 2 | 3 | // Copyright (C) 2006 Free Software Foundation, Inc. 4 | // 5 | // This file is part of the GNU ISO C++ Library. This library is free 6 | // software; you can redistribute it and/or modify it under the 7 | // terms of the GNU General Public License as published by the 8 | // Free Software Foundation; either version 2, or (at your option) 9 | // any later version. 10 | 11 | // This library is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | 16 | // You should have received a copy of the GNU General Public License along 17 | // with this library; see the file COPYING. If not, write to the Free 18 | // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 19 | // USA. 20 | 21 | // As a special exception, you may use this file as part of a free software 22 | // library without restriction. Specifically, if other files instantiate 23 | // templates or use macros or inline functions from this file, or you compile 24 | // this file and link it with other files to produce an executable, this 25 | // file does not by itself cause the resulting executable to be covered by 26 | // the GNU General Public License. This exception does not however 27 | // invalidate any other reasons why the executable file might be covered by 28 | // the GNU General Public License. 29 | 30 | /** @file tr1/wctype.h 31 | * This is a TR1 C++ Library header. 32 | */ 33 | 34 | #ifndef _TR1_WCTYPE_H 35 | #define _TR1_WCTYPE_H 1 36 | 37 | #include 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/search.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Written by J.T. Conklin 3 | * Public domain. 4 | * 5 | * $NetBSD: search.h,v 1.12 1999/02/22 10:34:28 christos Exp $ 6 | * $FreeBSD: release/9.0.0/include/search.h 105250 2002-10-16 14:29:23Z robert $ 7 | */ 8 | 9 | #ifndef _SEARCH_H_ 10 | #define _SEARCH_H_ 11 | 12 | #include 13 | #include 14 | 15 | #ifndef _SIZE_T_DECLARED 16 | typedef __size_t size_t; 17 | #define _SIZE_T_DECLARED 18 | #endif 19 | 20 | typedef struct entry { 21 | char *key; 22 | void *data; 23 | } ENTRY; 24 | 25 | typedef enum { 26 | FIND, ENTER 27 | } ACTION; 28 | 29 | typedef enum { 30 | preorder, 31 | postorder, 32 | endorder, 33 | leaf 34 | } VISIT; 35 | 36 | #ifdef _SEARCH_PRIVATE 37 | typedef struct node { 38 | char *key; 39 | struct node *llink, *rlink; 40 | } node_t; 41 | 42 | struct que_elem { 43 | struct que_elem *next; 44 | struct que_elem *prev; 45 | }; 46 | #endif 47 | 48 | __BEGIN_DECLS 49 | int hcreate(size_t); 50 | void hdestroy(void); 51 | ENTRY *hsearch(ENTRY, ACTION); 52 | void insque(void *, void *); 53 | void *lfind(const void *, const void *, size_t *, size_t, 54 | int (*)(const void *, const void *)); 55 | void *lsearch(const void *, void *, size_t *, size_t, 56 | int (*)(const void *, const void *)); 57 | void remque(void *); 58 | void *tdelete(const void * __restrict, void ** __restrict, 59 | int (*)(const void *, const void *)); 60 | void *tfind(const void *, void * const *, 61 | int (*)(const void *, const void *)); 62 | void *tsearch(const void *, void **, int (*)(const void *, const void *)); 63 | void twalk(const void *, void (*)(const void *, VISIT, int)); 64 | __END_DECLS 65 | 66 | #endif /* !_SEARCH_H_ */ 67 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/c++/4.2/tr1/stdbool.h: -------------------------------------------------------------------------------- 1 | // TR1 stdbool.h -*- C++ -*- 2 | 3 | // Copyright (C) 2006 Free Software Foundation, Inc. 4 | // 5 | // This file is part of the GNU ISO C++ Library. This library is free 6 | // software; you can redistribute it and/or modify it under the 7 | // terms of the GNU General Public License as published by the 8 | // Free Software Foundation; either version 2, or (at your option) 9 | // any later version. 10 | 11 | // This library is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | 16 | // You should have received a copy of the GNU General Public License along 17 | // with this library; see the file COPYING. If not, write to the Free 18 | // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 19 | // USA. 20 | 21 | // As a special exception, you may use this file as part of a free software 22 | // library without restriction. Specifically, if other files instantiate 23 | // templates or use macros or inline functions from this file, or you compile 24 | // this file and link it with other files to produce an executable, this 25 | // file does not by itself cause the resulting executable to be covered by 26 | // the GNU General Public License. This exception does not however 27 | // invalidate any other reasons why the executable file might be covered by 28 | // the GNU General Public License. 29 | 30 | /** @file tr1/stdbool.h 31 | * This is a TR1 C++ Library header. 32 | */ 33 | 34 | #ifndef _TR1_STDBOOL_H 35 | #define _TR1_STDBOOL_H 1 36 | 37 | #include 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/c++/4.2/tr1/inttypes.h: -------------------------------------------------------------------------------- 1 | // TR1 inttypes.h -*- C++ -*- 2 | 3 | // Copyright (C) 2006 Free Software Foundation, Inc. 4 | // 5 | // This file is part of the GNU ISO C++ Library. This library is free 6 | // software; you can redistribute it and/or modify it under the 7 | // terms of the GNU General Public License as published by the 8 | // Free Software Foundation; either version 2, or (at your option) 9 | // any later version. 10 | 11 | // This library is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | 16 | // You should have received a copy of the GNU General Public License along 17 | // with this library; see the file COPYING. If not, write to the Free 18 | // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 19 | // USA. 20 | 21 | // As a special exception, you may use this file as part of a free software 22 | // library without restriction. Specifically, if other files instantiate 23 | // templates or use macros or inline functions from this file, or you compile 24 | // this file and link it with other files to produce an executable, this 25 | // file does not by itself cause the resulting executable to be covered by 26 | // the GNU General Public License. This exception does not however 27 | // invalidate any other reasons why the executable file might be covered by 28 | // the GNU General Public License. 29 | 30 | /** @file tr1/inttypes.h 31 | * This is a TR1 C++ Library header. 32 | */ 33 | 34 | #ifndef _TR1_INTTYPES_H 35 | #define _TR1_INTTYPES_H 1 36 | 37 | #include 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/gnuregex.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2004 David E. O'Brien 3 | * Copyright (c) 2004 Andrey A. Chernov 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 16 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 19 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 | * SUCH DAMAGE. 26 | * 27 | * $FreeBSD: release/9.0.0/gnu/lib/libregex/gnuregex.h 126224 2004-02-25 10:56:54Z ache $ 28 | */ 29 | 30 | #ifdef __GNUC__ 31 | #warning "Use -I/usr/include/gnu and instead of " 32 | #endif 33 | #include 34 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/machine/mp_watchdog.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2004 Robert N. M. Watson 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 | * SUCH DAMAGE. 25 | * 26 | * $FreeBSD: release/9.0.0/sys/amd64/include/mp_watchdog.h 133759 2004-08-15 18:02:09Z rwatson $ 27 | */ 28 | 29 | #ifndef _MACHINE_MP_WATCHDOG_H_ 30 | #define _MACHINE_MP_WATCHDOG_H_ 31 | 32 | void ap_watchdog(u_int cpuid); 33 | 34 | #endif /* !_MACHINE_MP_WATCHDOG_H_ */ 35 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/netgraph/ng_ipfw.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright 2005, Gleb Smirnoff 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 | * SUCH DAMAGE. 25 | * 26 | * $FreeBSD: release/9.0.0/sys/netgraph/ng_ipfw.h 201124 2009-12-28 12:29:13Z luigi $ 27 | */ 28 | 29 | #ifndef _NG_IPFW_H 30 | #define _NG_IPFW_H 31 | #define NG_IPFW_NODE_TYPE "ipfw" 32 | #define NGM_IPFW_COOKIE 1105988990 33 | #endif /* _NG_IPFW_H */ 34 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/sys/fnv_hash.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Fowler / Noll / Vo Hash (FNV Hash) 3 | * http://www.isthe.com/chongo/tech/comp/fnv/ 4 | * 5 | * This is an implementation of the algorithms posted above. 6 | * This file is placed in the public domain by Peter Wemm. 7 | * 8 | * $FreeBSD: release/9.0.0/sys/sys/fnv_hash.h 139825 2005-01-07 02:29:27Z imp $ 9 | */ 10 | 11 | typedef u_int32_t Fnv32_t; 12 | typedef u_int64_t Fnv64_t; 13 | 14 | #define FNV1_32_INIT ((Fnv32_t) 33554467UL) 15 | #define FNV1_64_INIT ((Fnv64_t) 0xcbf29ce484222325ULL) 16 | 17 | #define FNV_32_PRIME ((Fnv32_t) 0x01000193UL) 18 | #define FNV_64_PRIME ((Fnv64_t) 0x100000001b3ULL) 19 | 20 | static __inline Fnv32_t 21 | fnv_32_buf(const void *buf, size_t len, Fnv32_t hval) 22 | { 23 | const u_int8_t *s = (const u_int8_t *)buf; 24 | 25 | while (len-- != 0) { 26 | hval *= FNV_32_PRIME; 27 | hval ^= *s++; 28 | } 29 | return hval; 30 | } 31 | 32 | static __inline Fnv32_t 33 | fnv_32_str(const char *str, Fnv32_t hval) 34 | { 35 | const u_int8_t *s = (const u_int8_t *)str; 36 | Fnv32_t c; 37 | 38 | while ((c = *s++) != 0) { 39 | hval *= FNV_32_PRIME; 40 | hval ^= c; 41 | } 42 | return hval; 43 | } 44 | 45 | static __inline Fnv64_t 46 | fnv_64_buf(const void *buf, size_t len, Fnv64_t hval) 47 | { 48 | const u_int8_t *s = (const u_int8_t *)buf; 49 | 50 | while (len-- != 0) { 51 | hval *= FNV_64_PRIME; 52 | hval ^= *s++; 53 | } 54 | return hval; 55 | } 56 | 57 | static __inline Fnv64_t 58 | fnv_64_str(const char *str, Fnv64_t hval) 59 | { 60 | const u_int8_t *s = (const u_int8_t *)str; 61 | u_register_t c; /* 32 bit on i386, 64 bit on alpha,ia64 */ 62 | 63 | while ((c = *s++) != 0) { 64 | hval *= FNV_64_PRIME; 65 | hval ^= c; 66 | } 67 | return hval; 68 | } 69 | -------------------------------------------------------------------------------- /loader/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Set the project to be a C CXX ASM 2 | project(loader) 3 | 4 | # Include all of the OOSDK defaults 5 | include(${CMAKE_SOURCE_DIR}/scripts/payload.cmake) 6 | 7 | enable_language(ASM) 8 | 9 | # Set the include directories 10 | #message("${PROJECT_SOURCE_DIR}/src") 11 | include_directories(${CMAKE_SOURCE_DIR}/external ${CMAKE_SOURCE_DIR}/external/mira ${CMAKE_SOURCE_DIR}/external/mira/Kernel ${CMAKE_SOURCE_DIR}/external/freebsd-headers/include ${PROJECT_SOURCE_DIR}/src) 12 | 13 | add_compile_definitions(_KERNEL) 14 | add_link_options(-T ${PROJECT_SOURCE_DIR}/src/link.ld) 15 | 16 | # Get all of the source files that need to be compiled 17 | file(GLOB_RECURSE MIRA_MODULE_SRC_FILES ${PROJECT_SOURCE_DIR}/*.cpp ${PROJECT_SOURCE_DIR}/*.cc ${PROJECT_SOURCE_DIR}/*.cxx ${CMAKE_SOURCE_DIR}/external/mira/Kernel/*.cpp ${PROJECT_SOURCE_DIR}/*.h ${PROJECT_SOURCE_DIR}/*.hpp ${PROJECT_SOURCE_DIR}/*.hxx) 18 | file(GLOB_RECURSE MIRA_MODULE_S_FILES ${PROJECT_SOURCE_DIR}/*.s) 19 | 20 | # Set all assembler flags 21 | set_source_files_properties(${PROJECT_SOURCE_DIR}/src/Utils/__Crt0.S PROPERTIES COMPILE_FLAGS "-x assembler-with-cpp") 22 | set_source_files_properties(${MIRA_MODULE_S_FILES} PROPERTIES COMPILE_FLAGS "-x assembler-with-cpp") 23 | 24 | # Automatic elf embedding, the kernel module should be built at this point 25 | set(MIRA_ELF_PATH ${CMAKE_BINARY_DIR}/kernel/kernel) 26 | add_compile_definitions(MIRA_ELF_PATH="${MIRA_ELF_PATH}") 27 | 28 | add_executable(loader ${PROJECT_SOURCE_DIR}/src/Utils/__Crt0.S ${MIRA_MODULE_S_FILES} ${MIRA_MODULE_SRC_FILES}) 29 | 30 | # Payload creation with objcopy 31 | set(LOADER_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/loader) 32 | add_custom_command(TARGET loader POST_BUILD COMMAND objcopy -O binary ${LOADER_OUTPUT_PATH} ${LOADER_OUTPUT_PATH}.bin) -------------------------------------------------------------------------------- /tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Default cmake version 2 | cmake_minimum_required(VERSION 3.20) 3 | 4 | # Name of the project 5 | project(tests) 6 | 7 | set(CMAKE_VERBOSE_MAKEFILE OFF) 8 | 9 | # NOTE: By default this line is disabled 10 | # You should compile this project by using 11 | # mkdir build && cd build 12 | # cmake -DCMAKE_TOOLCHAIN_FILE=$OO_PS4_TOOLCHAIN/oosdk.cmake .. 13 | # cmake --build . 14 | # 15 | # Include all of the OO_PS4_TOOLCHAIN defaults 16 | include (${CMAKE_SOURCE_DIR}/scripts/oosdk.cmake) 17 | 18 | # Enable assembly files 19 | enable_language(ASM) 20 | 21 | # Not needed for library examples 22 | # Set the SCE authentication id 23 | set(PROJECT_AUTH_ID 0x3800000000000011) 24 | 25 | # Include the default source directory, add additional include paths here 26 | include_directories(${PROJECT_SOURCE_DIR}/src) 27 | 28 | # Linked libraries 29 | link_libraries(-lc -lkernel -lc++ -lSceVideoOut) 30 | 31 | # Get all source location 32 | file(GLOB_RECURSE PROJECT_SOURCES ${PROJECT_SOURCE_DIR}/*.cpp ${PROJECT_SOURCE_DIR}/*.cc ${PROJECT_SOURCE_DIR}/*.cxx ${PROJECT_SOURCE_DIR}/*.h ${PROJECT_SOURCE_DIR}/*.hpp ${PROJECT_SOURCE_DIR}/*.hxx) 33 | 34 | # Prebuilt objects 35 | set(PREBUILT_OBJS 36 | ${OO_PS4_TOOLCHAIN}/lib/crt1.o 37 | ) 38 | 39 | # Add our project 40 | # NOTE: libraries use crtlib.o, executables use crt1.o 41 | add_executable(${PROJECT_NAME} ${PREBUILT_OBJS} ${PROJECT_SOURCES}) 42 | 43 | set_target_properties(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE CXX) 44 | 45 | # Create the fself 46 | set(MODULE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}) 47 | add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD COMMAND ${OO_PS4_TOOLCHAIN}/bin/linux/create-fself -in=${MODULE_OUTPUT_PATH} -out=${MODULE_OUTPUT_PATH}.oelf --eboot ${MODULE_OUTPUT_PATH}.EBOOT.bin) 48 | -------------------------------------------------------------------------------- /daemon/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Default cmake version 2 | cmake_minimum_required(VERSION 3.20) 3 | 4 | # Name of the project 5 | project(daemon) 6 | 7 | set(CMAKE_VERBOSE_MAKEFILE OFF) 8 | 9 | # NOTE: By default this line is disabled 10 | # You should compile this project by using 11 | # mkdir build && cd build 12 | # cmake -DCMAKE_TOOLCHAIN_FILE=$OO_PS4_TOOLCHAIN/oosdk.cmake .. 13 | # cmake --build . 14 | # 15 | # Include all of the OO_PS4_TOOLCHAIN defaults 16 | include (${CMAKE_SOURCE_DIR}/scripts/oosdk.cmake) 17 | 18 | # Enable assembly files 19 | enable_language(ASM) 20 | 21 | # Not needed for library examples 22 | # Set the SCE authentication id 23 | set(PROJECT_AUTH_ID 0x3800000000000011) 24 | 25 | # Include the default source directory, add additional include paths here 26 | include_directories(${PROJECT_SOURCE_DIR}/src) 27 | 28 | # Linked libraries 29 | link_libraries(-lc -lkernel -lc++) 30 | 31 | # Get all source location 32 | file(GLOB_RECURSE PROJECT_SOURCES ${PROJECT_SOURCE_DIR}/*.cpp ${PROJECT_SOURCE_DIR}/*.cc ${PROJECT_SOURCE_DIR}/*.cxx ${PROJECT_SOURCE_DIR}/*.h ${PROJECT_SOURCE_DIR}/*.hpp ${PROJECT_SOURCE_DIR}/*.hxx) 33 | 34 | # Prebuilt objects 35 | set(PREBUILT_OBJS 36 | ${OO_PS4_TOOLCHAIN}/lib/crtlib.o 37 | ) 38 | 39 | # Add our project 40 | # NOTE: libraries use crtlib.o, executables use crt1.o 41 | add_executable(${PROJECT_NAME} ${PROJECT_SOURCES} ${PREBUILT_OBJS} ) 42 | 43 | set_target_properties(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE CXX) 44 | 45 | # Create the fself 46 | set(MODULE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}) 47 | add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD COMMAND ${OO_PS4_TOOLCHAIN}/bin/linux/create-fself -in=${MODULE_OUTPUT_PATH} -out=${MODULE_OUTPUT_PATH}.oelf --lib ${MODULE_OUTPUT_PATH}.prx --paid ${PROJECT_AUTH_ID}) 48 | -------------------------------------------------------------------------------- /mira_module/src/Trainers/SubstituteManager.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | namespace Mira 12 | { 13 | typedef struct _SubstituteHook 14 | { 15 | // Hook id provided by the manager, each hook gets a unique one 16 | uint64_t Id; 17 | 18 | std::vector Chain; 19 | 20 | } SubstituteHook; 21 | 22 | class SubstituteManager 23 | { 24 | private: 25 | std::mutex m_Mutex; 26 | 27 | protected: 28 | std::map> m_Hooks; 29 | 30 | public: 31 | SubstituteManager(); 32 | 33 | protected: 34 | template 35 | std::function FunctionAs(void* p_FunctionPointer) 36 | { 37 | return static_cast(p_FunctionPointer); 38 | } 39 | 40 | public: 41 | virtual ~SubstituteManager(); 42 | virtual std::shared_ptr GetHookById(uint64_t p_HookId); 43 | virtual bool GetHookIdByJumpSlot(void* p_JumpSlotAddress, uint64_t& p_Id); 44 | 45 | virtual std::shared_ptr AllocateHook(HookType p_HookType); 46 | virtual void FreeHook(uint64_t p_HookId); 47 | virtual bool EnableHook(uint64_t p_HookId); 48 | virtual bool DisableHook(uint64_t p_HookId); 49 | 50 | virtual bool HookJmp(void* p_OriginalAddress, void* p_HookAddress); 51 | virtual bool HookIAT(std::string p_ModuleName, std::string p_FunctionName, void* p_HookAddress); 52 | 53 | virtual void RemoveAllHooks(); 54 | }; 55 | } -------------------------------------------------------------------------------- /external/freebsd-headers/include/sys/ptio.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 1999 Kenneth D. Merry. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions, and the following disclaimer, 10 | * without modification, immediately at the beginning of the file. 11 | * 2. The name of the author may not be used to endorse or promote products 12 | * derived from this software without specific prior written permission. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 | * SUCH DAMAGE. 25 | * 26 | * $FreeBSD: release/9.0.0/sys/sys/ptio.h 50477 1999-08-28 01:08:13Z peter $ 27 | */ 28 | 29 | #ifndef _SYS_PTIO_H_ 30 | #define _SYS_PTIO_H_ 31 | 32 | #include 33 | 34 | #define PTIOCGETTIMEOUT _IOR('T', 1, int) 35 | #define PTIOCSETTIMEOUT _IOW('T', 2, int) 36 | 37 | #endif /* !_SYS_PTIO_H_ */ 38 | -------------------------------------------------------------------------------- /mira_module/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Default cmake version 2 | cmake_minimum_required(VERSION 3.20) 3 | 4 | # Name of the project 5 | project(mira_module) 6 | 7 | set(CMAKE_VERBOSE_MAKEFILE OFF) 8 | 9 | # NOTE: By default this line is disabled 10 | # You should compile this project by using 11 | # mkdir build && cd build 12 | # cmake -DCMAKE_TOOLCHAIN_FILE=$OO_PS4_TOOLCHAIN/oosdk.cmake .. 13 | # cmake --build . 14 | # 15 | # Include all of the OO_PS4_TOOLCHAIN defaults 16 | include (${CMAKE_SOURCE_DIR}/scripts/oosdk.cmake) 17 | 18 | # Enable assembly files 19 | enable_language(ASM) 20 | 21 | # Not needed for library examples 22 | # Set the SCE authentication id 23 | #set(PROJECT_AUTH_ID 0x3800000000000011) 24 | 25 | # Include the default source directory, add additional include paths here 26 | include_directories(${PROJECT_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/external) 27 | 28 | # Linked libraries 29 | link_libraries(-lc -lkernel -lc++) 30 | 31 | # Get all source location 32 | file(GLOB_RECURSE PROJECT_SOURCES ${PROJECT_SOURCE_DIR}/*.cpp ${PROJECT_SOURCE_DIR}/*.cc ${PROJECT_SOURCE_DIR}/*.cxx ${PROJECT_SOURCE_DIR}/*.h ${PROJECT_SOURCE_DIR}/*.hpp ${PROJECT_SOURCE_DIR}/*.hxx) 33 | 34 | # Prebuilt objects 35 | set(PREBUILT_OBJS 36 | ${OO_PS4_TOOLCHAIN}/lib/crtlib.o 37 | ) 38 | 39 | # Add our project 40 | # NOTE: libraries use crtlib.o, executables use crt1.o 41 | add_executable(${PROJECT_NAME} ${PREBUILT_OBJS} ${PROJECT_SOURCES}) 42 | 43 | set_target_properties(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE CXX) 44 | 45 | # Create the fself 46 | set(MODULE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}) 47 | add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD COMMAND ${OO_PS4_TOOLCHAIN}/bin/linux/create-fself -in=${MODULE_OUTPUT_PATH} -out=${MODULE_OUTPUT_PATH}.oelf --lib ${MODULE_OUTPUT_PATH}.prx) 48 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/c++/4.2/backward/new.h: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- forwarding header. 2 | // Copyright (C) 2000 Free Software Foundation 3 | 4 | // This file is part of GCC. 5 | // 6 | // GCC is free software; you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation; either version 2, or (at your option) 9 | // any later version. 10 | // 11 | // GCC is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with GCC; see the file COPYING. If not, write to 18 | // the Free Software Foundation, 51 Franklin Street, Fifth Floor, 19 | // Boston, MA 02110-1301, USA. 20 | 21 | // As a special exception, you may use this file as part of a free software 22 | // library without restriction. Specifically, if other files instantiate 23 | // templates or use macros or inline functions from this file, or you compile 24 | // this file and link it with other files to produce an executable, this 25 | // file does not by itself cause the resulting executable to be covered by 26 | // the GNU General Public License. This exception does not however 27 | // invalidate any other reasons why the executable file might be covered by 28 | // the GNU General Public License. 29 | 30 | #ifndef _BACKWARD_NEW_H 31 | #define _BACKWARD_NEW_H 1 32 | 33 | #include "backward_warning.h" 34 | #include 35 | 36 | using std::bad_alloc; 37 | using std::nothrow_t; 38 | using std::nothrow; 39 | using std::new_handler; 40 | using std::set_new_handler; 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/machine/metadata.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2003 Peter Wemm 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 | * SUCH DAMAGE. 25 | * 26 | * $FreeBSD: release/9.0.0/sys/amd64/include/metadata.h 191111 2009-04-15 17:31:22Z jkim $ 27 | */ 28 | 29 | #ifndef _MACHINE_METADATA_H_ 30 | #define _MACHINE_METADATA_H_ 31 | 32 | #define MODINFOMD_SMAP 0x1001 33 | #define MODINFOMD_SMAP_XATTR 0x1002 34 | 35 | #endif /* !_MACHINE_METADATA_H_ */ 36 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/kenv.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2002 Maxime Henrion 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 | * SUCH DAMAGE. 25 | * 26 | * $FreeBSD: release/9.0.0/include/kenv.h 152750 2005-11-24 07:20:26Z ru $ 27 | */ 28 | 29 | #ifndef _KENV_H_ 30 | #define _KENV_H_ 31 | 32 | #include 33 | #include 34 | 35 | __BEGIN_DECLS 36 | int kenv(int, const char *, char *, int); 37 | __END_DECLS 38 | 39 | #endif /* !_KENV_H_ */ 40 | -------------------------------------------------------------------------------- /external/freebsd-headers/include/sys/_stack.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Antoine Brodin 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 | * SUCH DAMAGE. 25 | * 26 | * $FreeBSD: release/9.0.0/sys/sys/_stack.h 177957 2008-04-06 20:08:51Z attilio $ 27 | */ 28 | 29 | #ifndef _SYS__STACK_H_ 30 | #define _SYS__STACK_H_ 31 | 32 | #define STACK_MAX 18 /* Don't change, stack_ktr relies on this. */ 33 | 34 | struct stack { 35 | int depth; 36 | vm_offset_t pcs[STACK_MAX]; 37 | }; 38 | 39 | #endif 40 | --------------------------------------------------------------------------------