diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8260cc191..1b7b0d8b0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,148 +8,134 @@ on: workflow_dispatch: jobs: - build_core_debug: + build_melonloader: runs-on: windows-latest steps: - uses: actions/checkout@v3 - - name: setup-msbuild + - name: Setup MsBuild uses: microsoft/setup-msbuild@v1 - - name: Build Melonloader Core - shell: cmd - run: msbuild /restore /p:Platform="Windows - x64" # Platform is actually irrelevant for core, it's compiled as AnyCPU either way - - name: Upload core artifact - uses: actions/upload-artifact@v3 - with: - name: MLCoreDebug - path: Output/Debug/MelonLoader/ - build_core_release: - runs-on: windows-latest - steps: - - uses: actions/checkout@v3 - - name: setup-msbuild - uses: microsoft/setup-msbuild@v1 - - name: Build Melonloader Core + - name: Build Melonloader (Release) shell: cmd run: msbuild /restore /p:Configuration=Release /p:Platform="Windows - x64" - - name: Upload core artifact + - name: Build MelonLoader (Debug) + shell: cmd + run: msbuild /restore /p:Platform="Windows - x64" + - name: Upload Release Artifact uses: actions/upload-artifact@v3 with: name: MLCoreRelease path: Output/Release/MelonLoader/ - build_rust_windows: - runs-on: windows-latest + - name: Upload Debug Artifact + uses: actions/upload-artifact@v3 + with: + name: MLCoreDebug + path: Output/Debug/MelonLoader/ + build_rust: + runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: rust-toolchain - uses: dtolnay/rust-toolchain@stable - with: - toolchain: nightly - # Target triple to install for this toolchain - targets: i686-pc-windows-msvc, x86_64-pc-windows-msvc - # Build Rust Release - - name: Build Rust Release | Windows - x86 - shell: cmd - run: cargo +nightly build --target i686-pc-windows-msvc --release + - name: Install Rust (nightly) + run: + curl https://sh.rustup.rs -sSf | sh -s -- -y + - name: Make Rust Nightly + shell: bash + run: rustup default nightly + - name: Install Linux target x64 + shell: bash + run: rustup target add x86_64-unknown-linux-gnu + - name: Install Windows target x64 + shell: bash + run: rustup target add x86_64-pc-windows-msvc + - name: Install Windows target x86 + shell: bash + run: rustup target add i686-pc-windows-msvc + - name: Install x-win + shell: bash + run: cargo install cargo-xwin + - name: install dev dependencies + shell: bash + run: sudo apt-get install libgtk-3-dev wine llvm + - name: Build Rust Release | Linux - x64 + shell: bash + run: cargo build --target x86_64-unknown-linux-gnu --release + - name: Build Rust Debug | Linux - x64 + shell: bash + run: cargo build --target x86_64-unknown-linux-gnu - name: Build Rust Release | Windows - x64 - shell: cmd - run: cargo +nightly build --target x86_64-pc-windows-msvc --release - # Build Rust Debug - - name: Build Rust Debug | Windows - x86 - shell: cmd - run: cargo +nightly build --target i686-pc-windows-msvc + shell: bash + run: cargo xwin build --target x86_64-pc-windows-msvc --release - name: Build Rust Debug | Windows - x64 - shell: cmd - run: cargo +nightly build --target x86_64-pc-windows-msvc - # Upload Proxy Release - x86 + shell: bash + run: cargo xwin build --target x86_64-pc-windows-msvc + - name: Build Rust Release | Windows - x86 + shell: bash + run: XWIN_ARCH=x86 cargo xwin build --target i686-pc-windows-msvc --release + - name: Build Rust Debug | Windows - x86 + shell: bash + run: XWIN_ARCH=x86 cargo xwin build --target i686-pc-windows-msvc + - name: Upload Proxy Release | Linux x64 + uses: actions/upload-artifact@v3 + with: + name: MLProxyX64-Linux-Release + path: target/x86_64-unknown-linux-gnu/release/libversion.so + - name: Upload Bootstrap Release | Linux x64 + uses: actions/upload-artifact@v3 + with: + name: MLBootstrapX64-Linux-Release + path: target/x86_64-unknown-linux-gnu/release/libBootstrap.so + - name: Upload Proxy Debug | Linux x64 + uses: actions/upload-artifact@v3 + with: + name: MLProxyX64-Linux-Debug + path: target/x86_64-unknown-linux-gnu/debug/libversion.so + - name: Upload Bootstrap Debug | Linux x64 + uses: actions/upload-artifact@v3 + with: + name: MLBootstrapX64-Linux-Debug + path: target/x86_64-unknown-linux-gnu/debug/libBootstrap.so - name: Upload Proxy Release | Windows x86 uses: actions/upload-artifact@v3 with: name: MLProxyX86-Windows-Release path: target/i686-pc-windows-msvc/release/version.dll - # Upload Bootstrap Release - x86 - name: Upload Bootstrap Release | Windows x86 uses: actions/upload-artifact@v3 with: name: MLBootstrapX86-Windows-Release path: target/i686-pc-windows-msvc/release/Bootstrap.dll - # Upload Proxy Release - x64 - name: Upload Proxy Release | Windows x64 uses: actions/upload-artifact@v3 with: name: MLProxyX64-Windows-Release path: target/x86_64-pc-windows-msvc/release/version.dll - # Upload Bootstrap Release - x64 - name: Upload Bootstrap Release | Windows x64 uses: actions/upload-artifact@v3 with: name: MLBootstrapX64-Windows-Release path: target/x86_64-pc-windows-msvc/release/Bootstrap.dll - # Upload Proxy Debug - x86 - name: Upload Proxy Debug | Windows x86 uses: actions/upload-artifact@v3 with: name: MLProxyX86-Windows-Debug path: target/i686-pc-windows-msvc/debug/version.dll - # Upload Bootstrap Debug - x86 - name: Upload Bootstrap Debug | Windows x86 uses: actions/upload-artifact@v3 with: name: MLBootstrapX86-Windows-Debug path: target/i686-pc-windows-msvc/debug/Bootstrap.dll - # Upload Proxy Debug - x64 - name: Upload Proxy Debug | Windows x64 uses: actions/upload-artifact@v3 with: name: MLProxyX64-Windows-Debug path: target/x86_64-pc-windows-msvc/debug/version.dll - # Upload Bootstrap Debug - x64 - name: Upload Bootstrap Debug | Windows x64 uses: actions/upload-artifact@v3 with: name: MLBootstrapX64-Windows-Debug path: target/x86_64-pc-windows-msvc/debug/Bootstrap.dll - build_rust_linux: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: rust-toolchain - uses: dtolnay/rust-toolchain@stable - with: - toolchain: nightly - # Target triple to install for this toolchain - targets: x86_64-unknown-linux-gnu - - name: install dev dependencies - shell: bash - run: sudo apt-get install libgtk-3-dev - - name: Build Rust Release | Linux - x64 - shell: bash - run: cargo +nightly build --target x86_64-unknown-linux-gnu --release - - name: Build Rust Debug | Linux - x64 - shell: bash - run: cargo +nightly build --target x86_64-unknown-linux-gnu - - name: Upload Proxy Release | Linux x64 - uses: actions/upload-artifact@v3 - with: - name: MLProxyX64-Linux-Release - path: target/x86_64-unknown-linux-gnu/release/libversion.so - - name: Upload Bootstrap Release | Linux x64 - uses: actions/upload-artifact@v3 - with: - name: MLBootstrapX64-Linux-Release - path: target/x86_64-unknown-linux-gnu/release/libBootstrap.so - - name: Upload Proxy Debug | Linux x64 - uses: actions/upload-artifact@v3 - with: - name: MLProxyX64-Linux-Debug - path: target/x86_64-unknown-linux-gnu/debug/libversion.so - - name: Upload Bootstrap Debug | Linux x64 - uses: actions/upload-artifact@v3 - with: - name: MLBootstrapX64-Linux-Debug - path: target/x86_64-unknown-linux-gnu/debug/libBootstrap.so finalize_x64_debug_zip_windows: runs-on: windows-latest - needs: [build_core_debug, build_rust_windows] + needs: [build_rust, build_melonloader] steps: - uses: actions/checkout@v3 - name: Download core artifact @@ -191,7 +177,7 @@ jobs: path: ./Output/Debug/x64/* finalize_x86_debug_zip_windows: runs-on: windows-latest - needs: [build_core_debug, build_rust_windows] + needs: [build_rust, build_melonloader] steps: - uses: actions/checkout@v3 - name: Download core artifact @@ -233,7 +219,7 @@ jobs: path: ./Output/Debug/x86/* finalize_x64_release_zip_windows: runs-on: windows-latest - needs: [build_core_release, build_rust_windows] + needs: [build_rust, build_melonloader] steps: - uses: actions/checkout@v3 - name: Download core artifact @@ -275,7 +261,7 @@ jobs: path: ./Output/Release/x64/* finalize_x86_release_zip_windows: runs-on: windows-latest - needs: [build_core_release, build_rust_windows] + needs: [build_rust, build_melonloader] steps: - uses: actions/checkout@v3 - name: Download core artifact @@ -317,7 +303,7 @@ jobs: path: ./Output/Release/x86/* finalize_x64_debug_zip_linux: runs-on: windows-latest - needs: [build_core_debug, build_rust_linux] + needs: [build_rust, build_melonloader] steps: - uses: actions/checkout@v3 - name: Download core artifact @@ -356,7 +342,7 @@ jobs: path: ./Output/Debug/x64/* finalize_x64_release_zip_linux: runs-on: windows-latest - needs: [build_core_release, build_rust_linux] + needs: [build_rust, build_melonloader] steps: - uses: actions/checkout@v3 - name: Download core artifact diff --git a/BaseLibs/Managed/UnityEngine.Il2CppAssetBundleManager.dll b/BaseLibs/Managed/UnityEngine.Il2CppAssetBundleManager.dll index d98085b5c..517ce1165 100644 Binary files a/BaseLibs/Managed/UnityEngine.Il2CppAssetBundleManager.dll and b/BaseLibs/Managed/UnityEngine.Il2CppAssetBundleManager.dll differ diff --git a/Bootstrap/Cargo.toml b/Bootstrap/Cargo.toml index c31c08fa8..30e1f18fb 100755 --- a/Bootstrap/Cargo.toml +++ b/Bootstrap/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" [dependencies] #unity-rs = { path = "C:/Users/sarah/Documents/rust/Ferrex/unity/" } unity-rs = { git = "https://github.com/RinLovesYou/Ferrex/", rev = "77d114c" } -ctor = "0.1.26" +ctor = "0.2.6" chrono = "0.4.23" colored = "2.0.0" thiserror = "1.0.39" @@ -18,10 +18,11 @@ clap = { git = "https://github.com/RinLovesYou/clap", features = ["derive"] } libc = "0.2.140" dobby-rs = { git = "https://github.com/RinLovesYou/dobby-rs" } libc-stdhandle = "0.1.0" -netcorehost = "0.13.1" +netcorehost = "0.15.1" +exe = "0.5.6" [target.'cfg(windows)'.dependencies] -windows = { version = "0.46.0", features = [ +windows = { version = "0.52.0", features = [ "Win32_Foundation", "Win32_System_Console", "Win32_UI_WindowsAndMessaging" diff --git a/Bootstrap/src/base_assembly/mono.rs b/Bootstrap/src/base_assembly/mono.rs index a3a732724..bda843860 100644 --- a/Bootstrap/src/base_assembly/mono.rs +++ b/Bootstrap/src/base_assembly/mono.rs @@ -1,4 +1,4 @@ -use std::{ptr::null_mut, sync::Mutex}; +use std::{ptr::null_mut, sync::{RwLock, Mutex}}; use lazy_static::lazy_static; use unity_rs::{ @@ -6,16 +6,16 @@ use unity_rs::{ runtime::FerrexRuntime, }; -use crate::{debug, errors::DynErr, melonenv, runtime}; +use crate::{debug, errors::DynErr, melonenv::{self, paths}, runtime}; lazy_static! { pub static ref MONO_PRESTART: Mutex = Mutex::new(UnityMethod { inner: null_mut() }); pub static ref MONO_START: Mutex = Mutex::new(UnityMethod { inner: null_mut() }); - pub static ref ASSEMBLYMANAGER_RESOLVE: Mutex = - Mutex::new(UnityMethod { inner: null_mut() }); - pub static ref ASSEMBLYMANAGER_LOADINFO: Mutex = - Mutex::new(UnityMethod { inner: null_mut() }); + pub static ref ASSEMBLYMANAGER_RESOLVE: RwLock = + RwLock::new(UnityMethod { inner: null_mut() }); + pub static ref ASSEMBLYMANAGER_LOADINFO: RwLock = + RwLock::new(UnityMethod { inner: null_mut() }); } pub fn init(runtime: &FerrexRuntime) -> Result<(), DynErr> { @@ -23,6 +23,8 @@ pub fn init(runtime: &FerrexRuntime) -> Result<(), DynErr> { debug!("Initializing BaseAssembly")?; + let _runtime_dir = paths::runtime_dir()?; + //get MelonLoader.dll's path and confirm it exists let mut melonloader_dll = melonenv::paths::MELONLOADER_FOLDER.clone(); melonloader_dll.extend(&["net35", "MelonLoader.dll"]); @@ -52,8 +54,8 @@ pub fn init(runtime: &FerrexRuntime) -> Result<(), DynErr> { //store the methods for later, in a thread safe global static. *MONO_PRESTART.try_lock()? = prestart_method; *MONO_START.try_lock()? = start_method; - *ASSEMBLYMANAGER_RESOLVE.try_lock()? = resolve_method; - *ASSEMBLYMANAGER_LOADINFO.try_lock()? = loadinfo_method; + *ASSEMBLYMANAGER_RESOLVE.try_write()? = resolve_method; + *ASSEMBLYMANAGER_LOADINFO.try_write()? = loadinfo_method; //invoke the MelonLoader initialize method. let _ = initialize_method.invoke(None, None, runtime)?; diff --git a/Bootstrap/src/console/os/windows/mod.rs b/Bootstrap/src/console/os/windows/mod.rs index 1ab049e52..ce1a4a6c9 100644 --- a/Bootstrap/src/console/os/windows/mod.rs +++ b/Bootstrap/src/console/os/windows/mod.rs @@ -25,9 +25,7 @@ lazy_static! { pub unsafe fn init() -> Result<(), DynErr> { // creates a console window, if one already exists it'll just return true. - if !AllocConsole().as_bool() { - return Err(ConsoleError::FailedToAllocateConsole.into()); - } + AllocConsole()?; // store the console window handle let mut window = WINDOW.try_lock()?; @@ -39,7 +37,7 @@ pub unsafe fn init() -> Result<(), DynErr> { } // this lets us hook into console close events, and run some cleanup logic. - if SetConsoleCtrlHandler(Some(ctrl_handler_hook), Foundation::TRUE) == Foundation::FALSE { + if SetConsoleCtrlHandler(Some(ctrl_handler_hook), Foundation::TRUE).is_err() { return Err(ConsoleError::FailedToSetConsoleCtrlHandler.into()); } @@ -80,12 +78,12 @@ pub unsafe fn init() -> Result<(), DynErr> { mode |= ENABLE_LINE_INPUT | ENABLE_PROCESSED_INPUT; - if SetConsoleMode(*output_handle, mode) != Foundation::TRUE { + if SetConsoleMode(*output_handle, mode).is_err() { mode &= !(ENABLE_LINE_INPUT | ENABLE_PROCESSED_INPUT); } else { mode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING; - if SetConsoleMode(*output_handle, mode) != Foundation::TRUE { + if SetConsoleMode(*output_handle, mode).is_err() { mode &= !ENABLE_VIRTUAL_TERMINAL_PROCESSING; } } diff --git a/Bootstrap/src/constants.rs b/Bootstrap/src/constants.rs index 563ad0e7d..a169ff035 100644 --- a/Bootstrap/src/constants.rs +++ b/Bootstrap/src/constants.rs @@ -18,7 +18,7 @@ pub type InvokeFnIl2Cpp = extern "C" fn( pub type InitFnMono = extern "C" fn(*const c_char, *const c_char) -> *mut MonoDomain; pub type InitFnIl2Cpp = extern "C" fn(*const c_char) -> *mut Il2CppDomain; -pub const MELON_VERSION: &str = "0.6.1"; +pub const MELON_VERSION: &str = "0.6.2"; pub const IS_ALPHA: bool = false; diff --git a/Bootstrap/src/icalls/resolve_internals.rs b/Bootstrap/src/icalls/resolve_internals.rs index fc6a4046c..386fbd832 100644 --- a/Bootstrap/src/icalls/resolve_internals.rs +++ b/Bootstrap/src/icalls/resolve_internals.rs @@ -33,7 +33,7 @@ fn assembly_resolve( ) -> Result<*mut MonoAssembly, DynErr> { let runtime = runtime!()?; - let resolve_method = base_assembly::mono::ASSEMBLYMANAGER_RESOLVE.try_lock()?; + let resolve_method = base_assembly::mono::ASSEMBLYMANAGER_RESOLVE.try_read()?; if resolve_method.inner.is_null() { return Err("AssemblyManager.Resolve is null".into()); @@ -90,7 +90,7 @@ fn load_hook_inner(assembly: *mut MonoAssembly) -> Result<(), DynErr> { return Ok(()); } - let load_method = base_assembly::mono::ASSEMBLYMANAGER_LOADINFO.try_lock()?; + let load_method = base_assembly::mono::ASSEMBLYMANAGER_LOADINFO.try_read()?; if load_method.inner.is_null() { return Ok(()); } diff --git a/Bootstrap/src/lib.rs b/Bootstrap/src/lib.rs index b7f81a541..8b04c1f38 100755 --- a/Bootstrap/src/lib.rs +++ b/Bootstrap/src/lib.rs @@ -1,19 +1,17 @@ -#![feature(is_some_and)] - -#![allow(non_snake_case)] -#![deny( - missing_debug_implementations, - unused_results, - warnings, - clippy::extra_unused_lifetimes, - clippy::from_over_into, - clippy::needless_borrow, - clippy::new_without_default, - clippy::useless_conversion -)] -#![forbid(rust_2018_idioms)] -#![allow(clippy::inherent_to_string, clippy::type_complexity, improper_ctypes)] -#![cfg_attr(docsrs, feature(doc_cfg))] +// #![allow(non_snake_case)] +// #![deny( +// missing_debug_implementations, +// unused_results, +// warnings, +// clippy::extra_unused_lifetimes, +// clippy::from_over_into, +// clippy::needless_borrow, +// clippy::new_without_default, +// clippy::useless_conversion +// )] +// #![forbid(rust_2018_idioms)] +// #![allow(clippy::inherent_to_string, clippy::type_complexity, improper_ctypes)] +// #![cfg_attr(docsrs, feature(doc_cfg))] pub mod base_assembly; pub mod console; diff --git a/Bootstrap/src/logging/logger.rs b/Bootstrap/src/logging/logger.rs index b21410121..88aba07fe 100644 --- a/Bootstrap/src/logging/logger.rs +++ b/Bootstrap/src/logging/logger.rs @@ -30,7 +30,7 @@ impl std::convert::TryFrom for LogLevel { macro_rules! log_path { () => { - std::env::current_dir()?.join("MelonLoader").join("Latest-Bootstrap.log") + $crate::melonenv::paths::BASE_DIR.clone().join("MelonLoader").join("Latest-Bootstrap.log") }; } diff --git a/Bootstrap/src/melonenv/args.rs b/Bootstrap/src/melonenv/args.rs index a78d772c0..a045e01ef 100644 --- a/Bootstrap/src/melonenv/args.rs +++ b/Bootstrap/src/melonenv/args.rs @@ -6,17 +6,17 @@ use crate::{internal_failure}; #[derive(Debug, Parser)] #[command(author, version, about, long_about = None)] pub struct Cli { - #[arg(long = "melonloader.debug", default_value = "false")] - pub debug: bool, + #[arg(long = "melonloader.debug")] + pub debug: Option, - #[arg(long = "melonloader.consoledst", default_value = "false")] - pub console_dst: bool, + #[arg(long = "melonloader.consoledst")] + pub console_dst: Option, - #[arg(long = "melonloader.consoleontop", default_value = "false")] - pub console_on_top: bool, + #[arg(long = "melonloader.consoleontop")] + pub console_on_top: Option, - #[arg(long = "melonloader.hideconsole", default_value = "false")] - pub hide_console: bool, + #[arg(long = "melonloader.hideconsole")] + pub hide_console: Option, #[arg(long = "melonloader.basedir")] pub base_dir: Option, diff --git a/Bootstrap/src/melonenv/macros.rs b/Bootstrap/src/melonenv/macros.rs index 20e8e3e45..6758a8405 100644 --- a/Bootstrap/src/melonenv/macros.rs +++ b/Bootstrap/src/melonenv/macros.rs @@ -1,31 +1,35 @@ #[macro_export] macro_rules! debug_enabled { - () => { + () => {{ if cfg!(debug_assertions) { true } else { - $crate::melonenv::args::ARGS.debug + let args: Vec = std::env::args().collect(); + args.contains(&"--melonloader.debug".to_string()) } - }; + }}; } #[macro_export] macro_rules! should_set_title { - () => { - !$crate::melonenv::args::ARGS.console_dst - }; + () => {{ + let args: Vec = std::env::args().collect(); + !args.contains(&"--melonloader.consoledst".to_string()) + }}; } #[macro_export] macro_rules! console_on_top { - () => { - $crate::melonenv::args::ARGS.console_on_top - }; + () => {{ + let args: Vec = std::env::args().collect(); + args.contains(&"--melonloader.consoleontop".to_string()) + }}; } #[macro_export] macro_rules! hide_console { - () => { - $crate::melonenv::args::ARGS.hide_console - }; + () => {{ + let args: Vec = std::env::args().collect(); + args.contains(&"--melonloader.hideconsole".to_string()) + }}; } \ No newline at end of file diff --git a/Bootstrap/src/melonenv/paths.rs b/Bootstrap/src/melonenv/paths.rs index b34e1a2e6..db8b11d7c 100644 --- a/Bootstrap/src/melonenv/paths.rs +++ b/Bootstrap/src/melonenv/paths.rs @@ -1,25 +1,36 @@ -use std::path::PathBuf; +use std::path::{PathBuf}; use lazy_static::lazy_static; use unity_rs::runtime::RuntimeType; use crate::{errors::DynErr, internal_failure, runtime, constants::W}; -use super::args::ARGS; + lazy_static! { pub static ref BASE_DIR: W = { - match ARGS.base_dir { - Some(ref path) => W(PathBuf::from(path.clone())), - None => W(std::env::current_dir().unwrap_or_else(|e| { - internal_failure!("Failed to get base directory: {}", e.to_string()); - })), + let args: Vec = std::env::args().collect(); + let mut base_dir = std::env::current_dir().unwrap_or_else(|e|internal_failure!("Failed to get base dir: {e}")); + for arg in args.iter() { + if arg.starts_with("--melonloader.basedir") { + let a: Vec<&str> = arg.split("=").collect(); + base_dir = PathBuf::from(a[1]); + } } + + W(base_dir) }; pub static ref GAME_DIR: W = { - W(std::env::current_dir().unwrap_or_else(|e| { - internal_failure!("Failed to get game directory: {}", e.to_string()); - })) + let args: Vec = std::env::args().collect(); + let mut base_dir = std::env::current_dir().unwrap_or_else(|e|internal_failure!("Failed to get game dir: {e}")); + for arg in args.iter() { + if arg.starts_with("--melonloader.basedir") { + let a: Vec<&str> = arg.split("=").collect(); + base_dir = PathBuf::from(a[1]); + } + } + + W(base_dir) }; pub static ref MELONLOADER_FOLDER: W = W(BASE_DIR.join("MelonLoader")); pub static ref DEPENDENCIES_FOLDER: W = W(MELONLOADER_FOLDER.join("Dependencies")); @@ -32,6 +43,8 @@ pub fn runtime_dir() -> Result { let mut path = MELONLOADER_FOLDER.clone(); + //let version = runtime::get_netstandard_version()?; + match runtime.get_type() { RuntimeType::Mono(_) => path.push("net35"), RuntimeType::Il2Cpp(_) => path.push("net6"), diff --git a/Bootstrap/src/utils/runtime.rs b/Bootstrap/src/utils/runtime.rs index dea4933a2..84fbf0c54 100644 --- a/Bootstrap/src/utils/runtime.rs +++ b/Bootstrap/src/utils/runtime.rs @@ -1,6 +1,8 @@ +use std::{error::Error, collections::HashMap, io, path::Path}; + use unity_rs::runtime::FerrexRuntime; -use crate::errors::DynErr; +use crate::{errors::DynErr, melonenv::paths}; #[allow(dead_code)] pub static mut RUNTIME: Option = None; @@ -21,3 +23,80 @@ pub fn get_runtime() -> Result<&'static FerrexRuntime, DynErr> { Ok(RUNTIME.as_ref().ok_or("Failed to get runtime")?) } } + +#[derive(Debug)] +pub enum NetstandardVersion { + Old, + New, +} + +impl Default for PeFileInfo { + fn default () -> PeFileInfo { + PeFileInfo { + product_version: String::new(), + original_filename: String::new(), + file_description: String::new(), + file_version: String::new(), + product_name: String::new(), + company_name: String::new(), + internal_name: String::new(), + legal_copyright: String::new() + } + } +} +#[derive(Clone)] +pub struct PeFileInfo { + pub product_version: String, + pub original_filename: String, + pub file_description: String, + pub file_version: String, + pub product_name: String, + pub company_name: String, + pub internal_name: String, + pub legal_copyright: String +} + +pub fn get_netstandard_version() -> Result> { + let netstandard = paths::get_managed_dir()?.join("netstandard.dll"); + if !netstandard.exists() { + return Ok(NetstandardVersion::Old); + } + + let file_info = get_pe_file_info(&netstandard)?; + + match file_info.file_version.as_str() { + "2.1.0.0" => Ok(NetstandardVersion::New), + _ => Ok(NetstandardVersion::Old) + } +} + +fn get_pe_file_info(path: &Path) -> io::Result { + let mut file_info = PeFileInfo::default(); + let Ok(pefile) = exe::VecPE::from_disk_file(path) else { return Ok(file_info) }; + let Ok(vs_version_check) = exe::VSVersionInfo::parse(&pefile) else { return Ok(file_info) }; + let vs_version = vs_version_check; + if let Some(string_file_info) = vs_version.string_file_info { + let Ok(string_map) = string_file_info.children[0].string_map() else { return Ok(file_info) }; + file_info.product_version = get_hashmap_value(&string_map, "ProductVersion")?; + file_info.original_filename = get_hashmap_value(&string_map, "OriginalFilename")?; + file_info.file_description = get_hashmap_value(&string_map, "FileDescription")?; + file_info.file_version = get_hashmap_value(&string_map, "FileVersion")?; + file_info.product_name = get_hashmap_value(&string_map, "ProductName")?; + file_info.company_name = get_hashmap_value(&string_map, "CompanyName")?; + file_info.internal_name = get_hashmap_value(&string_map, "InternalName")?; + file_info.legal_copyright = get_hashmap_value(&string_map, "LegalCopyright")?; + } + Ok(file_info) +} + + +fn get_hashmap_value( + string_map: &HashMap, + value_name: &str + ) -> io::Result +{ +let _v = match string_map.get(value_name) { +Some(v) => return Ok(v.to_string()), +None => return Ok("".to_string()) +}; +} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f0f54db6..561d411b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ | Versions: | | - | +| [v0.6.2](#v061) | | [v0.6.1](#v061) | | [v0.6.0](#v060) | | [v0.5.7](#v057) | @@ -33,6 +34,21 @@ --- +### v0.6.2 + +1. Added a compatibility layer for EOS (Epic Online Services), preventing a crash caused by the Overlay +2. Updated Cpp2IL +3. Updated Tomlet +5. Updated `MelonLoader.NativeUtils.NativeHook` to prevent GC issues +6. Updated Il2CppAssetBundleManager for Il2CppInterop +7. Fix Proxy being unable to find System32 when Windows is not installed in C: +8. Fixed logger sha256 hash (Credits to [Windows10CE](https://github.com/Windows10CE)) +9. Fixed DAB Thread safety & Oculus Profile Pictures (Credits to [SirCoolness](https://github.com/SirCoolness)) +10. Fix Melon Load Order (Credits to [Loukylor](https://github.com/loukylor)) +11. General fixes for Proxy & Bootstrap + +--- + ### v0.6.1 1. Refactored Bootstrap, more informative errors diff --git a/Cargo.lock b/Cargo.lock index a571eb0f1..fc296188d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -11,6 +11,7 @@ dependencies = [ "colored", "ctor", "dobby-rs", + "exe", "lazy_static", "libc", "libc-stdhandle", @@ -18,7 +19,27 @@ dependencies = [ "netcorehost", "thiserror", "unity-rs", - "windows", + "windows 0.52.0", +] + +[[package]] +name = "MelonProxy" +version = "0.1.0" +dependencies = [ + "ctor", + "libloading 0.8.1", + "msgbox", + "proxygen-macros", + "winapi", +] + +[[package]] +name = "addr2line" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" +dependencies = [ + "gimli", ] [[package]] @@ -29,16 +50,21 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aes" -version = "0.7.5" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" +checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2" dependencies = [ "cfg-if", "cipher", "cpufeatures", - "opaque-debug", ] +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + [[package]] name = "android_system_properties" version = "0.1.5" @@ -50,9 +76,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.68" +version = "1.0.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cb2f989d18dd141ab8ae82f64d1a8cdd37e0840f73a406896cf5e99502fab61" +checksum = "3b13c32d80ecc7ab747b80c3784bce54ee8a7a0cc4fbda9bf4cda2cf6fe90854" [[package]] name = "atk" @@ -61,7 +87,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c3d816ce6f0e2909a96830d6911c2aff044370b1ef92d7f267b43bae5addedd" dependencies = [ "atk-sys", - "bitflags", + "bitflags 1.3.2", "glib", "libc", ] @@ -78,28 +104,32 @@ dependencies = [ "system-deps", ] -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi 0.1.19", - "libc", - "winapi", -] - [[package]] name = "autocfg" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +[[package]] +name = "backtrace" +version = "0.3.68" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + [[package]] name = "base64" -version = "0.21.0" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" +checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" [[package]] name = "base64ct" @@ -113,12 +143,27 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" + [[package]] name = "block" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" +[[package]] +name = "block-buffer" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +dependencies = [ + "generic-array", +] + [[package]] name = "block-buffer" version = "0.10.4" @@ -136,9 +181,9 @@ checksum = "832133bbabbbaa9fbdba793456a2827627a7d2b8fb96032fa1e7666d7895832b" [[package]] name = "bumpalo" -version = "3.12.0" +version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" +checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" [[package]] name = "byteorder" @@ -179,7 +224,7 @@ version = "0.15.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c76ee391b03d35510d9fa917357c7f1855bd9a6659c95a1b392e33f49b3369bc" dependencies = [ - "bitflags", + "bitflags 1.3.2", "cairo-sys-rs", "glib", "libc", @@ -205,20 +250,22 @@ checksum = "1582e1c9e755dd6ad6b224dcffb135d199399a4568d454bd89fe515ca8425695" [[package]] name = "cc" -version = "1.0.78" +version = "1.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a20104e2335ce8a659d6dd92a51a767a0c062599c73b343fd152cb401e828c3d" +checksum = "305fe645edc1442a0fa8b6726ba61d422798d37a52e12eaecf4b022ebbb88f01" dependencies = [ "jobserver", + "libc", ] [[package]] name = "cfg-expr" -version = "0.11.0" +version = "0.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0357a6402b295ca3a86bc148e84df46c02e41f41fef186bda662557ef6328aa" +checksum = "b40ccee03b5175c18cde8f37e7d2a33bcef6f8ec8f7cc0d81090d1bb380949c9" dependencies = [ "smallvec", + "target-lexicon", ] [[package]] @@ -229,26 +276,26 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.23" +version = "0.4.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16b0a3d9ed01224b22057780a37bb8c5dbfe1be8ba48678e7bf57ec4b385411f" +checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" dependencies = [ + "android-tzdata", "iana-time-zone", "js-sys", - "num-integer", "num-traits", - "time 0.1.45", "wasm-bindgen", - "winapi", + "windows-targets 0.48.5", ] [[package]] name = "cipher" -version = "0.3.0" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" dependencies = [ - "generic-array", + "crypto-common", + "inout", ] [[package]] @@ -256,7 +303,7 @@ name = "clap" version = "4.1.8" source = "git+https://github.com/RinLovesYou/clap#f959816de9a07eaf9867f0419a1484353e0629f6" dependencies = [ - "bitflags", + "bitflags 1.3.2", "clap_derive", "clap_lex", "is-terminal", @@ -274,7 +321,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -291,7 +338,7 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f425db7937052c684daec3bd6375c8abe2d146dca4b8b143d6db777c39138f3a" dependencies = [ - "bitflags", + "bitflags 1.3.2", "block", "cocoa-foundation", "core-foundation", @@ -303,11 +350,11 @@ dependencies = [ [[package]] name = "cocoa-foundation" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ade49b65d560ca58c403a479bb396592b155c0185eada742ee323d1d68d6318" +checksum = "931d3837c286f56e3c58423ce4eba12d08db2374461a785c86f672b08b5650d6" dependencies = [ - "bitflags", + "bitflags 1.3.2", "block", "core-foundation", "core-graphics-types", @@ -316,25 +363,15 @@ dependencies = [ "objc", ] -[[package]] -name = "codespan-reporting" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" -dependencies = [ - "termcolor", - "unicode-width", -] - [[package]] name = "colored" -version = "2.0.0" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3616f750b84d8f0de8a58bda93e08e2a81ad3f523089b05f1dffecab48c6cbd" +checksum = "2674ec482fbc38012cf31e6c42ba0177b431a0cb6f15fe40efa5aab1bda516f6" dependencies = [ - "atty", + "is-terminal", "lazy_static", - "winapi", + "windows-sys", ] [[package]] @@ -355,9 +392,9 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" +checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" [[package]] name = "core-graphics" @@ -365,7 +402,7 @@ version = "0.22.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2581bbab3b8ffc6fcbd550bf46c355135d16e9ff2a6ea032ad6b9bf1d7efe4fb" dependencies = [ - "bitflags", + "bitflags 1.3.2", "core-foundation", "core-graphics-types", "foreign-types", @@ -374,13 +411,12 @@ dependencies = [ [[package]] name = "core-graphics-types" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a68b68b3446082644c91ac778bf50cd4104bfb002b5a6a7c44cca5a2c70788b" +checksum = "2bb142d41022986c1d8ff29103a1411c8a3dfad3552f87a4f8dc50d61d4f4e33" dependencies = [ - "bitflags", + "bitflags 1.3.2", "core-foundation", - "foreign-types", "libc", ] @@ -395,9 +431,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.5" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" +checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" dependencies = [ "libc", ] @@ -413,9 +449,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.15" +version = "0.8.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c063cd8cc95f5c377ed0d4b49a4b21f632396ff690e8470c29b3359b346984b" +checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" dependencies = [ "cfg-if", ] @@ -442,12 +478,12 @@ dependencies = [ [[package]] name = "ctor" -version = "0.1.26" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d2301688392eb071b0bf1a37be05c469d3cc4dbbd95df672fe28ab021e6a096" +checksum = "30d2b3721e861707777e3195b0158f950ae6dc4a27e4d02ff9f67e3eb3de199e" dependencies = [ "quote", - "syn", + "syn 2.0.44", ] [[package]] @@ -457,48 +493,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35" [[package]] -name = "cxx" -version = "1.0.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a140f260e6f3f79013b8bfc65e7ce630c9ab4388c6a89c71e07226f49487b72" -dependencies = [ - "cc", - "cxxbridge-flags", - "cxxbridge-macro", - "link-cplusplus", -] - -[[package]] -name = "cxx-build" -version = "1.0.92" +name = "deranged" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da6383f459341ea689374bf0a42979739dc421874f112ff26f829b8040b8e613" -dependencies = [ - "cc", - "codespan-reporting", - "once_cell", - "proc-macro2", - "quote", - "scratch", - "syn", -] - -[[package]] -name = "cxxbridge-flags" -version = "1.0.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90201c1a650e95ccff1c8c0bb5a343213bdd317c6e600a93075bca2eff54ec97" - -[[package]] -name = "cxxbridge-macro" -version = "1.0.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b75aed41bb2e6367cae39e6326ef817a851db13c13e4f3263714ca3cfb8de56" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] +checksum = "7684a49fb1af197853ef7b2ee694bc1f5b4179556f1e5710e1760c5db6f5e929" [[package]] name = "derive_more" @@ -508,45 +506,54 @@ checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "destruct-drop" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be82dda1a4115f575d2a3c1a4712fc8b3473e1a983b5656841754c7d705cd2c9" +checksum = "0eef803a96c15c37e6c7dba7636950982e024fbbe00d1b07cfe60e01ab01e0e0" dependencies = [ "destruct-drop-derive", ] [[package]] name = "destruct-drop-derive" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "802d3d884d31343822c33802e75133a845322231ab334ffada47857376f7f9a2" +checksum = "133a7fa5cffeec6867fb2847335ec2d688f5bbee6318889d2a137ce1d226b180" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.44", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array", ] [[package]] name = "digest" -version = "0.10.6" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "block-buffer", + "block-buffer 0.10.4", "crypto-common", "subtle", ] [[package]] name = "dlopen2" -version = "0.4.1" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b121caccfc363e4d9a4589528f3bef7c71b83c6ed01c8dc68cbeeb7fd29ec698" +checksum = "6bc2c7ed06fd72a8513ded8d0d2f6fd2655a85d6885c48cae8625d80faf28c03" dependencies = [ "dlopen2_derive", "libc", @@ -556,13 +563,13 @@ dependencies = [ [[package]] name = "dlopen2_derive" -version = "0.2.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a09ac8bb8c16a282264c379dffba707b9c998afc7506009137f3c6136888078" +checksum = "f2b99bf03862d7f545ebc28ddd33a665b50865f4dfd84031a393823879bd4c54" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.44", ] [[package]] @@ -577,7 +584,7 @@ dependencies = [ [[package]] name = "dobby-sys" version = "0.1.0" -source = "git+https://github.com/RinLovesYou/dobby-sys.git#8ea9f0800de90b07073561306fe258bef973930f" +source = "git+https://github.com/RinLovesYou/dobby-sys.git#3001d5debc9a8b53fdbd7bf7224b16c584c26fbf" [[package]] name = "encoding_rs" @@ -588,15 +595,41 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "enum-map" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9705d8de4776df900a4a0b2384f8b0ab42f775e93b083b42f8ce71bdc32a47e3" +dependencies = [ + "enum-map-derive", +] + +[[package]] +name = "enum-map-derive" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccb14d927583dd5c2eac0f2cf264fc4762aefe1ae14c47a8a20fc1939d3a5fc0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.44", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + [[package]] name = "errno" -version = "0.2.8" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" +checksum = "6b30f669a7961ef1631673d2766cc92f52d64f7ef354d4fe0ddfd30ed52f0f4f" dependencies = [ "errno-dragonfly", "libc", - "winapi", + "windows-sys", ] [[package]] @@ -609,6 +642,24 @@ dependencies = [ "libc", ] +[[package]] +name = "exe" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37f6e4213f515539932c53cd36a87ad8296bb8b2bea7f71b27438b811ad64392" +dependencies = [ + "bitflags 1.3.2", + "byteorder", + "chrono", + "hex", + "md-5", + "num-traits", + "pkbuffer", + "sha-1", + "sha2 0.9.9", + "widestring", +] + [[package]] name = "ffi-opaque" version = "2.0.1" @@ -617,9 +668,9 @@ checksum = "ec54ac60a7f2ee9a97cad9946f9bf629a3bc6a7ae59e68983dc9318f5a54b81a" [[package]] name = "field-offset" -version = "0.3.4" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e1c54951450cbd39f3dbcf1005ac413b49487dabf18a720ad2383eccfeffb92" +checksum = "38e2275cc4e4fc009b0669731a1e5ab7ebf11f469eaede2bab9309a5b4d6057f" dependencies = [ "memoffset", "rustc_version", @@ -627,9 +678,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.25" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8a2db397cb1c8772f31494cb8917e48cd1e64f0fa7efac59fbd741a0a8ce841" +checksum = "3b9429470923de8e8cbd4d2dc513535400b4b3fef0319fb5c4e1f520a7bef743" dependencies = [ "crc32fast", "miniz_oxide", @@ -658,33 +709,33 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "form_urlencoded" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" dependencies = [ "percent-encoding", ] [[package]] name = "futures-channel" -version = "0.3.25" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52ba265a92256105f45b719605a571ffe2d1f0fea3807304b522c1d778f79eed" +checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" dependencies = [ "futures-core", ] [[package]] name = "futures-core" -version = "0.3.25" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04909a7a7e4633ae6c4a9ab280aeb86da1236243a77b694a49eacd659a4bd3ac" +checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" [[package]] name = "futures-executor" -version = "0.3.25" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7acc85df6714c176ab5edf386123fafe217be88c0840ec11f199441134a074e2" +checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" dependencies = [ "futures-core", "futures-task", @@ -693,30 +744,42 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.25" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00f5fb52a06bdcadeb54e8d3671f8888a39697dcb0b81b23b55174030427f4eb" +checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" + +[[package]] +name = "futures-macro" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.44", +] [[package]] name = "futures-sink" -version = "0.3.27" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec93083a4aecafb2a80a885c9de1f0ccae9dbd32c2bb54b0c3a65690e0b8d2f2" +checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" [[package]] name = "futures-task" -version = "0.3.25" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ffb393ac5d9a6eaa9d3fdf37ae2776656b706e200c8e16b1bdb227f5198e6ea" +checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" [[package]] name = "futures-util" -version = "0.3.25" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "197676987abd2f9cadff84926f410af1c183608d36641465df73ae8211dc65d6" +checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" dependencies = [ "futures-core", "futures-io", + "futures-macro", "futures-task", "memchr", "pin-project-lite", @@ -730,7 +793,7 @@ version = "0.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a6e05c1f572ab0e1f15be94217f0dc29088c248b14f792a5ff0af0d84bcda9e8" dependencies = [ - "bitflags", + "bitflags 1.3.2", "cairo-rs", "gdk-pixbuf", "gdk-sys", @@ -746,7 +809,7 @@ version = "0.15.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ad38dd9cc8b099cceecdf41375bb6d481b1b5a7cd5cd603e10a69a9383f8619a" dependencies = [ - "bitflags", + "bitflags 1.3.2", "gdk-pixbuf-sys", "gio", "glib", @@ -785,21 +848,27 @@ dependencies = [ [[package]] name = "generic-array" -version = "0.14.6" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", ] +[[package]] +name = "gimli" +version = "0.27.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" + [[package]] name = "gio" version = "0.15.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68fdbc90312d462781a395f7a16d96a2b379bb6ef8cd6310a2df272771c4283b" dependencies = [ - "bitflags", + "bitflags 1.3.2", "futures-channel", "futures-core", "futures-io", @@ -829,7 +898,7 @@ version = "0.15.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edb0306fbad0ab5428b0ca674a23893db909a98582969c9b537be4ced78c505d" dependencies = [ - "bitflags", + "bitflags 1.3.2", "futures-channel", "futures-core", "futures-executor", @@ -845,9 +914,9 @@ dependencies = [ [[package]] name = "glib-macros" -version = "0.15.11" +version = "0.15.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25a68131a662b04931e71891fb14aaf65ee4b44d08e8abc10f49e77418c86c64" +checksum = "10c6ae9f6fa26f4fb2ac16b528d138d971ead56141de489f8111e259b9df3c4a" dependencies = [ "anyhow", "heck", @@ -855,7 +924,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -886,7 +955,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92e3004a2d5d6d8b5057d2b57b3712c9529b62e82c77f25c1fecde1fd5c23bd0" dependencies = [ "atk", - "bitflags", + "bitflags 1.3.2", "cairo-rs", "field-offset", "futures-channel", @@ -922,23 +991,23 @@ dependencies = [ [[package]] name = "gtk3-macros" -version = "0.15.4" +version = "0.15.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24f518afe90c23fba585b2d7697856f9e6a7bbc62f65588035e66f6afb01a2e9" +checksum = "684c0456c086e8e7e9af73ec5b84e35938df394712054550e81558d21c44ab0d" dependencies = [ "anyhow", "proc-macro-crate", "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "h2" -version = "0.3.16" +version = "0.3.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5be7b54589b581f624f566bf5d8eb2bab1db736c51528720b6bd36b96b55924d" +checksum = "97ec8491ebaf99c8eaa73058b045fe58073cd6be7f596ac993ced0b0a0c01049" dependencies = [ "bytes", "fnv", @@ -946,7 +1015,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap", + "indexmap 1.9.3", "slab", "tokio", "tokio-util", @@ -959,29 +1028,29 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +[[package]] +name = "hashbrown" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" + [[package]] name = "heck" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.1.19" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] +checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" [[package]] -name = "hermit-abi" -version = "0.2.6" +name = "hex" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" -dependencies = [ - "libc", -] +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hmac" @@ -989,17 +1058,18 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "digest", + "digest 0.10.7", ] [[package]] name = "hostfxr-sys" -version = "0.5.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df740eff9acae39f7013829bd17cf4c65731f122b7efbfab9e6426fc70ebac0c" +checksum = "99ee6bbb19e9e466a49bc72baa370eac6959375ed1824e2574f30df6a3f10f98" dependencies = [ "coreclr-hosting-shared", "dlopen2", + "enum-map", ] [[package]] @@ -1032,15 +1102,15 @@ checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "httpdate" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" -version = "0.14.25" +version = "0.14.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc5e554ff619822309ffd57d8734d77cd5ce6238bc956f037ea06c58238c9899" +checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" dependencies = [ "bytes", "futures-channel", @@ -1053,7 +1123,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2", + "socket2 0.4.9", "tokio", "tower-service", "tracing", @@ -1062,10 +1132,11 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.23.2" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1788965e61b367cd03a62950836d5cd41560c3577d90e40e0819373194d1661c" +checksum = "8d78e1e73ec14cf7375674f74d7dde185c8206fd9dea6fb6295e8a98098aaa97" dependencies = [ + "futures-util", "http", "hyper", "rustls", @@ -1075,33 +1146,32 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.53" +version = "0.1.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64c122667b287044802d6ce17ee2ddf13207ed924c712de9a66a5814d5b64765" +checksum = "2fad5b825842d2b38bd206f3e81d6957625fd7f0a361e345c30e01a0ae2dd613" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "winapi", + "windows 0.48.0", ] [[package]] name = "iana-time-zone-haiku" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" dependencies = [ - "cxx", - "cxx-build", + "cc", ] [[package]] name = "idna" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -1109,47 +1179,55 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.9.2" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", - "hashbrown", + "hashbrown 0.12.3", ] [[package]] -name = "io-lifetimes" -version = "1.0.4" +name = "indexmap" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7d6c6f8c91b4b9ed43484ad1a938e393caf35960fce7f82a040497207bd8e9e" +checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" dependencies = [ - "libc", - "windows-sys 0.42.0", + "equivalent", + "hashbrown 0.14.0", +] + +[[package]] +name = "inout" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" +dependencies = [ + "generic-array", ] [[package]] name = "ipnet" -version = "2.7.1" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30e22bd8629359895450b59ea7a776c850561b96a3b1d31321c1949d9e6c9146" +checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" [[package]] name = "is-terminal" -version = "0.4.2" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28dfb6c8100ccc63462345b67d1bbc3679177c75ee4bf59bf29c8b1d110b8189" +checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ - "hermit-abi 0.2.6", - "io-lifetimes", + "hermit-abi", "rustix", - "windows-sys 0.42.0", + "windows-sys", ] [[package]] name = "itoa" -version = "1.0.6" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "jobserver" @@ -1162,9 +1240,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.61" +version = "0.3.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730" +checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" dependencies = [ "wasm-bindgen", ] @@ -1177,9 +1255,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.140" +version = "0.2.147" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99227334921fae1a979cf0bfdfcc6b3e5ce376ef57e16fb6fb3ea2ed6095f80c" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" [[package]] name = "libc-stdhandle" @@ -1202,28 +1280,26 @@ dependencies = [ ] [[package]] -name = "link-cplusplus" -version = "1.0.8" +name = "libloading" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecd207c9c713c34f95a097a5b029ac2ce6010530c7b49d7fea24d977dede04f5" +checksum = "c571b676ddfc9a8c12f1f3d3085a7b163966a8fd8098a90640953ce5f6170161" dependencies = [ - "cc", + "cfg-if", + "windows-sys", ] [[package]] name = "linux-raw-sys" -version = "0.1.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" +checksum = "57bcfdad1b858c2db7c38303a6d2ad4dfaf5eb53dfeb0910128b2c26d6158503" [[package]] name = "log" -version = "0.4.17" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" -dependencies = [ - "cfg-if", -] +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "malloc_buf" @@ -1234,6 +1310,17 @@ dependencies = [ "libc", ] +[[package]] +name = "md-5" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5a279bb9607f9f53c22d496eade00d138d1bdcccd07d74650387cf94942a15" +dependencies = [ + "block-buffer 0.9.0", + "digest 0.9.0", + "opaque-debug", +] + [[package]] name = "memchr" version = "2.5.0" @@ -1242,38 +1329,37 @@ checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "memoffset" -version = "0.6.5" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" dependencies = [ "autocfg", ] [[package]] name = "mime" -version = "0.3.16" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "miniz_oxide" -version = "0.6.2" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" dependencies = [ "adler", ] [[package]] name = "mio" -version = "0.8.6" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9" +checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" dependencies = [ "libc", - "log", - "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.45.0", + "wasi", + "windows-sys", ] [[package]] @@ -1292,20 +1378,21 @@ dependencies = [ [[package]] name = "netcorehost" -version = "0.13.1" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdcbf040ee492f59dd7b57247ae6b6491295d541702739eba3ae7cf4d22c2282" +checksum = "8016e6dd942c7495f6c2bc58dbef5da4a3096c0c424efbb210e8fec151afb5b3" dependencies = [ "coreclr-hosting-shared", "cstr", "derive_more", "destruct-drop", + "enum-map", "ffi-opaque", "hostfxr-sys", "nethost-sys", "num_enum", + "once_cell", "thiserror", - "u16cstr", "widestring", ] @@ -1319,59 +1406,49 @@ dependencies = [ "cargo-emit", "coreclr-hosting-shared", "reqwest", - "semver 1.0.17", + "semver", "serde", "serde_json", "zip", ] -[[package]] -name = "num-integer" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" -dependencies = [ - "autocfg", - "num-traits", -] - [[package]] name = "num-traits" -version = "0.2.15" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" dependencies = [ "autocfg", ] [[package]] name = "num_cpus" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.2.6", + "hermit-abi", "libc", ] [[package]] name = "num_enum" -version = "0.5.11" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9" +checksum = "7a015b430d3c108a207fd776d2e2196aaf8b1cf8cf93253e3a097ff3085076a1" dependencies = [ "num_enum_derive", ] [[package]] name = "num_enum_derive" -version = "0.5.11" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" +checksum = "96667db765a921f7b295ffee8b60472b686a51d4f21c2ee4ffdb94c7013b65a6" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.44", ] [[package]] @@ -1383,11 +1460,20 @@ dependencies = [ "malloc_buf", ] +[[package]] +name = "object" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" +dependencies = [ + "memchr", +] + [[package]] name = "once_cell" -version = "1.17.0" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "opaque-debug" @@ -1397,9 +1483,9 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] name = "os_str_bytes" -version = "6.4.1" +version = "6.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee" +checksum = "4d5d9eb14b174ee9aa2ef96dc2b94637a2d4b6e7cb873c7e171f0c20c6cf3eac" [[package]] name = "pango" @@ -1407,7 +1493,7 @@ version = "0.15.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22e4045548659aee5313bde6c582b0d83a627b7904dd20dc2d9ef0895d414e4f" dependencies = [ - "bitflags", + "bitflags 1.3.2", "glib", "libc", "once_cell", @@ -1443,33 +1529,23 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" dependencies = [ - "digest", + "digest 0.10.7", "hmac", "password-hash", - "sha2", + "sha2 0.10.7", ] [[package]] name = "percent-encoding" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" - -[[package]] -name = "pest" -version = "2.5.2" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f6e86fb9e7026527a0d46bc308b841d73170ef8f443e1807f6ef88526a816d4" -dependencies = [ - "thiserror", - "ucd-trie", -] +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "12cc1b0bf1727a77a54b6654e7b5f1af8604923edc8b81885f8ec92f9e3f0a05" [[package]] name = "pin-utils" @@ -1477,21 +1553,41 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "pkbuffer" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfc2d171e6bab0498ea5f696960ea3647194a0549b12af99070f1e4cf6d62d94" +dependencies = [ + "memchr", + "pkbuffer_derive", +] + +[[package]] +name = "pkbuffer_derive" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c86ad26b9715c9c1664b79f6e5c44baf38fb87a5133bdd7ec90baff7b71d155" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "pkg-config" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" +checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" [[package]] name = "proc-macro-crate" -version = "1.2.1" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eda0fc3b0fb7c975631757e14d9049da17374063edb6ebbcbc54d880d4fe94e9" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" dependencies = [ "once_cell", - "thiserror", - "toml", + "toml_edit", ] [[package]] @@ -1503,7 +1599,7 @@ dependencies = [ "proc-macro-error-attr", "proc-macro2", "quote", - "syn", + "syn 1.0.109", "version_check", ] @@ -1520,52 +1616,27 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.49" +version = "1.0.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57a8eca9f9c4ffde41714334dee777596264c7825420f521abc92b5b5deb63a5" +checksum = "2dd5e8a1f1029c43224ad5898e50140c2aebb1705f19e67c918ebf5b9e797fe1" dependencies = [ "unicode-ident", ] [[package]] -name = "proxy" -version = "0.2.0" -dependencies = [ - "cc", - "clap", - "ctor", - "lazy_static", - "libc", - "libloading", - "msgbox", - "proxy-dll", - "thiserror", -] - -[[package]] -name = "proxy-dll" -version = "0.2.5" -source = "git+https://github.com/RinLovesYou/dll-proxy-rs.git#160fd47d5d5e595ff694a1d004de7d8e562aba59" -dependencies = [ - "ctor", - "proxy-sys", - "thiserror", - "winapi", -] - -[[package]] -name = "proxy-sys" -version = "0.2.2" -source = "git+https://github.com/RinLovesYou/dll-proxy-rs.git#160fd47d5d5e595ff694a1d004de7d8e562aba59" +name = "proxygen-macros" +version = "0.5.0" +source = "git+https://github.com/RinLovesYou/proxygen#c549e4fad7cd50e1d3db252c97f2e1e94713d869" dependencies = [ - "syn", + "quote", + "syn 2.0.44", ] [[package]] name = "quote" -version = "1.0.23" +version = "1.0.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" +checksum = "22a37c9326af5ed140c86a46655b5278de879853be5573c01df185b6f49a580a" dependencies = [ "proc-macro2", ] @@ -1578,9 +1649,9 @@ checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" [[package]] name = "reqwest" -version = "0.11.14" +version = "0.11.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21eed90ec8570952d53b772ecf8f206aa1ec9a3d76b2521c56c42973f2d91ee9" +checksum = "cde824a14b7c14f85caff81225f411faacc04a2013f41670f41443742b1c1c55" dependencies = [ "base64", "bytes", @@ -1630,61 +1701,70 @@ dependencies = [ "winapi", ] +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + [[package]] name = "rustc_version" -version = "0.3.3" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 0.11.0", + "semver", ] [[package]] name = "rustix" -version = "0.36.7" +version = "0.38.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4fdebc4b395b7fbb9ab11e462e20ed9051e7b16e42d24042c776eca0ac81b03" +checksum = "19ed4fa021d81c8392ce04db050a3da9a60299050b7ae1cf482d862b54a7218f" dependencies = [ - "bitflags", + "bitflags 2.4.1", "errno", - "io-lifetimes", "libc", "linux-raw-sys", - "windows-sys 0.42.0", + "windows-sys", ] [[package]] name = "rustls" -version = "0.20.8" +version = "0.21.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" +checksum = "1d1feddffcfcc0b33f5c6ce9a29e341e4cd59c3f78e7ee45f4a40c038b1d6cbb" dependencies = [ "log", "ring", + "rustls-webpki", "sct", - "webpki", ] [[package]] name = "rustls-pemfile" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d194b56d58803a43635bdc398cd17e383d6f71f9182b9a192c127ca42494a59b" +checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" dependencies = [ "base64", ] [[package]] -name = "ryu" -version = "1.0.13" +name = "rustls-webpki" +version = "0.101.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" +checksum = "261e9e0888cba427c3316e6322805653c9425240b6fd96cee7cb671ab70ab8d0" +dependencies = [ + "ring", + "untrusted", +] [[package]] -name = "scratch" -version = "1.0.5" +name = "ryu" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1792db035ce95be60c3f8853017b3999209281c24e2ba5bc8e59bf97a0c590c1" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" [[package]] name = "sct" @@ -1698,59 +1778,50 @@ dependencies = [ [[package]] name = "semver" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" -dependencies = [ - "semver-parser", -] - -[[package]] -name = "semver" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" - -[[package]] -name = "semver-parser" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" -dependencies = [ - "pest", -] +checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" [[package]] name = "serde" -version = "1.0.152" +version = "1.0.183" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb" +checksum = "32ac8da02677876d532745a130fc9d8e6edfa81a269b107c5b00829b91d8eb3c" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.152" +version = "1.0.183" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" +checksum = "aafe972d60b0b9bee71a91b92fee2d4fb3c9d7e8f6b179aa99f27203d99a4816" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.44", ] [[package]] name = "serde_json" -version = "1.0.94" +version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c533a59c9d8a93a09c6ab31f0fd5e5f4dd1b8fc9434804029839884765d04ea" +checksum = "076066c5f1078eac5b722a31827a8832fe108bed65dfa75e233c89f8206e976c" dependencies = [ "itoa", "ryu", "serde", ] +[[package]] +name = "serde_spanned" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96426c9936fd7a0124915f9185ea1d20aa9445cc9821142f0a73bc9207a2e186" +dependencies = [ + "serde", +] + [[package]] name = "serde_urlencoded" version = "0.7.1" @@ -1763,6 +1834,19 @@ dependencies = [ "serde", ] +[[package]] +name = "sha-1" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if", + "cpufeatures", + "digest 0.9.0", + "opaque-debug", +] + [[package]] name = "sha1" version = "0.10.5" @@ -1771,34 +1855,47 @@ checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" dependencies = [ "cfg-if", "cpufeatures", - "digest", + "digest 0.10.7", ] [[package]] name = "sha2" -version = "0.10.6" +version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" +checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" dependencies = [ + "block-buffer 0.9.0", "cfg-if", "cpufeatures", - "digest", + "digest 0.9.0", + "opaque-debug", +] + +[[package]] +name = "sha2" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.7", ] [[package]] name = "slab" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" +checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" dependencies = [ "autocfg", ] [[package]] name = "smallvec" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" [[package]] name = "socket2" @@ -1810,6 +1907,16 @@ dependencies = [ "winapi", ] +[[package]] +name = "socket2" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877" +dependencies = [ + "libc", + "windows-sys", +] + [[package]] name = "spin" version = "0.5.2" @@ -1824,15 +1931,26 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "subtle" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] [[package]] name = "syn" -version = "1.0.107" +version = "2.0.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" +checksum = "92d27c2c202598d05175a6dd3af46824b7f747f8d8e9b14c623f19fa5069735d" dependencies = [ "proc-macro2", "quote", @@ -1841,9 +1959,9 @@ dependencies = [ [[package]] name = "system-deps" -version = "6.0.3" +version = "6.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2955b1fe31e1fa2fbd1976b71cc69a606d7d4da16f6de3333d0c92d51419aeff" +checksum = "30c2de8a4d8f4b823d634affc9cd2a74ec98c53a756f317e529a48046cbf71f3" dependencies = [ "cfg-expr", "heck", @@ -1852,61 +1970,57 @@ dependencies = [ "version-compare", ] +[[package]] +name = "target-lexicon" +version = "0.12.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d0e916b1148c8e263850e1ebcbd046f333e0683c724876bb0da63ea4373dc8a" + [[package]] name = "termcolor" -version = "1.1.3" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" +checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" dependencies = [ "winapi-util", ] [[package]] name = "thiserror" -version = "1.0.39" +version = "1.0.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5ab016db510546d856297882807df8da66a16fb8c4101cb8b30054b0d5b2d9c" +checksum = "611040a08a0439f8248d1990b111c95baa9c704c805fa1f62104b39655fd7f90" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.39" +version = "1.0.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5420d42e90af0c38c3290abcca25b9b3bdf379fc9f55c528f53a269d9c9a267e" +checksum = "090198534930841fab3a5d1bb637cde49e339654e606195f8d9c76eeb081dc96" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.44", ] [[package]] name = "time" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" -dependencies = [ - "libc", - "wasi 0.10.0+wasi-snapshot-preview1", - "winapi", -] - -[[package]] -name = "time" -version = "0.3.20" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd0cbfecb4d19b5ea75bb31ad904eb5b9fa13f21079c3b92017ebdf4999a5890" +checksum = "b0fdd63d58b18d663fbdf70e049f00a22c8e42be082203be7f26589213cd75ea" dependencies = [ + "deranged", "serde", "time-core", ] [[package]] name = "time-core" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd" +checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" [[package]] name = "tinyvec" @@ -1925,37 +2039,35 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.26.0" +version = "1.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03201d01c3c27a29c8a5cee5b55a93ddae1ccf6f08f65365c2c918f8c1b76f64" +checksum = "40de3a2ba249dcb097e01be5e67a5ff53cf250397715a071a81543e8a832a920" dependencies = [ - "autocfg", + "backtrace", "bytes", "libc", - "memchr", "mio", "num_cpus", "pin-project-lite", - "socket2", - "windows-sys 0.45.0", + "socket2 0.5.3", + "windows-sys", ] [[package]] name = "tokio-rustls" -version = "0.23.4" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ "rustls", "tokio", - "webpki", ] [[package]] name = "tokio-util" -version = "0.7.7" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5427d89453009325de0d8f342c9490009f76e999cb7672d77e46267448f7e6b2" +checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" dependencies = [ "bytes", "futures-core", @@ -1967,13 +2079,38 @@ dependencies = [ [[package]] name = "toml" -version = "0.5.10" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c17e963a819c331dcacd7ab957d80bc2b9a9c1e71c804826d2f283dd65306542" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1333c76748e868a4d9d1017b5ab53171dfd095f70c712fdb4653a406547f598f" +checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" dependencies = [ "serde", ] +[[package]] +name = "toml_edit" +version = "0.19.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8123f27e969974a3dfba720fdb560be359f57b44302d280ba72e76a74480e8a" +dependencies = [ + "indexmap 2.0.0", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + [[package]] name = "tower-service" version = "0.3.2" @@ -1993,9 +2130,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.30" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" +checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" dependencies = [ "once_cell", ] @@ -2012,33 +2149,17 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" -[[package]] -name = "u16cstr" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2f9527d7b5b2bf503a8eafe1e4c16944c95e8455ce4b5be9e78be7f290ad581" -dependencies = [ - "wchar", - "widestring", -] - -[[package]] -name = "ucd-trie" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" - [[package]] name = "unicode-bidi" -version = "0.3.12" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d502c968c6a838ead8e69b2ee18ec708802f99db92a0d156705ec9ef801993b" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.6" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" +checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" [[package]] name = "unicode-normalization" @@ -2049,19 +2170,13 @@ dependencies = [ "tinyvec", ] -[[package]] -name = "unicode-width" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" - [[package]] name = "unity-rs" version = "0.1.0" source = "git+https://github.com/RinLovesYou/Ferrex/?rev=77d114c#77d114c08fa57609b2cfcb1b9cb4572f53c60259" dependencies = [ "libc", - "libloading", + "libloading 0.7.4", "thiserror", "winapi", ] @@ -2074,9 +2189,9 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" [[package]] name = "url" -version = "2.3.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" +checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" dependencies = [ "form_urlencoded", "idna", @@ -2097,20 +2212,13 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "want" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" dependencies = [ - "log", "try-lock", ] -[[package]] -name = "wasi" -version = "0.10.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -2119,9 +2227,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.84" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b" +checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -2129,24 +2237,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.84" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9" +checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn", + "syn 2.0.44", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.34" +version = "0.4.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f219e0d211ba40266969f6dbdd90636da12f75bee4fc9d6c23d1260dadb51454" +checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" dependencies = [ "cfg-if", "js-sys", @@ -2156,9 +2264,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.84" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5" +checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2166,48 +2274,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.84" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" +checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.44", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.84" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" - -[[package]] -name = "wchar" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1ca6ea80317e76471c3aa6d47efb151ef04538960ab810845a1c854f5cd7d8c" -dependencies = [ - "wchar-impl", -] - -[[package]] -name = "wchar-impl" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "075c93156fed21f9dab57af5e81604d0fdb67432c919a8c1f78bb979f06a3d25" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] +checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" [[package]] name = "web-sys" -version = "0.3.61" +version = "0.3.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e33b99f4b23ba3eec1a53ac264e35a755f00e966e0065077d6027c0f575b0b97" +checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" dependencies = [ "js-sys", "wasm-bindgen", @@ -2271,93 +2359,163 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows" -version = "0.46.0" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdacb41e6a96a052c6cb63a144f24900236121c6f63f4f8219fef5977ecb0c25" +checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" dependencies = [ - "windows-targets", + "windows-targets 0.48.5", ] [[package]] -name = "windows-sys" -version = "0.42.0" +name = "windows" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" +dependencies = [ + "windows-core", + "windows-targets 0.52.0", +] + +[[package]] +name = "windows-core" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows-targets 0.52.0", ] [[package]] name = "windows-sys" -version = "0.45.0" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets", + "windows-targets 0.48.5", ] [[package]] name = "windows-targets" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", ] +[[package]] +name = "windows-targets" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +dependencies = [ + "windows_aarch64_gnullvm 0.52.0", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm 0.52.0", + "windows_x86_64_msvc 0.52.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + [[package]] name = "windows_aarch64_gnullvm" -version = "0.42.2" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.42.2" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" [[package]] name = "windows_i686_gnu" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.42.2" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" [[package]] name = "windows_x86_64_gnu" -version = "0.42.2" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.42.2" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" [[package]] name = "windows_x86_64_msvc" -version = "0.42.2" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" + +[[package]] +name = "winnow" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" +checksum = "5504cc7644f4b593cbc05c4a55bf9bd4e94b867c3c0bd440934174d50482427d" +dependencies = [ + "memchr", +] [[package]] name = "winreg" @@ -2370,9 +2528,9 @@ dependencies = [ [[package]] name = "zip" -version = "0.6.4" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0445d0fbc924bb93539b4316c11afb121ea39296f99a3c4c9edad09e3658cdef" +checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" dependencies = [ "aes", "byteorder", @@ -2384,7 +2542,7 @@ dependencies = [ "hmac", "pbkdf2", "sha1", - "time 0.3.20", + "time", "zstd", ] @@ -2409,9 +2567,9 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "2.0.7+zstd.1.5.4" +version = "2.0.8+zstd.1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94509c3ba2fe55294d752b79842c530ccfab760192521df74a081a78d2b3c7f5" +checksum = "5556e6ee25d32df2586c098bbfa278803692a20d0ab9565e049480d52707ec8c" dependencies = [ "cc", "libc", diff --git a/Cargo.toml b/Cargo.toml index 0001ba43a..6b580a745 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,3 @@ [workspace] -members = [ "Bootstrap", "Proxy" ] - -[profile.release] -lto = true -codegen-units = 1 -opt-level = "z" \ No newline at end of file +members = ["MelonProxy", "Bootstrap"] +resolver = "2" \ No newline at end of file diff --git a/Dependencies/CompatibilityLayers/EOS/EOS.csproj b/Dependencies/CompatibilityLayers/EOS/EOS.csproj new file mode 100644 index 000000000..cc4d68bae --- /dev/null +++ b/Dependencies/CompatibilityLayers/EOS/EOS.csproj @@ -0,0 +1,16 @@ + + + MelonLoader.CompatibilityLayers + net35 + Latest + true + false + false + $(SolutionDir)Output\$(Configuration)\MelonLoader\Dependencies\CompatibilityLayers\ + true + embedded + + + + + \ No newline at end of file diff --git a/Dependencies/CompatibilityLayers/EOS/Module.cs b/Dependencies/CompatibilityLayers/EOS/Module.cs new file mode 100644 index 000000000..fe51e5e4b --- /dev/null +++ b/Dependencies/CompatibilityLayers/EOS/Module.cs @@ -0,0 +1,56 @@ +using MelonLoader.Modules; +using MelonLoader.NativeUtils; +using System; +using System.Diagnostics; +using System.Reflection; +using System.Runtime.InteropServices; + +[assembly: AssemblyTitle(MelonLoader.BuildInfo.Description)] +[assembly: AssemblyDescription(MelonLoader.BuildInfo.Description)] +[assembly: AssemblyCompany(MelonLoader.BuildInfo.Company)] +[assembly: AssemblyProduct(MelonLoader.BuildInfo.Name)] +[assembly: AssemblyCopyright("Created by " + MelonLoader.BuildInfo.Author)] +[assembly: AssemblyTrademark(MelonLoader.BuildInfo.Company)] +[assembly: Guid("5100810A-9842-4073-9658-E5841FDF9D73")] +[assembly: AssemblyVersion(MelonLoader.BuildInfo.Version)] +[assembly: AssemblyFileVersion(MelonLoader.BuildInfo.Version)] +[assembly: MelonLoader.PatchShield] + +namespace MelonLoader.CompatibilityLayers +{ + internal class EOS_Module : MelonModule + { + [DllImport("kernel32", CharSet = CharSet.Unicode)] + static extern IntPtr LoadLibrary(string lpFileName); + + internal delegate IntPtr LoadLibraryWDetour(IntPtr path); + internal static NativeHook _hook = new NativeHook(); + public override void OnInitialize() + { + var lib = new NativeLibrary(LoadLibrary("kernel32.dll")); + var func = lib.GetExport("LoadLibraryW"); + + var detour = Marshal.GetFunctionPointerForDelegate((LoadLibraryWDetour)Detour); + + _hook = new NativeHook(func, detour); + _hook.Attach(); + } + + private IntPtr Detour(IntPtr path) + { + var pathString = Marshal.PtrToStringUni(path); + if (pathString.EndsWith("EOSOVH-Win64-Shipping.dll") || pathString.EndsWith("EOSOVH-Win32-Shipping.dll")) + { + _hook.Detach(); + return IntPtr.Zero; + } + + return _hook.Trampoline(path); + } + + ~EOS_Module() + { + _hook.Detach(); + } + } +} diff --git a/Dependencies/Il2CppAssemblyGenerator/Packages/Cpp2IL.cs b/Dependencies/Il2CppAssemblyGenerator/Packages/Cpp2IL.cs index 06811d827..287aff08e 100644 --- a/Dependencies/Il2CppAssemblyGenerator/Packages/Cpp2IL.cs +++ b/Dependencies/Il2CppAssemblyGenerator/Packages/Cpp2IL.cs @@ -17,7 +17,7 @@ internal Cpp2IL() Version = RemoteAPI.Info.ForceDumperVersion; #endif if (string.IsNullOrEmpty(Version) || Version.Equals("0.0.0.0")) - Version = "2022.1.0-pre-release.10"; + Version = "2022.1.0-pre-release.13"; Name = nameof(Cpp2IL); Destination = Path.Combine(Core.BasePath, Name); diff --git a/Dependencies/Il2CppAssemblyGenerator/RemoteAPI.cs b/Dependencies/Il2CppAssemblyGenerator/RemoteAPI.cs index 5ca438600..2f64d3a25 100644 --- a/Dependencies/Il2CppAssemblyGenerator/RemoteAPI.cs +++ b/Dependencies/Il2CppAssemblyGenerator/RemoteAPI.cs @@ -40,7 +40,7 @@ static RemoteAPI() new HostInfo($"{DefaultHostInfo.Melon.API_URL_1}{gamename}", DefaultHostInfo.Melon.Contact), new HostInfo($"{DefaultHostInfo.Melon.API_URL_2}{gamename}", DefaultHostInfo.Melon.Contact), new HostInfo($"{DefaultHostInfo.Melon.API_URL_SAMBOY}{gamename}", DefaultHostInfo.Melon.Contact), - new HostInfo($"{DefaultHostInfo.Ruby.API_URL}{gamename}.json", DefaultHostInfo.Ruby.Contact), + new HostInfo($"{DefaultHostInfo.Melon.API_URL_DUBYADUDE}{gamename}", DefaultHostInfo.Melon.Contact), }; } @@ -118,6 +118,7 @@ internal static class Melon internal static string API_URL_1 = $"https://api-1.melonloader.com/api/{API_VERSION}/game/"; internal static string API_URL_2 = $"https://api-2.melonloader.com/api/{API_VERSION}/game/"; internal static string API_URL_SAMBOY = $"https://melon.samboy.dev/api/{API_VERSION}/game/"; + internal static string API_URL_DUBYADUDE = $"https://melon.dubyadu.de/api/{API_VERSION}/game/"; internal static InfoStruct Contact(string response_str) { @@ -144,34 +145,6 @@ internal class ResponseStruct public string obfuscationRegex = null; } } - - internal static class Ruby - { - internal static string API_URL = "https://ruby-core.com/api/ml/"; - - internal static InfoStruct Contact(string response_str) - { - ResponseStruct responseobj = MelonUtils.ParseJSONStringtoStruct(response_str); - if (responseobj == null) - return null; - - InfoStruct returninfo = new InfoStruct(); - //returninfo.ForceDumperVersion = responseobj.forceDumperVersion; - returninfo.ObfuscationRegex = responseobj.obfuscationRegex; - returninfo.MappingURL = responseobj.mappingURL; - returninfo.MappingFileSHA512 = responseobj.mappingFileSHA512; - return returninfo; - } - - private class ResponseStruct - { - public string forceDumperVersion = null; - public string forceUnhollowerVersion = null; //TODO: Remove this from the API - public string obfuscationRegex = null; - public string mappingURL = null; - public string mappingFileSHA512 = null; - } - } } } } diff --git a/Dependencies/MelonStartScreen/MelonStartScreen.csproj b/Dependencies/MelonStartScreen/MelonStartScreen.csproj index 8e363e185..4e7f1972b 100644 --- a/Dependencies/MelonStartScreen/MelonStartScreen.csproj +++ b/Dependencies/MelonStartScreen/MelonStartScreen.csproj @@ -19,6 +19,6 @@ - + \ No newline at end of file diff --git a/Dependencies/SupportModules/Il2Cpp/Il2Cpp.csproj b/Dependencies/SupportModules/Il2Cpp/Il2Cpp.csproj index e6d53a997..afb9ecd62 100644 --- a/Dependencies/SupportModules/Il2Cpp/Il2Cpp.csproj +++ b/Dependencies/SupportModules/Il2Cpp/Il2Cpp.csproj @@ -47,6 +47,6 @@ - + \ No newline at end of file diff --git a/Dependencies/SupportModules/Mono/Mono.csproj b/Dependencies/SupportModules/Mono/Mono.csproj index 38ad7eeff..976996954 100644 --- a/Dependencies/SupportModules/Mono/Mono.csproj +++ b/Dependencies/SupportModules/Mono/Mono.csproj @@ -24,6 +24,6 @@ - + \ No newline at end of file diff --git a/Dependencies/SupportModules/Preload/Preload.cs b/Dependencies/SupportModules/Preload/Preload.cs index c75f027be..a40fe72aa 100644 --- a/Dependencies/SupportModules/Preload/Preload.cs +++ b/Dependencies/SupportModules/Preload/Preload.cs @@ -1,4 +1,5 @@ using System.IO; +using System.Reflection; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; @@ -8,23 +9,32 @@ internal static class Preload { private static void Initialize() { - string ManagedFolder = string.Copy(GetManagedDirectory()); + string managedFolder = string.Copy(GetManagedDirectory()); - string SystemPath = Path.Combine(ManagedFolder, "System.dll"); - if (!File.Exists(SystemPath)) - File.WriteAllBytes(SystemPath, Properties.Resources.System); + string systemPath = Path.Combine(managedFolder, "System.dll"); + if (!File.Exists(systemPath)) + WriteResource("System.dll", systemPath); - string SystemCorePath = Path.Combine(ManagedFolder, "System.Core.dll"); - if (!File.Exists(SystemCorePath)) - File.WriteAllBytes(SystemCorePath, Properties.Resources.System_Core); + string systemCorePath = Path.Combine(managedFolder, "System.Core.dll"); + if (!File.Exists(systemCorePath)) + WriteResource("System.Core.dll", systemCorePath); - string SystemDrawingPath = Path.Combine(ManagedFolder, "System.Drawing.dll"); - if (!File.Exists(SystemDrawingPath)) - File.WriteAllBytes(SystemDrawingPath, Properties.Resources.System_Drawing); + string systemDrawingPath = Path.Combine(managedFolder, "System.Drawing.dll"); + if (!File.Exists(systemDrawingPath)) + WriteResource("System.Drawing.dll", systemCorePath); } [MethodImpl(MethodImplOptions.InternalCall)] [return: MarshalAs(UnmanagedType.LPStr)] - private extern static string GetManagedDirectory(); + private static extern string GetManagedDirectory(); + + private static void WriteResource(string name, string destination) + { + var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(name); + var fileStream = new FileStream(destination, FileMode.CreateNew); + for (int i = 0; i < stream!.Length; i++) + fileStream.WriteByte((byte)stream.ReadByte()); + fileStream.Close(); + } } } \ No newline at end of file diff --git a/Dependencies/SupportModules/Preload/Preload.csproj b/Dependencies/SupportModules/Preload/Preload.csproj index 05f254dfe..10d6b8531 100644 --- a/Dependencies/SupportModules/Preload/Preload.csproj +++ b/Dependencies/SupportModules/Preload/Preload.csproj @@ -21,15 +21,10 @@ - - True - True - Resources.resx - - - - + + + \ No newline at end of file diff --git a/Dependencies/SupportModules/Preload/Properties/Resources.Designer.cs b/Dependencies/SupportModules/Preload/Properties/Resources.Designer.cs deleted file mode 100644 index 598a47a04..000000000 --- a/Dependencies/SupportModules/Preload/Properties/Resources.Designer.cs +++ /dev/null @@ -1,92 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace MelonLoader.Support.Properties { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MelonLoader.Support.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized resource of type System.Byte[]. - /// - internal static byte[] System { - get { - object obj = ResourceManager.GetObject("System", resourceCulture); - return ((byte[])(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Byte[]. - /// - internal static byte[] System_Core { - get { - object obj = ResourceManager.GetObject("System_Core", resourceCulture); - return ((byte[])(obj)); - } - } - - internal static byte[] System_Drawing - { - get - { - object obj = ResourceManager.GetObject("System_Drawing", resourceCulture); - return ((byte[])(obj)); - } - } - } -} diff --git a/Dependencies/SupportModules/Preload/Properties/Resources.resx b/Dependencies/SupportModules/Preload/Properties/Resources.resx deleted file mode 100644 index d74d9783a..000000000 --- a/Dependencies/SupportModules/Preload/Properties/Resources.resx +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - ..\Resources\System.dll;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - ..\Resources\System.Core.dll;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - ..\Resources\System.Drawing.dll;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/MelonLoader.sln b/MelonLoader.sln index a432ca006..7b720c2fd 100644 --- a/MelonLoader.sln +++ b/MelonLoader.sln @@ -59,6 +59,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MelonLoader.NativeHost", "M EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Preload", "Dependencies\SupportModules\Preload\Preload.csproj", "{81172B93-0ADE-47A5-9CC4-9833676C2D38}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EOS", "Dependencies\CompatibilityLayers\EOS\EOS.csproj", "{DB9D4AFC-E266-42C8-909A-21C14EEB8A5B}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -201,6 +203,18 @@ Global {81172B93-0ADE-47A5-9CC4-9833676C2D38}.Release|Windows - x64.Build.0 = Release|Any CPU {81172B93-0ADE-47A5-9CC4-9833676C2D38}.Release|Windows - x86.ActiveCfg = Release|Any CPU {81172B93-0ADE-47A5-9CC4-9833676C2D38}.Release|Windows - x86.Build.0 = Release|Any CPU + {DB9D4AFC-E266-42C8-909A-21C14EEB8A5B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DB9D4AFC-E266-42C8-909A-21C14EEB8A5B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DB9D4AFC-E266-42C8-909A-21C14EEB8A5B}.Debug|Windows - x64.ActiveCfg = Debug|Any CPU + {DB9D4AFC-E266-42C8-909A-21C14EEB8A5B}.Debug|Windows - x64.Build.0 = Debug|Any CPU + {DB9D4AFC-E266-42C8-909A-21C14EEB8A5B}.Debug|Windows - x86.ActiveCfg = Debug|Any CPU + {DB9D4AFC-E266-42C8-909A-21C14EEB8A5B}.Debug|Windows - x86.Build.0 = Debug|Any CPU + {DB9D4AFC-E266-42C8-909A-21C14EEB8A5B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DB9D4AFC-E266-42C8-909A-21C14EEB8A5B}.Release|Any CPU.Build.0 = Release|Any CPU + {DB9D4AFC-E266-42C8-909A-21C14EEB8A5B}.Release|Windows - x64.ActiveCfg = Release|Any CPU + {DB9D4AFC-E266-42C8-909A-21C14EEB8A5B}.Release|Windows - x64.Build.0 = Release|Any CPU + {DB9D4AFC-E266-42C8-909A-21C14EEB8A5B}.Release|Windows - x86.ActiveCfg = Release|Any CPU + {DB9D4AFC-E266-42C8-909A-21C14EEB8A5B}.Release|Windows - x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -217,6 +231,7 @@ Global {3AF58371-2E0A-4256-B3A3-C100DB07E599} = {AB4D471C-9AB2-4A5F-93E1-8929E436C121} {1DB3679C-DCCA-492D-A725-75604A379C7A} = {AB4D471C-9AB2-4A5F-93E1-8929E436C121} {81172B93-0ADE-47A5-9CC4-9833676C2D38} = {8D8A18CB-7319-4220-BED8-6B3E23E6C19F} + {DB9D4AFC-E266-42C8-909A-21C14EEB8A5B} = {AB4D471C-9AB2-4A5F-93E1-8929E436C121} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {4AB93B1D-1C52-4A80-809D-C28770140E0A} diff --git a/MelonLoader/Attributes/MelonAuthorColorAttribute.cs b/MelonLoader/Attributes/MelonAuthorColorAttribute.cs index 0e040eefd..b12864705 100644 --- a/MelonLoader/Attributes/MelonAuthorColorAttribute.cs +++ b/MelonLoader/Attributes/MelonAuthorColorAttribute.cs @@ -25,10 +25,7 @@ public ConsoleColor Color public MelonAuthorColorAttribute() => DrawingColor = MelonLogger.DefaultTextColor; - public MelonAuthorColorAttribute(Color drawingColor) - => DrawingColor = drawingColor; - - [Obsolete("ConsoleColor is obsolete, use the (int, int, int, int) or (Color) constructor instead.")] + [Obsolete("ConsoleColor is obsolete, use the (int, int, int, int) constructor instead.")] public MelonAuthorColorAttribute(ConsoleColor color) => Color = ((color == ConsoleColor.Black) ? LoggerUtils.DrawingColorToConsoleColor(MelonLogger.DefaultMelonColor) : color); diff --git a/MelonLoader/Attributes/MelonColorAttribute.cs b/MelonLoader/Attributes/MelonColorAttribute.cs index 6241cd49e..46af0637d 100644 --- a/MelonLoader/Attributes/MelonColorAttribute.cs +++ b/MelonLoader/Attributes/MelonColorAttribute.cs @@ -25,10 +25,7 @@ public ConsoleColor Color public MelonColorAttribute() => DrawingColor = MelonLogger.DefaultTextColor; - public MelonColorAttribute(Color drawingColor) - => DrawingColor = drawingColor; - - [Obsolete("ConsoleColor is obsolete, use the (int, int, int, int) or (Color) constructor instead.")] + [Obsolete("ConsoleColor is obsolete, use the (int, int, int, int) constructor instead.")] public MelonColorAttribute(ConsoleColor color) => Color = ((color == ConsoleColor.Black) ? LoggerUtils.DrawingColorToConsoleColor(MelonLogger.DefaultMelonColor) : color); diff --git a/MelonLoader/BootstrapInterop.cs b/MelonLoader/BootstrapInterop.cs index 7f9acab19..a4e5a28c2 100644 --- a/MelonLoader/BootstrapInterop.cs +++ b/MelonLoader/BootstrapInterop.cs @@ -24,19 +24,7 @@ internal static void SetDefaultConsoleTitleWithGameName([MarshalAs(UnmanagedType Console.Title = versionStr; } - -#if !NET6_0 - [MethodImpl(MethodImplOptions.InternalCall)] - internal static extern void EnableCloseButton(IntPtr mainWindow); - [MethodImpl(MethodImplOptions.InternalCall)] - internal static extern void DisableCloseButton(IntPtr mainWindow); - - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern void NativeHookAttach(IntPtr target, IntPtr detour); - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern void NativeHookDetach(IntPtr target, IntPtr detour); -#else - + private const int MF_BYCOMMAND = 0x00000000; private const int MF_ENABLED = 0x00000000; @@ -63,7 +51,12 @@ public static void DisableCloseButton(IntPtr mainWindow) EnableMenuItem(GetSystemMenu(mainWindow, 0), SC_CLOSE, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED); } - +#if !NET6_0 + [MethodImpl(MethodImplOptions.InternalCall)] + public static extern void NativeHookAttach(IntPtr target, IntPtr detour); + [MethodImpl(MethodImplOptions.InternalCall)] + public static extern void NativeHookDetach(IntPtr target, IntPtr detour); +#else public static void NativeHookAttach(IntPtr target, IntPtr detour) { //SanityCheckDetour is able to wrap and fix the bad method in a delegate where possible, so we pass the detour by ref. diff --git a/MelonLoader/CompatibilityLayers/MelonCompatibilityLayer.cs b/MelonLoader/CompatibilityLayers/MelonCompatibilityLayer.cs index 00c1941bc..df567faf2 100644 --- a/MelonLoader/CompatibilityLayers/MelonCompatibilityLayer.cs +++ b/MelonLoader/CompatibilityLayers/MelonCompatibilityLayer.cs @@ -1,13 +1,15 @@ using MelonLoader.Modules; using System; using System.Collections.Generic; +using System.Diagnostics; using System.IO; +using MelonLoader.Utils; namespace MelonLoader { public static class MelonCompatibilityLayer { - public static string baseDirectory = $"MelonLoader{Path.DirectorySeparatorChar}Dependencies{Path.DirectorySeparatorChar}CompatibilityLayers"; + public static string baseDirectory = $"{MelonEnvironment.GameRootDirectory}{Path.DirectorySeparatorChar}MelonLoader{Path.DirectorySeparatorChar}Dependencies{Path.DirectorySeparatorChar}CompatibilityLayers"; private static List layers = new List() { @@ -16,6 +18,7 @@ public static class MelonCompatibilityLayer // Illusion Plugin Architecture new MelonModule.Info(Path.Combine(baseDirectory, "IPA.dll"), MelonUtils.IsGameIl2Cpp), + new MelonModule.Info(Path.Combine(baseDirectory, "EOS.dll"), () => !MelonUtils.IsWindows) }; private static void CheckGameLayerWithPlatform(string name, Func shouldBeIgnored) diff --git a/MelonLoader/Core.cs b/MelonLoader/Core.cs index 8b2a4d1d3..e570fac17 100644 --- a/MelonLoader/Core.cs +++ b/MelonLoader/Core.cs @@ -42,6 +42,10 @@ internal static int Initialize() MelonEnvironment.MelonLoaderDirectory = runtimeDirInfo.Parent!.FullName; MelonEnvironment.GameRootDirectory = Path.GetDirectoryName(MelonEnvironment.GameExecutablePath); +#if NET6_0 + Environment.SetEnvironmentVariable("IL2CPP_INTEROP_DATABASES_LOCATION", MelonEnvironment.Il2CppAssembliesDirectory); +#endif + SetupWineCheck(); Utils.MelonConsole.Init(); @@ -89,7 +93,8 @@ internal static int Initialize() MelonCompatibilityLayer.LoadModules(); bHapticsManager.Connect(BuildInfo.Name, UnityInformationHandler.GameName); - + + MelonHandler.LoadUserlibs(MelonEnvironment.UserLibsDirectory); MelonHandler.LoadMelonsFromDirectory(MelonEnvironment.PluginsDirectory); MelonEvents.MelonHarmonyEarlyInit.Invoke(); MelonEvents.OnPreInitialization.Invoke(); diff --git a/MelonLoader/InternalUtils/Il2CppAssemblyGenerator.cs b/MelonLoader/InternalUtils/Il2CppAssemblyGenerator.cs index 55df8d3ac..572660602 100644 --- a/MelonLoader/InternalUtils/Il2CppAssemblyGenerator.cs +++ b/MelonLoader/InternalUtils/Il2CppAssemblyGenerator.cs @@ -10,7 +10,7 @@ namespace MelonLoader.InternalUtils internal static class Il2CppAssemblyGenerator { public static readonly MelonModule.Info moduleInfo = new MelonModule.Info( - $"MelonLoader{Path.DirectorySeparatorChar}Dependencies{Path.DirectorySeparatorChar}Il2CppAssemblyGenerator{Path.DirectorySeparatorChar}Il2CppAssemblyGenerator.dll" + $"{MelonEnvironment.GameRootDirectory}{Path.DirectorySeparatorChar}MelonLoader{Path.DirectorySeparatorChar}Dependencies{Path.DirectorySeparatorChar}Il2CppAssemblyGenerator{Path.DirectorySeparatorChar}Il2CppAssemblyGenerator.dll" , () => !MelonUtils.IsGameIl2Cpp()); internal static bool Run() diff --git a/MelonLoader/MelonLoader.csproj b/MelonLoader/MelonLoader.csproj index 6d90b8a6f..9d4023eeb 100644 --- a/MelonLoader/MelonLoader.csproj +++ b/MelonLoader/MelonLoader.csproj @@ -36,7 +36,7 @@ - + diff --git a/MelonLoader/MelonUtils.cs b/MelonLoader/MelonUtils.cs index 4be065b5a..ec830a898 100644 --- a/MelonLoader/MelonUtils.cs +++ b/MelonLoader/MelonUtils.cs @@ -30,7 +30,7 @@ public static class MelonUtils internal static void Setup(AppDomain domain) { using (var sha = SHA256.Create()) - HashCode = string.Join("", sha.ComputeHash(File.ReadAllBytes(Assembly.GetExecutingAssembly().Location)).Select(b => b.ToString("X")).ToArray()); + HashCode = string.Concat(sha.ComputeHash(File.ReadAllBytes(Assembly.GetExecutingAssembly().Location)).Select(b => b.ToString("X2")).ToArray()); Core.WelcomeMessage(); @@ -447,4 +447,4 @@ public static string GetFileProductName(string filepath) //[return: MarshalAs(UnmanagedType.LPStr)] //private extern static string Internal_GetGameDirectory(); } -} \ No newline at end of file +} diff --git a/MelonLoader/Melons/MelonBase.cs b/MelonLoader/Melons/MelonBase.cs index 611921486..94d77a073 100644 --- a/MelonLoader/Melons/MelonBase.cs +++ b/MelonLoader/Melons/MelonBase.cs @@ -65,7 +65,7 @@ public static void RegisterSorted(IEnumerable melons) where T : MelonBase var collection = melons.ToList(); SortMelons(ref collection); - foreach (var m in melons) + foreach (var m in collection) m.Register(); } @@ -656,4 +656,4 @@ public enum Incompatibility Platform } } -} \ No newline at end of file +} diff --git a/MelonLoader/Melons/MelonHandler.cs b/MelonLoader/Melons/MelonHandler.cs index a63c033c7..e8ec51ca9 100644 --- a/MelonLoader/Melons/MelonHandler.cs +++ b/MelonLoader/Melons/MelonHandler.cs @@ -91,6 +91,34 @@ public static void LoadMelonsFromDirectory(string path) where T : MelonTypeBa MelonLogger.WriteSpacer(); firstSpacer = true; } + + public static void LoadUserlibs(string path) + { + path = Path.GetFullPath(path); + + var loadingMsg = $"Loading UserLibss from '{path}'..."; + MelonLogger.WriteSpacer(); + MelonLogger.Msg(loadingMsg); + + bool hasWroteLine = false; + + var files = Directory.GetFiles(path, "*.dll"); + var melonAssemblies = new List(); + foreach (var f in files) + { + if (!hasWroteLine) + { + hasWroteLine = true; + MelonLogger.WriteLine(Color.Magenta); + } + + var asm = MelonAssembly.LoadMelonAssembly(f, false); + if (asm == null) + continue; + + melonAssemblies.Add(asm); + } + } #region Obsolete Members /// diff --git a/MelonLoader/NativeUtils/NativeHooks.cs b/MelonLoader/NativeUtils/NativeHooks.cs index 4c72e6cad..a869c10bf 100644 --- a/MelonLoader/NativeUtils/NativeHooks.cs +++ b/MelonLoader/NativeUtils/NativeHooks.cs @@ -10,6 +10,8 @@ namespace MelonLoader.NativeUtils public class NativeHook where T : Delegate { #region Private Values + private static readonly List _gcProtect = new(); + private IntPtr _targetHandle; private IntPtr _detourHandle; private IntPtr _trampolineHandle; @@ -51,12 +53,30 @@ public IntPtr Detour public T Trampoline { - get + get => _trampoline; + private set { - if (_trampoline == null) - _trampoline = (T)Marshal.GetDelegateForFunctionPointer(_trampolineHandle, typeof(T)); + if (value == null) + throw new ArgumentNullException(nameof(value)); + + if (_trampoline != null) + _gcProtect.Remove(_trampoline); + + _trampoline = value; + _gcProtect.Add(_trampoline); + } + + } + + public IntPtr TrampolineHandle + { + get => _trampolineHandle; + private set + { + if (value == IntPtr.Zero) + throw new ArgumentNullException(nameof(value)); - return _trampoline; + _trampolineHandle = value; } } @@ -91,6 +111,9 @@ public unsafe void Attach() IntPtr trampoline = _targetHandle; BootstrapInterop.NativeHookAttach((IntPtr)(&trampoline), _detourHandle); _trampolineHandle = trampoline; + + _trampoline = (T)Marshal.GetDelegateForFunctionPointer(_trampolineHandle, typeof(T)); + _gcProtect.Add(_trampoline); IsHooked = true; } @@ -107,6 +130,8 @@ public unsafe void Detach() BootstrapInterop.NativeHookDetach((IntPtr)(&original), _detourHandle); IsHooked= false; + _gcProtect.Remove(_trampoline); + _trampoline = null; _trampolineHandle = IntPtr.Zero; } } diff --git a/MelonLoader/Properties/BuildInfo.cs b/MelonLoader/Properties/BuildInfo.cs index 34e726168..6d2613f13 100644 --- a/MelonLoader/Properties/BuildInfo.cs +++ b/MelonLoader/Properties/BuildInfo.cs @@ -6,6 +6,6 @@ public static class BuildInfo public const string Description = "MelonLoader"; public const string Author = "Lava Gang"; public const string Company = "discord.gg/2Wn3N2P"; - public const string Version = "0.6.1"; + public const string Version = "0.6.2"; } } \ No newline at end of file diff --git a/MelonLoader/Utils/ManagedAnalyticsBlocker.cs b/MelonLoader/Utils/ManagedAnalyticsBlocker.cs index 7430f78c2..945c88b22 100644 --- a/MelonLoader/Utils/ManagedAnalyticsBlocker.cs +++ b/MelonLoader/Utils/ManagedAnalyticsBlocker.cs @@ -25,6 +25,8 @@ internal static unsafe class ManagedAnalyticsBlocker private static gethostbyname_delegate original_gethostbyname; private static getaddrinfo_delegate original_getaddrinfo; + + private static object _observedDomainsLock = new object(); private static List _blockList = new() { @@ -67,14 +69,21 @@ internal static unsafe class ManagedAnalyticsBlocker "\u0066\u0061\u0063\u0065\u0062\u006f\u006f\u006b\u002e\u0063\u006f\u006d", }; + /// + /// Explicitly allow domains that may be a subdomain of a blocked domain. + /// + private static HashSet _explicitAllowList = new() + { + "\u0073\u0063\u006f\u006e\u0074\u0065\u006e\u0074\u002e\u006f\u0063\u0075\u006c\u0075\u0073\u0063\u0064\u006e\u002e\u0063\u006f\u006d" + }; + private static List _observedHostnames = new() { //Default ignored (as in, not logged) hostnames. I'm leaving these in cleartext cause it's easier. "ntp.org", - "bonetome.com", "samboy.dev", "github.com", - "ruby-core.com", + "dubyadu.de", "melonloader.com", "githubusercontent.com", "thetrueyoshifan.com" @@ -87,16 +96,23 @@ private static bool CheckShouldBlock(string hostname) hostname = hostname.Trim().ToLowerInvariant(); - var shouldBlock = _blockList.Any(b => hostname.Contains(b)); + var shouldBlock = !_explicitAllowList.Contains(hostname) && + _blockList.Any(b => hostname.Contains(b)); if (MelonDebug.IsEnabled() || MelonLaunchOptions.Core.ShouldDisplayAnalyticsBlocker) { if (shouldBlock) MelonDebug.Msg($"Host Name or IP blocked: {hostname}"); - else if (!_observedHostnames.Any(h => hostname.Contains(h))) + else { - MelonDebug.Msg($"Unique Host Name or IP Found: {hostname}"); - _observedHostnames.Add(hostname); + lock (_observedDomainsLock) + { + if (!_observedHostnames.Any(h => hostname.Contains(h))) + { + MelonDebug.Msg($"Unique Host Name or IP Found: {hostname}"); + _observedHostnames.Add(hostname); + } + } } } diff --git a/MelonProxy/Cargo.toml b/MelonProxy/Cargo.toml new file mode 100644 index 000000000..71b542fc8 --- /dev/null +++ b/MelonProxy/Cargo.toml @@ -0,0 +1,33 @@ +[package] +name = "MelonProxy" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +msgbox = "0.7.0" +libloading = "0.8.1" + +[target.'cfg(target_os = "windows")'.dependencies] +#proxygen-macros = "0.5.0" +proxygen-macros = { git = "https://github.com/RinLovesYou/proxygen" } # temporary until PR is accepted +winapi = { version = "0.3.9", features = [ + "minwindef", + "libloaderapi", + "processthreadsapi", + "consoleapi", + "processenv", + "winbase", + "winuser", + "sysinfoapi", + "errhandlingapi", +] } + +[target.'cfg(not(target_os = "windows"))'.dependencies] +ctor = "0.2.6" + + +[lib] +name = "version" +crate-type = ["cdylib"] diff --git a/MelonProxy/src/core.rs b/MelonProxy/src/core.rs new file mode 100644 index 000000000..20fa394eb --- /dev/null +++ b/MelonProxy/src/core.rs @@ -0,0 +1,56 @@ +use std::{ + error::Error, + path::PathBuf, + sync::{LazyLock, Mutex}, +}; + +use libloading::Library; + +use crate::utils::files; + +pub static BOOTSTRAP: LazyLock>> = LazyLock::new(|| Mutex::new(None)); + +pub fn init() -> Result<(), Box> { + let args: Vec = std::env::args().collect(); + + //TODO: Support UTF-16 (it will suck) + let mut base_dir = std::env::current_dir()?; + let mut no_mods = false; + + let current_exe = std::env::current_exe()?; + let game_name = current_exe + .file_name() + .ok_or("Failed to get game name")? + .to_str() + .ok_or("Failed to get game name")?; + + if game_name.starts_with("UnityCrashHandler64") || game_name.starts_with("UnityCrashHandler32") + { + return Ok(()); + } + + for arg in args.iter() { + if arg.starts_with("--melonloader.basedir") { + let a: Vec<&str> = arg.split("=").collect(); + base_dir = PathBuf::from(a[1]); + } + + if arg.contains("--no-mods") { + no_mods = true; + } + } + + //return Ok, and silently stop loading MelonLoader, if the user has specified to not load mods, + //or if the game is not a Unity game + if no_mods { + return Ok(()); + } + + let bootstrap_path = files::get_bootstrap_path(&base_dir)?; + + unsafe { + *BOOTSTRAP.try_lock()? = Some(Library::new(&bootstrap_path)?); + } + + Ok(()) +} diff --git a/MelonProxy/src/export_indices.rs b/MelonProxy/src/export_indices.rs new file mode 100644 index 000000000..13e524567 --- /dev/null +++ b/MelonProxy/src/export_indices.rs @@ -0,0 +1,256 @@ +// After making changes in this file, you should run `proxygen update .`` in the root of this project to update exports + +#![allow(non_upper_case_globals)] + +pub const TOTAL_EXPORTS: usize = 251; +pub const Index_CloseDriver: usize = 0; +pub const Index_DefDriverProc: usize = 1; +pub const Index_DllCanUnloadNow: usize = 2; +pub const Index_DllGetClassObject: usize = 3; +pub const Index_DllRegisterServer: usize = 4; +pub const Index_DllUnregisterServer: usize = 5; +pub const Index_DriverCallback: usize = 6; +pub const Index_DrvClose: usize = 7; +pub const Index_DrvDefDriverProc: usize = 8; +pub const Index_DrvGetModuleHandle: usize = 9; +pub const Index_DrvOpen: usize = 10; +pub const Index_DrvOpenA: usize = 11; +pub const Index_DrvSendMessage: usize = 12; +pub const Index_GetDriverFlags: usize = 13; +pub const Index_GetDriverModuleHandle: usize = 14; +pub const Index_GetFileVersionInfoA: usize = 15; +pub const Index_GetFileVersionInfoExA: usize = 16; +pub const Index_GetFileVersionInfoExW: usize = 17; +pub const Index_GetFileVersionInfoSizeA: usize = 18; +pub const Index_GetFileVersionInfoSizeExA: usize = 19; +pub const Index_GetFileVersionInfoSizeExW: usize = 20; +pub const Index_GetFileVersionInfoSizeW: usize = 21; +pub const Index_GetFileVersionInfoW: usize = 22; +pub const Index_OpenDriver: usize = 23; +pub const Index_OpenDriverA: usize = 24; +pub const Index_PlaySound: usize = 25; +pub const Index_PlaySoundA: usize = 26; +pub const Index_PlaySoundW: usize = 27; +pub const Index_SendDriverMessage: usize = 28; +pub const Index_VerFindFileA: usize = 29; +pub const Index_VerFindFileW: usize = 30; +pub const Index_VerInstallFileA: usize = 31; +pub const Index_VerInstallFileW: usize = 32; +pub const Index_VerLanguageNameA: usize = 33; +pub const Index_VerLanguageNameW: usize = 34; +pub const Index_VerQueryValueA: usize = 35; +pub const Index_VerQueryValueW: usize = 36; +pub const Index_WinHttpAddRequestHeaders: usize = 37; +pub const Index_WinHttpCheckPlatform: usize = 38; +pub const Index_WinHttpCloseHandle: usize = 39; +pub const Index_WinHttpConnect: usize = 40; +pub const Index_WinHttpCrackUrl: usize = 41; +pub const Index_WinHttpCreateProxyResolver: usize = 42; +pub const Index_WinHttpCreateUrl: usize = 43; +pub const Index_WinHttpDetectAutoProxyConfigUrl: usize = 44; +pub const Index_WinHttpFreeProxyResult: usize = 45; +pub const Index_WinHttpFreeProxyResultEx: usize = 46; +pub const Index_WinHttpFreeProxySettings: usize = 47; +pub const Index_WinHttpGetDefaultProxyConfiguration: usize = 48; +pub const Index_WinHttpGetIEProxyConfigForCurrentUser: usize = 49; +pub const Index_WinHttpGetProxyForUrl: usize = 50; +pub const Index_WinHttpGetProxyForUrlEx: usize = 51; +pub const Index_WinHttpGetProxyForUrlEx2: usize = 52; +pub const Index_WinHttpGetProxyResult: usize = 53; +pub const Index_WinHttpGetProxyResultEx: usize = 54; +pub const Index_WinHttpGetProxySettingsVersion: usize = 55; +pub const Index_WinHttpOpen: usize = 56; +pub const Index_WinHttpOpenRequest: usize = 57; +pub const Index_WinHttpQueryAuthSchemes: usize = 58; +pub const Index_WinHttpQueryDataAvailable: usize = 59; +pub const Index_WinHttpQueryHeaders: usize = 60; +pub const Index_WinHttpQueryOption: usize = 61; +pub const Index_WinHttpReadData: usize = 62; +pub const Index_WinHttpReadProxySettings: usize = 63; +pub const Index_WinHttpReceiveResponse: usize = 64; +pub const Index_WinHttpResetAutoProxy: usize = 65; +pub const Index_WinHttpSendRequest: usize = 66; +pub const Index_WinHttpSetCredentials: usize = 67; +pub const Index_WinHttpSetDefaultProxyConfiguration: usize = 68; +pub const Index_WinHttpSetOption: usize = 69; +pub const Index_WinHttpSetStatusCallback: usize = 70; +pub const Index_WinHttpSetTimeouts: usize = 71; +pub const Index_WinHttpTimeFromSystemTime: usize = 72; +pub const Index_WinHttpTimeToSystemTime: usize = 73; +pub const Index_WinHttpWebSocketClose: usize = 74; +pub const Index_WinHttpWebSocketCompleteUpgrade: usize = 75; +pub const Index_WinHttpWebSocketQueryCloseStatus: usize = 76; +pub const Index_WinHttpWebSocketReceive: usize = 77; +pub const Index_WinHttpWebSocketSend: usize = 78; +pub const Index_WinHttpWebSocketShutdown: usize = 79; +pub const Index_WinHttpWriteData: usize = 80; +pub const Index_WinHttpWriteProxySettings: usize = 81; +pub const Index_auxGetDevCapsA: usize = 82; +pub const Index_auxGetDevCapsW: usize = 83; +pub const Index_auxGetNumDevs: usize = 84; +pub const Index_auxGetVolume: usize = 85; +pub const Index_auxOutMessage: usize = 86; +pub const Index_auxSetVolume: usize = 87; +pub const Index_joyConfigChanged: usize = 88; +pub const Index_joyGetDevCapsA: usize = 89; +pub const Index_joyGetDevCapsW: usize = 90; +pub const Index_joyGetNumDevs: usize = 91; +pub const Index_joyGetPos: usize = 92; +pub const Index_joyGetPosEx: usize = 93; +pub const Index_joyGetThreshold: usize = 94; +pub const Index_joyReleaseCapture: usize = 95; +pub const Index_joySetCapture: usize = 96; +pub const Index_joySetThreshold: usize = 97; +pub const Index_mciDriverNotify: usize = 98; +pub const Index_mciDriverYield: usize = 99; +pub const Index_mciExecute: usize = 100; +pub const Index_mciFreeCommandResource: usize = 101; +pub const Index_mciGetCreatorTask: usize = 102; +pub const Index_mciGetDeviceIDA: usize = 103; +pub const Index_mciGetDeviceIDFromElementIDA: usize = 104; +pub const Index_mciGetDeviceIDFromElementIDW: usize = 105; +pub const Index_mciGetDeviceIDW: usize = 106; +pub const Index_mciGetDriverData: usize = 107; +pub const Index_mciGetErrorStringA: usize = 108; +pub const Index_mciGetErrorStringW: usize = 109; +pub const Index_mciGetYieldProc: usize = 110; +pub const Index_mciLoadCommandResource: usize = 111; +pub const Index_mciSendCommandA: usize = 112; +pub const Index_mciSendCommandW: usize = 113; +pub const Index_mciSendStringA: usize = 114; +pub const Index_mciSendStringW: usize = 115; +pub const Index_mciSetDriverData: usize = 116; +pub const Index_mciSetYieldProc: usize = 117; +pub const Index_midiConnect: usize = 118; +pub const Index_midiDisconnect: usize = 119; +pub const Index_midiInAddBuffer: usize = 120; +pub const Index_midiInClose: usize = 121; +pub const Index_midiInGetDevCapsA: usize = 122; +pub const Index_midiInGetDevCapsW: usize = 123; +pub const Index_midiInGetErrorTextA: usize = 124; +pub const Index_midiInGetErrorTextW: usize = 125; +pub const Index_midiInGetID: usize = 126; +pub const Index_midiInGetNumDevs: usize = 127; +pub const Index_midiInMessage: usize = 128; +pub const Index_midiInOpen: usize = 129; +pub const Index_midiInPrepareHeader: usize = 130; +pub const Index_midiInReset: usize = 131; +pub const Index_midiInStart: usize = 132; +pub const Index_midiInStop: usize = 133; +pub const Index_midiInUnprepareHeader: usize = 134; +pub const Index_midiOutCacheDrumPatches: usize = 135; +pub const Index_midiOutCachePatches: usize = 136; +pub const Index_midiOutClose: usize = 137; +pub const Index_midiOutGetDevCapsA: usize = 138; +pub const Index_midiOutGetDevCapsW: usize = 139; +pub const Index_midiOutGetErrorTextA: usize = 140; +pub const Index_midiOutGetErrorTextW: usize = 141; +pub const Index_midiOutGetID: usize = 142; +pub const Index_midiOutGetNumDevs: usize = 143; +pub const Index_midiOutGetVolume: usize = 144; +pub const Index_midiOutLongMsg: usize = 145; +pub const Index_midiOutMessage: usize = 146; +pub const Index_midiOutOpen: usize = 147; +pub const Index_midiOutPrepareHeader: usize = 148; +pub const Index_midiOutReset: usize = 149; +pub const Index_midiOutSetVolume: usize = 150; +pub const Index_midiOutShortMsg: usize = 151; +pub const Index_midiOutUnprepareHeader: usize = 152; +pub const Index_midiStreamClose: usize = 153; +pub const Index_midiStreamOpen: usize = 154; +pub const Index_midiStreamOut: usize = 155; +pub const Index_midiStreamPause: usize = 156; +pub const Index_midiStreamPosition: usize = 157; +pub const Index_midiStreamProperty: usize = 158; +pub const Index_midiStreamRestart: usize = 159; +pub const Index_midiStreamStop: usize = 160; +pub const Index_mixerClose: usize = 161; +pub const Index_mixerGetControlDetailsA: usize = 162; +pub const Index_mixerGetControlDetailsW: usize = 163; +pub const Index_mixerGetDevCapsA: usize = 164; +pub const Index_mixerGetDevCapsW: usize = 165; +pub const Index_mixerGetID: usize = 166; +pub const Index_mixerGetLineControlsA: usize = 167; +pub const Index_mixerGetLineControlsW: usize = 168; +pub const Index_mixerGetLineInfoA: usize = 169; +pub const Index_mixerGetLineInfoW: usize = 170; +pub const Index_mixerGetNumDevs: usize = 171; +pub const Index_mixerMessage: usize = 172; +pub const Index_mixerOpen: usize = 173; +pub const Index_mixerSetControlDetails: usize = 174; +pub const Index_mmGetCurrentTask: usize = 175; +pub const Index_mmTaskBlock: usize = 176; +pub const Index_mmTaskCreate: usize = 177; +pub const Index_mmTaskSignal: usize = 178; +pub const Index_mmTaskYield: usize = 179; +pub const Index_mmioAdvance: usize = 180; +pub const Index_mmioAscend: usize = 181; +pub const Index_mmioClose: usize = 182; +pub const Index_mmioCreateChunk: usize = 183; +pub const Index_mmioDescend: usize = 184; +pub const Index_mmioFlush: usize = 185; +pub const Index_mmioGetInfo: usize = 186; +pub const Index_mmioInstallIOProc16: usize = 187; +pub const Index_mmioInstallIOProcA: usize = 188; +pub const Index_mmioInstallIOProcW: usize = 189; +pub const Index_mmioOpenA: usize = 190; +pub const Index_mmioOpenW: usize = 191; +pub const Index_mmioRead: usize = 192; +pub const Index_mmioRenameA: usize = 193; +pub const Index_mmioRenameW: usize = 194; +pub const Index_mmioSeek: usize = 195; +pub const Index_mmioSendMessage: usize = 196; +pub const Index_mmioSetBuffer: usize = 197; +pub const Index_mmioSetInfo: usize = 198; +pub const Index_mmioStringToFOURCCA: usize = 199; +pub const Index_mmioStringToFOURCCW: usize = 200; +pub const Index_mmioWrite: usize = 201; +pub const Index_mmsystemGetVersion: usize = 202; +pub const Index_sndPlaySoundA: usize = 203; +pub const Index_sndPlaySoundW: usize = 204; +pub const Index_timeBeginPeriod: usize = 205; +pub const Index_timeEndPeriod: usize = 206; +pub const Index_timeGetDevCaps: usize = 207; +pub const Index_timeGetSystemTime: usize = 208; +pub const Index_timeGetTime: usize = 209; +pub const Index_timeKillEvent: usize = 210; +pub const Index_timeSetEvent: usize = 211; +pub const Index_waveInAddBuffer: usize = 212; +pub const Index_waveInClose: usize = 213; +pub const Index_waveInGetDevCapsA: usize = 214; +pub const Index_waveInGetDevCapsW: usize = 215; +pub const Index_waveInGetErrorTextA: usize = 216; +pub const Index_waveInGetErrorTextW: usize = 217; +pub const Index_waveInGetID: usize = 218; +pub const Index_waveInGetNumDevs: usize = 219; +pub const Index_waveInGetPosition: usize = 220; +pub const Index_waveInMessage: usize = 221; +pub const Index_waveInOpen: usize = 222; +pub const Index_waveInPrepareHeader: usize = 223; +pub const Index_waveInReset: usize = 224; +pub const Index_waveInStart: usize = 225; +pub const Index_waveInStop: usize = 226; +pub const Index_waveInUnprepareHeader: usize = 227; +pub const Index_waveOutBreakLoop: usize = 228; +pub const Index_waveOutClose: usize = 229; +pub const Index_waveOutGetDevCapsA: usize = 230; +pub const Index_waveOutGetDevCapsW: usize = 231; +pub const Index_waveOutGetErrorTextA: usize = 232; +pub const Index_waveOutGetErrorTextW: usize = 233; +pub const Index_waveOutGetID: usize = 234; +pub const Index_waveOutGetNumDevs: usize = 235; +pub const Index_waveOutGetPitch: usize = 236; +pub const Index_waveOutGetPlaybackRate: usize = 237; +pub const Index_waveOutGetPosition: usize = 238; +pub const Index_waveOutGetVolume: usize = 239; +pub const Index_waveOutMessage: usize = 240; +pub const Index_waveOutOpen: usize = 241; +pub const Index_waveOutPause: usize = 242; +pub const Index_waveOutPrepareHeader: usize = 243; +pub const Index_waveOutReset: usize = 244; +pub const Index_waveOutRestart: usize = 245; +pub const Index_waveOutSetPitch: usize = 246; +pub const Index_waveOutSetPlaybackRate: usize = 247; +pub const Index_waveOutSetVolume: usize = 248; +pub const Index_waveOutUnprepareHeader: usize = 249; +pub const Index_waveOutWrite: usize = 250; diff --git a/MelonProxy/src/intercepted_exports.rs b/MelonProxy/src/intercepted_exports.rs new file mode 100644 index 000000000..b4bffa80b --- /dev/null +++ b/MelonProxy/src/intercepted_exports.rs @@ -0,0 +1,44 @@ +// Intercepted/replaced functions go here +// Remember to run `proxygen update .` in the root of this project every time you add or remove an export here +// +// Example function proxies/hooks. +// Note, if using any of the `proxy`, `pre_hook` or `post_hook` macros, you will have access to the original function +// You can easily call `orig_func` with the same args as your interceptor function +// NOTE: Use the correct arg types and return type for any functions you proxy, or else you will probably mess up the stack +// and you will probably crash whatever program the DLL is loaded into +// +// #[pre_hook(sig="known")] +// #[export_name="SomeFunction"] +// pub extern "C" fn SomeFunction(some_arg_1: usize, some_arg_2: u32) -> bool { +// println!("Pre-hooked SomeFunction. Args: {}, {}", some_arg_1, some_arg_2); +// // After all our code in this pre-hook runs, if we don't return, the original function will be called +// // and its result will be returned +// } +// +// #[proxy(sig="known")] +// #[export_name="SomeFunction"] +// pub extern "C" fn SomeFunction(some_arg_1: usize, some_arg_2: u32) -> bool { +// let orig_result = orig_func(some_arg_1, some_arg_2); +// println!("Manually proxied SomeFunction. Args: {}, {}. Result: {}", some_arg_1, some_arg_2, orig_result); +// // This is just a normal/manual proxy. It is up to us to return a value. +// // Also note that the original function `orig_func` will not be run in this case unless we explicitly call it +// true +// } +// +// #[post_hook(sig="known")] +// #[export_name="SomeFunction"] +// pub extern "C" fn SomeFunction(some_arg_1: usize, some_arg_2: u32) -> bool { +// // `orig_func` got run just before our code. Its result is stored in `orig_result` +// println!("In post-hook for SomeFunction. Args: {}, {}. Result: {}", some_arg_1, some_arg_2, orig_result); +// // We could manually return something here if we didn't want `orig_result` returned +// } +// +// #[pre_hook(sig="unknown")] +// #[export_name="SomeFunction"] +// pub extern "C" fn SomeFunction() { +// println!("In pre-hook for SomeFunction. (signature unknown)") +// } + +#![allow(unused_imports)] +use proxygen_macros::{post_hook, pre_hook, proxy, forward}; + diff --git a/MelonProxy/src/lib.rs b/MelonProxy/src/lib.rs new file mode 100644 index 000000000..fa3d33386 --- /dev/null +++ b/MelonProxy/src/lib.rs @@ -0,0 +1,205 @@ +//! Most of this Project was generated using [ProxyGen](https://github.com/WarrenHood/proxygen) +//! +//! Altered to work with MelonLoader, and be cross platform. + +#![feature(naked_functions)] +#![allow(named_asm_labels)] +#![allow(non_snake_case)] +#![feature(asm_const)] +#![feature(lazy_cell)] + +#[cfg(target_os = "windows")] +mod export_indices; +#[cfg(target_os = "windows")] +mod intercepted_exports; +#[cfg(target_os = "windows")] +mod orig_exports; +#[cfg(target_os = "windows")] +mod proxied_exports; + +mod utils; +mod core; + + +#[allow(unused_imports)] +#[cfg(target_os = "windows")] +pub use intercepted_exports::*; +#[cfg(target_os = "windows")] +pub use proxied_exports::*; + +#[cfg(target_os = "windows")] +use export_indices::TOTAL_EXPORTS; +#[cfg(target_os = "windows")] +use orig_exports::load_dll_funcs; +#[cfg(target_arch="x86_64")] +#[cfg(target_os = "windows")] +use std::arch::x86_64::_mm_pause; +#[cfg(target_arch="x86")] +#[cfg(target_os = "windows")] +use std::arch::x86::_mm_pause; +#[cfg(target_os = "windows")] +use std::ffi::OsString; +#[cfg(target_os = "windows")] +use std::os::windows::prelude::{AsRawHandle, OsStringExt}; + +#[cfg(target_os = "windows")] +use winapi::{ + ctypes::c_void, + shared::{ + minwindef::{FARPROC, HMODULE}, + ntdef::LPCSTR, + }, + um::{ + consoleapi::AllocConsole, + errhandlingapi::GetLastError, + libloaderapi::{DisableThreadLibraryCalls, FreeLibrary, GetModuleFileNameW, LoadLibraryA}, + processenv::SetStdHandle, + processthreadsapi::{CreateThread, GetCurrentProcess, TerminateProcess}, + winbase::{STD_ERROR_HANDLE, STD_OUTPUT_HANDLE}, + winnt::{DLL_PROCESS_ATTACH, DLL_PROCESS_DETACH}, + winuser::{MessageBoxA, MB_OK}, + sysinfoapi::GetSystemDirectoryW, + }, +}; + + +// Static handles +#[cfg(target_os = "windows")] +static mut THIS_HANDLE: Option = None; +#[cfg(target_os = "windows")] +static mut ORIG_DLL_HANDLE: Option = None; + +// Original funcs +#[cfg(target_os = "windows")] +#[no_mangle] +static mut ORIGINAL_FUNCS: [FARPROC; TOTAL_EXPORTS] = [std::ptr::null_mut(); TOTAL_EXPORTS]; +#[cfg(target_os = "windows")] +#[no_mangle] +static mut ORIG_FUNCS_PTR: *const FARPROC = std::ptr::null_mut(); + +const INFO_BUFFER_SIZE: u32 = 32767; + +/// Indicates once we are ready to accept incoming calls to proxied functions + +static mut PROXYGEN_READY: bool = false; + +#[cfg(target_os = "windows")] +#[no_mangle] +pub unsafe extern "stdcall" fn DllMain(module: HMODULE, reason: isize, _res: *const c_void) -> i32 { + THIS_HANDLE = Some(module); + + if reason == 1 { + init(std::ptr::null_mut()); + + core::init().unwrap_or_else(|e| { + internal_failure!("Failed to initialize MelonLoader: {}", e) + }); + } + + 1 +} + +#[cfg(not(target_os = "windows"))] +#[ctor::ctor] +fn init() { + core::init().unwrap_or_else(|e| { + internal_failure!("Failed to initialize MelonLoader: {}", e) + }); +} + + +/// Get the current DLLs path +#[cfg(target_os = "windows")] +unsafe fn get_dll_path() -> Option { + let mut buffer: Vec = vec![0; 260]; + if THIS_HANDLE.is_none() { + return None; + } + let size = GetModuleFileNameW( + THIS_HANDLE.unwrap(), + buffer.as_mut_ptr(), + buffer.len() as u32, + ); + + if size == 0 { + return None; + } + + buffer.truncate(size as usize); + let os_string = OsString::from_wide(&buffer); + Some(os_string.to_string_lossy().into_owned()) +} + +#[cfg(target_os = "windows")] +unsafe fn get_system32_path() -> Option { + let mut buffer: Vec = vec![0; INFO_BUFFER_SIZE as usize]; + let size = GetSystemDirectoryW( + buffer.as_mut_ptr(), + buffer.len() as u32, + ); + + if size == 0 { + return None; + } + + buffer.truncate(size as usize); + let os_string = OsString::from_wide(&buffer); + Some(os_string.to_string_lossy().into_owned()) +} + +/// Called when the thread is spawned +#[cfg(target_os = "windows")] +unsafe extern "system" fn init(_: *mut c_void) -> u32 { + use std::{path::PathBuf, ffi::{c_char, CString, CStr}}; + + ORIG_FUNCS_PTR = ORIGINAL_FUNCS.as_ptr(); + + if let Some(dll_path) = get_dll_path() { + println!("This DLL path: {}", &dll_path); + let path = PathBuf::from(dll_path); + let orig_dll_name = path.file_name().unwrap_or_else(|| { + internal_failure!("Failed to get DLL name"); + }); + + + let system32_path = get_system32_path().unwrap_or_else(|| { + internal_failure!("Failed to get system32 path"); + }); + + let path = PathBuf::from(&system32_path).join(orig_dll_name); + + if !path.exists() { + internal_failure!("Original DLL does not exist"); + } + + let path = path.to_str().unwrap_or_else(|| { + internal_failure!("Failed to convert path to string"); + }); + + ORIG_DLL_HANDLE = Some(LoadLibraryA(path.as_ptr() as *const i8)); + } else { + internal_failure!("Failed to get DLL path"); + return 1; + } + if let Some(orig_dll_handle) = ORIG_DLL_HANDLE { + if orig_dll_handle.is_null() { + internal_failure!("Failed to load original DLL"); + } + println!("Original DLL handle: {:?}", orig_dll_handle); + } else { + let err = GetLastError(); + internal_failure!("Failed to load original DLL: {}", err); + } + load_dll_funcs(); + PROXYGEN_READY = true; + 0 +} + +/// Call this before attempting to call a function in the proxied DLL +/// +/// This will wait for proxygen to fully load up all the proxied function addresses before returning +#[cfg(target_os = "windows")] +#[no_mangle] +pub extern "C" fn wait_dll_proxy_init() { + //leftover from proxygen +} diff --git a/MelonProxy/src/orig_exports.rs b/MelonProxy/src/orig_exports.rs new file mode 100644 index 000000000..74eb55408 --- /dev/null +++ b/MelonProxy/src/orig_exports.rs @@ -0,0 +1,276 @@ +use crate::export_indices::*; +use crate::{ORIGINAL_FUNCS, ORIG_DLL_HANDLE}; +use std::ffi::CString; +use winapi::{ + shared::minwindef::{FARPROC, HMODULE}, + um::libloaderapi::GetProcAddress, +}; + +/// Loads up the address of the original function in the given module +unsafe fn load_dll_func(index: usize, h_module: HMODULE, func: &str) { + let func_c_string = CString::new(func).unwrap(); + let proc_address: FARPROC = GetProcAddress(h_module, func_c_string.as_ptr()); + ORIGINAL_FUNCS[index] = proc_address; + println!("[0x{:016x}] Loaded {}", proc_address as u64, func); +} + +/// Loads the original DLL functions for later use +pub unsafe fn load_dll_funcs() { + println!("Loading original DLL functions"); + if ORIG_DLL_HANDLE.is_none() { + eprintln!("Original DLL handle is none. Cannot load original DLL funcs"); + return; + } + let dll_handle = ORIG_DLL_HANDLE.unwrap(); + load_dll_func(Index_CloseDriver, dll_handle, "CloseDriver"); + load_dll_func(Index_DefDriverProc, dll_handle, "DefDriverProc"); + load_dll_func(Index_DllCanUnloadNow, dll_handle, "DllCanUnloadNow"); + load_dll_func(Index_DllGetClassObject, dll_handle, "DllGetClassObject"); + load_dll_func(Index_DllRegisterServer, dll_handle, "DllRegisterServer"); + load_dll_func(Index_DllUnregisterServer, dll_handle, "DllUnregisterServer"); + load_dll_func(Index_DriverCallback, dll_handle, "DriverCallback"); + load_dll_func(Index_DrvClose, dll_handle, "DrvClose"); + load_dll_func(Index_DrvDefDriverProc, dll_handle, "DrvDefDriverProc"); + load_dll_func(Index_DrvGetModuleHandle, dll_handle, "DrvGetModuleHandle"); + load_dll_func(Index_DrvOpen, dll_handle, "DrvOpen"); + load_dll_func(Index_DrvOpenA, dll_handle, "DrvOpenA"); + load_dll_func(Index_DrvSendMessage, dll_handle, "DrvSendMessage"); + load_dll_func(Index_GetDriverFlags, dll_handle, "GetDriverFlags"); + load_dll_func(Index_GetDriverModuleHandle, dll_handle, "GetDriverModuleHandle"); + load_dll_func(Index_GetFileVersionInfoA, dll_handle, "GetFileVersionInfoA"); + load_dll_func(Index_GetFileVersionInfoExA, dll_handle, "GetFileVersionInfoExA"); + load_dll_func(Index_GetFileVersionInfoExW, dll_handle, "GetFileVersionInfoExW"); + load_dll_func(Index_GetFileVersionInfoSizeA, dll_handle, "GetFileVersionInfoSizeA"); + load_dll_func(Index_GetFileVersionInfoSizeExA, dll_handle, "GetFileVersionInfoSizeExA"); + load_dll_func(Index_GetFileVersionInfoSizeExW, dll_handle, "GetFileVersionInfoSizeExW"); + load_dll_func(Index_GetFileVersionInfoSizeW, dll_handle, "GetFileVersionInfoSizeW"); + load_dll_func(Index_GetFileVersionInfoW, dll_handle, "GetFileVersionInfoW"); + load_dll_func(Index_OpenDriver, dll_handle, "OpenDriver"); + load_dll_func(Index_OpenDriverA, dll_handle, "OpenDriverA"); + load_dll_func(Index_PlaySound, dll_handle, "PlaySound"); + load_dll_func(Index_PlaySoundA, dll_handle, "PlaySoundA"); + load_dll_func(Index_PlaySoundW, dll_handle, "PlaySoundW"); + load_dll_func(Index_SendDriverMessage, dll_handle, "SendDriverMessage"); + load_dll_func(Index_VerFindFileA, dll_handle, "VerFindFileA"); + load_dll_func(Index_VerFindFileW, dll_handle, "VerFindFileW"); + load_dll_func(Index_VerInstallFileA, dll_handle, "VerInstallFileA"); + load_dll_func(Index_VerInstallFileW, dll_handle, "VerInstallFileW"); + load_dll_func(Index_VerLanguageNameA, dll_handle, "VerLanguageNameA"); + load_dll_func(Index_VerLanguageNameW, dll_handle, "VerLanguageNameW"); + load_dll_func(Index_VerQueryValueA, dll_handle, "VerQueryValueA"); + load_dll_func(Index_VerQueryValueW, dll_handle, "VerQueryValueW"); + load_dll_func(Index_WinHttpAddRequestHeaders, dll_handle, "WinHttpAddRequestHeaders"); + load_dll_func(Index_WinHttpCheckPlatform, dll_handle, "WinHttpCheckPlatform"); + load_dll_func(Index_WinHttpCloseHandle, dll_handle, "WinHttpCloseHandle"); + load_dll_func(Index_WinHttpConnect, dll_handle, "WinHttpConnect"); + load_dll_func(Index_WinHttpCrackUrl, dll_handle, "WinHttpCrackUrl"); + load_dll_func(Index_WinHttpCreateProxyResolver, dll_handle, "WinHttpCreateProxyResolver"); + load_dll_func(Index_WinHttpCreateUrl, dll_handle, "WinHttpCreateUrl"); + load_dll_func(Index_WinHttpDetectAutoProxyConfigUrl, dll_handle, "WinHttpDetectAutoProxyConfigUrl"); + load_dll_func(Index_WinHttpFreeProxyResult, dll_handle, "WinHttpFreeProxyResult"); + load_dll_func(Index_WinHttpFreeProxyResultEx, dll_handle, "WinHttpFreeProxyResultEx"); + load_dll_func(Index_WinHttpFreeProxySettings, dll_handle, "WinHttpFreeProxySettings"); + load_dll_func(Index_WinHttpGetDefaultProxyConfiguration, dll_handle, "WinHttpGetDefaultProxyConfiguration"); + load_dll_func(Index_WinHttpGetIEProxyConfigForCurrentUser, dll_handle, "WinHttpGetIEProxyConfigForCurrentUser"); + load_dll_func(Index_WinHttpGetProxyForUrl, dll_handle, "WinHttpGetProxyForUrl"); + load_dll_func(Index_WinHttpGetProxyForUrlEx, dll_handle, "WinHttpGetProxyForUrlEx"); + load_dll_func(Index_WinHttpGetProxyForUrlEx2, dll_handle, "WinHttpGetProxyForUrlEx2"); + load_dll_func(Index_WinHttpGetProxyResult, dll_handle, "WinHttpGetProxyResult"); + load_dll_func(Index_WinHttpGetProxyResultEx, dll_handle, "WinHttpGetProxyResultEx"); + load_dll_func(Index_WinHttpGetProxySettingsVersion, dll_handle, "WinHttpGetProxySettingsVersion"); + load_dll_func(Index_WinHttpOpen, dll_handle, "WinHttpOpen"); + load_dll_func(Index_WinHttpOpenRequest, dll_handle, "WinHttpOpenRequest"); + load_dll_func(Index_WinHttpQueryAuthSchemes, dll_handle, "WinHttpQueryAuthSchemes"); + load_dll_func(Index_WinHttpQueryDataAvailable, dll_handle, "WinHttpQueryDataAvailable"); + load_dll_func(Index_WinHttpQueryHeaders, dll_handle, "WinHttpQueryHeaders"); + load_dll_func(Index_WinHttpQueryOption, dll_handle, "WinHttpQueryOption"); + load_dll_func(Index_WinHttpReadData, dll_handle, "WinHttpReadData"); + load_dll_func(Index_WinHttpReadProxySettings, dll_handle, "WinHttpReadProxySettings"); + load_dll_func(Index_WinHttpReceiveResponse, dll_handle, "WinHttpReceiveResponse"); + load_dll_func(Index_WinHttpResetAutoProxy, dll_handle, "WinHttpResetAutoProxy"); + load_dll_func(Index_WinHttpSendRequest, dll_handle, "WinHttpSendRequest"); + load_dll_func(Index_WinHttpSetCredentials, dll_handle, "WinHttpSetCredentials"); + load_dll_func(Index_WinHttpSetDefaultProxyConfiguration, dll_handle, "WinHttpSetDefaultProxyConfiguration"); + load_dll_func(Index_WinHttpSetOption, dll_handle, "WinHttpSetOption"); + load_dll_func(Index_WinHttpSetStatusCallback, dll_handle, "WinHttpSetStatusCallback"); + load_dll_func(Index_WinHttpSetTimeouts, dll_handle, "WinHttpSetTimeouts"); + load_dll_func(Index_WinHttpTimeFromSystemTime, dll_handle, "WinHttpTimeFromSystemTime"); + load_dll_func(Index_WinHttpTimeToSystemTime, dll_handle, "WinHttpTimeToSystemTime"); + load_dll_func(Index_WinHttpWebSocketClose, dll_handle, "WinHttpWebSocketClose"); + load_dll_func(Index_WinHttpWebSocketCompleteUpgrade, dll_handle, "WinHttpWebSocketCompleteUpgrade"); + load_dll_func(Index_WinHttpWebSocketQueryCloseStatus, dll_handle, "WinHttpWebSocketQueryCloseStatus"); + load_dll_func(Index_WinHttpWebSocketReceive, dll_handle, "WinHttpWebSocketReceive"); + load_dll_func(Index_WinHttpWebSocketSend, dll_handle, "WinHttpWebSocketSend"); + load_dll_func(Index_WinHttpWebSocketShutdown, dll_handle, "WinHttpWebSocketShutdown"); + load_dll_func(Index_WinHttpWriteData, dll_handle, "WinHttpWriteData"); + load_dll_func(Index_WinHttpWriteProxySettings, dll_handle, "WinHttpWriteProxySettings"); + load_dll_func(Index_auxGetDevCapsA, dll_handle, "auxGetDevCapsA"); + load_dll_func(Index_auxGetDevCapsW, dll_handle, "auxGetDevCapsW"); + load_dll_func(Index_auxGetNumDevs, dll_handle, "auxGetNumDevs"); + load_dll_func(Index_auxGetVolume, dll_handle, "auxGetVolume"); + load_dll_func(Index_auxOutMessage, dll_handle, "auxOutMessage"); + load_dll_func(Index_auxSetVolume, dll_handle, "auxSetVolume"); + load_dll_func(Index_joyConfigChanged, dll_handle, "joyConfigChanged"); + load_dll_func(Index_joyGetDevCapsA, dll_handle, "joyGetDevCapsA"); + load_dll_func(Index_joyGetDevCapsW, dll_handle, "joyGetDevCapsW"); + load_dll_func(Index_joyGetNumDevs, dll_handle, "joyGetNumDevs"); + load_dll_func(Index_joyGetPos, dll_handle, "joyGetPos"); + load_dll_func(Index_joyGetPosEx, dll_handle, "joyGetPosEx"); + load_dll_func(Index_joyGetThreshold, dll_handle, "joyGetThreshold"); + load_dll_func(Index_joyReleaseCapture, dll_handle, "joyReleaseCapture"); + load_dll_func(Index_joySetCapture, dll_handle, "joySetCapture"); + load_dll_func(Index_joySetThreshold, dll_handle, "joySetThreshold"); + load_dll_func(Index_mciDriverNotify, dll_handle, "mciDriverNotify"); + load_dll_func(Index_mciDriverYield, dll_handle, "mciDriverYield"); + load_dll_func(Index_mciExecute, dll_handle, "mciExecute"); + load_dll_func(Index_mciFreeCommandResource, dll_handle, "mciFreeCommandResource"); + load_dll_func(Index_mciGetCreatorTask, dll_handle, "mciGetCreatorTask"); + load_dll_func(Index_mciGetDeviceIDA, dll_handle, "mciGetDeviceIDA"); + load_dll_func(Index_mciGetDeviceIDFromElementIDA, dll_handle, "mciGetDeviceIDFromElementIDA"); + load_dll_func(Index_mciGetDeviceIDFromElementIDW, dll_handle, "mciGetDeviceIDFromElementIDW"); + load_dll_func(Index_mciGetDeviceIDW, dll_handle, "mciGetDeviceIDW"); + load_dll_func(Index_mciGetDriverData, dll_handle, "mciGetDriverData"); + load_dll_func(Index_mciGetErrorStringA, dll_handle, "mciGetErrorStringA"); + load_dll_func(Index_mciGetErrorStringW, dll_handle, "mciGetErrorStringW"); + load_dll_func(Index_mciGetYieldProc, dll_handle, "mciGetYieldProc"); + load_dll_func(Index_mciLoadCommandResource, dll_handle, "mciLoadCommandResource"); + load_dll_func(Index_mciSendCommandA, dll_handle, "mciSendCommandA"); + load_dll_func(Index_mciSendCommandW, dll_handle, "mciSendCommandW"); + load_dll_func(Index_mciSendStringA, dll_handle, "mciSendStringA"); + load_dll_func(Index_mciSendStringW, dll_handle, "mciSendStringW"); + load_dll_func(Index_mciSetDriverData, dll_handle, "mciSetDriverData"); + load_dll_func(Index_mciSetYieldProc, dll_handle, "mciSetYieldProc"); + load_dll_func(Index_midiConnect, dll_handle, "midiConnect"); + load_dll_func(Index_midiDisconnect, dll_handle, "midiDisconnect"); + load_dll_func(Index_midiInAddBuffer, dll_handle, "midiInAddBuffer"); + load_dll_func(Index_midiInClose, dll_handle, "midiInClose"); + load_dll_func(Index_midiInGetDevCapsA, dll_handle, "midiInGetDevCapsA"); + load_dll_func(Index_midiInGetDevCapsW, dll_handle, "midiInGetDevCapsW"); + load_dll_func(Index_midiInGetErrorTextA, dll_handle, "midiInGetErrorTextA"); + load_dll_func(Index_midiInGetErrorTextW, dll_handle, "midiInGetErrorTextW"); + load_dll_func(Index_midiInGetID, dll_handle, "midiInGetID"); + load_dll_func(Index_midiInGetNumDevs, dll_handle, "midiInGetNumDevs"); + load_dll_func(Index_midiInMessage, dll_handle, "midiInMessage"); + load_dll_func(Index_midiInOpen, dll_handle, "midiInOpen"); + load_dll_func(Index_midiInPrepareHeader, dll_handle, "midiInPrepareHeader"); + load_dll_func(Index_midiInReset, dll_handle, "midiInReset"); + load_dll_func(Index_midiInStart, dll_handle, "midiInStart"); + load_dll_func(Index_midiInStop, dll_handle, "midiInStop"); + load_dll_func(Index_midiInUnprepareHeader, dll_handle, "midiInUnprepareHeader"); + load_dll_func(Index_midiOutCacheDrumPatches, dll_handle, "midiOutCacheDrumPatches"); + load_dll_func(Index_midiOutCachePatches, dll_handle, "midiOutCachePatches"); + load_dll_func(Index_midiOutClose, dll_handle, "midiOutClose"); + load_dll_func(Index_midiOutGetDevCapsA, dll_handle, "midiOutGetDevCapsA"); + load_dll_func(Index_midiOutGetDevCapsW, dll_handle, "midiOutGetDevCapsW"); + load_dll_func(Index_midiOutGetErrorTextA, dll_handle, "midiOutGetErrorTextA"); + load_dll_func(Index_midiOutGetErrorTextW, dll_handle, "midiOutGetErrorTextW"); + load_dll_func(Index_midiOutGetID, dll_handle, "midiOutGetID"); + load_dll_func(Index_midiOutGetNumDevs, dll_handle, "midiOutGetNumDevs"); + load_dll_func(Index_midiOutGetVolume, dll_handle, "midiOutGetVolume"); + load_dll_func(Index_midiOutLongMsg, dll_handle, "midiOutLongMsg"); + load_dll_func(Index_midiOutMessage, dll_handle, "midiOutMessage"); + load_dll_func(Index_midiOutOpen, dll_handle, "midiOutOpen"); + load_dll_func(Index_midiOutPrepareHeader, dll_handle, "midiOutPrepareHeader"); + load_dll_func(Index_midiOutReset, dll_handle, "midiOutReset"); + load_dll_func(Index_midiOutSetVolume, dll_handle, "midiOutSetVolume"); + load_dll_func(Index_midiOutShortMsg, dll_handle, "midiOutShortMsg"); + load_dll_func(Index_midiOutUnprepareHeader, dll_handle, "midiOutUnprepareHeader"); + load_dll_func(Index_midiStreamClose, dll_handle, "midiStreamClose"); + load_dll_func(Index_midiStreamOpen, dll_handle, "midiStreamOpen"); + load_dll_func(Index_midiStreamOut, dll_handle, "midiStreamOut"); + load_dll_func(Index_midiStreamPause, dll_handle, "midiStreamPause"); + load_dll_func(Index_midiStreamPosition, dll_handle, "midiStreamPosition"); + load_dll_func(Index_midiStreamProperty, dll_handle, "midiStreamProperty"); + load_dll_func(Index_midiStreamRestart, dll_handle, "midiStreamRestart"); + load_dll_func(Index_midiStreamStop, dll_handle, "midiStreamStop"); + load_dll_func(Index_mixerClose, dll_handle, "mixerClose"); + load_dll_func(Index_mixerGetControlDetailsA, dll_handle, "mixerGetControlDetailsA"); + load_dll_func(Index_mixerGetControlDetailsW, dll_handle, "mixerGetControlDetailsW"); + load_dll_func(Index_mixerGetDevCapsA, dll_handle, "mixerGetDevCapsA"); + load_dll_func(Index_mixerGetDevCapsW, dll_handle, "mixerGetDevCapsW"); + load_dll_func(Index_mixerGetID, dll_handle, "mixerGetID"); + load_dll_func(Index_mixerGetLineControlsA, dll_handle, "mixerGetLineControlsA"); + load_dll_func(Index_mixerGetLineControlsW, dll_handle, "mixerGetLineControlsW"); + load_dll_func(Index_mixerGetLineInfoA, dll_handle, "mixerGetLineInfoA"); + load_dll_func(Index_mixerGetLineInfoW, dll_handle, "mixerGetLineInfoW"); + load_dll_func(Index_mixerGetNumDevs, dll_handle, "mixerGetNumDevs"); + load_dll_func(Index_mixerMessage, dll_handle, "mixerMessage"); + load_dll_func(Index_mixerOpen, dll_handle, "mixerOpen"); + load_dll_func(Index_mixerSetControlDetails, dll_handle, "mixerSetControlDetails"); + load_dll_func(Index_mmGetCurrentTask, dll_handle, "mmGetCurrentTask"); + load_dll_func(Index_mmTaskBlock, dll_handle, "mmTaskBlock"); + load_dll_func(Index_mmTaskCreate, dll_handle, "mmTaskCreate"); + load_dll_func(Index_mmTaskSignal, dll_handle, "mmTaskSignal"); + load_dll_func(Index_mmTaskYield, dll_handle, "mmTaskYield"); + load_dll_func(Index_mmioAdvance, dll_handle, "mmioAdvance"); + load_dll_func(Index_mmioAscend, dll_handle, "mmioAscend"); + load_dll_func(Index_mmioClose, dll_handle, "mmioClose"); + load_dll_func(Index_mmioCreateChunk, dll_handle, "mmioCreateChunk"); + load_dll_func(Index_mmioDescend, dll_handle, "mmioDescend"); + load_dll_func(Index_mmioFlush, dll_handle, "mmioFlush"); + load_dll_func(Index_mmioGetInfo, dll_handle, "mmioGetInfo"); + load_dll_func(Index_mmioInstallIOProc16, dll_handle, "mmioInstallIOProc16"); + load_dll_func(Index_mmioInstallIOProcA, dll_handle, "mmioInstallIOProcA"); + load_dll_func(Index_mmioInstallIOProcW, dll_handle, "mmioInstallIOProcW"); + load_dll_func(Index_mmioOpenA, dll_handle, "mmioOpenA"); + load_dll_func(Index_mmioOpenW, dll_handle, "mmioOpenW"); + load_dll_func(Index_mmioRead, dll_handle, "mmioRead"); + load_dll_func(Index_mmioRenameA, dll_handle, "mmioRenameA"); + load_dll_func(Index_mmioRenameW, dll_handle, "mmioRenameW"); + load_dll_func(Index_mmioSeek, dll_handle, "mmioSeek"); + load_dll_func(Index_mmioSendMessage, dll_handle, "mmioSendMessage"); + load_dll_func(Index_mmioSetBuffer, dll_handle, "mmioSetBuffer"); + load_dll_func(Index_mmioSetInfo, dll_handle, "mmioSetInfo"); + load_dll_func(Index_mmioStringToFOURCCA, dll_handle, "mmioStringToFOURCCA"); + load_dll_func(Index_mmioStringToFOURCCW, dll_handle, "mmioStringToFOURCCW"); + load_dll_func(Index_mmioWrite, dll_handle, "mmioWrite"); + load_dll_func(Index_mmsystemGetVersion, dll_handle, "mmsystemGetVersion"); + load_dll_func(Index_sndPlaySoundA, dll_handle, "sndPlaySoundA"); + load_dll_func(Index_sndPlaySoundW, dll_handle, "sndPlaySoundW"); + load_dll_func(Index_timeBeginPeriod, dll_handle, "timeBeginPeriod"); + load_dll_func(Index_timeEndPeriod, dll_handle, "timeEndPeriod"); + load_dll_func(Index_timeGetDevCaps, dll_handle, "timeGetDevCaps"); + load_dll_func(Index_timeGetSystemTime, dll_handle, "timeGetSystemTime"); + load_dll_func(Index_timeGetTime, dll_handle, "timeGetTime"); + load_dll_func(Index_timeKillEvent, dll_handle, "timeKillEvent"); + load_dll_func(Index_timeSetEvent, dll_handle, "timeSetEvent"); + load_dll_func(Index_waveInAddBuffer, dll_handle, "waveInAddBuffer"); + load_dll_func(Index_waveInClose, dll_handle, "waveInClose"); + load_dll_func(Index_waveInGetDevCapsA, dll_handle, "waveInGetDevCapsA"); + load_dll_func(Index_waveInGetDevCapsW, dll_handle, "waveInGetDevCapsW"); + load_dll_func(Index_waveInGetErrorTextA, dll_handle, "waveInGetErrorTextA"); + load_dll_func(Index_waveInGetErrorTextW, dll_handle, "waveInGetErrorTextW"); + load_dll_func(Index_waveInGetID, dll_handle, "waveInGetID"); + load_dll_func(Index_waveInGetNumDevs, dll_handle, "waveInGetNumDevs"); + load_dll_func(Index_waveInGetPosition, dll_handle, "waveInGetPosition"); + load_dll_func(Index_waveInMessage, dll_handle, "waveInMessage"); + load_dll_func(Index_waveInOpen, dll_handle, "waveInOpen"); + load_dll_func(Index_waveInPrepareHeader, dll_handle, "waveInPrepareHeader"); + load_dll_func(Index_waveInReset, dll_handle, "waveInReset"); + load_dll_func(Index_waveInStart, dll_handle, "waveInStart"); + load_dll_func(Index_waveInStop, dll_handle, "waveInStop"); + load_dll_func(Index_waveInUnprepareHeader, dll_handle, "waveInUnprepareHeader"); + load_dll_func(Index_waveOutBreakLoop, dll_handle, "waveOutBreakLoop"); + load_dll_func(Index_waveOutClose, dll_handle, "waveOutClose"); + load_dll_func(Index_waveOutGetDevCapsA, dll_handle, "waveOutGetDevCapsA"); + load_dll_func(Index_waveOutGetDevCapsW, dll_handle, "waveOutGetDevCapsW"); + load_dll_func(Index_waveOutGetErrorTextA, dll_handle, "waveOutGetErrorTextA"); + load_dll_func(Index_waveOutGetErrorTextW, dll_handle, "waveOutGetErrorTextW"); + load_dll_func(Index_waveOutGetID, dll_handle, "waveOutGetID"); + load_dll_func(Index_waveOutGetNumDevs, dll_handle, "waveOutGetNumDevs"); + load_dll_func(Index_waveOutGetPitch, dll_handle, "waveOutGetPitch"); + load_dll_func(Index_waveOutGetPlaybackRate, dll_handle, "waveOutGetPlaybackRate"); + load_dll_func(Index_waveOutGetPosition, dll_handle, "waveOutGetPosition"); + load_dll_func(Index_waveOutGetVolume, dll_handle, "waveOutGetVolume"); + load_dll_func(Index_waveOutMessage, dll_handle, "waveOutMessage"); + load_dll_func(Index_waveOutOpen, dll_handle, "waveOutOpen"); + load_dll_func(Index_waveOutPause, dll_handle, "waveOutPause"); + load_dll_func(Index_waveOutPrepareHeader, dll_handle, "waveOutPrepareHeader"); + load_dll_func(Index_waveOutReset, dll_handle, "waveOutReset"); + load_dll_func(Index_waveOutRestart, dll_handle, "waveOutRestart"); + load_dll_func(Index_waveOutSetPitch, dll_handle, "waveOutSetPitch"); + load_dll_func(Index_waveOutSetPlaybackRate, dll_handle, "waveOutSetPlaybackRate"); + load_dll_func(Index_waveOutSetVolume, dll_handle, "waveOutSetVolume"); + load_dll_func(Index_waveOutUnprepareHeader, dll_handle, "waveOutUnprepareHeader"); + load_dll_func(Index_waveOutWrite, dll_handle, "waveOutWrite"); +} diff --git a/MelonProxy/src/proxied_exports.rs b/MelonProxy/src/proxied_exports.rs new file mode 100644 index 000000000..707343232 --- /dev/null +++ b/MelonProxy/src/proxied_exports.rs @@ -0,0 +1,1007 @@ +// Just proxied functions in this file +use proxygen_macros::forward; + +#[forward] +#[export_name="CloseDriver"] +pub extern "C" fn CloseDriver() {} + +#[forward] +#[export_name="DefDriverProc"] +pub extern "C" fn DefDriverProc() {} + +#[forward] +#[export_name="DllCanUnloadNow"] +pub extern "C" fn DllCanUnloadNow() {} + +#[forward] +#[export_name="DllGetClassObject"] +pub extern "C" fn DllGetClassObject() {} + +#[forward] +#[export_name="DllRegisterServer"] +pub extern "C" fn DllRegisterServer() {} + +#[forward] +#[export_name="DllUnregisterServer"] +pub extern "C" fn DllUnregisterServer() {} + +#[forward] +#[export_name="DriverCallback"] +pub extern "C" fn DriverCallback() {} + +#[forward] +#[export_name="DrvClose"] +pub extern "C" fn DrvClose() {} + +#[forward] +#[export_name="DrvDefDriverProc"] +pub extern "C" fn DrvDefDriverProc() {} + +#[forward] +#[export_name="DrvGetModuleHandle"] +pub extern "C" fn DrvGetModuleHandle() {} + +#[forward] +#[export_name="DrvOpen"] +pub extern "C" fn DrvOpen() {} + +#[forward] +#[export_name="DrvOpenA"] +pub extern "C" fn DrvOpenA() {} + +#[forward] +#[export_name="DrvSendMessage"] +pub extern "C" fn DrvSendMessage() {} + +#[forward] +#[export_name="GetDriverFlags"] +pub extern "C" fn GetDriverFlags() {} + +#[forward] +#[export_name="GetDriverModuleHandle"] +pub extern "C" fn GetDriverModuleHandle() {} + +#[forward] +#[export_name="GetFileVersionInfoA"] +pub extern "C" fn GetFileVersionInfoA() {} + +#[forward] +#[export_name="GetFileVersionInfoExA"] +pub extern "C" fn GetFileVersionInfoExA() {} + +#[forward] +#[export_name="GetFileVersionInfoExW"] +pub extern "C" fn GetFileVersionInfoExW() {} + +#[forward] +#[export_name="GetFileVersionInfoSizeA"] +pub extern "C" fn GetFileVersionInfoSizeA() {} + +#[forward] +#[export_name="GetFileVersionInfoSizeExA"] +pub extern "C" fn GetFileVersionInfoSizeExA() {} + +#[forward] +#[export_name="GetFileVersionInfoSizeExW"] +pub extern "C" fn GetFileVersionInfoSizeExW() {} + +#[forward] +#[export_name="GetFileVersionInfoSizeW"] +pub extern "C" fn GetFileVersionInfoSizeW() {} + +#[forward] +#[export_name="GetFileVersionInfoW"] +pub extern "C" fn GetFileVersionInfoW() {} + +#[forward] +#[export_name="OpenDriver"] +pub extern "C" fn OpenDriver() {} + +#[forward] +#[export_name="OpenDriverA"] +pub extern "C" fn OpenDriverA() {} + +#[forward] +#[export_name="PlaySound"] +pub extern "C" fn PlaySound() {} + +#[forward] +#[export_name="PlaySoundA"] +pub extern "C" fn PlaySoundA() {} + +#[forward] +#[export_name="PlaySoundW"] +pub extern "C" fn PlaySoundW() {} + +#[forward] +#[export_name="SendDriverMessage"] +pub extern "C" fn SendDriverMessage() {} + +#[forward] +#[export_name="VerFindFileA"] +pub extern "C" fn VerFindFileA() {} + +#[forward] +#[export_name="VerFindFileW"] +pub extern "C" fn VerFindFileW() {} + +#[forward] +#[export_name="VerInstallFileA"] +pub extern "C" fn VerInstallFileA() {} + +#[forward] +#[export_name="VerInstallFileW"] +pub extern "C" fn VerInstallFileW() {} + +#[forward] +#[export_name="VerLanguageNameA"] +pub extern "C" fn VerLanguageNameA() {} + +#[forward] +#[export_name="VerLanguageNameW"] +pub extern "C" fn VerLanguageNameW() {} + +#[forward] +#[export_name="VerQueryValueA"] +pub extern "C" fn VerQueryValueA() {} + +#[forward] +#[export_name="VerQueryValueW"] +pub extern "C" fn VerQueryValueW() {} + +#[forward] +#[export_name="WinHttpAddRequestHeaders"] +pub extern "C" fn WinHttpAddRequestHeaders() {} + +#[forward] +#[export_name="WinHttpCheckPlatform"] +pub extern "C" fn WinHttpCheckPlatform() {} + +#[forward] +#[export_name="WinHttpCloseHandle"] +pub extern "C" fn WinHttpCloseHandle() {} + +#[forward] +#[export_name="WinHttpConnect"] +pub extern "C" fn WinHttpConnect() {} + +#[forward] +#[export_name="WinHttpCrackUrl"] +pub extern "C" fn WinHttpCrackUrl() {} + +#[forward] +#[export_name="WinHttpCreateProxyResolver"] +pub extern "C" fn WinHttpCreateProxyResolver() {} + +#[forward] +#[export_name="WinHttpCreateUrl"] +pub extern "C" fn WinHttpCreateUrl() {} + +#[forward] +#[export_name="WinHttpDetectAutoProxyConfigUrl"] +pub extern "C" fn WinHttpDetectAutoProxyConfigUrl() {} + +#[forward] +#[export_name="WinHttpFreeProxyResult"] +pub extern "C" fn WinHttpFreeProxyResult() {} + +#[forward] +#[export_name="WinHttpFreeProxyResultEx"] +pub extern "C" fn WinHttpFreeProxyResultEx() {} + +#[forward] +#[export_name="WinHttpFreeProxySettings"] +pub extern "C" fn WinHttpFreeProxySettings() {} + +#[forward] +#[export_name="WinHttpGetDefaultProxyConfiguration"] +pub extern "C" fn WinHttpGetDefaultProxyConfiguration() {} + +#[forward] +#[export_name="WinHttpGetIEProxyConfigForCurrentUser"] +pub extern "C" fn WinHttpGetIEProxyConfigForCurrentUser() {} + +#[forward] +#[export_name="WinHttpGetProxyForUrl"] +pub extern "C" fn WinHttpGetProxyForUrl() {} + +#[forward] +#[export_name="WinHttpGetProxyForUrlEx"] +pub extern "C" fn WinHttpGetProxyForUrlEx() {} + +#[forward] +#[export_name="WinHttpGetProxyForUrlEx2"] +pub extern "C" fn WinHttpGetProxyForUrlEx2() {} + +#[forward] +#[export_name="WinHttpGetProxyResult"] +pub extern "C" fn WinHttpGetProxyResult() {} + +#[forward] +#[export_name="WinHttpGetProxyResultEx"] +pub extern "C" fn WinHttpGetProxyResultEx() {} + +#[forward] +#[export_name="WinHttpGetProxySettingsVersion"] +pub extern "C" fn WinHttpGetProxySettingsVersion() {} + +#[forward] +#[export_name="WinHttpOpen"] +pub extern "C" fn WinHttpOpen() {} + +#[forward] +#[export_name="WinHttpOpenRequest"] +pub extern "C" fn WinHttpOpenRequest() {} + +#[forward] +#[export_name="WinHttpQueryAuthSchemes"] +pub extern "C" fn WinHttpQueryAuthSchemes() {} + +#[forward] +#[export_name="WinHttpQueryDataAvailable"] +pub extern "C" fn WinHttpQueryDataAvailable() {} + +#[forward] +#[export_name="WinHttpQueryHeaders"] +pub extern "C" fn WinHttpQueryHeaders() {} + +#[forward] +#[export_name="WinHttpQueryOption"] +pub extern "C" fn WinHttpQueryOption() {} + +#[forward] +#[export_name="WinHttpReadData"] +pub extern "C" fn WinHttpReadData() {} + +#[forward] +#[export_name="WinHttpReadProxySettings"] +pub extern "C" fn WinHttpReadProxySettings() {} + +#[forward] +#[export_name="WinHttpReceiveResponse"] +pub extern "C" fn WinHttpReceiveResponse() {} + +#[forward] +#[export_name="WinHttpResetAutoProxy"] +pub extern "C" fn WinHttpResetAutoProxy() {} + +#[forward] +#[export_name="WinHttpSendRequest"] +pub extern "C" fn WinHttpSendRequest() {} + +#[forward] +#[export_name="WinHttpSetCredentials"] +pub extern "C" fn WinHttpSetCredentials() {} + +#[forward] +#[export_name="WinHttpSetDefaultProxyConfiguration"] +pub extern "C" fn WinHttpSetDefaultProxyConfiguration() {} + +#[forward] +#[export_name="WinHttpSetOption"] +pub extern "C" fn WinHttpSetOption() {} + +#[forward] +#[export_name="WinHttpSetStatusCallback"] +pub extern "C" fn WinHttpSetStatusCallback() {} + +#[forward] +#[export_name="WinHttpSetTimeouts"] +pub extern "C" fn WinHttpSetTimeouts() {} + +#[forward] +#[export_name="WinHttpTimeFromSystemTime"] +pub extern "C" fn WinHttpTimeFromSystemTime() {} + +#[forward] +#[export_name="WinHttpTimeToSystemTime"] +pub extern "C" fn WinHttpTimeToSystemTime() {} + +#[forward] +#[export_name="WinHttpWebSocketClose"] +pub extern "C" fn WinHttpWebSocketClose() {} + +#[forward] +#[export_name="WinHttpWebSocketCompleteUpgrade"] +pub extern "C" fn WinHttpWebSocketCompleteUpgrade() {} + +#[forward] +#[export_name="WinHttpWebSocketQueryCloseStatus"] +pub extern "C" fn WinHttpWebSocketQueryCloseStatus() {} + +#[forward] +#[export_name="WinHttpWebSocketReceive"] +pub extern "C" fn WinHttpWebSocketReceive() {} + +#[forward] +#[export_name="WinHttpWebSocketSend"] +pub extern "C" fn WinHttpWebSocketSend() {} + +#[forward] +#[export_name="WinHttpWebSocketShutdown"] +pub extern "C" fn WinHttpWebSocketShutdown() {} + +#[forward] +#[export_name="WinHttpWriteData"] +pub extern "C" fn WinHttpWriteData() {} + +#[forward] +#[export_name="WinHttpWriteProxySettings"] +pub extern "C" fn WinHttpWriteProxySettings() {} + +#[forward] +#[export_name="auxGetDevCapsA"] +pub extern "C" fn auxGetDevCapsA() {} + +#[forward] +#[export_name="auxGetDevCapsW"] +pub extern "C" fn auxGetDevCapsW() {} + +#[forward] +#[export_name="auxGetNumDevs"] +pub extern "C" fn auxGetNumDevs() {} + +#[forward] +#[export_name="auxGetVolume"] +pub extern "C" fn auxGetVolume() {} + +#[forward] +#[export_name="auxOutMessage"] +pub extern "C" fn auxOutMessage() {} + +#[forward] +#[export_name="auxSetVolume"] +pub extern "C" fn auxSetVolume() {} + +#[forward] +#[export_name="joyConfigChanged"] +pub extern "C" fn joyConfigChanged() {} + +#[forward] +#[export_name="joyGetDevCapsA"] +pub extern "C" fn joyGetDevCapsA() {} + +#[forward] +#[export_name="joyGetDevCapsW"] +pub extern "C" fn joyGetDevCapsW() {} + +#[forward] +#[export_name="joyGetNumDevs"] +pub extern "C" fn joyGetNumDevs() {} + +#[forward] +#[export_name="joyGetPos"] +pub extern "C" fn joyGetPos() {} + +#[forward] +#[export_name="joyGetPosEx"] +pub extern "C" fn joyGetPosEx() {} + +#[forward] +#[export_name="joyGetThreshold"] +pub extern "C" fn joyGetThreshold() {} + +#[forward] +#[export_name="joyReleaseCapture"] +pub extern "C" fn joyReleaseCapture() {} + +#[forward] +#[export_name="joySetCapture"] +pub extern "C" fn joySetCapture() {} + +#[forward] +#[export_name="joySetThreshold"] +pub extern "C" fn joySetThreshold() {} + +#[forward] +#[export_name="mciDriverNotify"] +pub extern "C" fn mciDriverNotify() {} + +#[forward] +#[export_name="mciDriverYield"] +pub extern "C" fn mciDriverYield() {} + +#[forward] +#[export_name="mciExecute"] +pub extern "C" fn mciExecute() {} + +#[forward] +#[export_name="mciFreeCommandResource"] +pub extern "C" fn mciFreeCommandResource() {} + +#[forward] +#[export_name="mciGetCreatorTask"] +pub extern "C" fn mciGetCreatorTask() {} + +#[forward] +#[export_name="mciGetDeviceIDA"] +pub extern "C" fn mciGetDeviceIDA() {} + +#[forward] +#[export_name="mciGetDeviceIDFromElementIDA"] +pub extern "C" fn mciGetDeviceIDFromElementIDA() {} + +#[forward] +#[export_name="mciGetDeviceIDFromElementIDW"] +pub extern "C" fn mciGetDeviceIDFromElementIDW() {} + +#[forward] +#[export_name="mciGetDeviceIDW"] +pub extern "C" fn mciGetDeviceIDW() {} + +#[forward] +#[export_name="mciGetDriverData"] +pub extern "C" fn mciGetDriverData() {} + +#[forward] +#[export_name="mciGetErrorStringA"] +pub extern "C" fn mciGetErrorStringA() {} + +#[forward] +#[export_name="mciGetErrorStringW"] +pub extern "C" fn mciGetErrorStringW() {} + +#[forward] +#[export_name="mciGetYieldProc"] +pub extern "C" fn mciGetYieldProc() {} + +#[forward] +#[export_name="mciLoadCommandResource"] +pub extern "C" fn mciLoadCommandResource() {} + +#[forward] +#[export_name="mciSendCommandA"] +pub extern "C" fn mciSendCommandA() {} + +#[forward] +#[export_name="mciSendCommandW"] +pub extern "C" fn mciSendCommandW() {} + +#[forward] +#[export_name="mciSendStringA"] +pub extern "C" fn mciSendStringA() {} + +#[forward] +#[export_name="mciSendStringW"] +pub extern "C" fn mciSendStringW() {} + +#[forward] +#[export_name="mciSetDriverData"] +pub extern "C" fn mciSetDriverData() {} + +#[forward] +#[export_name="mciSetYieldProc"] +pub extern "C" fn mciSetYieldProc() {} + +#[forward] +#[export_name="midiConnect"] +pub extern "C" fn midiConnect() {} + +#[forward] +#[export_name="midiDisconnect"] +pub extern "C" fn midiDisconnect() {} + +#[forward] +#[export_name="midiInAddBuffer"] +pub extern "C" fn midiInAddBuffer() {} + +#[forward] +#[export_name="midiInClose"] +pub extern "C" fn midiInClose() {} + +#[forward] +#[export_name="midiInGetDevCapsA"] +pub extern "C" fn midiInGetDevCapsA() {} + +#[forward] +#[export_name="midiInGetDevCapsW"] +pub extern "C" fn midiInGetDevCapsW() {} + +#[forward] +#[export_name="midiInGetErrorTextA"] +pub extern "C" fn midiInGetErrorTextA() {} + +#[forward] +#[export_name="midiInGetErrorTextW"] +pub extern "C" fn midiInGetErrorTextW() {} + +#[forward] +#[export_name="midiInGetID"] +pub extern "C" fn midiInGetID() {} + +#[forward] +#[export_name="midiInGetNumDevs"] +pub extern "C" fn midiInGetNumDevs() {} + +#[forward] +#[export_name="midiInMessage"] +pub extern "C" fn midiInMessage() {} + +#[forward] +#[export_name="midiInOpen"] +pub extern "C" fn midiInOpen() {} + +#[forward] +#[export_name="midiInPrepareHeader"] +pub extern "C" fn midiInPrepareHeader() {} + +#[forward] +#[export_name="midiInReset"] +pub extern "C" fn midiInReset() {} + +#[forward] +#[export_name="midiInStart"] +pub extern "C" fn midiInStart() {} + +#[forward] +#[export_name="midiInStop"] +pub extern "C" fn midiInStop() {} + +#[forward] +#[export_name="midiInUnprepareHeader"] +pub extern "C" fn midiInUnprepareHeader() {} + +#[forward] +#[export_name="midiOutCacheDrumPatches"] +pub extern "C" fn midiOutCacheDrumPatches() {} + +#[forward] +#[export_name="midiOutCachePatches"] +pub extern "C" fn midiOutCachePatches() {} + +#[forward] +#[export_name="midiOutClose"] +pub extern "C" fn midiOutClose() {} + +#[forward] +#[export_name="midiOutGetDevCapsA"] +pub extern "C" fn midiOutGetDevCapsA() {} + +#[forward] +#[export_name="midiOutGetDevCapsW"] +pub extern "C" fn midiOutGetDevCapsW() {} + +#[forward] +#[export_name="midiOutGetErrorTextA"] +pub extern "C" fn midiOutGetErrorTextA() {} + +#[forward] +#[export_name="midiOutGetErrorTextW"] +pub extern "C" fn midiOutGetErrorTextW() {} + +#[forward] +#[export_name="midiOutGetID"] +pub extern "C" fn midiOutGetID() {} + +#[forward] +#[export_name="midiOutGetNumDevs"] +pub extern "C" fn midiOutGetNumDevs() {} + +#[forward] +#[export_name="midiOutGetVolume"] +pub extern "C" fn midiOutGetVolume() {} + +#[forward] +#[export_name="midiOutLongMsg"] +pub extern "C" fn midiOutLongMsg() {} + +#[forward] +#[export_name="midiOutMessage"] +pub extern "C" fn midiOutMessage() {} + +#[forward] +#[export_name="midiOutOpen"] +pub extern "C" fn midiOutOpen() {} + +#[forward] +#[export_name="midiOutPrepareHeader"] +pub extern "C" fn midiOutPrepareHeader() {} + +#[forward] +#[export_name="midiOutReset"] +pub extern "C" fn midiOutReset() {} + +#[forward] +#[export_name="midiOutSetVolume"] +pub extern "C" fn midiOutSetVolume() {} + +#[forward] +#[export_name="midiOutShortMsg"] +pub extern "C" fn midiOutShortMsg() {} + +#[forward] +#[export_name="midiOutUnprepareHeader"] +pub extern "C" fn midiOutUnprepareHeader() {} + +#[forward] +#[export_name="midiStreamClose"] +pub extern "C" fn midiStreamClose() {} + +#[forward] +#[export_name="midiStreamOpen"] +pub extern "C" fn midiStreamOpen() {} + +#[forward] +#[export_name="midiStreamOut"] +pub extern "C" fn midiStreamOut() {} + +#[forward] +#[export_name="midiStreamPause"] +pub extern "C" fn midiStreamPause() {} + +#[forward] +#[export_name="midiStreamPosition"] +pub extern "C" fn midiStreamPosition() {} + +#[forward] +#[export_name="midiStreamProperty"] +pub extern "C" fn midiStreamProperty() {} + +#[forward] +#[export_name="midiStreamRestart"] +pub extern "C" fn midiStreamRestart() {} + +#[forward] +#[export_name="midiStreamStop"] +pub extern "C" fn midiStreamStop() {} + +#[forward] +#[export_name="mixerClose"] +pub extern "C" fn mixerClose() {} + +#[forward] +#[export_name="mixerGetControlDetailsA"] +pub extern "C" fn mixerGetControlDetailsA() {} + +#[forward] +#[export_name="mixerGetControlDetailsW"] +pub extern "C" fn mixerGetControlDetailsW() {} + +#[forward] +#[export_name="mixerGetDevCapsA"] +pub extern "C" fn mixerGetDevCapsA() {} + +#[forward] +#[export_name="mixerGetDevCapsW"] +pub extern "C" fn mixerGetDevCapsW() {} + +#[forward] +#[export_name="mixerGetID"] +pub extern "C" fn mixerGetID() {} + +#[forward] +#[export_name="mixerGetLineControlsA"] +pub extern "C" fn mixerGetLineControlsA() {} + +#[forward] +#[export_name="mixerGetLineControlsW"] +pub extern "C" fn mixerGetLineControlsW() {} + +#[forward] +#[export_name="mixerGetLineInfoA"] +pub extern "C" fn mixerGetLineInfoA() {} + +#[forward] +#[export_name="mixerGetLineInfoW"] +pub extern "C" fn mixerGetLineInfoW() {} + +#[forward] +#[export_name="mixerGetNumDevs"] +pub extern "C" fn mixerGetNumDevs() {} + +#[forward] +#[export_name="mixerMessage"] +pub extern "C" fn mixerMessage() {} + +#[forward] +#[export_name="mixerOpen"] +pub extern "C" fn mixerOpen() {} + +#[forward] +#[export_name="mixerSetControlDetails"] +pub extern "C" fn mixerSetControlDetails() {} + +#[forward] +#[export_name="mmGetCurrentTask"] +pub extern "C" fn mmGetCurrentTask() {} + +#[forward] +#[export_name="mmTaskBlock"] +pub extern "C" fn mmTaskBlock() {} + +#[forward] +#[export_name="mmTaskCreate"] +pub extern "C" fn mmTaskCreate() {} + +#[forward] +#[export_name="mmTaskSignal"] +pub extern "C" fn mmTaskSignal() {} + +#[forward] +#[export_name="mmTaskYield"] +pub extern "C" fn mmTaskYield() {} + +#[forward] +#[export_name="mmioAdvance"] +pub extern "C" fn mmioAdvance() {} + +#[forward] +#[export_name="mmioAscend"] +pub extern "C" fn mmioAscend() {} + +#[forward] +#[export_name="mmioClose"] +pub extern "C" fn mmioClose() {} + +#[forward] +#[export_name="mmioCreateChunk"] +pub extern "C" fn mmioCreateChunk() {} + +#[forward] +#[export_name="mmioDescend"] +pub extern "C" fn mmioDescend() {} + +#[forward] +#[export_name="mmioFlush"] +pub extern "C" fn mmioFlush() {} + +#[forward] +#[export_name="mmioGetInfo"] +pub extern "C" fn mmioGetInfo() {} + +#[forward] +#[export_name="mmioInstallIOProc16"] +pub extern "C" fn mmioInstallIOProc16() {} + +#[forward] +#[export_name="mmioInstallIOProcA"] +pub extern "C" fn mmioInstallIOProcA() {} + +#[forward] +#[export_name="mmioInstallIOProcW"] +pub extern "C" fn mmioInstallIOProcW() {} + +#[forward] +#[export_name="mmioOpenA"] +pub extern "C" fn mmioOpenA() {} + +#[forward] +#[export_name="mmioOpenW"] +pub extern "C" fn mmioOpenW() {} + +#[forward] +#[export_name="mmioRead"] +pub extern "C" fn mmioRead() {} + +#[forward] +#[export_name="mmioRenameA"] +pub extern "C" fn mmioRenameA() {} + +#[forward] +#[export_name="mmioRenameW"] +pub extern "C" fn mmioRenameW() {} + +#[forward] +#[export_name="mmioSeek"] +pub extern "C" fn mmioSeek() {} + +#[forward] +#[export_name="mmioSendMessage"] +pub extern "C" fn mmioSendMessage() {} + +#[forward] +#[export_name="mmioSetBuffer"] +pub extern "C" fn mmioSetBuffer() {} + +#[forward] +#[export_name="mmioSetInfo"] +pub extern "C" fn mmioSetInfo() {} + +#[forward] +#[export_name="mmioStringToFOURCCA"] +pub extern "C" fn mmioStringToFOURCCA() {} + +#[forward] +#[export_name="mmioStringToFOURCCW"] +pub extern "C" fn mmioStringToFOURCCW() {} + +#[forward] +#[export_name="mmioWrite"] +pub extern "C" fn mmioWrite() {} + +#[forward] +#[export_name="mmsystemGetVersion"] +pub extern "C" fn mmsystemGetVersion() {} + +#[forward] +#[export_name="sndPlaySoundA"] +pub extern "C" fn sndPlaySoundA() {} + +#[forward] +#[export_name="sndPlaySoundW"] +pub extern "C" fn sndPlaySoundW() {} + +#[forward] +#[export_name="timeBeginPeriod"] +pub extern "C" fn timeBeginPeriod() {} + +#[forward] +#[export_name="timeEndPeriod"] +pub extern "C" fn timeEndPeriod() {} + +#[forward] +#[export_name="timeGetDevCaps"] +pub extern "C" fn timeGetDevCaps() {} + +#[forward] +#[export_name="timeGetSystemTime"] +pub extern "C" fn timeGetSystemTime() {} + +#[forward] +#[export_name="timeGetTime"] +pub extern "C" fn timeGetTime() {} + +#[forward] +#[export_name="timeKillEvent"] +pub extern "C" fn timeKillEvent() {} + +#[forward] +#[export_name="timeSetEvent"] +pub extern "C" fn timeSetEvent() {} + +#[forward] +#[export_name="waveInAddBuffer"] +pub extern "C" fn waveInAddBuffer() {} + +#[forward] +#[export_name="waveInClose"] +pub extern "C" fn waveInClose() {} + +#[forward] +#[export_name="waveInGetDevCapsA"] +pub extern "C" fn waveInGetDevCapsA() {} + +#[forward] +#[export_name="waveInGetDevCapsW"] +pub extern "C" fn waveInGetDevCapsW() {} + +#[forward] +#[export_name="waveInGetErrorTextA"] +pub extern "C" fn waveInGetErrorTextA() {} + +#[forward] +#[export_name="waveInGetErrorTextW"] +pub extern "C" fn waveInGetErrorTextW() {} + +#[forward] +#[export_name="waveInGetID"] +pub extern "C" fn waveInGetID() {} + +#[forward] +#[export_name="waveInGetNumDevs"] +pub extern "C" fn waveInGetNumDevs() {} + +#[forward] +#[export_name="waveInGetPosition"] +pub extern "C" fn waveInGetPosition() {} + +#[forward] +#[export_name="waveInMessage"] +pub extern "C" fn waveInMessage() {} + +#[forward] +#[export_name="waveInOpen"] +pub extern "C" fn waveInOpen() {} + +#[forward] +#[export_name="waveInPrepareHeader"] +pub extern "C" fn waveInPrepareHeader() {} + +#[forward] +#[export_name="waveInReset"] +pub extern "C" fn waveInReset() {} + +#[forward] +#[export_name="waveInStart"] +pub extern "C" fn waveInStart() {} + +#[forward] +#[export_name="waveInStop"] +pub extern "C" fn waveInStop() {} + +#[forward] +#[export_name="waveInUnprepareHeader"] +pub extern "C" fn waveInUnprepareHeader() {} + +#[forward] +#[export_name="waveOutBreakLoop"] +pub extern "C" fn waveOutBreakLoop() {} + +#[forward] +#[export_name="waveOutClose"] +pub extern "C" fn waveOutClose() {} + +#[forward] +#[export_name="waveOutGetDevCapsA"] +pub extern "C" fn waveOutGetDevCapsA() {} + +#[forward] +#[export_name="waveOutGetDevCapsW"] +pub extern "C" fn waveOutGetDevCapsW() {} + +#[forward] +#[export_name="waveOutGetErrorTextA"] +pub extern "C" fn waveOutGetErrorTextA() {} + +#[forward] +#[export_name="waveOutGetErrorTextW"] +pub extern "C" fn waveOutGetErrorTextW() {} + +#[forward] +#[export_name="waveOutGetID"] +pub extern "C" fn waveOutGetID() {} + +#[forward] +#[export_name="waveOutGetNumDevs"] +pub extern "C" fn waveOutGetNumDevs() {} + +#[forward] +#[export_name="waveOutGetPitch"] +pub extern "C" fn waveOutGetPitch() {} + +#[forward] +#[export_name="waveOutGetPlaybackRate"] +pub extern "C" fn waveOutGetPlaybackRate() {} + +#[forward] +#[export_name="waveOutGetPosition"] +pub extern "C" fn waveOutGetPosition() {} + +#[forward] +#[export_name="waveOutGetVolume"] +pub extern "C" fn waveOutGetVolume() {} + +#[forward] +#[export_name="waveOutMessage"] +pub extern "C" fn waveOutMessage() {} + +#[forward] +#[export_name="waveOutOpen"] +pub extern "C" fn waveOutOpen() {} + +#[forward] +#[export_name="waveOutPause"] +pub extern "C" fn waveOutPause() {} + +#[forward] +#[export_name="waveOutPrepareHeader"] +pub extern "C" fn waveOutPrepareHeader() {} + +#[forward] +#[export_name="waveOutReset"] +pub extern "C" fn waveOutReset() {} + +#[forward] +#[export_name="waveOutRestart"] +pub extern "C" fn waveOutRestart() {} + +#[forward] +#[export_name="waveOutSetPitch"] +pub extern "C" fn waveOutSetPitch() {} + +#[forward] +#[export_name="waveOutSetPlaybackRate"] +pub extern "C" fn waveOutSetPlaybackRate() {} + +#[forward] +#[export_name="waveOutSetVolume"] +pub extern "C" fn waveOutSetVolume() {} + +#[forward] +#[export_name="waveOutUnprepareHeader"] +pub extern "C" fn waveOutUnprepareHeader() {} + +#[forward] +#[export_name="waveOutWrite"] +pub extern "C" fn waveOutWrite() {} + diff --git a/Proxy/src/utils/assert.rs b/MelonProxy/src/utils/assert.rs similarity index 87% rename from Proxy/src/utils/assert.rs rename to MelonProxy/src/utils/assert.rs index 2cd9ec6e7..c28382f0f 100644 --- a/Proxy/src/utils/assert.rs +++ b/MelonProxy/src/utils/assert.rs @@ -2,7 +2,7 @@ /// Throws an internal failure with the given message /// -/// This logs your message to file, creates a message box, and then panics. +/// This creates a message box, and then panics. /// It uses the same syntax as _format!_ /// /// # Examples diff --git a/MelonProxy/src/utils/files.rs b/MelonProxy/src/utils/files.rs new file mode 100644 index 000000000..78858b3f4 --- /dev/null +++ b/MelonProxy/src/utils/files.rs @@ -0,0 +1,25 @@ +use std::{ + env::consts::DLL_EXTENSION, + io::{self, Error, ErrorKind}, + path::PathBuf, +}; + +/// search for Bootstrap in the given path +pub fn get_bootstrap_path(base_path: &PathBuf) -> Result { + let bootstrap_names = ["Bootstrap", "libBootstrap"]; //by convention, on unix, the library is prefixed with "lib" + + let path = base_path.join("MelonLoader").join("Dependencies"); + + for name in bootstrap_names.iter() { + let bootstrap_path = path.join(name).with_extension(DLL_EXTENSION); + + if bootstrap_path.exists() { + return Ok(bootstrap_path); + } + } + + Err(Error::new( + ErrorKind::NotFound, + "Failed to find MelonLoader Bootstrap", + )) +} diff --git a/MelonProxy/src/utils/mod.rs b/MelonProxy/src/utils/mod.rs new file mode 100644 index 000000000..7c6fb7640 --- /dev/null +++ b/MelonProxy/src/utils/mod.rs @@ -0,0 +1,2 @@ +pub mod assert; +pub mod files; \ No newline at end of file diff --git a/Proxy/Cargo.toml b/Proxy/Cargo.toml deleted file mode 100644 index 579871f29..000000000 --- a/Proxy/Cargo.toml +++ /dev/null @@ -1,28 +0,0 @@ -[package] -name = "proxy" -version = "0.2.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -ctor = "0.1.26" -msgbox = "0.7.0" -lazy_static = "1.4.0" -thiserror = "*" -libloading = "*" -clap = { git = "https://github.com/RinLovesYou/clap", features = ["derive"] } - -[target.'cfg(windows)'.dependencies] -proxy-dll = { git = "https://github.com/RinLovesYou/dll-proxy-rs.git" } -#proxy-dll = { path = "C:\\Users\\sarah\\Documents\\rust\\dll-proxy-rs\\proxy" } - -[target.'cfg(unix)'.dependencies] -libc = "0.2.137" - -[lib] -name = "version" -crate-type = ["cdylib"] - -[build-dependencies] -cc = "1.0.76" diff --git a/Proxy/src/core.rs b/Proxy/src/core.rs deleted file mode 100644 index dab8040b6..000000000 --- a/Proxy/src/core.rs +++ /dev/null @@ -1,49 +0,0 @@ -//! the core logic of the proxy - -use crate::utils::files; -use clap::Parser; -use lazy_static::lazy_static; -use libloading::Library; -use std::{error, path::PathBuf, sync::Mutex}; - -#[derive(Parser)] -struct Arguments { - #[arg(long = "no-mods", default_value = "false")] - no_mods: bool, - - #[arg(long = "melonloader.basedir")] - base_dir: Option, -} - -lazy_static!( - static ref BOOTSTRAP: Mutex> = Mutex::new(None); -); - -pub fn init() -> Result<(), Box> { - let file_path = std::env::current_exe()?; - - if !files::is_unity(&file_path)? { - return Ok(()); - } - - let args = Arguments::parse_optimistic()?; - - //return Ok, and silently stop loading MelonLoader, if the user has specified to not load mods, - //or if the game is not a Unity game - if args.no_mods { - return Ok(()); - } - - let base_path = match args.base_dir { - Some(path) => PathBuf::from(path), - None => std::env::current_dir()?, - }; - - let bootstrap_path = files::get_bootstrap_path(&base_path)?; - - unsafe { - *BOOTSTRAP.try_lock()? = Some(Library::new(&bootstrap_path)?); - } - - Ok(()) -} diff --git a/Proxy/src/entry.rs b/Proxy/src/entry.rs deleted file mode 100644 index 8b6dbf4df..000000000 --- a/Proxy/src/entry.rs +++ /dev/null @@ -1,35 +0,0 @@ -//! These are platform specific init functions. -//! On Windows, we need to "proxy" a built-in Windows library. -//! The crate 'proxy-dll' takes care of this, dynamically proxying 3 -//! different dlls, depending on the file name of the compiled binary. -//! -//! See https://github.com/RinLovesYou/dll-proxy-rs/ -//! -//! On Linux, injection is done through LD_PRELOAD, so there's no need to proxy anything. -//! there we just use `ctor`. - -#[cfg(not(target_os = "windows"))] -use ctor::ctor; - -#[cfg(target_os = "windows")] -use proxy_dll::proxy; - -use crate::{core, internal_failure}; - -#[cfg(not(target_os = "windows"))] -#[no_mangle] -#[ctor] -fn main() { - core::init().unwrap_or_else(|e| { - internal_failure!("Failed to initialize MelonLoader: {}", e); - }); -} - -#[cfg(target_os = "windows")] -#[no_mangle] -#[proxy] -fn main() { - core::init().unwrap_or_else(|e| { - internal_failure!("Failed to initialize MelonLoader: {}", e); - }); -} diff --git a/Proxy/src/lib.rs b/Proxy/src/lib.rs deleted file mode 100644 index c373203ec..000000000 --- a/Proxy/src/lib.rs +++ /dev/null @@ -1,21 +0,0 @@ -//! Cross platform reimplementation of MelonLoader's Proxy in rust - -#![feature(is_some_and)] - -#![deny( - missing_debug_implementations, - unused_results, - warnings, - clippy::extra_unused_lifetimes, - clippy::from_over_into, - clippy::needless_borrow, - clippy::new_without_default, - clippy::useless_conversion -)] -#![forbid(rust_2018_idioms)] -#![allow(clippy::inherent_to_string, clippy::type_complexity, improper_ctypes)] -#![cfg_attr(docsrs, feature(doc_cfg))] - -pub mod entry; -pub mod core; -pub mod utils; diff --git a/Proxy/src/utils/errors.rs b/Proxy/src/utils/errors.rs deleted file mode 100644 index 3b66e0b27..000000000 --- a/Proxy/src/utils/errors.rs +++ /dev/null @@ -1,9 +0,0 @@ -use std::path::PathBuf; - -use thiserror::Error; - -#[derive(Debug, Error)] -pub enum ProxyError { - #[error("failed to find Bootstrap at \"{0}\" please make sure you have installed MelonLoader correctly")] - BootstrapNotFound(PathBuf), -} \ No newline at end of file diff --git a/Proxy/src/utils/files.rs b/Proxy/src/utils/files.rs deleted file mode 100644 index 4a580d0b3..000000000 --- a/Proxy/src/utils/files.rs +++ /dev/null @@ -1,48 +0,0 @@ -//! various filesystem utils - -use std::{env::consts::DLL_EXTENSION, error::Error, path::PathBuf}; - -use super::errors::ProxyError; - -/// search for Bootstrap in the given path -pub fn get_bootstrap_path(base_path: &PathBuf) -> Result { - let bootstrap_names = ["Bootstrap", "libBootstrap"]; //by convention, on unix, the library is prefixed with "lib" - - let path = base_path.join("MelonLoader").join("Dependencies"); - - for name in bootstrap_names.iter() { - let bootstrap_path = path.join(name).with_extension(DLL_EXTENSION); - - if bootstrap_path.exists() { - return Ok(bootstrap_path); - } - } - - Err(ProxyError::BootstrapNotFound(base_path.to_owned())) -} - -pub fn is_unity(file_path: &PathBuf) -> Result> { - let file_name = file_path - .file_stem() - .ok_or("Failed to get file stem")? - .to_str() - .ok_or("Failed to convert file stem to str")?; - - let base_folder = file_path.parent().ok_or("Failed to get parent folder")?; - - let data_path = base_folder.join(format!("{file_name}_Data")); - - if !data_path.exists() { - return Ok(false); - } - - let global_game_managers = data_path.join("globalgamemanagers"); - let data_unity3d = data_path.join("data.unity3d"); - let main_data = data_path.join("mainData"); - - if global_game_managers.exists() || data_unity3d.exists() || main_data.exists() { - Ok(true) - } else { - Ok(false) - } -} diff --git a/Proxy/src/utils/mod.rs b/Proxy/src/utils/mod.rs deleted file mode 100644 index b5bfd8b1a..000000000 --- a/Proxy/src/utils/mod.rs +++ /dev/null @@ -1,5 +0,0 @@ -//! various utilites - -pub mod assert; -pub mod files; -pub mod errors; \ No newline at end of file