From d85cf67158e321abee05857ce657d7f7e01126c1 Mon Sep 17 00:00:00 2001 From: Sarah Date: Sat, 30 Dec 2023 19:14:49 +0100 Subject: [PATCH 01/12] Update build.rs to print the absolute path of the Exports.def file --- MelonProxy/build.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MelonProxy/build.rs b/MelonProxy/build.rs index 2c8ce803a..3674d6830 100644 --- a/MelonProxy/build.rs +++ b/MelonProxy/build.rs @@ -16,10 +16,10 @@ fn main() { /// links Exports.def to the resulting dll, exporting all our asm functions. fn link_exports() { - println!("cargo:warning=Linking Exports File.."); use std::path::Path; let lib_path = Path::new("deps").join("Exports.def"); let absolute_path = std::fs::canonicalize(&lib_path).unwrap(); + println!("cargo:warning=Linking Exports File: {}", absolute_path.display()); println!( "cargo:rustc-cdylib-link-arg=/DEF:{}", absolute_path.display() From 9181d4c510982977d9ba90957da6157cf3d5b3cf Mon Sep 17 00:00:00 2001 From: Sarah Date: Sat, 30 Dec 2023 19:22:41 +0100 Subject: [PATCH 02/12] Fix path issue in MelonProxy build.rs --- MelonProxy/build.rs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/MelonProxy/build.rs b/MelonProxy/build.rs index 3674d6830..cfabcbd6f 100644 --- a/MelonProxy/build.rs +++ b/MelonProxy/build.rs @@ -18,10 +18,18 @@ fn main() { fn link_exports() { use std::path::Path; let lib_path = Path::new("deps").join("Exports.def"); - let absolute_path = std::fs::canonicalize(&lib_path).unwrap(); - println!("cargo:warning=Linking Exports File: {}", absolute_path.display()); + let mut absolute_path = std::fs::canonicalize(&lib_path).unwrap().to_str().unwrap().to_string(); + if absolute_path.contains("\\\\?\\") { + absolute_path = absolute_path.replace("\\\\?\\", ""); + } + + if !lib_path.exists() { + panic!("Exports.def not found at {}", lib_path.display()); + } + + println!("cargo:warning=Linking Exports File: {}", absolute_path); println!( "cargo:rustc-cdylib-link-arg=/DEF:{}", - absolute_path.display() + absolute_path ); } \ No newline at end of file From 9a60d635bb70f3010c340d171a7a358aa72cb6aa Mon Sep 17 00:00:00 2001 From: Sarah Date: Sat, 30 Dec 2023 19:34:26 +0100 Subject: [PATCH 03/12] I hate github CI --- MelonProxy/build.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/MelonProxy/build.rs b/MelonProxy/build.rs index cfabcbd6f..3f057becf 100644 --- a/MelonProxy/build.rs +++ b/MelonProxy/build.rs @@ -18,12 +18,9 @@ fn main() { fn link_exports() { use std::path::Path; let lib_path = Path::new("deps").join("Exports.def"); - let mut absolute_path = std::fs::canonicalize(&lib_path).unwrap().to_str().unwrap().to_string(); - if absolute_path.contains("\\\\?\\") { - absolute_path = absolute_path.replace("\\\\?\\", ""); - } + let absolute_path = std::fs::canonicalize(&lib_path).unwrap().to_str().unwrap().to_string().replace("\\\\?\\", ""); - if !lib_path.exists() { + if !Path::new(&absolute_path).exists() { panic!("Exports.def not found at {}", lib_path.display()); } From 61a6da5e3651eefda8ef6e5224d4cb6dc9336211 Mon Sep 17 00:00:00 2001 From: Sarah Date: Sat, 30 Dec 2023 20:00:08 +0100 Subject: [PATCH 04/12] Try fixing build script again --- MelonProxy/build.rs | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/MelonProxy/build.rs b/MelonProxy/build.rs index 3f057becf..5383971ce 100644 --- a/MelonProxy/build.rs +++ b/MelonProxy/build.rs @@ -4,29 +4,25 @@ fn main() { let target_os = env::var("CARGO_CFG_TARGET_OS"); match target_os.as_ref().map(|x| &**x) { - Ok("linux") | Ok("android") => {}, - Ok("freebsd") | Ok("dragonfly") => {}, + Ok("linux") | Ok("android") => {} + Ok("freebsd") | Ok("dragonfly") => {} Ok("openbsd") | Ok("bitrig") | Ok("netbsd") | Ok("macos") | Ok("ios") => {} Ok("windows") => link_exports(), - tos => panic!("unknown target os {:?}!", tos) + tos => panic!("unknown target os {:?}!", tos), } } /// links Exports.def to the resulting dll, exporting all our asm functions. fn link_exports() { - use std::path::Path; - let lib_path = Path::new("deps").join("Exports.def"); - let absolute_path = std::fs::canonicalize(&lib_path).unwrap().to_str().unwrap().to_string().replace("\\\\?\\", ""); + let lib_path = env::current_dir().unwrap().join("deps").join("Exports.def"); - if !Path::new(&absolute_path).exists() { - panic!("Exports.def not found at {}", lib_path.display()); + + if !lib_path.exists() { + println!("cargo:error=Exports.def not found at {}", lib_path.display()); } - println!("cargo:warning=Linking Exports File: {}", absolute_path); - println!( - "cargo:rustc-cdylib-link-arg=/DEF:{}", - absolute_path - ); -} \ No newline at end of file + println!("cargo:warning=Linking Exports File: {}", lib_path.display()); + println!("cargo:rustc-cdylib-link-arg=/DEF:{}", lib_path.display()); +} From a71a25fc4fa9112a905c89e225afa1fe9a53a9ec Mon Sep 17 00:00:00 2001 From: Sarah Date: Sat, 30 Dec 2023 21:22:59 +0100 Subject: [PATCH 05/12] Try another way of exporting functions --- MelonProxy/build.rs | 12 +- MelonProxy/deps/Exports.def | 528 ++++++++++++++++++------------------ 2 files changed, 272 insertions(+), 268 deletions(-) diff --git a/MelonProxy/build.rs b/MelonProxy/build.rs index 5383971ce..83702c986 100644 --- a/MelonProxy/build.rs +++ b/MelonProxy/build.rs @@ -10,7 +10,7 @@ fn main() { Ok("windows") => link_exports(), - tos => panic!("unknown target os {:?}!", tos), + tos => println!("cargo:error=unknown target os {:?}!", tos), } } @@ -23,6 +23,12 @@ fn link_exports() { println!("cargo:error=Exports.def not found at {}", lib_path.display()); } - println!("cargo:warning=Linking Exports File: {}", lib_path.display()); - println!("cargo:rustc-cdylib-link-arg=/DEF:{}", lib_path.display()); + let lines = std::fs::read_to_string(lib_path).unwrap(); + let lines = lines.split("\n"); + let lines = lines.filter(|x| !x.is_empty()); + + //export each function + for line in lines { + println!("cargo:rustc-cdylib-link-arg=/EXPORT:{}", line); + } } diff --git a/MelonProxy/deps/Exports.def b/MelonProxy/deps/Exports.def index e274da2be..9e4416cc5 100644 --- a/MelonProxy/deps/Exports.def +++ b/MelonProxy/deps/Exports.def @@ -1,266 +1,264 @@ -EXPORTS - GetFileVersionInfoA - GetFileVersionInfoByHandle - GetFileVersionInfoExA - GetFileVersionInfoExW - GetFileVersionInfoSizeA - GetFileVersionInfoSizeExA - GetFileVersionInfoSizeExW - GetFileVersionInfoSizeW - GetFileVersionInfoW - VerFindFileA - VerFindFileW - VerInstallFileA - VerInstallFileW - VerLanguageNameA - VerLanguageNameW - VerQueryValueA - VerQueryValueW - - Private1 - SvchostPushServiceGlobals - WinHttpAddRequestHeaders - WinHttpAutoProxySvcMain - WinHttpCheckPlatform - WinHttpCloseHandle - WinHttpConnect - WinHttpConnectionDeletePolicyEntries - WinHttpConnectionDeleteProxyInfo - WinHttpConnectionFreeNameList - WinHttpConnectionFreeProxyInfo - WinHttpConnectionFreeProxyList - WinHttpConnectionGetNameList - WinHttpConnectionGetProxyInfo - WinHttpConnectionGetProxyList - WinHttpConnectionSetPolicyEntries - WinHttpConnectionSetProxyInfo - WinHttpConnectionUpdateIfIndexTable - WinHttpCrackUrl - WinHttpCreateProxyResolver - WinHttpCreateUrl - WinHttpDetectAutoProxyConfigUrl - WinHttpFreeProxyResult - WinHttpFreeProxyResultEx - WinHttpFreeProxySettings - WinHttpGetDefaultProxyConfiguration - WinHttpGetIEProxyConfigForCurrentUser - WinHttpGetProxyForUrl - WinHttpGetProxyForUrlEx - WinHttpGetProxyForUrlEx2 - WinHttpGetProxyForUrlHvsi - WinHttpGetProxyResult - WinHttpGetProxyResultEx - WinHttpGetProxySettingsVersion - WinHttpGetTunnelSocket - WinHttpOpen - WinHttpOpenRequest - WinHttpPacJsWorkerMain - WinHttpProbeConnectivity - WinHttpQueryAuthSchemes - WinHttpQueryDataAvailable - WinHttpQueryHeaders - WinHttpQueryOption - WinHttpReadData - WinHttpReadProxySettings - WinHttpReadProxySettingsHvsi - WinHttpReceiveResponse - WinHttpResetAutoProxy - WinHttpSaveProxyCredentials - WinHttpSendRequest - WinHttpSetCredentials - WinHttpSetDefaultProxyConfiguration - WinHttpSetOption - WinHttpSetStatusCallback - WinHttpSetTimeouts - WinHttpTimeFromSystemTime - WinHttpTimeToSystemTime - WinHttpWebSocketClose - WinHttpWebSocketCompleteUpgrade - WinHttpWebSocketQueryCloseStatus - WinHttpWebSocketReceive - WinHttpWebSocketSend - WinHttpWebSocketShutdown - WinHttpWriteData - WinHttpWriteProxySettings +GetFileVersionInfoA +GetFileVersionInfoByHandle +GetFileVersionInfoExA +GetFileVersionInfoExW +GetFileVersionInfoSizeA +GetFileVersionInfoSizeExA +GetFileVersionInfoSizeExW +GetFileVersionInfoSizeW +GetFileVersionInfoW +VerFindFileA +VerFindFileW +VerInstallFileA +VerInstallFileW +VerLanguageNameA +VerLanguageNameW +VerQueryValueA +VerQueryValueW - CloseDriver - DefDriverProc - DriverCallback - DrvGetModuleHandle - GetDriverModuleHandle - OpenDriver - PlaySound - PlaySoundA - PlaySoundW - SendDriverMessage - WOWAppExit - auxGetDevCapsA - auxGetDevCapsW - auxGetNumDevs - auxGetVolume - auxOutMessage - auxSetVolume - joyConfigChanged - joyGetDevCapsA - joyGetDevCapsW - joyGetNumDevs - joyGetPos - joyGetPosEx - joyGetThreshold - joyReleaseCapture - joySetCapture - joySetThreshold - mciDriverNotify - mciDriverYield - mciExecute - mciFreeCommandResource - mciGetCreatorTask - mciGetDeviceIDA - mciGetDeviceIDFromElementIDA - mciGetDeviceIDFromElementIDW - mciGetDeviceIDW - mciGetDriverData - mciGetErrorStringA - mciGetErrorStringW - mciGetYieldProc - mciLoadCommandResource - mciSendCommandA - mciSendCommandW - mciSendStringA - mciSendStringW - mciSetDriverData - mciSetYieldProc - midiConnect - midiDisconnect - midiInAddBuffer - midiInClose - midiInGetDevCapsA - midiInGetDevCapsW - midiInGetErrorTextA - midiInGetErrorTextW - midiInGetID - midiInGetNumDevs - midiInMessage - midiInOpen - midiInPrepareHeader - midiInReset - midiInStart - midiInStop - midiInUnprepareHeader - midiOutCacheDrumPatches - midiOutCachePatches - midiOutClose - midiOutGetDevCapsA - midiOutGetDevCapsW - midiOutGetErrorTextA - midiOutGetErrorTextW - midiOutGetID - midiOutGetNumDevs - midiOutGetVolume - midiOutLongMsg - midiOutMessage - midiOutOpen - midiOutPrepareHeader - midiOutReset - midiOutSetVolume - midiOutShortMsg - midiOutUnprepareHeader - midiStreamClose - midiStreamOpen - midiStreamOut - midiStreamPause - midiStreamPosition - midiStreamProperty - midiStreamRestart - midiStreamStop - mixerClose - mixerGetControlDetailsA - mixerGetControlDetailsW - mixerGetDevCapsA - mixerGetDevCapsW - mixerGetID - mixerGetLineControlsA - mixerGetLineControlsW - mixerGetLineInfoA - mixerGetLineInfoW - mixerGetNumDevs - mixerMessage - mixerOpen - mixerSetControlDetails - mmDrvInstall - mmGetCurrentTask - mmTaskBlock - mmTaskCreate - mmTaskSignal - mmTaskYield - mmioAdvance - mmioAscend - mmioClose - mmioCreateChunk - mmioDescend - mmioFlush - mmioGetInfo - mmioInstallIOProcA - mmioInstallIOProcW - mmioOpenA - mmioOpenW - mmioRead - mmioRenameA - mmioRenameW - mmioSeek - mmioSendMessage - mmioSetBuffer - mmioSetInfo - mmioStringToFOURCCA - mmioStringToFOURCCW - mmioWrite - mmsystemGetVersion - sndPlaySoundA - sndPlaySoundW - timeBeginPeriod - timeEndPeriod - timeGetDevCaps - timeGetSystemTime - timeGetTime - timeKillEvent - timeSetEvent - waveInAddBuffer - waveInClose - waveInGetDevCapsA - waveInGetDevCapsW - waveInGetErrorTextA - waveInGetErrorTextW - waveInGetID - waveInGetNumDevs - waveInGetPosition - waveInMessage - waveInOpen - waveInPrepareHeader - waveInReset - waveInStart - waveInStop - waveInUnprepareHeader - waveOutBreakLoop - waveOutClose - waveOutGetDevCapsA - waveOutGetDevCapsW - waveOutGetErrorTextA - waveOutGetErrorTextW - waveOutGetID - waveOutGetNumDevs - waveOutGetPitch - waveOutGetPlaybackRate - waveOutGetPosition - waveOutGetVolume - waveOutMessage - waveOutOpen - waveOutPause - waveOutPrepareHeader - waveOutReset - waveOutRestart - waveOutSetPitch - waveOutSetPlaybackRate - waveOutSetVolume - waveOutUnprepareHeader - waveOutWrite - ExportByOrdinal2 \ No newline at end of file +Private1 +SvchostPushServiceGlobals +WinHttpAddRequestHeaders +WinHttpAutoProxySvcMain +WinHttpCheckPlatform +WinHttpCloseHandle +WinHttpConnect +WinHttpConnectionDeletePolicyEntries +WinHttpConnectionDeleteProxyInfo +WinHttpConnectionFreeNameList +WinHttpConnectionFreeProxyInfo +WinHttpConnectionFreeProxyList +WinHttpConnectionGetNameList +WinHttpConnectionGetProxyInfo +WinHttpConnectionGetProxyList +WinHttpConnectionSetPolicyEntries +WinHttpConnectionSetProxyInfo +WinHttpConnectionUpdateIfIndexTable +WinHttpCrackUrl +WinHttpCreateProxyResolver +WinHttpCreateUrl +WinHttpDetectAutoProxyConfigUrl +WinHttpFreeProxyResult +WinHttpFreeProxyResultEx +WinHttpFreeProxySettings +WinHttpGetDefaultProxyConfiguration +WinHttpGetIEProxyConfigForCurrentUser +WinHttpGetProxyForUrl +WinHttpGetProxyForUrlEx +WinHttpGetProxyForUrlEx2 +WinHttpGetProxyForUrlHvsi +WinHttpGetProxyResult +WinHttpGetProxyResultEx +WinHttpGetProxySettingsVersion +WinHttpGetTunnelSocket +WinHttpOpen +WinHttpOpenRequest +WinHttpPacJsWorkerMain +WinHttpProbeConnectivity +WinHttpQueryAuthSchemes +WinHttpQueryDataAvailable +WinHttpQueryHeaders +WinHttpQueryOption +WinHttpReadData +WinHttpReadProxySettings +WinHttpReadProxySettingsHvsi +WinHttpReceiveResponse +WinHttpResetAutoProxy +WinHttpSaveProxyCredentials +WinHttpSendRequest +WinHttpSetCredentials +WinHttpSetDefaultProxyConfiguration +WinHttpSetOption +WinHttpSetStatusCallback +WinHttpSetTimeouts +WinHttpTimeFromSystemTime +WinHttpTimeToSystemTime +WinHttpWebSocketClose +WinHttpWebSocketCompleteUpgrade +WinHttpWebSocketQueryCloseStatus +WinHttpWebSocketReceive +WinHttpWebSocketSend +WinHttpWebSocketShutdown +WinHttpWriteData +WinHttpWriteProxySettings +CloseDriver +DefDriverProc +DriverCallback +DrvGetModuleHandle +GetDriverModuleHandle +OpenDriver +PlaySound +PlaySoundA +PlaySoundW +SendDriverMessage +WOWAppExit +auxGetDevCapsA +auxGetDevCapsW +auxGetNumDevs +auxGetVolume +auxOutMessage +auxSetVolume +joyConfigChanged +joyGetDevCapsA +joyGetDevCapsW +joyGetNumDevs +joyGetPos +joyGetPosEx +joyGetThreshold +joyReleaseCapture +joySetCapture +joySetThreshold +mciDriverNotify +mciDriverYield +mciExecute +mciFreeCommandResource +mciGetCreatorTask +mciGetDeviceIDA +mciGetDeviceIDFromElementIDA +mciGetDeviceIDFromElementIDW +mciGetDeviceIDW +mciGetDriverData +mciGetErrorStringA +mciGetErrorStringW +mciGetYieldProc +mciLoadCommandResource +mciSendCommandA +mciSendCommandW +mciSendStringA +mciSendStringW +mciSetDriverData +mciSetYieldProc +midiConnect +midiDisconnect +midiInAddBuffer +midiInClose +midiInGetDevCapsA +midiInGetDevCapsW +midiInGetErrorTextA +midiInGetErrorTextW +midiInGetID +midiInGetNumDevs +midiInMessage +midiInOpen +midiInPrepareHeader +midiInReset +midiInStart +midiInStop +midiInUnprepareHeader +midiOutCacheDrumPatches +midiOutCachePatches +midiOutClose +midiOutGetDevCapsA +midiOutGetDevCapsW +midiOutGetErrorTextA +midiOutGetErrorTextW +midiOutGetID +midiOutGetNumDevs +midiOutGetVolume +midiOutLongMsg +midiOutMessage +midiOutOpen +midiOutPrepareHeader +midiOutReset +midiOutSetVolume +midiOutShortMsg +midiOutUnprepareHeader +midiStreamClose +midiStreamOpen +midiStreamOut +midiStreamPause +midiStreamPosition +midiStreamProperty +midiStreamRestart +midiStreamStop +mixerClose +mixerGetControlDetailsA +mixerGetControlDetailsW +mixerGetDevCapsA +mixerGetDevCapsW +mixerGetID +mixerGetLineControlsA +mixerGetLineControlsW +mixerGetLineInfoA +mixerGetLineInfoW +mixerGetNumDevs +mixerMessage +mixerOpen +mixerSetControlDetails +mmDrvInstall +mmGetCurrentTask +mmTaskBlock +mmTaskCreate +mmTaskSignal +mmTaskYield +mmioAdvance +mmioAscend +mmioClose +mmioCreateChunk +mmioDescend +mmioFlush +mmioGetInfo +mmioInstallIOProcA +mmioInstallIOProcW +mmioOpenA +mmioOpenW +mmioRead +mmioRenameA +mmioRenameW +mmioSeek +mmioSendMessage +mmioSetBuffer +mmioSetInfo +mmioStringToFOURCCA +mmioStringToFOURCCW +mmioWrite +mmsystemGetVersion +sndPlaySoundA +sndPlaySoundW +timeBeginPeriod +timeEndPeriod +timeGetDevCaps +timeGetSystemTime +timeGetTime +timeKillEvent +timeSetEvent +waveInAddBuffer +waveInClose +waveInGetDevCapsA +waveInGetDevCapsW +waveInGetErrorTextA +waveInGetErrorTextW +waveInGetID +waveInGetNumDevs +waveInGetPosition +waveInMessage +waveInOpen +waveInPrepareHeader +waveInReset +waveInStart +waveInStop +waveInUnprepareHeader +waveOutBreakLoop +waveOutClose +waveOutGetDevCapsA +waveOutGetDevCapsW +waveOutGetErrorTextA +waveOutGetErrorTextW +waveOutGetID +waveOutGetNumDevs +waveOutGetPitch +waveOutGetPlaybackRate +waveOutGetPosition +waveOutGetVolume +waveOutMessage +waveOutOpen +waveOutPause +waveOutPrepareHeader +waveOutReset +waveOutRestart +waveOutSetPitch +waveOutSetPlaybackRate +waveOutSetVolume +waveOutUnprepareHeader +waveOutWrite +ExportByOrdinal2 \ No newline at end of file From d4d446909687515cc47fc6de976f733a0e607ab7 Mon Sep 17 00:00:00 2001 From: Sarah Date: Sat, 30 Dec 2023 21:42:09 +0100 Subject: [PATCH 06/12] Update build.yml --- .github/workflows/build.yml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8260cc191..9d7e13a61 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -38,14 +38,19 @@ jobs: path: Output/Release/MelonLoader/ build_rust_windows: runs-on: windows-latest + strategy: + matrix: + target: + - i686-pc-windows-msvc + - x86_64-pc-windows-msvc steps: - uses: actions/checkout@v3 - name: rust-toolchain - uses: dtolnay/rust-toolchain@stable + uses: actions-rs/toolchain@v1 with: toolchain: nightly # Target triple to install for this toolchain - targets: i686-pc-windows-msvc, x86_64-pc-windows-msvc + target: ${{ matrix.target }} # Build Rust Release - name: Build Rust Release | Windows - x86 shell: cmd @@ -110,14 +115,18 @@ jobs: path: target/x86_64-pc-windows-msvc/debug/Bootstrap.dll build_rust_linux: runs-on: ubuntu-latest + strategy: + matrix: + target: + - x86_64-unknown-linux-gnu steps: - uses: actions/checkout@v3 - name: rust-toolchain - uses: dtolnay/rust-toolchain@stable + uses: actions-rs/toolchain@v1 with: toolchain: nightly # Target triple to install for this toolchain - targets: x86_64-unknown-linux-gnu + target: ${{ matrix.target }} - name: install dev dependencies shell: bash run: sudo apt-get install libgtk-3-dev From 55843f5c784855b086cac96c40fccc5d20a2706f Mon Sep 17 00:00:00 2001 From: Sarah Date: Sat, 30 Dec 2023 21:48:53 +0100 Subject: [PATCH 07/12] Update build.yml --- .github/workflows/build.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9d7e13a61..2b8b1d372 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -38,19 +38,21 @@ jobs: path: Output/Release/MelonLoader/ build_rust_windows: runs-on: windows-latest - strategy: - matrix: - target: - - i686-pc-windows-msvc - - x86_64-pc-windows-msvc steps: - uses: actions/checkout@v3 - - name: rust-toolchain + - name: rust-toolchain x64 uses: actions-rs/toolchain@v1 with: toolchain: nightly # Target triple to install for this toolchain - target: ${{ matrix.target }} + target: x86_64-pc-windows-msvc + - name: rust-toolchain x86 + uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + # Target triple to install for this toolchain + target: i686-pc-windows-msvc + override: true # Build Rust Release - name: Build Rust Release | Windows - x86 shell: cmd From b60661908e37794ecaf15787d740e800f30cfe03 Mon Sep 17 00:00:00 2001 From: Sarah Date: Sat, 30 Dec 2023 23:04:45 +0100 Subject: [PATCH 08/12] Update build.yml --- .github/workflows/build.yml | 41 ++++++++++++++++--------------------- 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2b8b1d372..11e92b3a8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -40,19 +40,15 @@ jobs: runs-on: windows-latest steps: - uses: actions/checkout@v3 - - name: rust-toolchain x64 - uses: actions-rs/toolchain@v1 - with: - toolchain: nightly - # Target triple to install for this toolchain - target: x86_64-pc-windows-msvc - - name: rust-toolchain x86 - uses: actions-rs/toolchain@v1 - with: - toolchain: nightly - # Target triple to install for this toolchain - target: i686-pc-windows-msvc - override: true + - name: Install Rust (nightly) + run: + curl https://sh.rustup.rs -sSf | sh -s -- -y + - name: Make Rust Nightly + shell: cmd + run: rustup default nightly + - name: Install target x86 + shell: cmd + run: rustup target add i686-pc-windows-msvc # Build Rust Release - name: Build Rust Release | Windows - x86 shell: cmd @@ -117,18 +113,17 @@ jobs: path: target/x86_64-pc-windows-msvc/debug/Bootstrap.dll build_rust_linux: runs-on: ubuntu-latest - strategy: - matrix: - target: - - x86_64-unknown-linux-gnu steps: - uses: actions/checkout@v3 - - name: rust-toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: nightly - # Target triple to install for this toolchain - target: ${{ matrix.target }} + - 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 target x64 + shell: bash + run: rustup target add x86_64-unknown-linux-gnu - name: install dev dependencies shell: bash run: sudo apt-get install libgtk-3-dev From b20b4107485233ec9e65b7bcd4289abd81065b13 Mon Sep 17 00:00:00 2001 From: Sarah Date: Thu, 4 Jan 2024 07:11:45 +0100 Subject: [PATCH 09/12] new proxy (again) and streamlined build.yml --- .github/workflows/build.yml | 161 ++-- Bootstrap/Cargo.toml | 4 +- Bootstrap/src/melonenv/paths.rs | 6 +- Bootstrap/src/utils/runtime.rs | 3 +- Cargo.lock | 199 ++--- Cargo.toml | 2 +- MelonProxy-sys/Cargo.toml | 20 - MelonProxy-sys/src/lib.rs | 99 --- MelonProxy/Cargo.toml | 33 +- MelonProxy/build.rs | 34 - MelonProxy/deps/Exports.def | 264 ------- MelonProxy/deps/version.x64.S | 52 -- MelonProxy/deps/version.x86.S | 52 -- MelonProxy/deps/winhttp.x64.S | 196 ----- MelonProxy/deps/winhttp.x86.S | 260 ------- MelonProxy/deps/winmm.x64.S | 724 ------------------ MelonProxy/deps/winmm.x86.S | 724 ------------------ MelonProxy/src/export_indices.rs | 256 +++++++ MelonProxy/src/intercepted_exports.rs | 44 ++ MelonProxy/src/lib.rs | 214 +++++- MelonProxy/src/orig_exports.rs | 276 +++++++ MelonProxy/src/proxied_exports.rs | 1007 +++++++++++++++++++++++++ MelonProxy/src/proxy/exports.rs | 316 -------- MelonProxy/src/proxy/hinstance_ext.rs | 62 -- MelonProxy/src/proxy/mod.rs | 3 - MelonProxy/src/proxy/windows_ext.rs | 23 - 26 files changed, 1966 insertions(+), 3068 deletions(-) delete mode 100644 MelonProxy-sys/Cargo.toml delete mode 100644 MelonProxy-sys/src/lib.rs delete mode 100644 MelonProxy/build.rs delete mode 100644 MelonProxy/deps/Exports.def delete mode 100644 MelonProxy/deps/version.x64.S delete mode 100644 MelonProxy/deps/version.x86.S delete mode 100644 MelonProxy/deps/winhttp.x64.S delete mode 100644 MelonProxy/deps/winhttp.x86.S delete mode 100644 MelonProxy/deps/winmm.x64.S delete mode 100644 MelonProxy/deps/winmm.x86.S create mode 100644 MelonProxy/src/export_indices.rs create mode 100644 MelonProxy/src/intercepted_exports.rs create mode 100644 MelonProxy/src/orig_exports.rs create mode 100644 MelonProxy/src/proxied_exports.rs delete mode 100644 MelonProxy/src/proxy/exports.rs delete mode 100644 MelonProxy/src/proxy/hinstance_ext.rs delete mode 100644 MelonProxy/src/proxy/mod.rs delete mode 100644 MelonProxy/src/proxy/windows_ext.rs diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 11e92b3a8..777ccf7cf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,62 +8,28 @@ 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 + name: MLRelease path: Output/Release/MelonLoader/ - build_rust_windows: - runs-on: windows-latest - steps: - - uses: actions/checkout@v3 - - name: Install Rust (nightly) - run: - curl https://sh.rustup.rs -sSf | sh -s -- -y - - name: Make Rust Nightly - shell: cmd - run: rustup default nightly - - name: Install target x86 - shell: cmd - run: rustup target add i686-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: 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 - - name: Build Rust Debug | Windows - x64 - shell: cmd - run: cargo +nightly build --target x86_64-pc-windows-msvc - # Upload Proxy Release - x86 + - name: Upload Debug Artifact + uses: actions/upload-artifact@v3 + with: + name: MLDebug + path: Output/Debug/MelonLoader/ - name: Upload Proxy Release | Windows x86 uses: actions/upload-artifact@v3 with: @@ -111,7 +77,7 @@ jobs: with: name: MLBootstrapX64-Windows-Debug path: target/x86_64-pc-windows-msvc/debug/Bootstrap.dll - build_rust_linux: + build_rust: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -121,18 +87,57 @@ jobs: - name: Make Rust Nightly shell: bash run: rustup default nightly - - name: Install target x64 + - 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-gnu + - name: Install Windows target x86 + shell: bash + run: rustup target add i686-pc-windows-gnu + - name: Install Windows target x64 (MSVC) + shell: bash + run: rustup target add x86_64-pc-windows-msvc + - name: Install Windows target x86 (MSVC) + 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 + run: sudo apt-get install libgtk-3-dev mingw-w64 binutils-mingw-w64 wine - name: Build Rust Release | Linux - x64 shell: bash - run: cargo +nightly build --target x86_64-unknown-linux-gnu --release + run: cargo 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 + run: cargo build --target x86_64-unknown-linux-gnu + - name: Build Bootstrap Release | Windows - x64 + shell: bash + run: cargo xwin build --package Bootstrap --target x86_64-pc-windows-msvc --release + - name: Build Bootstrap Debug | Windows - x64 + shell: bash + run: cargo xwin build --package Bootstrap --target x86_64-pc-windows-msvc + - name: Build Bootstrap Release | Windows - x86 + shell: bash + run: cargo xwin build --package Bootstrap --target i686-pc-windows-msvc --release + - name: Build Bootstrap Debug | Windows - x86 + shell: bash + run: cargo xwin build --package Bootstrap --target i686-pc-windows-msvc + - name: Build Proxy Release | Windows - x64 + shell: bash + run: cargo build --package MelonProxy --target x86_64-pc-windows-gnu --release + - name: Build Proxy Debug | Windows - x64 + shell: bash + run: cargo build --package MelonProxy --target x86_64-pc-windows-gnu + - name: Build Proxy Release | Windows - x86 + shell: bash + run: cargo build --package MelonProxy --target i686-pc-windows-gnu --release + - name: Build Proxy Debug | Windows - x86 + shell: bash + run: cargo build --package MelonProxy --target i686-pc-windows-gnu - name: Upload Proxy Release | Linux x64 uses: actions/upload-artifact@v3 with: @@ -153,9 +158,49 @@ jobs: 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-gnu/release/version.dll + - 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 + - name: Upload Proxy Release | Windows x64 + uses: actions/upload-artifact@v3 + with: + name: MLProxyX64-Windows-Release + path: target/x86_64-pc-windows-gnu/release/version.dll + - 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 + - name: Upload Proxy Debug | Windows x86 + uses: actions/upload-artifact@v3 + with: + name: MLProxyX86-Windows-Debug + path: target/i686-pc-windows-gnu/debug/version.dll + - 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 + - name: Upload Proxy Debug | Windows x64 + uses: actions/upload-artifact@v3 + with: + name: MLProxyX64-Windows-Debug + path: target/x86_64-pc-windows-gnu/debug/version.dll + - 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 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 @@ -197,7 +242,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 @@ -239,7 +284,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 @@ -281,7 +326,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 @@ -323,7 +368,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 @@ -362,7 +407,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/Bootstrap/Cargo.toml b/Bootstrap/Cargo.toml index 9bf9f33d4..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" @@ -22,7 +22,7 @@ netcorehost = "0.15.1" exe = "0.5.6" [target.'cfg(windows)'.dependencies] -windows = { version = "0.51.0", features = [ +windows = { version = "0.52.0", features = [ "Win32_Foundation", "Win32_System_Console", "Win32_UI_WindowsAndMessaging" diff --git a/Bootstrap/src/melonenv/paths.rs b/Bootstrap/src/melonenv/paths.rs index 040f0df66..db8b11d7c 100644 --- a/Bootstrap/src/melonenv/paths.rs +++ b/Bootstrap/src/melonenv/paths.rs @@ -1,11 +1,11 @@ -use std::path::{PathBuf, Path}; +use std::path::{PathBuf}; use lazy_static::lazy_static; use unity_rs::runtime::RuntimeType; -use crate::{errors::DynErr, internal_failure, runtime, constants::W, utils::runtime::{self, NetstandardVersion}}; +use crate::{errors::DynErr, internal_failure, runtime, constants::W}; + -use super::args::ARGS; lazy_static! { pub static ref BASE_DIR: W = { diff --git a/Bootstrap/src/utils/runtime.rs b/Bootstrap/src/utils/runtime.rs index d657995c5..84fbf0c54 100644 --- a/Bootstrap/src/utils/runtime.rs +++ b/Bootstrap/src/utils/runtime.rs @@ -1,9 +1,8 @@ use std::{error::Error, collections::HashMap, io, path::Path}; -use exe::{ImageDirectoryEntry, ResourceDirectory, VecPE, PE, ImportDirectory, ImportData, CCharString, ImageDataDirectory, ImageResourceDirectory}; use unity_rs::runtime::FerrexRuntime; -use crate::{errors::DynErr, log, melonenv::paths}; +use crate::{errors::DynErr, melonenv::paths}; #[allow(dead_code)] pub static mut RUNTIME: Option = None; diff --git a/Cargo.lock b/Cargo.lock index 74267c499..fc296188d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -9,7 +9,7 @@ dependencies = [ "chrono", "clap", "colored", - "ctor 0.1.26", + "ctor", "dobby-rs", "exe", "lazy_static", @@ -19,7 +19,18 @@ dependencies = [ "netcorehost", "thiserror", "unity-rs", - "windows 0.51.0", + "windows 0.52.0", +] + +[[package]] +name = "MelonProxy" +version = "0.1.0" +dependencies = [ + "ctor", + "libloading 0.8.1", + "msgbox", + "proxygen-macros", + "winapi", ] [[package]] @@ -134,9 +145,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" [[package]] name = "block" @@ -265,17 +276,16 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.26" +version = "0.4.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5" +checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" dependencies = [ "android-tzdata", "iana-time-zone", "js-sys", "num-traits", - "time 0.1.45", "wasm-bindgen", - "winapi", + "windows-targets 0.48.5", ] [[package]] @@ -466,16 +476,6 @@ dependencies = [ "quote", ] -[[package]] -name = "ctor" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d2301688392eb071b0bf1a37be05c469d3cc4dbbd95df672fe28ab021e6a096" -dependencies = [ - "quote", - "syn 1.0.109", -] - [[package]] name = "ctor" version = "0.2.6" @@ -483,7 +483,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "30d2b3721e861707777e3195b0158f950ae6dc4a27e4d02ff9f67e3eb3de199e" dependencies = [ "quote", - "syn 2.0.43", + "syn 2.0.44", ] [[package]] @@ -526,7 +526,7 @@ checksum = "133a7fa5cffeec6867fb2847335ec2d688f5bbee6318889d2a137ce1d226b180" dependencies = [ "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.44", ] [[package]] @@ -569,7 +569,7 @@ checksum = "f2b99bf03862d7f545ebc28ddd33a665b50865f4dfd84031a393823879bd4c54" dependencies = [ "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.44", ] [[package]] @@ -584,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" @@ -612,7 +612,7 @@ checksum = "ccb14d927583dd5c2eac0f2cf264fc4762aefe1ae14c47a8a20fc1939d3a5fc0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.44", ] [[package]] @@ -756,7 +756,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.44", ] [[package]] @@ -1281,9 +1281,9 @@ dependencies = [ [[package]] name = "libloading" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d580318f95776505201b28cf98eb1fa5e4be3b689633ba6a3e6cd880ff22d8cb" +checksum = "c571b676ddfc9a8c12f1f3d3085a7b163966a8fd8098a90640953ce5f6170161" dependencies = [ "cfg-if", "windows-sys", @@ -1321,24 +1321,6 @@ dependencies = [ "opaque-debug", ] -[[package]] -name = "melon_proxy" -version = "0.2.5" -dependencies = [ - "ctor 0.2.6", - "libloading 0.8.0", - "melon_proxy-sys", - "msgbox", - "windows 0.52.0", -] - -[[package]] -name = "melon_proxy-sys" -version = "0.2.2" -dependencies = [ - "syn 2.0.43", -] - [[package]] name = "memchr" version = "2.5.0" @@ -1376,7 +1358,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" dependencies = [ "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", "windows-sys", ] @@ -1432,9 +1414,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" dependencies = [ "autocfg", ] @@ -1466,7 +1448,7 @@ checksum = "96667db765a921f7b295ffee8b60472b686a51d4f21c2ee4ffdb94c7013b65a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.44", ] [[package]] @@ -1634,18 +1616,27 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.71" +version = "1.0.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75cb1540fadbd5b8fbccc4dddad2734eba435053f725621c070711a14bb5f4b8" +checksum = "2dd5e8a1f1029c43224ad5898e50140c2aebb1705f19e67c918ebf5b9e797fe1" dependencies = [ "unicode-ident", ] +[[package]] +name = "proxygen-macros" +version = "0.5.0" +source = "git+https://github.com/RinLovesYou/proxygen#c549e4fad7cd50e1d3db252c97f2e1e94713d869" +dependencies = [ + "quote", + "syn 2.0.44", +] + [[package]] name = "quote" -version = "1.0.32" +version = "1.0.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f3b39ccfb720540debaa0164757101c08ecb8d326b15358ce76a62c7e85965" +checksum = "22a37c9326af5ed140c86a46655b5278de879853be5573c01df185b6f49a580a" dependencies = [ "proc-macro2", ] @@ -1731,7 +1722,7 @@ version = "0.38.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19ed4fa021d81c8392ce04db050a3da9a60299050b7ae1cf482d862b54a7218f" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.4.1", "errno", "libc", "linux-raw-sys", @@ -1808,7 +1799,7 @@ checksum = "aafe972d60b0b9bee71a91b92fee2d4fb3c9d7e8f6b179aa99f27203d99a4816" dependencies = [ "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.44", ] [[package]] @@ -1957,9 +1948,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.43" +version = "2.0.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee659fb5f3d355364e1f3e5bc10fb82068efbf824a1e9d1c9504244a6469ad53" +checksum = "92d27c2c202598d05175a6dd3af46824b7f747f8d8e9b14c623f19fa5069735d" dependencies = [ "proc-macro2", "quote", @@ -2011,18 +2002,7 @@ checksum = "090198534930841fab3a5d1bb637cde49e339654e606195f8d9c76eeb081dc96" dependencies = [ "proc-macro2", "quote", - "syn 2.0.43", -] - -[[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", + "syn 2.0.44", ] [[package]] @@ -2239,12 +2219,6 @@ dependencies = [ "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" @@ -2272,7 +2246,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.44", "wasm-bindgen-shared", ] @@ -2306,7 +2280,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.44", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -2389,17 +2363,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" dependencies = [ - "windows-targets 0.48.2", -] - -[[package]] -name = "windows" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9763fb813068e9f4ab70a92a0c6ad61ff6b342f693b1ed0e5387c854386e670" -dependencies = [ - "windows-core 0.51.0", - "windows-targets 0.48.2", + "windows-targets 0.48.5", ] [[package]] @@ -2408,19 +2372,10 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" dependencies = [ - "windows-core 0.52.0", + "windows-core", "windows-targets 0.52.0", ] -[[package]] -name = "windows-core" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b81650771e76355778637954dc9d7eb8d991cd89ad64ba26f21eeb3c22d8d836" -dependencies = [ - "windows-targets 0.48.2", -] - [[package]] name = "windows-core" version = "0.52.0" @@ -2436,22 +2391,22 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets 0.48.2", + "windows-targets 0.48.5", ] [[package]] name = "windows-targets" -version = "0.48.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1eeca1c172a285ee6c2c84c341ccea837e7c01b12fbb2d0fe3c9e550ce49ec8" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm 0.48.2", - "windows_aarch64_msvc 0.48.2", - "windows_i686_gnu 0.48.2", - "windows_i686_msvc 0.48.2", - "windows_x86_64_gnu 0.48.2", - "windows_x86_64_gnullvm 0.48.2", - "windows_x86_64_msvc 0.48.2", + "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]] @@ -2471,9 +2426,9 @@ dependencies = [ [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b10d0c968ba7f6166195e13d593af609ec2e3d24f916f081690695cf5eaffb2f" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" @@ -2483,9 +2438,9 @@ checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" [[package]] name = "windows_aarch64_msvc" -version = "0.48.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "571d8d4e62f26d4932099a9efe89660e8bd5087775a2ab5cdd8b747b811f1058" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" @@ -2495,9 +2450,9 @@ checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" [[package]] name = "windows_i686_gnu" -version = "0.48.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2229ad223e178db5fbbc8bd8d3835e51e566b8474bfca58d2e6150c48bb723cd" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" @@ -2507,9 +2462,9 @@ checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" [[package]] name = "windows_i686_msvc" -version = "0.48.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "600956e2d840c194eedfc5d18f8242bc2e17c7775b6684488af3a9fff6fe3287" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" @@ -2519,9 +2474,9 @@ checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" [[package]] name = "windows_x86_64_gnu" -version = "0.48.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea99ff3f8b49fb7a8e0d305e5aec485bd068c2ba691b6e277d29eaeac945868a" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" @@ -2531,9 +2486,9 @@ checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f1a05a1ece9a7a0d5a7ccf30ba2c33e3a61a30e042ffd247567d1de1d94120d" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" @@ -2543,9 +2498,9 @@ checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" [[package]] name = "windows_x86_64_msvc" -version = "0.48.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d419259aba16b663966e29e6d7c6ecfa0bb8425818bb96f6f1f3c3eb71a6e7b9" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" @@ -2587,7 +2542,7 @@ dependencies = [ "hmac", "pbkdf2", "sha1", - "time 0.3.25", + "time", "zstd", ] diff --git a/Cargo.toml b/Cargo.toml index cfc57d747..6b580a745 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,3 +1,3 @@ [workspace] -members = ["MelonProxy", "Bootstrap", "MelonProxy-sys"] +members = ["MelonProxy", "Bootstrap"] resolver = "2" \ No newline at end of file diff --git a/MelonProxy-sys/Cargo.toml b/MelonProxy-sys/Cargo.toml deleted file mode 100644 index 3133256a6..000000000 --- a/MelonProxy-sys/Cargo.toml +++ /dev/null @@ -1,20 +0,0 @@ -[package] -name = "melon_proxy-sys" -version = "0.2.2" -authors = ["RinLovesYou"] -edition = "2021" -description = "A dynamic Windows System DLL proxy" -repository = "https://github.com/LavaGang/MelonLoader" -license = "GPL-2.0" -readme = "../README.md" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] - -[dependencies.syn] -version = "2.0.33" - -[lib] -name = "melon_proxy_sys" -proc-macro = true \ No newline at end of file diff --git a/MelonProxy-sys/src/lib.rs b/MelonProxy-sys/src/lib.rs deleted file mode 100644 index 8aa9ae540..000000000 --- a/MelonProxy-sys/src/lib.rs +++ /dev/null @@ -1,99 +0,0 @@ -//! A Macro for defining an entry point for a cdylib. -//! -//! On Windows, this macro will wrap your function in DllMain, and call it when the DLL attaches. -//! It will lookup exports of supported proxies, based on our own Module Name, and store them. -//! Effectively, creating a dynamic proxy that we could add any number of supported proxies to. -//! -//! # Supported Targets -//! -//! - Windows -//! - `x86_64-pc-windows-msvc` -//! - `i686-pc-windows-msvc` -//! -//! # Safety -//! -//! This crate is pretty unsafe - -#![feature(naked_functions)] -#![feature(asm_const)] -#![deny( - missing_debug_implementations, - missing_docs, - 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))] - -use syn::__private::{quote::quote, TokenStream}; - -/// Wraps your function in DllMain on windows -#[proc_macro_attribute] -pub fn proxy(_attribute: TokenStream, function: TokenStream) -> TokenStream { - //this gets us the Tokens of the function. Procedural macros let us modify functions before they are - //given to the compiler. - let fn_ts = function.clone(); - - //get the function as an item, letting us break it down into its component parts. - let item: syn::Item = syn::parse_macro_input!(fn_ts); - if let syn::Item::Fn(function) = item { - let syn::ItemFn { - attrs, - block, - vis, - sig: - syn::Signature { - ident, - unsafety, - constness, - abi, - output, - .. - }, - .. - } = function; - - //this is what we will give to the compiler instead of the original function. - let output = quote!( - //this is the original function, this is what we got from the item above. - #(#attrs)* - #vis #unsafety #abi #constness fn #ident() #output #block - - //create DllMain - #[no_mangle] - #[allow(non_snake_case)] - pub extern "system" fn DllMain( - _hinstDLL: crate::HINSTANCE, - fdwReason: isize, - _lpvReserved: isize, - ) -> isize { - - if fdwReason == 1 { - //initialize the proxy exports. - crate::proxy::exports::initialize(_hinstDLL).unwrap_or_else(|e| { - ::std::panic!("Failed to initialize MelonLoader's Proxy: {}", e); - }); - - //call the original function - #ident(); - } - - //return OK - 1 - } - - ); - - //return the modified function to the compiler. - return output.into(); - } - - //return the original function if things fail. - function -} diff --git a/MelonProxy/Cargo.toml b/MelonProxy/Cargo.toml index 31412534c..cfb72059e 100644 --- a/MelonProxy/Cargo.toml +++ b/MelonProxy/Cargo.toml @@ -1,25 +1,32 @@ [package] -name = "melon_proxy" -version = "0.2.5" -authors = ["RinLovesYou"] +name = "MelonProxy" +version = "0.1.0" edition = "2021" -description = "A dynamic Windows System DLL proxy" -repository = "https://github.com/LavaGang/MelonLoader" -license = "GPL-2.0" -readme = "../README.md" + # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -melon_proxy-sys = { path = "../MelonProxy-sys" } -libloading = "0.8.0" msgbox = "0.7.0" +libloading = "0.8.1" [target.'cfg(target_os = "windows")'.dependencies] -windows = { version = "0.52.0", features = ["Win32_Foundation", "Win32_System", "Win32_System_LibraryLoader"] } +#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", + "errhandlingapi", +] } + +[target.'cfg(not(target_os = "windows"))'.dependencies] +ctor = "0.2.6" -[target.'cfg(target_os = "linux")'.dependencies] -ctor = "0.2.4" [lib] name = "version" -crate-type = ["cdylib", "rlib"] \ No newline at end of file +crate-type = ["cdylib"] diff --git a/MelonProxy/build.rs b/MelonProxy/build.rs deleted file mode 100644 index 83702c986..000000000 --- a/MelonProxy/build.rs +++ /dev/null @@ -1,34 +0,0 @@ -use std::env; - -fn main() { - let target_os = env::var("CARGO_CFG_TARGET_OS"); - - match target_os.as_ref().map(|x| &**x) { - Ok("linux") | Ok("android") => {} - Ok("freebsd") | Ok("dragonfly") => {} - Ok("openbsd") | Ok("bitrig") | Ok("netbsd") | Ok("macos") | Ok("ios") => {} - - Ok("windows") => link_exports(), - - tos => println!("cargo:error=unknown target os {:?}!", tos), - } -} - -/// links Exports.def to the resulting dll, exporting all our asm functions. -fn link_exports() { - let lib_path = env::current_dir().unwrap().join("deps").join("Exports.def"); - - - if !lib_path.exists() { - println!("cargo:error=Exports.def not found at {}", lib_path.display()); - } - - let lines = std::fs::read_to_string(lib_path).unwrap(); - let lines = lines.split("\n"); - let lines = lines.filter(|x| !x.is_empty()); - - //export each function - for line in lines { - println!("cargo:rustc-cdylib-link-arg=/EXPORT:{}", line); - } -} diff --git a/MelonProxy/deps/Exports.def b/MelonProxy/deps/Exports.def deleted file mode 100644 index 9e4416cc5..000000000 --- a/MelonProxy/deps/Exports.def +++ /dev/null @@ -1,264 +0,0 @@ -GetFileVersionInfoA -GetFileVersionInfoByHandle -GetFileVersionInfoExA -GetFileVersionInfoExW -GetFileVersionInfoSizeA -GetFileVersionInfoSizeExA -GetFileVersionInfoSizeExW -GetFileVersionInfoSizeW -GetFileVersionInfoW -VerFindFileA -VerFindFileW -VerInstallFileA -VerInstallFileW -VerLanguageNameA -VerLanguageNameW -VerQueryValueA -VerQueryValueW - -Private1 -SvchostPushServiceGlobals -WinHttpAddRequestHeaders -WinHttpAutoProxySvcMain -WinHttpCheckPlatform -WinHttpCloseHandle -WinHttpConnect -WinHttpConnectionDeletePolicyEntries -WinHttpConnectionDeleteProxyInfo -WinHttpConnectionFreeNameList -WinHttpConnectionFreeProxyInfo -WinHttpConnectionFreeProxyList -WinHttpConnectionGetNameList -WinHttpConnectionGetProxyInfo -WinHttpConnectionGetProxyList -WinHttpConnectionSetPolicyEntries -WinHttpConnectionSetProxyInfo -WinHttpConnectionUpdateIfIndexTable -WinHttpCrackUrl -WinHttpCreateProxyResolver -WinHttpCreateUrl -WinHttpDetectAutoProxyConfigUrl -WinHttpFreeProxyResult -WinHttpFreeProxyResultEx -WinHttpFreeProxySettings -WinHttpGetDefaultProxyConfiguration -WinHttpGetIEProxyConfigForCurrentUser -WinHttpGetProxyForUrl -WinHttpGetProxyForUrlEx -WinHttpGetProxyForUrlEx2 -WinHttpGetProxyForUrlHvsi -WinHttpGetProxyResult -WinHttpGetProxyResultEx -WinHttpGetProxySettingsVersion -WinHttpGetTunnelSocket -WinHttpOpen -WinHttpOpenRequest -WinHttpPacJsWorkerMain -WinHttpProbeConnectivity -WinHttpQueryAuthSchemes -WinHttpQueryDataAvailable -WinHttpQueryHeaders -WinHttpQueryOption -WinHttpReadData -WinHttpReadProxySettings -WinHttpReadProxySettingsHvsi -WinHttpReceiveResponse -WinHttpResetAutoProxy -WinHttpSaveProxyCredentials -WinHttpSendRequest -WinHttpSetCredentials -WinHttpSetDefaultProxyConfiguration -WinHttpSetOption -WinHttpSetStatusCallback -WinHttpSetTimeouts -WinHttpTimeFromSystemTime -WinHttpTimeToSystemTime -WinHttpWebSocketClose -WinHttpWebSocketCompleteUpgrade -WinHttpWebSocketQueryCloseStatus -WinHttpWebSocketReceive -WinHttpWebSocketSend -WinHttpWebSocketShutdown -WinHttpWriteData -WinHttpWriteProxySettings -CloseDriver -DefDriverProc -DriverCallback -DrvGetModuleHandle -GetDriverModuleHandle -OpenDriver -PlaySound -PlaySoundA -PlaySoundW -SendDriverMessage -WOWAppExit -auxGetDevCapsA -auxGetDevCapsW -auxGetNumDevs -auxGetVolume -auxOutMessage -auxSetVolume -joyConfigChanged -joyGetDevCapsA -joyGetDevCapsW -joyGetNumDevs -joyGetPos -joyGetPosEx -joyGetThreshold -joyReleaseCapture -joySetCapture -joySetThreshold -mciDriverNotify -mciDriverYield -mciExecute -mciFreeCommandResource -mciGetCreatorTask -mciGetDeviceIDA -mciGetDeviceIDFromElementIDA -mciGetDeviceIDFromElementIDW -mciGetDeviceIDW -mciGetDriverData -mciGetErrorStringA -mciGetErrorStringW -mciGetYieldProc -mciLoadCommandResource -mciSendCommandA -mciSendCommandW -mciSendStringA -mciSendStringW -mciSetDriverData -mciSetYieldProc -midiConnect -midiDisconnect -midiInAddBuffer -midiInClose -midiInGetDevCapsA -midiInGetDevCapsW -midiInGetErrorTextA -midiInGetErrorTextW -midiInGetID -midiInGetNumDevs -midiInMessage -midiInOpen -midiInPrepareHeader -midiInReset -midiInStart -midiInStop -midiInUnprepareHeader -midiOutCacheDrumPatches -midiOutCachePatches -midiOutClose -midiOutGetDevCapsA -midiOutGetDevCapsW -midiOutGetErrorTextA -midiOutGetErrorTextW -midiOutGetID -midiOutGetNumDevs -midiOutGetVolume -midiOutLongMsg -midiOutMessage -midiOutOpen -midiOutPrepareHeader -midiOutReset -midiOutSetVolume -midiOutShortMsg -midiOutUnprepareHeader -midiStreamClose -midiStreamOpen -midiStreamOut -midiStreamPause -midiStreamPosition -midiStreamProperty -midiStreamRestart -midiStreamStop -mixerClose -mixerGetControlDetailsA -mixerGetControlDetailsW -mixerGetDevCapsA -mixerGetDevCapsW -mixerGetID -mixerGetLineControlsA -mixerGetLineControlsW -mixerGetLineInfoA -mixerGetLineInfoW -mixerGetNumDevs -mixerMessage -mixerOpen -mixerSetControlDetails -mmDrvInstall -mmGetCurrentTask -mmTaskBlock -mmTaskCreate -mmTaskSignal -mmTaskYield -mmioAdvance -mmioAscend -mmioClose -mmioCreateChunk -mmioDescend -mmioFlush -mmioGetInfo -mmioInstallIOProcA -mmioInstallIOProcW -mmioOpenA -mmioOpenW -mmioRead -mmioRenameA -mmioRenameW -mmioSeek -mmioSendMessage -mmioSetBuffer -mmioSetInfo -mmioStringToFOURCCA -mmioStringToFOURCCW -mmioWrite -mmsystemGetVersion -sndPlaySoundA -sndPlaySoundW -timeBeginPeriod -timeEndPeriod -timeGetDevCaps -timeGetSystemTime -timeGetTime -timeKillEvent -timeSetEvent -waveInAddBuffer -waveInClose -waveInGetDevCapsA -waveInGetDevCapsW -waveInGetErrorTextA -waveInGetErrorTextW -waveInGetID -waveInGetNumDevs -waveInGetPosition -waveInMessage -waveInOpen -waveInPrepareHeader -waveInReset -waveInStart -waveInStop -waveInUnprepareHeader -waveOutBreakLoop -waveOutClose -waveOutGetDevCapsA -waveOutGetDevCapsW -waveOutGetErrorTextA -waveOutGetErrorTextW -waveOutGetID -waveOutGetNumDevs -waveOutGetPitch -waveOutGetPlaybackRate -waveOutGetPosition -waveOutGetVolume -waveOutMessage -waveOutOpen -waveOutPause -waveOutPrepareHeader -waveOutReset -waveOutRestart -waveOutSetPitch -waveOutSetPlaybackRate -waveOutSetVolume -waveOutUnprepareHeader -waveOutWrite -ExportByOrdinal2 \ No newline at end of file diff --git a/MelonProxy/deps/version.x64.S b/MelonProxy/deps/version.x64.S deleted file mode 100644 index 2b8dcd2b9..000000000 --- a/MelonProxy/deps/version.x64.S +++ /dev/null @@ -1,52 +0,0 @@ -.globl GetFileVersionInfoA -.globl GetFileVersionInfoByHandle -.globl GetFileVersionInfoExA -.globl GetFileVersionInfoExW -.globl GetFileVersionInfoSizeA -.globl GetFileVersionInfoSizeExA -.globl GetFileVersionInfoSizeExW -.globl GetFileVersionInfoSizeW -.globl GetFileVersionInfoW -.globl VerFindFileA -.globl VerFindFileW -.globl VerInstallFileA -.globl VerInstallFileW -.globl VerLanguageNameA -.globl VerLanguageNameW -.globl VerQueryValueA -.globl VerQueryValueW - -GetFileVersionInfoA: - jmp qword ptr [rip + OriginalFuncs + 0 * 8] -GetFileVersionInfoByHandle: - jmp qword ptr [rip + OriginalFuncs + 1 * 8] -GetFileVersionInfoExA: - jmp qword ptr [rip + OriginalFuncs + 2 * 8] -GetFileVersionInfoExW: - jmp qword ptr [rip + OriginalFuncs + 3 * 8] -GetFileVersionInfoSizeA: - jmp qword ptr [rip + OriginalFuncs + 4 * 8] -GetFileVersionInfoSizeExA: - jmp qword ptr [rip + OriginalFuncs + 5 * 8] -GetFileVersionInfoSizeExW: - jmp qword ptr [rip + OriginalFuncs + 6 * 8] -GetFileVersionInfoSizeW: - jmp qword ptr [rip + OriginalFuncs + 7 * 8] -GetFileVersionInfoW: - jmp qword ptr [rip + OriginalFuncs + 8 * 8] -VerFindFileA: - jmp qword ptr [rip + OriginalFuncs + 9 * 8] -VerFindFileW: - jmp qword ptr [rip + OriginalFuncs + 10 * 8] -VerInstallFileA: - jmp qword ptr [rip + OriginalFuncs + 11 * 8] -VerInstallFileW: - jmp qword ptr [rip + OriginalFuncs + 12 * 8] -VerLanguageNameA: - jmp qword ptr [rip + OriginalFuncs + 13 * 8] -VerLanguageNameW: - jmp qword ptr [rip + OriginalFuncs + 14 * 8] -VerQueryValueA: - jmp qword ptr [rip + OriginalFuncs + 15 * 8] -VerQueryValueW: - jmp qword ptr [rip + OriginalFuncs + 16 * 8] \ No newline at end of file diff --git a/MelonProxy/deps/version.x86.S b/MelonProxy/deps/version.x86.S deleted file mode 100644 index 859eac04f..000000000 --- a/MelonProxy/deps/version.x86.S +++ /dev/null @@ -1,52 +0,0 @@ -.globl GetFileVersionInfoA -.globl GetFileVersionInfoByHandle -.globl GetFileVersionInfoExA -.globl GetFileVersionInfoExW -.globl GetFileVersionInfoSizeA -.globl GetFileVersionInfoSizeExA -.globl GetFileVersionInfoSizeExW -.globl GetFileVersionInfoSizeW -.globl GetFileVersionInfoW -.globl VerFindFileA -.globl VerFindFileW -.globl VerInstallFileA -.globl VerInstallFileW -.globl VerLanguageNameA -.globl VerLanguageNameW -.globl VerQueryValueA -.globl VerQueryValueW - -GetFileVersionInfoA: - jmp ds:[_OriginalFuncs + 0 * 4] -GetFileVersionInfoByHandle: - jmp ds:[_OriginalFuncs + 1 * 4] -GetFileVersionInfoExA: - jmp ds:[_OriginalFuncs + 2 * 4] -GetFileVersionInfoExW: - jmp ds:[_OriginalFuncs + 3 * 4] -GetFileVersionInfoSizeA: - jmp ds:[_OriginalFuncs + 4 * 4] -GetFileVersionInfoSizeExA: - jmp ds:[_OriginalFuncs + 5 * 4] -GetFileVersionInfoSizeExW: - jmp ds:[_OriginalFuncs + 6 * 4] -GetFileVersionInfoSizeW: - jmp ds:[_OriginalFuncs + 7 * 4] -GetFileVersionInfoW: - jmp ds:[_OriginalFuncs + 4 * 4] -VerFindFileA: - jmp ds:[_OriginalFuncs + 9 * 4] -VerFindFileW: - jmp ds:[_OriginalFuncs + 10 * 4] -VerInstallFileA: - jmp ds:[_OriginalFuncs + 11 * 4] -VerInstallFileW: - jmp ds:[_OriginalFuncs + 12 * 4] -VerLanguageNameA: - jmp ds:[_OriginalFuncs + 13 * 4] -VerLanguageNameW: - jmp ds:[_OriginalFuncs + 14 * 4] -VerQueryValueA: - jmp ds:[_OriginalFuncs + 15 * 4] -VerQueryValueW: - jmp ds:[_OriginalFuncs + 16 * 4] \ No newline at end of file diff --git a/MelonProxy/deps/winhttp.x64.S b/MelonProxy/deps/winhttp.x64.S deleted file mode 100644 index d8c641824..000000000 --- a/MelonProxy/deps/winhttp.x64.S +++ /dev/null @@ -1,196 +0,0 @@ -.globl Private1 -.globl SvchostPushServiceGlobals -.globl WinHttpAddRequestHeaders -.globl WinHttpAutoProxySvcMain -.globl WinHttpCheckPlatform -.globl WinHttpCloseHandle -.globl WinHttpConnect -.globl WinHttpConnectionDeletePolicyEntries -.globl WinHttpConnectionDeleteProxyInfo -.globl WinHttpConnectionFreeNameList -.globl WinHttpConnectionFreeProxyInfo -.globl WinHttpConnectionFreeProxyList -.globl WinHttpConnectionGetNameList -.globl WinHttpConnectionGetProxyInfo -.globl WinHttpConnectionGetProxyList -.globl WinHttpConnectionSetPolicyEntries -.globl WinHttpConnectionSetProxyInfo -.globl WinHttpConnectionUpdateIfIndexTable -.globl WinHttpCrackUrl -.globl WinHttpCreateProxyResolver -.globl WinHttpCreateUrl -.globl WinHttpDetectAutoProxyConfigUrl -.globl WinHttpFreeProxyResult -.globl WinHttpFreeProxyResultEx -.globl WinHttpFreeProxySettings -.globl WinHttpGetDefaultProxyConfiguration -.globl WinHttpGetIEProxyConfigForCurrentUser -.globl WinHttpGetProxyForUrl -.globl WinHttpGetProxyForUrlEx -.globl WinHttpGetProxyForUrlEx2 -.globl WinHttpGetProxyForUrlHvsi -.globl WinHttpGetProxyResult -.globl WinHttpGetProxyResultEx -.globl WinHttpGetProxySettingsVersion -.globl WinHttpGetTunnelSocket -.globl WinHttpOpen -.globl WinHttpOpenRequest -.globl WinHttpPacJsWorkerMain -.globl WinHttpProbeConnectivity -.globl WinHttpQueryAuthSchemes -.globl WinHttpQueryDataAvailable -.globl WinHttpQueryHeaders -.globl WinHttpQueryOption -.globl WinHttpReadData -.globl WinHttpReadProxySettings -.globl WinHttpReadProxySettingsHvsi -.globl WinHttpReceiveResponse -.globl WinHttpResetAutoProxy -.globl WinHttpSaveProxyCredentials -.globl WinHttpSendRequest -.globl WinHttpSetCredentials -.globl WinHttpSetDefaultProxyConfiguration -.globl WinHttpSetOption -.globl WinHttpSetStatusCallback -.globl WinHttpSetTimeouts -.globl WinHttpTimeFromSystemTime -.globl WinHttpTimeToSystemTime -.globl WinHttpWebSocketClose -.globl WinHttpWebSocketCompleteUpgrade -.globl WinHttpWebSocketQueryCloseStatus -.globl WinHttpWebSocketReceive -.globl WinHttpWebSocketSend -.globl WinHttpWebSocketShutdown -.globl WinHttpWriteData -.globl WinHttpWriteProxySettings - -Private1: - jmp qword ptr [rip + OriginalFuncs + 0 * 8] -SvchostPushServiceGlobals: - jmp qword ptr [rip + OriginalFuncs + 1 * 8] -WinHttpAddRequestHeaders: - jmp qword ptr [rip + OriginalFuncs + 2 * 8] -WinHttpAutoProxySvcMain: - jmp qword ptr [rip + OriginalFuncs + 3 * 8] -WinHttpCheckPlatform: - jmp qword ptr [rip + OriginalFuncs + 4 * 8] -WinHttpCloseHandle: - jmp qword ptr [rip + OriginalFuncs + 5 * 8] -WinHttpConnect: - jmp qword ptr [rip + OriginalFuncs + 6 * 8] -WinHttpConnectionDeletePolicyEntries: - jmp qword ptr [rip + OriginalFuncs + 7 * 8] -WinHttpConnectionDeleteProxyInfo: - jmp qword ptr [rip + OriginalFuncs + 8 * 8] -WinHttpConnectionFreeNameList: - jmp qword ptr [rip + OriginalFuncs + 9 * 8] -WinHttpConnectionFreeProxyInfo: - jmp qword ptr [rip + OriginalFuncs + 10 * 8] -WinHttpConnectionFreeProxyList: - jmp qword ptr [rip + OriginalFuncs + 11 * 8] -WinHttpConnectionGetNameList: - jmp qword ptr [rip + OriginalFuncs + 12 * 8] -WinHttpConnectionGetProxyInfo: - jmp qword ptr [rip + OriginalFuncs + 13 * 8] -WinHttpConnectionGetProxyList: - jmp qword ptr [rip + OriginalFuncs + 14 * 8] -WinHttpConnectionSetPolicyEntries: - jmp qword ptr [rip + OriginalFuncs + 15 * 8] -WinHttpConnectionSetProxyInfo: - jmp qword ptr [rip + OriginalFuncs + 16 * 8] -WinHttpConnectionUpdateIfIndexTable: - jmp qword ptr [rip + OriginalFuncs + 17 * 8] -WinHttpCrackUrl: - jmp qword ptr [rip + OriginalFuncs + 18 * 8] -WinHttpCreateProxyResolver: - jmp qword ptr [rip + OriginalFuncs + 19 * 8] -WinHttpCreateUrl: - jmp qword ptr [rip + OriginalFuncs + 20 * 8] -WinHttpDetectAutoProxyConfigUrl: - jmp qword ptr [rip + OriginalFuncs + 21 * 8] -WinHttpFreeProxyResult: - jmp qword ptr [rip + OriginalFuncs + 22 * 8] -WinHttpFreeProxyResultEx: - jmp qword ptr [rip + OriginalFuncs + 23 * 8] -WinHttpFreeProxySettings: - jmp qword ptr [rip + OriginalFuncs + 24 * 8] -WinHttpGetDefaultProxyConfiguration: - jmp qword ptr [rip + OriginalFuncs + 25 * 8] -WinHttpGetIEProxyConfigForCurrentUser: - jmp qword ptr [rip + OriginalFuncs + 26 * 8] -WinHttpGetProxyForUrl: - jmp qword ptr [rip + OriginalFuncs + 27 * 8] -WinHttpGetProxyForUrlEx: - jmp qword ptr [rip + OriginalFuncs + 28 * 8] -WinHttpGetProxyForUrlEx2: - jmp qword ptr [rip + OriginalFuncs + 29 * 8] -WinHttpGetProxyForUrlHvsi: - jmp qword ptr [rip + OriginalFuncs + 30 * 8] -WinHttpGetProxyResult: - jmp qword ptr [rip + OriginalFuncs + 31 * 8] -WinHttpGetProxyResultEx: - jmp qword ptr [rip + OriginalFuncs + 32 * 8] -WinHttpGetProxySettingsVersion: - jmp qword ptr [rip + OriginalFuncs + 33 * 8] -WinHttpGetTunnelSocket: - jmp qword ptr [rip + OriginalFuncs + 34 * 8] -WinHttpOpen: - jmp qword ptr [rip + OriginalFuncs + 35 * 8] -WinHttpOpenRequest: - jmp qword ptr [rip + OriginalFuncs + 36 * 8] -WinHttpPacJsWorkerMain: - jmp qword ptr [rip + OriginalFuncs + 37 * 8] -WinHttpProbeConnectivity: - jmp qword ptr [rip + OriginalFuncs + 38 * 8] -WinHttpQueryAuthSchemes: - jmp qword ptr [rip + OriginalFuncs + 39 * 8] -WinHttpQueryDataAvailable: - jmp qword ptr [rip + OriginalFuncs + 40 * 8] -WinHttpQueryHeaders: - jmp qword ptr [rip + OriginalFuncs + 41 * 8] -WinHttpQueryOption: - jmp qword ptr [rip + OriginalFuncs + 42 * 8] -WinHttpReadData: - jmp qword ptr [rip + OriginalFuncs + 43 * 8] -WinHttpReadProxySettings: - jmp qword ptr [rip + OriginalFuncs + 44 * 8] -WinHttpReadProxySettingsHvsi: - jmp qword ptr [rip + OriginalFuncs + 45 * 8] -WinHttpReceiveResponse: - jmp qword ptr [rip + OriginalFuncs + 46 * 8] -WinHttpResetAutoProxy: - jmp qword ptr [rip + OriginalFuncs + 47 * 8] -WinHttpSaveProxyCredentials: - jmp qword ptr [rip + OriginalFuncs + 48 * 8] -WinHttpSendRequest: - jmp qword ptr [rip + OriginalFuncs + 49 * 8] -WinHttpSetCredentials: - jmp qword ptr [rip + OriginalFuncs + 50 * 8] -WinHttpSetDefaultProxyConfiguration: - jmp qword ptr [rip + OriginalFuncs + 51 * 8] -WinHttpSetOption: - jmp qword ptr [rip + OriginalFuncs + 52 * 8] -WinHttpSetStatusCallback: - jmp qword ptr [rip + OriginalFuncs + 53 * 8] -WinHttpSetTimeouts: - jmp qword ptr [rip + OriginalFuncs + 54 * 8] -WinHttpTimeFromSystemTime: - jmp qword ptr [rip + OriginalFuncs + 55 * 8] -WinHttpTimeToSystemTime: - jmp qword ptr [rip + OriginalFuncs + 56 * 8] -WinHttpWebSocketClose: - jmp qword ptr [rip + OriginalFuncs + 57 * 8] -WinHttpWebSocketCompleteUpgrade: - jmp qword ptr [rip + OriginalFuncs + 58 * 8] -WinHttpWebSocketQueryCloseStatus: - jmp qword ptr [rip + OriginalFuncs + 59 * 8] -WinHttpWebSocketReceive: - jmp qword ptr [rip + OriginalFuncs + 60 * 8] -WinHttpWebSocketSend: - jmp qword ptr [rip + OriginalFuncs + 61 * 8] -WinHttpWebSocketShutdown: - jmp qword ptr [rip + OriginalFuncs + 62 * 8] -WinHttpWriteData: - jmp qword ptr [rip + OriginalFuncs + 63 * 8] -WinHttpWriteProxySettings: - jmp qword ptr [rip + OriginalFuncs + 64 * 8] diff --git a/MelonProxy/deps/winhttp.x86.S b/MelonProxy/deps/winhttp.x86.S deleted file mode 100644 index 0227c742b..000000000 --- a/MelonProxy/deps/winhttp.x86.S +++ /dev/null @@ -1,260 +0,0 @@ -.globl Private1 -.globl SvchostPushServiceGlobals -.globl WinHttpAddRequestHeaders -.globl WinHttpAutoProxySvcMain -.globl WinHttpCheckPlatform -.globl WinHttpCloseHandle -.globl WinHttpConnect -.globl WinHttpConnectionDeletePolicyEntries -.globl WinHttpConnectionDeleteProxyInfo -.globl WinHttpConnectionFreeNameList -.globl WinHttpConnectionFreeProxyInfo -.globl WinHttpConnectionFreeProxyList -.globl WinHttpConnectionGetNameList -.globl WinHttpConnectionGetProxyInfo -.globl WinHttpConnectionGetProxyList -.globl WinHttpConnectionSetPolicyEntries -.globl WinHttpConnectionSetProxyInfo -.globl WinHttpConnectionUpdateIfIndexTable -.globl WinHttpCrackUrl -.globl WinHttpCreateProxyResolver -.globl WinHttpCreateUrl -.globl WinHttpDetectAutoProxyConfigUrl -.globl WinHttpFreeProxyResult -.globl WinHttpFreeProxyResultEx -.globl WinHttpFreeProxySettings -.globl WinHttpGetDefaultProxyConfiguration -.globl WinHttpGetIEProxyConfigForCurrentUser -.globl WinHttpGetProxyForUrl -.globl WinHttpGetProxyForUrlEx -.globl WinHttpGetProxyForUrlEx2 -.globl WinHttpGetProxyForUrlHvsi -.globl WinHttpGetProxyResult -.globl WinHttpGetProxyResultEx -.globl WinHttpGetProxySettingsVersion -.globl WinHttpGetTunnelSocket -.globl WinHttpOpen -.globl WinHttpOpenRequest -.globl WinHttpPacJsWorkerMain -.globl WinHttpProbeConnectivity -.globl WinHttpQueryAuthSchemes -.globl WinHttpQueryDataAvailable -.globl WinHttpQueryHeaders -.globl WinHttpQueryOption -.globl WinHttpReadData -.globl WinHttpReadProxySettings -.globl WinHttpReadProxySettingsHvsi -.globl WinHttpReceiveResponse -.globl WinHttpResetAutoProxy -.globl WinHttpSaveProxyCredentials -.globl WinHttpSendRequest -.globl WinHttpSetCredentials -.globl WinHttpSetDefaultProxyConfiguration -.globl WinHttpSetOption -.globl WinHttpSetStatusCallback -.globl WinHttpSetTimeouts -.globl WinHttpTimeFromSystemTime -.globl WinHttpTimeToSystemTime -.globl WinHttpWebSocketClose -.globl WinHttpWebSocketCompleteUpgrade -.globl WinHttpWebSocketQueryCloseStatus -.globl WinHttpWebSocketReceive -.globl WinHttpWebSocketSend -.globl WinHttpWebSocketShutdown -.globl WinHttpWriteData -.globl WinHttpWriteProxySettings - -Private1: - jmp ds:[_OriginalFuncs + 0 * 4] - -SvchostPushServiceGlobals: - jmp ds:[_OriginalFuncs + 1 * 4] - -WinHttpAddRequestHeaders: - jmp ds:[_OriginalFuncs + 2 * 4] - -WinHttpAutoProxySvcMain: - jmp ds:[_OriginalFuncs + 3 * 4] - -WinHttpCheckPlatform: - jmp ds:[_OriginalFuncs + 4 * 4] - -WinHttpCloseHandle: - jmp ds:[_OriginalFuncs + 5 * 4] - -WinHttpConnect: - jmp ds:[_OriginalFuncs + 6 * 4] - -WinHttpConnectionDeletePolicyEntries: - jmp ds:[_OriginalFuncs + 7 * 4] - -WinHttpConnectionDeleteProxyInfo: - jmp ds:[_OriginalFuncs + 4 * 4] - -WinHttpConnectionFreeNameList: - jmp ds:[_OriginalFuncs + 9 * 4] - -WinHttpConnectionFreeProxyInfo: - jmp ds:[_OriginalFuncs + 10 * 4] - -WinHttpConnectionFreeProxyList: - jmp ds:[_OriginalFuncs + 11 * 4] - -WinHttpConnectionGetNameList: - jmp ds:[_OriginalFuncs + 12 * 4] - -WinHttpConnectionGetProxyInfo: - jmp ds:[_OriginalFuncs + 13 * 4] - -WinHttpConnectionGetProxyList: - jmp ds:[_OriginalFuncs + 14 * 4] - -WinHttpConnectionSetPolicyEntries: - jmp ds:[_OriginalFuncs + 15 * 4] - -WinHttpConnectionSetProxyInfo: - jmp ds:[_OriginalFuncs + 16 * 4] - -WinHttpConnectionUpdateIfIndexTable: - jmp ds:[_OriginalFuncs + 17 * 4] - -WinHttpCrackUrl: - jmp ds:[_OriginalFuncs + 14 * 4] - -WinHttpCreateProxyResolver: - jmp ds:[_OriginalFuncs + 19 * 4] - -WinHttpCreateUrl: - jmp ds:[_OriginalFuncs + 20 * 4] - -WinHttpDetectAutoProxyConfigUrl: - jmp ds:[_OriginalFuncs + 21 * 4] - -WinHttpFreeProxyResult: - jmp ds:[_OriginalFuncs + 22 * 4] - -WinHttpFreeProxyResultEx: - jmp ds:[_OriginalFuncs + 23 * 4] - -WinHttpFreeProxySettings: - jmp ds:[_OriginalFuncs + 24 * 4] - -WinHttpGetDefaultProxyConfiguration: - jmp ds:[_OriginalFuncs + 25 * 4] - -WinHttpGetIEProxyConfigForCurrentUser: - jmp ds:[_OriginalFuncs + 26 * 4] - -WinHttpGetProxyForUrl: - jmp ds:[_OriginalFuncs + 27 * 4] - -WinHttpGetProxyForUrlEx: - jmp ds:[_OriginalFuncs + 24 * 4] - -WinHttpGetProxyForUrlEx2: - jmp ds:[_OriginalFuncs + 29 * 4] - -WinHttpGetProxyForUrlHvsi: - jmp ds:[_OriginalFuncs + 30 * 4] - -WinHttpGetProxyResult: - jmp ds:[_OriginalFuncs + 31 * 4] - -WinHttpGetProxyResultEx: - jmp ds:[_OriginalFuncs + 32 * 4] - -WinHttpGetProxySettingsVersion: - jmp ds:[_OriginalFuncs + 33 * 4] - -WinHttpGetTunnelSocket: - jmp ds:[_OriginalFuncs + 34 * 4] - -WinHttpOpen: - jmp ds:[_OriginalFuncs + 35 * 4] - -WinHttpOpenRequest: - jmp ds:[_OriginalFuncs + 36 * 4] - -WinHttpPacJsWorkerMain: - jmp ds:[_OriginalFuncs + 37 * 4] - -WinHttpProbeConnectivity: - jmp ds:[_OriginalFuncs + 34 * 4] - -WinHttpQueryAuthSchemes: - jmp ds:[_OriginalFuncs + 39 * 4] - -WinHttpQueryDataAvailable: - jmp ds:[_OriginalFuncs + 40 * 4] - -WinHttpQueryHeaders: - jmp ds:[_OriginalFuncs + 41 * 4] - -WinHttpQueryOption: - jmp ds:[_OriginalFuncs + 42 * 4] - -WinHttpReadData: - jmp ds:[_OriginalFuncs + 43 * 4] - -WinHttpReadProxySettings: - jmp ds:[_OriginalFuncs + 44 * 4] - -WinHttpReadProxySettingsHvsi: - jmp ds:[_OriginalFuncs + 45 * 4] - -WinHttpReceiveResponse: - jmp ds:[_OriginalFuncs + 46 * 4] - -WinHttpResetAutoProxy: - jmp ds:[_OriginalFuncs + 47 * 4] - -WinHttpSaveProxyCredentials: - jmp ds:[_OriginalFuncs + 44 * 4] - -WinHttpSendRequest: - jmp ds:[_OriginalFuncs + 49 * 4] - -WinHttpSetCredentials: - jmp ds:[_OriginalFuncs + 50 * 4] - -WinHttpSetDefaultProxyConfiguration: - jmp ds:[_OriginalFuncs + 51 * 4] - -WinHttpSetOption: - jmp ds:[_OriginalFuncs + 52 * 4] - -WinHttpSetStatusCallback: - jmp ds:[_OriginalFuncs + 53 * 4] - -WinHttpSetTimeouts: - jmp ds:[_OriginalFuncs + 54 * 4] - -WinHttpTimeFromSystemTime: - jmp ds:[_OriginalFuncs + 55 * 4] - -WinHttpTimeToSystemTime: - jmp ds:[_OriginalFuncs + 56 * 4] - -WinHttpWebSocketClose: - jmp ds:[_OriginalFuncs + 57 * 4] - -WinHttpWebSocketCompleteUpgrade: - jmp ds:[_OriginalFuncs + 54 * 4] - -WinHttpWebSocketQueryCloseStatus: - jmp ds:[_OriginalFuncs + 59 * 4] - -WinHttpWebSocketReceive: - jmp ds:[_OriginalFuncs + 60 * 4] - -WinHttpWebSocketSend: - jmp ds:[_OriginalFuncs + 61 * 4] - -WinHttpWebSocketShutdown: - jmp ds:[_OriginalFuncs + 62 * 4] - -WinHttpWriteData: - jmp ds:[_OriginalFuncs + 63 * 4] - -WinHttpWriteProxySettings: - jmp ds:[_OriginalFuncs + 64 * 4] diff --git a/MelonProxy/deps/winmm.x64.S b/MelonProxy/deps/winmm.x64.S deleted file mode 100644 index 2cd1fb993..000000000 --- a/MelonProxy/deps/winmm.x64.S +++ /dev/null @@ -1,724 +0,0 @@ -.globl CloseDriver -.globl DefDriverProc -.globl DriverCallback -.globl DrvGetModuleHandle -.globl GetDriverModuleHandle -.globl OpenDriver -.globl PlaySound -.globl PlaySoundA -.globl PlaySoundW -.globl SendDriverMessage -.globl WOWAppExit -.globl auxGetDevCapsA -.globl auxGetDevCapsW -.globl auxGetNumDevs -.globl auxGetVolume -.globl auxOutMessage -.globl auxSetVolume -.globl joyConfigChanged -.globl joyGetDevCapsA -.globl joyGetDevCapsW -.globl joyGetNumDevs -.globl joyGetPos -.globl joyGetPosEx -.globl joyGetThreshold -.globl joyReleaseCapture -.globl joySetCapture -.globl joySetThreshold -.globl mciDriverNotify -.globl mciDriverYield -.globl mciExecute -.globl mciFreeCommandResource -.globl mciGetCreatorTask -.globl mciGetDeviceIDA -.globl mciGetDeviceIDFromElementIDA -.globl mciGetDeviceIDFromElementIDW -.globl mciGetDeviceIDW -.globl mciGetDriverData -.globl mciGetErrorStringA -.globl mciGetErrorStringW -.globl mciGetYieldProc -.globl mciLoadCommandResource -.globl mciSendCommandA -.globl mciSendCommandW -.globl mciSendStringA -.globl mciSendStringW -.globl mciSetDriverData -.globl mciSetYieldProc -.globl midiConnect -.globl midiDisconnect -.globl midiInAddBuffer -.globl midiInClose -.globl midiInGetDevCapsA -.globl midiInGetDevCapsW -.globl midiInGetErrorTextA -.globl midiInGetErrorTextW -.globl midiInGetID -.globl midiInGetNumDevs -.globl midiInMessage -.globl midiInOpen -.globl midiInPrepareHeader -.globl midiInReset -.globl midiInStart -.globl midiInStop -.globl midiInUnprepareHeader -.globl midiOutCacheDrumPatches -.globl midiOutCachePatches -.globl midiOutClose -.globl midiOutGetDevCapsA -.globl midiOutGetDevCapsW -.globl midiOutGetErrorTextA -.globl midiOutGetErrorTextW -.globl midiOutGetID -.globl midiOutGetNumDevs -.globl midiOutGetVolume -.globl midiOutLongMsg -.globl midiOutMessage -.globl midiOutOpen -.globl midiOutPrepareHeader -.globl midiOutReset -.globl midiOutSetVolume -.globl midiOutShortMsg -.globl midiOutUnprepareHeader -.globl midiStreamClose -.globl midiStreamOpen -.globl midiStreamOut -.globl midiStreamPause -.globl midiStreamPosition -.globl midiStreamProperty -.globl midiStreamRestart -.globl midiStreamStop -.globl mixerClose -.globl mixerGetControlDetailsA -.globl mixerGetControlDetailsW -.globl mixerGetDevCapsA -.globl mixerGetDevCapsW -.globl mixerGetID -.globl mixerGetLineControlsA -.globl mixerGetLineControlsW -.globl mixerGetLineInfoA -.globl mixerGetLineInfoW -.globl mixerGetNumDevs -.globl mixerMessage -.globl mixerOpen -.globl mixerSetControlDetails -.globl mmDrvInstall -.globl mmGetCurrentTask -.globl mmTaskBlock -.globl mmTaskCreate -.globl mmTaskSignal -.globl mmTaskYield -.globl mmioAdvance -.globl mmioAscend -.globl mmioClose -.globl mmioCreateChunk -.globl mmioDescend -.globl mmioFlush -.globl mmioGetInfo -.globl mmioInstallIOProcA -.globl mmioInstallIOProcW -.globl mmioOpenA -.globl mmioOpenW -.globl mmioRead -.globl mmioRenameA -.globl mmioRenameW -.globl mmioSeek -.globl mmioSendMessage -.globl mmioSetBuffer -.globl mmioSetInfo -.globl mmioStringToFOURCCA -.globl mmioStringToFOURCCW -.globl mmioWrite -.globl mmsystemGetVersion -.globl sndPlaySoundA -.globl sndPlaySoundW -.globl timeBeginPeriod -.globl timeEndPeriod -.globl timeGetDevCaps -.globl timeGetSystemTime -.globl timeGetTime -.globl timeKillEvent -.globl timeSetEvent -.globl waveInAddBuffer -.globl waveInClose -.globl waveInGetDevCapsA -.globl waveInGetDevCapsW -.globl waveInGetErrorTextA -.globl waveInGetErrorTextW -.globl waveInGetID -.globl waveInGetNumDevs -.globl waveInGetPosition -.globl waveInMessage -.globl waveInOpen -.globl waveInPrepareHeader -.globl waveInReset -.globl waveInStart -.globl waveInStop -.globl waveInUnprepareHeader -.globl waveOutBreakLoop -.globl waveOutClose -.globl waveOutGetDevCapsA -.globl waveOutGetDevCapsW -.globl waveOutGetErrorTextA -.globl waveOutGetErrorTextW -.globl waveOutGetID -.globl waveOutGetNumDevs -.globl waveOutGetPitch -.globl waveOutGetPlaybackRate -.globl waveOutGetPosition -.globl waveOutGetVolume -.globl waveOutMessage -.globl waveOutOpen -.globl waveOutPause -.globl waveOutPrepareHeader -.globl waveOutReset -.globl waveOutRestart -.globl waveOutSetPitch -.globl waveOutSetPlaybackRate -.globl waveOutSetVolume -.globl waveOutUnprepareHeader -.globl waveOutWrite -.globl ExportByOrdinal2 - -CloseDriver: - jmp qword ptr [rip + OriginalFuncs + 0 * 8] - -DefDriverProc: - jmp qword ptr [rip + OriginalFuncs + 1 * 8] - -DriverCallback: - jmp qword ptr [rip + OriginalFuncs + 2 * 8] - -DrvGetModuleHandle: - jmp qword ptr [rip + OriginalFuncs + 3 * 8] - -GetDriverModuleHandle: - jmp qword ptr [rip + OriginalFuncs + 4 * 8] - -OpenDriver: - jmp qword ptr [rip + OriginalFuncs + 5 * 8] - -PlaySound: - jmp qword ptr [rip + OriginalFuncs + 6 * 8] - -PlaySoundA: - jmp qword ptr [rip + OriginalFuncs + 7 * 8] - -PlaySoundW: - jmp qword ptr [rip + OriginalFuncs + 8 * 8] - -SendDriverMessage: - jmp qword ptr [rip + OriginalFuncs + 9 * 8] - -WOWAppExit: - jmp qword ptr [rip + OriginalFuncs + 10 * 8] - -auxGetDevCapsA: - jmp qword ptr [rip + OriginalFuncs + 11 * 8] - -auxGetDevCapsW: - jmp qword ptr [rip + OriginalFuncs + 12 * 8] - -auxGetNumDevs: - jmp qword ptr [rip + OriginalFuncs + 13 * 8] - -auxGetVolume: - jmp qword ptr [rip + OriginalFuncs + 14 * 8] - -auxOutMessage: - jmp qword ptr [rip + OriginalFuncs + 15 * 8] - -auxSetVolume: - jmp qword ptr [rip + OriginalFuncs + 16 * 8] - -joyConfigChanged: - jmp qword ptr [rip + OriginalFuncs + 17 * 8] - -joyGetDevCapsA: - jmp qword ptr [rip + OriginalFuncs + 18 * 8] - -joyGetDevCapsW: - jmp qword ptr [rip + OriginalFuncs + 19 * 8] - -joyGetNumDevs: - jmp qword ptr [rip + OriginalFuncs + 20 * 8] - -joyGetPos: - jmp qword ptr [rip + OriginalFuncs + 21 * 8] - -joyGetPosEx: - jmp qword ptr [rip + OriginalFuncs + 22 * 8] - -joyGetThreshold: - jmp qword ptr [rip + OriginalFuncs + 23 * 8] - -joyReleaseCapture: - jmp qword ptr [rip + OriginalFuncs + 24 * 8] - -joySetCapture: - jmp qword ptr [rip + OriginalFuncs + 25 * 8] - -joySetThreshold: - jmp qword ptr [rip + OriginalFuncs + 26 * 8] - -mciDriverNotify: - jmp qword ptr [rip + OriginalFuncs + 27 * 8] - -mciDriverYield: - jmp qword ptr [rip + OriginalFuncs + 28 * 8] - -mciExecute: - jmp qword ptr [rip + OriginalFuncs + 29 * 8] - -mciFreeCommandResource: - jmp qword ptr [rip + OriginalFuncs + 30 * 8] - -mciGetCreatorTask: - jmp qword ptr [rip + OriginalFuncs + 31 * 8] - -mciGetDeviceIDA: - jmp qword ptr [rip + OriginalFuncs + 32 * 8] - -mciGetDeviceIDFromElementIDA: - jmp qword ptr [rip + OriginalFuncs + 33 * 8] - -mciGetDeviceIDFromElementIDW: - jmp qword ptr [rip + OriginalFuncs + 34 * 8] - -mciGetDeviceIDW: - jmp qword ptr [rip + OriginalFuncs + 35 * 8] - -mciGetDriverData: - jmp qword ptr [rip + OriginalFuncs + 36 * 8] - -mciGetErrorStringA: - jmp qword ptr [rip + OriginalFuncs + 37 * 8] - -mciGetErrorStringW: - jmp qword ptr [rip + OriginalFuncs + 38 * 8] - -mciGetYieldProc: - jmp qword ptr [rip + OriginalFuncs + 39 * 8] - -mciLoadCommandResource: - jmp qword ptr [rip + OriginalFuncs + 40 * 8] - -mciSendCommandA: - jmp qword ptr [rip + OriginalFuncs + 41 * 8] - -mciSendCommandW: - jmp qword ptr [rip + OriginalFuncs + 42 * 8] - -mciSendStringA: - jmp qword ptr [rip + OriginalFuncs + 43 * 8] - -mciSendStringW: - jmp qword ptr [rip + OriginalFuncs + 44 * 8] - -mciSetDriverData: - jmp qword ptr [rip + OriginalFuncs + 45 * 8] - -mciSetYieldProc: - jmp qword ptr [rip + OriginalFuncs + 46 * 8] - -midiConnect: - jmp qword ptr [rip + OriginalFuncs + 47 * 8] - -midiDisconnect: - jmp qword ptr [rip + OriginalFuncs + 48 * 8] - -midiInAddBuffer: - jmp qword ptr [rip + OriginalFuncs + 49 * 8] - -midiInClose: - jmp qword ptr [rip + OriginalFuncs + 50 * 8] - -midiInGetDevCapsA: - jmp qword ptr [rip + OriginalFuncs + 51 * 8] - -midiInGetDevCapsW: - jmp qword ptr [rip + OriginalFuncs + 52 * 8] - -midiInGetErrorTextA: - jmp qword ptr [rip + OriginalFuncs + 53 * 8] - -midiInGetErrorTextW: - jmp qword ptr [rip + OriginalFuncs + 54 * 8] - -midiInGetID: - jmp qword ptr [rip + OriginalFuncs + 55 * 8] - -midiInGetNumDevs: - jmp qword ptr [rip + OriginalFuncs + 56 * 8] - -midiInMessage: - jmp qword ptr [rip + OriginalFuncs + 57 * 8] - -midiInOpen: - jmp qword ptr [rip + OriginalFuncs + 58 * 8] - -midiInPrepareHeader: - jmp qword ptr [rip + OriginalFuncs + 59 * 8] - -midiInReset: - jmp qword ptr [rip + OriginalFuncs + 60 * 8] - -midiInStart: - jmp qword ptr [rip + OriginalFuncs + 61 * 8] - -midiInStop: - jmp qword ptr [rip + OriginalFuncs + 62 * 8] - -midiInUnprepareHeader: - jmp qword ptr [rip + OriginalFuncs + 63 * 8] - -midiOutCacheDrumPatches: - jmp qword ptr [rip + OriginalFuncs + 64 * 8] - -midiOutCachePatches: - jmp qword ptr [rip + OriginalFuncs + 65 * 8] - -midiOutClose: - jmp qword ptr [rip + OriginalFuncs + 66 * 8] - -midiOutGetDevCapsA: - jmp qword ptr [rip + OriginalFuncs + 67 * 8] - -midiOutGetDevCapsW: - jmp qword ptr [rip + OriginalFuncs + 68 * 8] - -midiOutGetErrorTextA: - jmp qword ptr [rip + OriginalFuncs + 69 * 8] - -midiOutGetErrorTextW: - jmp qword ptr [rip + OriginalFuncs + 70 * 8] - -midiOutGetID: - jmp qword ptr [rip + OriginalFuncs + 71 * 8] - -midiOutGetNumDevs: - jmp qword ptr [rip + OriginalFuncs + 72 * 8] - -midiOutGetVolume: - jmp qword ptr [rip + OriginalFuncs + 73 * 8] - -midiOutLongMsg: - jmp qword ptr [rip + OriginalFuncs + 74 * 8] - -midiOutMessage: - jmp qword ptr [rip + OriginalFuncs + 75 * 8] - -midiOutOpen: - jmp qword ptr [rip + OriginalFuncs + 76 * 8] - -midiOutPrepareHeader: - jmp qword ptr [rip + OriginalFuncs + 77 * 8] - -midiOutReset: - jmp qword ptr [rip + OriginalFuncs + 78 * 8] - -midiOutSetVolume: - jmp qword ptr [rip + OriginalFuncs + 79 * 8] - -midiOutShortMsg: - jmp qword ptr [rip + OriginalFuncs + 80 * 8] - -midiOutUnprepareHeader: - jmp qword ptr [rip + OriginalFuncs + 81 * 8] - -midiStreamClose: - jmp qword ptr [rip + OriginalFuncs + 82 * 8] - -midiStreamOpen: - jmp qword ptr [rip + OriginalFuncs + 83 * 8] - -midiStreamOut: - jmp qword ptr [rip + OriginalFuncs + 84 * 8] - -midiStreamPause: - jmp qword ptr [rip + OriginalFuncs + 85 * 8] - -midiStreamPosition: - jmp qword ptr [rip + OriginalFuncs + 86 * 8] - -midiStreamProperty: - jmp qword ptr [rip + OriginalFuncs + 87 * 8] - -midiStreamRestart: - jmp qword ptr [rip + OriginalFuncs + 88 * 8] - -midiStreamStop: - jmp qword ptr [rip + OriginalFuncs + 89 * 8] - -mixerClose: - jmp qword ptr [rip + OriginalFuncs + 90 * 8] - -mixerGetControlDetailsA: - jmp qword ptr [rip + OriginalFuncs + 91 * 8] - -mixerGetControlDetailsW: - jmp qword ptr [rip + OriginalFuncs + 92 * 8] - -mixerGetDevCapsA: - jmp qword ptr [rip + OriginalFuncs + 93 * 8] - -mixerGetDevCapsW: - jmp qword ptr [rip + OriginalFuncs + 94 * 8] - -mixerGetID: - jmp qword ptr [rip + OriginalFuncs + 95 * 8] - -mixerGetLineControlsA: - jmp qword ptr [rip + OriginalFuncs + 96 * 8] - -mixerGetLineControlsW: - jmp qword ptr [rip + OriginalFuncs + 97 * 8] - -mixerGetLineInfoA: - jmp qword ptr [rip + OriginalFuncs + 98 * 8] - -mixerGetLineInfoW: - jmp qword ptr [rip + OriginalFuncs + 99 * 8] - -mixerGetNumDevs: - jmp qword ptr [rip + OriginalFuncs + 100 * 8] - -mixerMessage: - jmp qword ptr [rip + OriginalFuncs + 101 * 8] - -mixerOpen: - jmp qword ptr [rip + OriginalFuncs + 102 * 8] - -mixerSetControlDetails: - jmp qword ptr [rip + OriginalFuncs + 103 * 8] - -mmDrvInstall: - jmp qword ptr [rip + OriginalFuncs + 104 * 8] - -mmGetCurrentTask: - jmp qword ptr [rip + OriginalFuncs + 105 * 8] - -mmTaskBlock: - jmp qword ptr [rip + OriginalFuncs + 106 * 8] - -mmTaskCreate: - jmp qword ptr [rip + OriginalFuncs + 107 * 8] - -mmTaskSignal: - jmp qword ptr [rip + OriginalFuncs + 108 * 8] - -mmTaskYield: - jmp qword ptr [rip + OriginalFuncs + 109 * 8] - -mmioAdvance: - jmp qword ptr [rip + OriginalFuncs + 110 * 8] - -mmioAscend: - jmp qword ptr [rip + OriginalFuncs + 111 * 8] - -mmioClose: - jmp qword ptr [rip + OriginalFuncs + 112 * 8] - -mmioCreateChunk: - jmp qword ptr [rip + OriginalFuncs + 113 * 8] - -mmioDescend: - jmp qword ptr [rip + OriginalFuncs + 114 * 8] - -mmioFlush: - jmp qword ptr [rip + OriginalFuncs + 115 * 8] - -mmioGetInfo: - jmp qword ptr [rip + OriginalFuncs + 116 * 8] - -mmioInstallIOProcA: - jmp qword ptr [rip + OriginalFuncs + 117 * 8] - -mmioInstallIOProcW: - jmp qword ptr [rip + OriginalFuncs + 118 * 8] - -mmioOpenA: - jmp qword ptr [rip + OriginalFuncs + 119 * 8] - -mmioOpenW: - jmp qword ptr [rip + OriginalFuncs + 120 * 8] - -mmioRead: - jmp qword ptr [rip + OriginalFuncs + 121 * 8] - -mmioRenameA: - jmp qword ptr [rip + OriginalFuncs + 122 * 8] - -mmioRenameW: - jmp qword ptr [rip + OriginalFuncs + 123 * 8] - -mmioSeek: - jmp qword ptr [rip + OriginalFuncs + 124 * 8] - -mmioSendMessage: - jmp qword ptr [rip + OriginalFuncs + 125 * 8] - -mmioSetBuffer: - jmp qword ptr [rip + OriginalFuncs + 126 * 8] - -mmioSetInfo: - jmp qword ptr [rip + OriginalFuncs + 127 * 8] - -mmioStringToFOURCCA: - jmp qword ptr [rip + OriginalFuncs + 128 * 8] - -mmioStringToFOURCCW: - jmp qword ptr [rip + OriginalFuncs + 129 * 8] - -mmioWrite: - jmp qword ptr [rip + OriginalFuncs + 130 * 8] - -mmsystemGetVersion: - jmp qword ptr [rip + OriginalFuncs + 131 * 8] - -sndPlaySoundA: - jmp qword ptr [rip + OriginalFuncs + 132 * 8] - -sndPlaySoundW: - jmp qword ptr [rip + OriginalFuncs + 133 * 8] - -timeBeginPeriod: - jmp qword ptr [rip + OriginalFuncs + 134 * 8] - -timeEndPeriod: - jmp qword ptr [rip + OriginalFuncs + 135 * 8] - -timeGetDevCaps: - jmp qword ptr [rip + OriginalFuncs + 136 * 8] - -timeGetSystemTime: - jmp qword ptr [rip + OriginalFuncs + 137 * 8] - -timeGetTime: - jmp qword ptr [rip + OriginalFuncs + 138 * 8] - -timeKillEvent: - jmp qword ptr [rip + OriginalFuncs + 139 * 8] - -timeSetEvent: - jmp qword ptr [rip + OriginalFuncs + 140 * 8] - -waveInAddBuffer: - jmp qword ptr [rip + OriginalFuncs + 141 * 8] - -waveInClose: - jmp qword ptr [rip + OriginalFuncs + 142 * 8] - -waveInGetDevCapsA: - jmp qword ptr [rip + OriginalFuncs + 143 * 8] - -waveInGetDevCapsW: - jmp qword ptr [rip + OriginalFuncs + 144 * 8] - -waveInGetErrorTextA: - jmp qword ptr [rip + OriginalFuncs + 145 * 8] - -waveInGetErrorTextW: - jmp qword ptr [rip + OriginalFuncs + 146 * 8] - -waveInGetID: - jmp qword ptr [rip + OriginalFuncs + 147 * 8] - -waveInGetNumDevs: - jmp qword ptr [rip + OriginalFuncs + 148 * 8] - -waveInGetPosition: - jmp qword ptr [rip + OriginalFuncs + 149 * 8] - -waveInMessage: - jmp qword ptr [rip + OriginalFuncs + 150 * 8] - -waveInOpen: - jmp qword ptr [rip + OriginalFuncs + 151 * 8] - -waveInPrepareHeader: - jmp qword ptr [rip + OriginalFuncs + 152 * 8] - -waveInReset: - jmp qword ptr [rip + OriginalFuncs + 153 * 8] - -waveInStart: - jmp qword ptr [rip + OriginalFuncs + 154 * 8] - -waveInStop: - jmp qword ptr [rip + OriginalFuncs + 155 * 8] - -waveInUnprepareHeader: - jmp qword ptr [rip + OriginalFuncs + 156 * 8] - -waveOutBreakLoop: - jmp qword ptr [rip + OriginalFuncs + 157 * 8] - -waveOutClose: - jmp qword ptr [rip + OriginalFuncs + 158 * 8] - -waveOutGetDevCapsA: - jmp qword ptr [rip + OriginalFuncs + 159 * 8] - -waveOutGetDevCapsW: - jmp qword ptr [rip + OriginalFuncs + 160 * 8] - -waveOutGetErrorTextA: - jmp qword ptr [rip + OriginalFuncs + 161 * 8] - -waveOutGetErrorTextW: - jmp qword ptr [rip + OriginalFuncs + 162 * 8] - -waveOutGetID: - jmp qword ptr [rip + OriginalFuncs + 163 * 8] - -waveOutGetNumDevs: - jmp qword ptr [rip + OriginalFuncs + 164 * 8] - -waveOutGetPitch: - jmp qword ptr [rip + OriginalFuncs + 165 * 8] - -waveOutGetPlaybackRate: - jmp qword ptr [rip + OriginalFuncs + 166 * 8] - -waveOutGetPosition: - jmp qword ptr [rip + OriginalFuncs + 167 * 8] - -waveOutGetVolume: - jmp qword ptr [rip + OriginalFuncs + 168 * 8] - -waveOutMessage: - jmp qword ptr [rip + OriginalFuncs + 169 * 8] - -waveOutOpen: - jmp qword ptr [rip + OriginalFuncs + 170 * 8] - -waveOutPause: - jmp qword ptr [rip + OriginalFuncs + 171 * 8] - -waveOutPrepareHeader: - jmp qword ptr [rip + OriginalFuncs + 172 * 8] - -waveOutReset: - jmp qword ptr [rip + OriginalFuncs + 173 * 8] - -waveOutRestart: - jmp qword ptr [rip + OriginalFuncs + 174 * 8] - -waveOutSetPitch: - jmp qword ptr [rip + OriginalFuncs + 175 * 8] - -waveOutSetPlaybackRate: - jmp qword ptr [rip + OriginalFuncs + 176 * 8] - -waveOutSetVolume: - jmp qword ptr [rip + OriginalFuncs + 177 * 8] - -waveOutUnprepareHeader: - jmp qword ptr [rip + OriginalFuncs + 178 * 8] - -waveOutWrite: - jmp qword ptr [rip + OriginalFuncs + 179 * 8] - -ExportByOrdinal2: - jmp qword ptr [rip + OriginalFuncs + 180 * 8] \ No newline at end of file diff --git a/MelonProxy/deps/winmm.x86.S b/MelonProxy/deps/winmm.x86.S deleted file mode 100644 index 3eb2bbfb0..000000000 --- a/MelonProxy/deps/winmm.x86.S +++ /dev/null @@ -1,724 +0,0 @@ -.globl CloseDriver -.globl DefDriverProc -.globl DriverCallback -.globl DrvGetModuleHandle -.globl GetDriverModuleHandle -.globl OpenDriver -.globl PlaySound -.globl PlaySoundA -.globl PlaySoundW -.globl SendDriverMessage -.globl WOWAppExit -.globl auxGetDevCapsA -.globl auxGetDevCapsW -.globl auxGetNumDevs -.globl auxGetVolume -.globl auxOutMessage -.globl auxSetVolume -.globl joyConfigChanged -.globl joyGetDevCapsA -.globl joyGetDevCapsW -.globl joyGetNumDevs -.globl joyGetPos -.globl joyGetPosEx -.globl joyGetThreshold -.globl joyReleaseCapture -.globl joySetCapture -.globl joySetThreshold -.globl mciDriverNotify -.globl mciDriverYield -.globl mciExecute -.globl mciFreeCommandResource -.globl mciGetCreatorTask -.globl mciGetDeviceIDA -.globl mciGetDeviceIDFromElementIDA -.globl mciGetDeviceIDFromElementIDW -.globl mciGetDeviceIDW -.globl mciGetDriverData -.globl mciGetErrorStringA -.globl mciGetErrorStringW -.globl mciGetYieldProc -.globl mciLoadCommandResource -.globl mciSendCommandA -.globl mciSendCommandW -.globl mciSendStringA -.globl mciSendStringW -.globl mciSetDriverData -.globl mciSetYieldProc -.globl midiConnect -.globl midiDisconnect -.globl midiInAddBuffer -.globl midiInClose -.globl midiInGetDevCapsA -.globl midiInGetDevCapsW -.globl midiInGetErrorTextA -.globl midiInGetErrorTextW -.globl midiInGetID -.globl midiInGetNumDevs -.globl midiInMessage -.globl midiInOpen -.globl midiInPrepareHeader -.globl midiInReset -.globl midiInStart -.globl midiInStop -.globl midiInUnprepareHeader -.globl midiOutCacheDrumPatches -.globl midiOutCachePatches -.globl midiOutClose -.globl midiOutGetDevCapsA -.globl midiOutGetDevCapsW -.globl midiOutGetErrorTextA -.globl midiOutGetErrorTextW -.globl midiOutGetID -.globl midiOutGetNumDevs -.globl midiOutGetVolume -.globl midiOutLongMsg -.globl midiOutMessage -.globl midiOutOpen -.globl midiOutPrepareHeader -.globl midiOutReset -.globl midiOutSetVolume -.globl midiOutShortMsg -.globl midiOutUnprepareHeader -.globl midiStreamClose -.globl midiStreamOpen -.globl midiStreamOut -.globl midiStreamPause -.globl midiStreamPosition -.globl midiStreamProperty -.globl midiStreamRestart -.globl midiStreamStop -.globl mixerClose -.globl mixerGetControlDetailsA -.globl mixerGetControlDetailsW -.globl mixerGetDevCapsA -.globl mixerGetDevCapsW -.globl mixerGetID -.globl mixerGetLineControlsA -.globl mixerGetLineControlsW -.globl mixerGetLineInfoA -.globl mixerGetLineInfoW -.globl mixerGetNumDevs -.globl mixerMessage -.globl mixerOpen -.globl mixerSetControlDetails -.globl mmDrvInstall -.globl mmGetCurrentTask -.globl mmTaskBlock -.globl mmTaskCreate -.globl mmTaskSignal -.globl mmTaskYield -.globl mmioAdvance -.globl mmioAscend -.globl mmioClose -.globl mmioCreateChunk -.globl mmioDescend -.globl mmioFlush -.globl mmioGetInfo -.globl mmioInstallIOProcA -.globl mmioInstallIOProcW -.globl mmioOpenA -.globl mmioOpenW -.globl mmioRead -.globl mmioRenameA -.globl mmioRenameW -.globl mmioSeek -.globl mmioSendMessage -.globl mmioSetBuffer -.globl mmioSetInfo -.globl mmioStringToFOURCCA -.globl mmioStringToFOURCCW -.globl mmioWrite -.globl mmsystemGetVersion -.globl sndPlaySoundA -.globl sndPlaySoundW -.globl timeBeginPeriod -.globl timeEndPeriod -.globl timeGetDevCaps -.globl timeGetSystemTime -.globl timeGetTime -.globl timeKillEvent -.globl timeSetEvent -.globl waveInAddBuffer -.globl waveInClose -.globl waveInGetDevCapsA -.globl waveInGetDevCapsW -.globl waveInGetErrorTextA -.globl waveInGetErrorTextW -.globl waveInGetID -.globl waveInGetNumDevs -.globl waveInGetPosition -.globl waveInMessage -.globl waveInOpen -.globl waveInPrepareHeader -.globl waveInReset -.globl waveInStart -.globl waveInStop -.globl waveInUnprepareHeader -.globl waveOutBreakLoop -.globl waveOutClose -.globl waveOutGetDevCapsA -.globl waveOutGetDevCapsW -.globl waveOutGetErrorTextA -.globl waveOutGetErrorTextW -.globl waveOutGetID -.globl waveOutGetNumDevs -.globl waveOutGetPitch -.globl waveOutGetPlaybackRate -.globl waveOutGetPosition -.globl waveOutGetVolume -.globl waveOutMessage -.globl waveOutOpen -.globl waveOutPause -.globl waveOutPrepareHeader -.globl waveOutReset -.globl waveOutRestart -.globl waveOutSetPitch -.globl waveOutSetPlaybackRate -.globl waveOutSetVolume -.globl waveOutUnprepareHeader -.globl waveOutWrite -.globl ExportByOrdinal2 - -CloseDriver: - jmp ds:[_OriginalFuncs + 0 * 4] - -DefDriverProc: - jmp ds:[_OriginalFuncs + 1 * 4] - -DriverCallback: - jmp ds:[_OriginalFuncs + 2 * 4] - -DrvGetModuleHandle: - jmp ds:[_OriginalFuncs + 3 * 4] - -GetDriverModuleHandle: - jmp ds:[_OriginalFuncs + 4 * 4] - -OpenDriver: - jmp ds:[_OriginalFuncs + 5 * 4] - -PlaySound: - jmp ds:[_OriginalFuncs + 6 * 4] - -PlaySoundA: - jmp ds:[_OriginalFuncs + 7 * 4] - -PlaySoundW: - jmp ds:[_OriginalFuncs + 4 * 4] - -SendDriverMessage: - jmp ds:[_OriginalFuncs + 9 * 4] - -WOWAppExit: - jmp ds:[_OriginalFuncs + 10 * 4] - -auxGetDevCapsA: - jmp ds:[_OriginalFuncs + 11 * 4] - -auxGetDevCapsW: - jmp ds:[_OriginalFuncs + 12 * 4] - -auxGetNumDevs: - jmp ds:[_OriginalFuncs + 13 * 4] - -auxGetVolume: - jmp ds:[_OriginalFuncs + 14 * 4] - -auxOutMessage: - jmp ds:[_OriginalFuncs + 15 * 4] - -auxSetVolume: - jmp ds:[_OriginalFuncs + 16 * 4] - -joyConfigChanged: - jmp ds:[_OriginalFuncs + 17 * 4] - -joyGetDevCapsA: - jmp ds:[_OriginalFuncs + 14 * 4] - -joyGetDevCapsW: - jmp ds:[_OriginalFuncs + 19 * 4] - -joyGetNumDevs: - jmp ds:[_OriginalFuncs + 20 * 4] - -joyGetPos: - jmp ds:[_OriginalFuncs + 21 * 4] - -joyGetPosEx: - jmp ds:[_OriginalFuncs + 22 * 4] - -joyGetThreshold: - jmp ds:[_OriginalFuncs + 23 * 4] - -joyReleaseCapture: - jmp ds:[_OriginalFuncs + 24 * 4] - -joySetCapture: - jmp ds:[_OriginalFuncs + 25 * 4] - -joySetThreshold: - jmp ds:[_OriginalFuncs + 26 * 4] - -mciDriverNotify: - jmp ds:[_OriginalFuncs + 27 * 4] - -mciDriverYield: - jmp ds:[_OriginalFuncs + 24 * 4] - -mciExecute: - jmp ds:[_OriginalFuncs + 29 * 4] - -mciFreeCommandResource: - jmp ds:[_OriginalFuncs + 30 * 4] - -mciGetCreatorTask: - jmp ds:[_OriginalFuncs + 31 * 4] - -mciGetDeviceIDA: - jmp ds:[_OriginalFuncs + 32 * 4] - -mciGetDeviceIDFromElementIDA: - jmp ds:[_OriginalFuncs + 33 * 4] - -mciGetDeviceIDFromElementIDW: - jmp ds:[_OriginalFuncs + 34 * 4] - -mciGetDeviceIDW: - jmp ds:[_OriginalFuncs + 35 * 4] - -mciGetDriverData: - jmp ds:[_OriginalFuncs + 36 * 4] - -mciGetErrorStringA: - jmp ds:[_OriginalFuncs + 37 * 4] - -mciGetErrorStringW: - jmp ds:[_OriginalFuncs + 34 * 4] - -mciGetYieldProc: - jmp ds:[_OriginalFuncs + 39 * 4] - -mciLoadCommandResource: - jmp ds:[_OriginalFuncs + 40 * 4] - -mciSendCommandA: - jmp ds:[_OriginalFuncs + 41 * 4] - -mciSendCommandW: - jmp ds:[_OriginalFuncs + 42 * 4] - -mciSendStringA: - jmp ds:[_OriginalFuncs + 43 * 4] - -mciSendStringW: - jmp ds:[_OriginalFuncs + 44 * 4] - -mciSetDriverData: - jmp ds:[_OriginalFuncs + 45 * 4] - -mciSetYieldProc: - jmp ds:[_OriginalFuncs + 46 * 4] - -midiConnect: - jmp ds:[_OriginalFuncs + 47 * 4] - -midiDisconnect: - jmp ds:[_OriginalFuncs + 44 * 4] - -midiInAddBuffer: - jmp ds:[_OriginalFuncs + 49 * 4] - -midiInClose: - jmp ds:[_OriginalFuncs + 50 * 4] - -midiInGetDevCapsA: - jmp ds:[_OriginalFuncs + 51 * 4] - -midiInGetDevCapsW: - jmp ds:[_OriginalFuncs + 52 * 4] - -midiInGetErrorTextA: - jmp ds:[_OriginalFuncs + 53 * 4] - -midiInGetErrorTextW: - jmp ds:[_OriginalFuncs + 54 * 4] - -midiInGetID: - jmp ds:[_OriginalFuncs + 55 * 4] - -midiInGetNumDevs: - jmp ds:[_OriginalFuncs + 56 * 4] - -midiInMessage: - jmp ds:[_OriginalFuncs + 57 * 4] - -midiInOpen: - jmp ds:[_OriginalFuncs + 54 * 4] - -midiInPrepareHeader: - jmp ds:[_OriginalFuncs + 59 * 4] - -midiInReset: - jmp ds:[_OriginalFuncs + 60 * 4] - -midiInStart: - jmp ds:[_OriginalFuncs + 61 * 4] - -midiInStop: - jmp ds:[_OriginalFuncs + 62 * 4] - -midiInUnprepareHeader: - jmp ds:[_OriginalFuncs + 63 * 4] - -midiOutCacheDrumPatches: - jmp ds:[_OriginalFuncs + 64 * 4] - -midiOutCachePatches: - jmp ds:[_OriginalFuncs + 65 * 4] - -midiOutClose: - jmp ds:[_OriginalFuncs + 66 * 4] - -midiOutGetDevCapsA: - jmp ds:[_OriginalFuncs + 67 * 4] - -midiOutGetDevCapsW: - jmp ds:[_OriginalFuncs + 64 * 4] - -midiOutGetErrorTextA: - jmp ds:[_OriginalFuncs + 69 * 4] - -midiOutGetErrorTextW: - jmp ds:[_OriginalFuncs + 70 * 4] - -midiOutGetID: - jmp ds:[_OriginalFuncs + 71 * 4] - -midiOutGetNumDevs: - jmp ds:[_OriginalFuncs + 72 * 4] - -midiOutGetVolume: - jmp ds:[_OriginalFuncs + 73 * 4] - -midiOutLongMsg: - jmp ds:[_OriginalFuncs + 74 * 4] - -midiOutMessage: - jmp ds:[_OriginalFuncs + 75 * 4] - -midiOutOpen: - jmp ds:[_OriginalFuncs + 76 * 4] - -midiOutPrepareHeader: - jmp ds:[_OriginalFuncs + 77 * 4] - -midiOutReset: - jmp ds:[_OriginalFuncs + 74 * 4] - -midiOutSetVolume: - jmp ds:[_OriginalFuncs + 79 * 4] - -midiOutShortMsg: - jmp ds:[_OriginalFuncs + 40 * 4] - -midiOutUnprepareHeader: - jmp ds:[_OriginalFuncs + 41 * 4] - -midiStreamClose: - jmp ds:[_OriginalFuncs + 42 * 4] - -midiStreamOpen: - jmp ds:[_OriginalFuncs + 43 * 4] - -midiStreamOut: - jmp ds:[_OriginalFuncs + 44 * 4] - -midiStreamPause: - jmp ds:[_OriginalFuncs + 45 * 4] - -midiStreamPosition: - jmp ds:[_OriginalFuncs + 46 * 4] - -midiStreamProperty: - jmp ds:[_OriginalFuncs + 47 * 4] - -midiStreamRestart: - jmp ds:[_OriginalFuncs + 44 * 4] - -midiStreamStop: - jmp ds:[_OriginalFuncs + 49 * 4] - -mixerClose: - jmp ds:[_OriginalFuncs + 90 * 4] - -mixerGetControlDetailsA: - jmp ds:[_OriginalFuncs + 91 * 4] - -mixerGetControlDetailsW: - jmp ds:[_OriginalFuncs + 92 * 4] - -mixerGetDevCapsA: - jmp ds:[_OriginalFuncs + 93 * 4] - -mixerGetDevCapsW: - jmp ds:[_OriginalFuncs + 94 * 4] - -mixerGetID: - jmp ds:[_OriginalFuncs + 95 * 4] - -mixerGetLineControlsA: - jmp ds:[_OriginalFuncs + 96 * 4] - -mixerGetLineControlsW: - jmp ds:[_OriginalFuncs + 97 * 4] - -mixerGetLineInfoA: - jmp ds:[_OriginalFuncs + 94 * 4] - -mixerGetLineInfoW: - jmp ds:[_OriginalFuncs + 99 * 4] - -mixerGetNumDevs: - jmp ds:[_OriginalFuncs + 100 * 4] - -mixerMessage: - jmp ds:[_OriginalFuncs + 101 * 4] - -mixerOpen: - jmp ds:[_OriginalFuncs + 102 * 4] - -mixerSetControlDetails: - jmp ds:[_OriginalFuncs + 103 * 4] - -mmDrvInstall: - jmp ds:[_OriginalFuncs + 104 * 4] - -mmGetCurrentTask: - jmp ds:[_OriginalFuncs + 105 * 4] - -mmTaskBlock: - jmp ds:[_OriginalFuncs + 106 * 4] - -mmTaskCreate: - jmp ds:[_OriginalFuncs + 107 * 4] - -mmTaskSignal: - jmp ds:[_OriginalFuncs + 104 * 4] - -mmTaskYield: - jmp ds:[_OriginalFuncs + 109 * 4] - -mmioAdvance: - jmp ds:[_OriginalFuncs + 110 * 4] - -mmioAscend: - jmp ds:[_OriginalFuncs + 111 * 4] - -mmioClose: - jmp ds:[_OriginalFuncs + 112 * 4] - -mmioCreateChunk: - jmp ds:[_OriginalFuncs + 113 * 4] - -mmioDescend: - jmp ds:[_OriginalFuncs + 114 * 4] - -mmioFlush: - jmp ds:[_OriginalFuncs + 115 * 4] - -mmioGetInfo: - jmp ds:[_OriginalFuncs + 116 * 4] - -mmioInstallIOProcA: - jmp ds:[_OriginalFuncs + 117 * 4] - -mmioInstallIOProcW: - jmp ds:[_OriginalFuncs + 114 * 4] - -mmioOpenA: - jmp ds:[_OriginalFuncs + 119 * 4] - -mmioOpenW: - jmp ds:[_OriginalFuncs + 120 * 4] - -mmioRead: - jmp ds:[_OriginalFuncs + 121 * 4] - -mmioRenameA: - jmp ds:[_OriginalFuncs + 122 * 4] - -mmioRenameW: - jmp ds:[_OriginalFuncs + 123 * 4] - -mmioSeek: - jmp ds:[_OriginalFuncs + 124 * 4] - -mmioSendMessage: - jmp ds:[_OriginalFuncs + 125 * 4] - -mmioSetBuffer: - jmp ds:[_OriginalFuncs + 126 * 4] - -mmioSetInfo: - jmp ds:[_OriginalFuncs + 127 * 4] - -mmioStringToFOURCCA: - jmp ds:[_OriginalFuncs + 124 * 4] - -mmioStringToFOURCCW: - jmp ds:[_OriginalFuncs + 129 * 4] - -mmioWrite: - jmp ds:[_OriginalFuncs + 130 * 4] - -mmsystemGetVersion: - jmp ds:[_OriginalFuncs + 131 * 4] - -sndPlaySoundA: - jmp ds:[_OriginalFuncs + 132 * 4] - -sndPlaySoundW: - jmp ds:[_OriginalFuncs + 133 * 4] - -timeBeginPeriod: - jmp ds:[_OriginalFuncs + 134 * 4] - -timeEndPeriod: - jmp ds:[_OriginalFuncs + 135 * 4] - -timeGetDevCaps: - jmp ds:[_OriginalFuncs + 136 * 4] - -timeGetSystemTime: - jmp ds:[_OriginalFuncs + 137 * 4] - -timeGetTime: - jmp ds:[_OriginalFuncs + 134 * 4] - -timeKillEvent: - jmp ds:[_OriginalFuncs + 139 * 4] - -timeSetEvent: - jmp ds:[_OriginalFuncs + 140 * 4] - -waveInAddBuffer: - jmp ds:[_OriginalFuncs + 141 * 4] - -waveInClose: - jmp ds:[_OriginalFuncs + 142 * 4] - -waveInGetDevCapsA: - jmp ds:[_OriginalFuncs + 143 * 4] - -waveInGetDevCapsW: - jmp ds:[_OriginalFuncs + 144 * 4] - -waveInGetErrorTextA: - jmp ds:[_OriginalFuncs + 145 * 4] - -waveInGetErrorTextW: - jmp ds:[_OriginalFuncs + 146 * 4] - -waveInGetID: - jmp ds:[_OriginalFuncs + 147 * 4] - -waveInGetNumDevs: - jmp ds:[_OriginalFuncs + 144 * 4] - -waveInGetPosition: - jmp ds:[_OriginalFuncs + 149 * 4] - -waveInMessage: - jmp ds:[_OriginalFuncs + 150 * 4] - -waveInOpen: - jmp ds:[_OriginalFuncs + 151 * 4] - -waveInPrepareHeader: - jmp ds:[_OriginalFuncs + 152 * 4] - -waveInReset: - jmp ds:[_OriginalFuncs + 153 * 4] - -waveInStart: - jmp ds:[_OriginalFuncs + 154 * 4] - -waveInStop: - jmp ds:[_OriginalFuncs + 155 * 4] - -waveInUnprepareHeader: - jmp ds:[_OriginalFuncs + 156 * 4] - -waveOutBreakLoop: - jmp ds:[_OriginalFuncs + 157 * 4] - -waveOutClose: - jmp ds:[_OriginalFuncs + 154 * 4] - -waveOutGetDevCapsA: - jmp ds:[_OriginalFuncs + 159 * 4] - -waveOutGetDevCapsW: - jmp ds:[_OriginalFuncs + 160 * 4] - -waveOutGetErrorTextA: - jmp ds:[_OriginalFuncs + 161 * 4] - -waveOutGetErrorTextW: - jmp ds:[_OriginalFuncs + 162 * 4] - -waveOutGetID: - jmp ds:[_OriginalFuncs + 163 * 4] - -waveOutGetNumDevs: - jmp ds:[_OriginalFuncs + 164 * 4] - -waveOutGetPitch: - jmp ds:[_OriginalFuncs + 165 * 4] - -waveOutGetPlaybackRate: - jmp ds:[_OriginalFuncs + 166 * 4] - -waveOutGetPosition: - jmp ds:[_OriginalFuncs + 167 * 4] - -waveOutGetVolume: - jmp ds:[_OriginalFuncs + 164 * 4] - -waveOutMessage: - jmp ds:[_OriginalFuncs + 169 * 4] - -waveOutOpen: - jmp ds:[_OriginalFuncs + 170 * 4] - -waveOutPause: - jmp ds:[_OriginalFuncs + 171 * 4] - -waveOutPrepareHeader: - jmp ds:[_OriginalFuncs + 172 * 4] - -waveOutReset: - jmp ds:[_OriginalFuncs + 173 * 4] - -waveOutRestart: - jmp ds:[_OriginalFuncs + 174 * 4] - -waveOutSetPitch: - jmp ds:[_OriginalFuncs + 175 * 4] - -waveOutSetPlaybackRate: - jmp ds:[_OriginalFuncs + 176 * 4] - -waveOutSetVolume: - jmp ds:[_OriginalFuncs + 177 * 4] - -waveOutUnprepareHeader: - jmp ds:[_OriginalFuncs + 174 * 4] - -waveOutWrite: - jmp ds:[_OriginalFuncs + 179 * 4] - -ExportByOrdinal2: - jmp ds:[_OriginalFuncs + 140 * 4] \ No newline at end of file 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 index 8b7e796b7..62e61bc72 100644 --- a/MelonProxy/src/lib.rs +++ b/MelonProxy/src/lib.rs @@ -1,42 +1,180 @@ -#![feature(fn_ptr_trait)] -#![feature(lazy_cell)] +//! 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)] -#![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))] - -#[cfg(target_os = "windows")] -pub use windows::Win32::Foundation::HINSTANCE; - -#[cfg(target_os = "windows")] -pub mod proxy; - -pub mod utils; -pub mod core; - -/// this function will get called by our proxy macro. See MelonProxy-sys -#[cfg_attr( - not(target_os = "windows"), - ctor::ctor -)] -#[cfg_attr( - target_os = "windows", - melon_proxy_sys::proxy -)] -#[allow(dead_code)] -fn main() { +#![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}, + }, +}; + + +// 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(); + +/// 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); + internal_failure!("Failed to initialize MelonLoader: {}", e) }); -} \ No newline at end of file +} + + +/// 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()) +} + +/// Called when the thread is spawned +#[cfg(target_os = "windows")] +unsafe extern "system" fn init(_: *mut c_void) -> u32 { + use std::path::PathBuf; + + 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 path = PathBuf::from("C:\\Windows\\System32").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/MelonProxy/src/proxy/exports.rs b/MelonProxy/src/proxy/exports.rs deleted file mode 100644 index 800650230..000000000 --- a/MelonProxy/src/proxy/exports.rs +++ /dev/null @@ -1,316 +0,0 @@ -//! all the logic for exporting the functions. - -use std::{ - arch::global_asm, - marker::FnPtr, - ptr::null_mut, - sync::{LazyLock, Mutex}, io, -}; - -use super::hinstance_ext::ProxyDll; -use libloading::Library; -use windows::Win32::Foundation::HINSTANCE; - -// These arrays are accessed by assembly code to jump to the given function. -// TODO: once dynamically sized arrays are implemented, consider starting this off at 17 and dynamically resizing as needed -#[no_mangle] -static mut OriginalFuncs: [*const (); 181] = [null_mut(); 181]; - -// These assembly files define the Windows DLL functions that we're proxying, they are exported through a linked .def file. -#[cfg(target_arch = "x86_64")] -global_asm!(include_str!("../../deps/version.x64.S")); -#[cfg(target_arch = "x86")] -global_asm!(include_str!("../../deps/version.x86.S")); - -#[cfg(target_arch = "x86_64")] -global_asm!(include_str!("../../deps/winhttp.x64.S")); -#[cfg(target_arch = "x86")] -global_asm!(include_str!("../../deps/winhttp.x86.S")); - -#[cfg(target_arch = "x86_64")] -global_asm!(include_str!("../../deps/winmm.x64.S")); -#[cfg(target_arch = "x86")] -global_asm!(include_str!("../../deps/winmm.x86.S")); - -const EXPORTS_VERSION: [&[u8]; 17] = [ - b"GetFileVersionInfoA", - b"GetFileVersionInfoByHandle", - b"GetFileVersionInfoExA", - b"GetFileVersionInfoExW", - b"GetFileVersionInfoSizeA", - b"GetFileVersionInfoSizeExA", - b"GetFileVersionInfoSizeExW", - b"GetFileVersionInfoSizeW", - b"GetFileVersionInfoW", - b"VerFindFileA", - b"VerFindFileW", - b"VerInstallFileA", - b"VerInstallFileW", - b"VerLanguageNameA", - b"VerLanguageNameW", - b"VerQueryValueA", - b"VerQueryValueW", -]; - -const EXPORTS_WINHTTP: [&[u8]; 27] = [ - b"EmptyWorkingSet", - b"EnumDeviceDrivers", - b"EnumPageFilesA", - b"EnumPageFilesW", - b"EnumProcessModules", - b"EnumProcessModulesEx", - b"EnumProcesses", - b"GetDeviceDriverBaseNameA", - b"GetDeviceDriverBaseNameW", - b"GetDeviceDriverFileNameA", - b"GetDeviceDriverFileNameW", - b"GetMappedFileNameA", - b"GetMappedFileNameW", - b"GetModuleBaseNameA", - b"GetModuleBaseNameW", - b"GetModuleFileNameExA", - b"GetModuleFileNameExW", - b"GetModuleInformation", - b"GetPerformanceInfo", - b"GetProcessImageFileNameA", - b"GetProcessImageFileNameW", - b"GetProcessMemoryInfo", - b"GetWsChanges", - b"GetWsChangesEx", - b"InitializeProcessForWsWatch", - b"QueryWorkingSet", - b"QueryWorkingSetEx", -]; - -const EXPORTS_WINMM: [&[u8]; 181] = [ - b"CloseDriver", - b"DefDriverProc", - b"DriverCallback", - b"DrvGetModuleHandle", - b"GetDriverModuleHandle", - b"OpenDriver", - b"PlaySound", - b"PlaySoundA", - b"PlaySoundW", - b"SendDriverMessage", - b"WOWAppExit", - b"auxGetDevCapsA", - b"auxGetDevCapsW", - b"auxGetNumDevs", - b"auxGetVolume", - b"auxOutMessage", - b"auxSetVolume", - b"joyConfigChanged", - b"joyGetDevCapsA", - b"joyGetDevCapsW", - b"joyGetNumDevs", - b"joyGetPos", - b"joyGetPosEx", - b"joyGetThreshold", - b"joyReleaseCapture", - b"joySetCapture", - b"joySetThreshold", - b"mciDriverNotify", - b"mciDriverYield", - b"mciExecute", - b"mciFreeCommandResource", - b"mciGetCreatorTask", - b"mciGetDeviceIDA", - b"mciGetDeviceIDFromElementIDA", - b"mciGetDeviceIDFromElementIDW", - b"mciGetDeviceIDW", - b"mciGetDriverData", - b"mciGetErrorStringA", - b"mciGetErrorStringW", - b"mciGetYieldProc", - b"mciLoadCommandResource", - b"mciSendCommandA", - b"mciSendCommandW", - b"mciSendStringA", - b"mciSendStringW", - b"mciSetDriverData", - b"mciSetYieldProc", - b"midiConnect", - b"midiDisconnect", - b"midiInAddBuffer", - b"midiInClose", - b"midiInGetDevCapsA", - b"midiInGetDevCapsW", - b"midiInGetErrorTextA", - b"midiInGetErrorTextW", - b"midiInGetID", - b"midiInGetNumDevs", - b"midiInMessage", - b"midiInOpen", - b"midiInPrepareHeader", - b"midiInReset", - b"midiInStart", - b"midiInStop", - b"midiInUnprepareHeader", - b"midiOutCacheDrumPatches", - b"midiOutCachePatches", - b"midiOutClose", - b"midiOutGetDevCapsA", - b"midiOutGetDevCapsW", - b"midiOutGetErrorTextA", - b"midiOutGetErrorTextW", - b"midiOutGetID", - b"midiOutGetNumDevs", - b"midiOutGetVolume", - b"midiOutLongMsg", - b"midiOutMessage", - b"midiOutOpen", - b"midiOutPrepareHeader", - b"midiOutReset", - b"midiOutSetVolume", - b"midiOutShortMsg", - b"midiOutUnprepareHeader", - b"midiStreamClose", - b"midiStreamOpen", - b"midiStreamOut", - b"midiStreamPause", - b"midiStreamPosition", - b"midiStreamProperty", - b"midiStreamRestart", - b"midiStreamStop", - b"mixerClose", - b"mixerGetControlDetailsA", - b"mixerGetControlDetailsW", - b"mixerGetDevCapsA", - b"mixerGetDevCapsW", - b"mixerGetID", - b"mixerGetLineControlsA", - b"mixerGetLineControlsW", - b"mixerGetLineInfoA", - b"mixerGetLineInfoW", - b"mixerGetNumDevs", - b"mixerMessage", - b"mixerOpen", - b"mixerSetControlDetails", - b"mmDrvInstall", - b"mmGetCurrentTask", - b"mmTaskBlock", - b"mmTaskCreate", - b"mmTaskSignal", - b"mmTaskYield", - b"mmioAdvance", - b"mmioAscend", - b"mmioClose", - b"mmioCreateChunk", - b"mmioDescend", - b"mmioFlush", - b"mmioGetInfo", - b"mmioInstallIOProcA", - b"mmioInstallIOProcW", - b"mmioOpenA", - b"mmioOpenW", - b"mmioRead", - b"mmioRenameA", - b"mmioRenameW", - b"mmioSeek", - b"mmioSendMessage", - b"mmioSetBuffer", - b"mmioSetInfo", - b"mmioStringToFOURCCA", - b"mmioStringToFOURCCW", - b"mmioWrite", - b"mmsystemGetVersion", - b"sndPlaySoundA", - b"sndPlaySoundW", - b"timeBeginPeriod", - b"timeEndPeriod", - b"timeGetDevCaps", - b"timeGetSystemTime", - b"timeGetTime", - b"timeKillEvent", - b"timeSetEvent", - b"waveInAddBuffer", - b"waveInClose", - b"waveInGetDevCapsA", - b"waveInGetDevCapsW", - b"waveInGetErrorTextA", - b"waveInGetErrorTextW", - b"waveInGetID", - b"waveInGetNumDevs", - b"waveInGetPosition", - b"waveInMessage", - b"waveInOpen", - b"waveInPrepareHeader", - b"waveInReset", - b"waveInStart", - b"waveInStop", - b"waveInUnprepareHeader", - b"waveOutBreakLoop", - b"waveOutClose", - b"waveOutGetDevCapsA", - b"waveOutGetDevCapsW", - b"waveOutGetErrorTextA", - b"waveOutGetErrorTextW", - b"waveOutGetID", - b"waveOutGetNumDevs", - b"waveOutGetPitch", - b"waveOutGetPlaybackRate", - b"waveOutGetPosition", - b"waveOutGetVolume", - b"waveOutMessage", - b"waveOutOpen", - b"waveOutPause", - b"waveOutPrepareHeader", - b"waveOutReset", - b"waveOutRestart", - b"waveOutSetPitch", - b"waveOutSetPlaybackRate", - b"waveOutSetVolume", - b"waveOutUnprepareHeader", - b"waveOutWrite", - b"ExportByOrdinal2", -]; - -// we have to statically store the original library here, because if it gets dropped, the function pointers we get out of it become invalid. -pub static ORIGINAL: LazyLock>> = LazyLock::new(|| Mutex::new(None)); - -/// this function gets called by the #[proxy] macro in our entrypoint. -pub fn initialize(module: HINSTANCE) -> Result<(), io::Error> { - let INVALID_HANDLE: io::Error = io::Error::new(io::ErrorKind::InvalidInput, "Invalid module handle"); - let INVALID_FILE_NAME: io::Error = io::Error::new(io::ErrorKind::InvalidInput, "Invalid file name"); - let POISONED_LOCK: io::Error = io::Error::new(io::ErrorKind::Other, "Poisoned lock"); - - if module.is_invalid() { - return Err(INVALID_HANDLE); - } - - let name = module.get_file_name()?; - let original = module.load_original()?; - - let exports = match name.as_str() { - "version.dll" => EXPORTS_VERSION.to_vec(), - "winhttp.dll" => EXPORTS_WINHTTP.to_vec(), - "winmm.dll" => EXPORTS_WINMM.to_vec(), - _ => return Err(INVALID_FILE_NAME), - }; - - for (i, export) in exports.iter().enumerate() { - unsafe { - OriginalFuncs[i] = get_maybe(&original, export); - } - } - - //store the library so it doesn't get unloaded - let orig = ORIGINAL.try_lock(); - if orig.is_err() { - return Err(POISONED_LOCK); - } - - *orig.unwrap() = Some(original); - - Ok(()) -} - -unsafe fn get_maybe(lib: &Library, name: &[u8]) -> *const () { - let func = lib.get::(name); - - match func.is_err() { - false => func.unwrap().addr(), - true => null_mut(), - } -} diff --git a/MelonProxy/src/proxy/hinstance_ext.rs b/MelonProxy/src/proxy/hinstance_ext.rs deleted file mode 100644 index d7348d0d1..000000000 --- a/MelonProxy/src/proxy/hinstance_ext.rs +++ /dev/null @@ -1,62 +0,0 @@ -use std::{io, path::Path}; - -use super::windows_ext::get_module_path; -use libloading::Library; -use windows::Win32::Foundation::HINSTANCE; - -pub trait ProxyDll { - fn get_file_name(&self) -> Result; - fn is_compatible(&self) -> Result; - fn load_original(&self) -> Result; -} - -impl ProxyDll for HINSTANCE { - fn get_file_name(&self) -> Result { - let path = get_module_path(*self)?; - - let file_name = path - .file_name() - .ok_or(io::Error::new( - io::ErrorKind::NotFound, - "Failed to get File Name", - ))? - .to_str() - .ok_or(io::Error::new( - io::ErrorKind::NotFound, - "Failed to get File Name", - ))?; - - Ok(file_name.to_lowercase().to_string()) - } - - fn is_compatible(&self) -> Result { - let file_name = self.get_file_name()?; - - Ok(file_name.eq("version.dll") || file_name.eq("winhttp.dll") || file_name.eq("winmm.dll")) - } - - fn load_original(&self) -> Result { - - let INVALID_FILE_NAME: io::Error = - io::Error::new(io::ErrorKind::NotFound, "Invalid File Name"); - let LIBRARY_NOT_FOUND: io::Error = - io::Error::new(io::ErrorKind::NotFound, "Failed to load original Proxy DLL"); - if !self.is_compatible()? { - return Err(INVALID_FILE_NAME); - } - - let name = self.get_file_name()?; - let path = Path::new("C:\\Windows\\System32").join(name); - - if !path.exists() { - return Err(LIBRARY_NOT_FOUND); - } - - let lib = unsafe { Library::new(path) }; - - match lib { - Ok(lib) => Ok(lib), - Err(_) => Err(LIBRARY_NOT_FOUND), - } - } -} diff --git a/MelonProxy/src/proxy/mod.rs b/MelonProxy/src/proxy/mod.rs deleted file mode 100644 index ca08762df..000000000 --- a/MelonProxy/src/proxy/mod.rs +++ /dev/null @@ -1,3 +0,0 @@ -pub mod exports; -pub mod hinstance_ext; -pub mod windows_ext; \ No newline at end of file diff --git a/MelonProxy/src/proxy/windows_ext.rs b/MelonProxy/src/proxy/windows_ext.rs deleted file mode 100644 index c9ccb6e05..000000000 --- a/MelonProxy/src/proxy/windows_ext.rs +++ /dev/null @@ -1,23 +0,0 @@ -use std::{io, path::PathBuf}; - -use windows::Win32::{ - Foundation::{HINSTANCE, MAX_PATH}, - System::LibraryLoader::GetModuleFileNameW, -}; - -pub fn get_module_path(module: HINSTANCE) -> Result { - let mut path = [0u16; MAX_PATH as usize]; - - let len = unsafe { GetModuleFileNameW(module, &mut path) }; - - if len <= 0 { - return Err(io::Error::new( - io::ErrorKind::NotFound, - "Failed to get File Name", - )); - } - - let str = String::from_utf16_lossy(&path[..len as usize]); - - Ok(PathBuf::from(str)) -} From 9b3f7aae1e23bac9cdbb3b04b97521103233fbd9 Mon Sep 17 00:00:00 2001 From: Sarah Date: Thu, 4 Jan 2024 07:20:22 +0100 Subject: [PATCH 10/12] install llvm --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 777ccf7cf..7b3367f7b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -107,7 +107,7 @@ jobs: run: cargo install cargo-xwin - name: install dev dependencies shell: bash - run: sudo apt-get install libgtk-3-dev mingw-w64 binutils-mingw-w64 wine + run: sudo apt-get install libgtk-3-dev mingw-w64 binutils-mingw-w64 wine llvm - name: Build Rust Release | Linux - x64 shell: bash run: cargo build --target x86_64-unknown-linux-gnu --release From 1b2508698967123e2fddc8aa40e244896924f11e Mon Sep 17 00:00:00 2001 From: Sarah Date: Thu, 4 Jan 2024 08:11:36 +0100 Subject: [PATCH 11/12] xwin_arch env var for cross-arch compile --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7b3367f7b..1f961b0e0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -122,10 +122,10 @@ jobs: run: cargo xwin build --package Bootstrap --target x86_64-pc-windows-msvc - name: Build Bootstrap Release | Windows - x86 shell: bash - run: cargo xwin build --package Bootstrap --target i686-pc-windows-msvc --release + run: XWIN_ARCH=x86 cargo xwin build --package Bootstrap --target i686-pc-windows-msvc --release - name: Build Bootstrap Debug | Windows - x86 shell: bash - run: cargo xwin build --package Bootstrap --target i686-pc-windows-msvc + run: XWIN_ARCH=x86 cargo xwin build --package Bootstrap --target i686-pc-windows-msvc - name: Build Proxy Release | Windows - x64 shell: bash run: cargo build --package MelonProxy --target x86_64-pc-windows-gnu --release From 97130964b09ae1249472e747ae84b85d834c4ae5 Mon Sep 17 00:00:00 2001 From: Sarah Date: Thu, 4 Jan 2024 08:23:32 +0100 Subject: [PATCH 12/12] Fix build.yml --- .github/workflows/build.yml | 51 ++----------------------------------- 1 file changed, 2 insertions(+), 49 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1f961b0e0..eec06f5e3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,60 +23,13 @@ jobs: - name: Upload Release Artifact uses: actions/upload-artifact@v3 with: - name: MLRelease + name: MLCoreRelease path: Output/Release/MelonLoader/ - name: Upload Debug Artifact uses: actions/upload-artifact@v3 with: - name: MLDebug + name: MLCoreDebug path: Output/Debug/MelonLoader/ - - 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: runs-on: ubuntu-latest steps: