diff --git a/CHANGELOG.md b/CHANGELOG.md index 9efa9fc..3304029 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,15 @@ # Changelog +## v0.1.0-beta.3 (2023/07/25) +- Added support for older Dolphin (e.g. Dolphin 5.0-114) +- Added support for MEM2 + ## v0.1.0-beta.2 (2023/07/24) - Added api.getVersion() - Added static variables - Improved UI - Added buttons to show/hide UI elements - Added button to reload managers + ## v0.1.0-beta.1 (2023/07/23) - Implemented ObjectViewer - load/reload `ObjectParameters/*.json` diff --git a/Cargo.lock b/Cargo.lock index fa901c0..18fd1c0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -854,7 +854,7 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "sup-smsac" -version = "0.1.0-beta.2" +version = "0.1.0-beta.3" dependencies = [ "clap", "encoding_rs", diff --git a/Cargo.toml b/Cargo.toml index 41b602b..786a55c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sup-smsac" -version = "0.1.0-beta.2" +version = "0.1.0-beta.3" edition = "2021" license = "MIT OR Apache-2.0" authors = ["sup39 "] @@ -13,7 +13,9 @@ encoding_rs = "0.8.32" windows = {version = "0.48.0", features = [ "Win32_Foundation", "Win32_System_Diagnostics_ToolHelp", + "Win32_System_Diagnostics_Debug", "Win32_System_Memory", + "Win32_System_Threading", ]} futures-util = "0.3.28" hyper = { version = "0.14.27", features = ["full"] } diff --git a/LICENSE.txt b/LICENSE.txt index 93cd80e..0974416 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,4 +1,10 @@ # SPDX-FileCopyrightText: 2023 sup39 # SPDX-License-Identifier: MIT OR Apache-2.0 +Some of the code regarding finding dolphin is based on + aldelaro5's Dolphin memory engine + (https://github.com/aldelaro5/Dolphin-memory-engine) +# SPDX-FileCopyrightText: 2017 aldelaro5 +# SPDX-License-Identifier: MIT + See "www/LICENSE.html" for the full license text. diff --git a/README.md b/README.md index 3df4c1a..115354f 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,10 @@ Download the binary from the [releases page](https://github.com/sup39/sup-smsac/ Requirements: - [cargo](https://www.rust-lang.org/tools/install) - [Git Bash](https://git-scm.com/download/win) +- [cargo-about](https://github.com/EmbarkStudios/cargo-about) + ``` + cargo install --locked cargo-about + ``` ```sh # Clone the repository diff --git a/about.hbs b/about.hbs index 699b3b0..10acbca 100644 --- a/about.hbs +++ b/about.hbs @@ -1,70 +1,70 @@ - - + + -
-
-

Third Party Licenses

-

This page lists the licenses of the projects used in cargo-about.

-
- -

Overview of licenses:

-
    - {{#each overview}} -
  • {{name}} ({{count}})
  • - {{/each}} -
+
+
+

Third Party Licenses

+

This page lists the licenses of the projects used in cargo-about.

+
-

All license text:

-
    - {{#each licenses}} -
  • -

    {{name}}

    -

    Used by:

    - -
    {{text}}
    -
  • - {{/each}} +

    Overview of licenses:

    +
      + {{#each overview}} +
    • {{name}} ({{count}})
    • + {{/each}} +
    + +

    All license text:

    +
+
{{text}}
+ + {{/each}} + +
diff --git a/build.sh b/build.sh index ee4b205..5366bbd 100644 --- a/build.sh +++ b/build.sh @@ -6,5 +6,6 @@ outDir=out/sup-smsac-$version mkdir -p "$outDir" cargo build --release +cargo-about generate about.hbs -o www/LICENSE.html cp ./target/release/sup-smsac.exe "$outDir/" cp -r www res README.md LICENSE.txt CHANGELOG.md "$outDir/" diff --git a/res/ObjectParameters/TBGCheckData.json b/res/ObjectParameters/TBGCheckData.json new file mode 100644 index 0000000..546cffd --- /dev/null +++ b/res/ObjectParameters/TBGCheckData.json @@ -0,0 +1,88 @@ +{ + "TBGCheckData": { + "size": "72", + "offsets": [ + { + "offset": "0", + "type": "u16", + "format": "hex", + "name": "Surface Type", + "notes": "" + }, + { + "offset": "2", + "type": "s16", + "name": "Surface Parameter", + "notes": "" + }, + { + "offset": "4", + "type": "u16", + "format": "hex", + "hidden": true, + "name": "Surface Flag", + "notes": "0x0008: XWALL(0) ZWALL(1)\n0x0010: isIllegal(1)" + }, + { + "offset": "6", + "type": "u8", + "name": "Sound effect id", + "hidden": true, + "notes": "" + }, + { + "offset": "8", + "type": "float", + "name": "Min Y", + "notes": "" + }, + { + "offset": "c", + "type": "float", + "name": "Max Y", + "notes": "" + }, + { + "offset": "10", + "type": "JGeometry::TVec3", + "name": "Vertex0.*", + "hidden": true, + "notes": "" + }, + { + "offset": "1c", + "type": "JGeometry::TVec3", + "name": "Vertex1.*", + "hidden": true, + "notes": "" + }, + { + "offset": "28", + "type": "JGeometry::TVec3", + "name": "Vertex2.*", + "hidden": true, + "notes": "" + }, + { + "offset": "34", + "type": "JGeometry::TVec3", + "name": "Normal.*", + "notes": "" + }, + { + "offset": "40", + "type": "float", + "name": "-Vertex0 dot Normal", + "hidden": true, + "notes": "" + }, + { + "offset": "44", + "type": "void*", + "name": "Owner", + "hidden": true, + "notes": "" + } + ] + } +} diff --git a/res/ObjectParameters/TMario.json b/res/ObjectParameters/TMario.json index 0c56dd5..1672cc1 100644 --- a/res/ObjectParameters/TMario.json +++ b/res/ObjectParameters/TMario.json @@ -80,24 +80,32 @@ "offset": "e0", "type": "TBGCheckData*", "name": "Floor triangle under Mario", + "hidden": true, + "notes": "" + }, + { + "offset": ["e0", "0"], + "type": "TBGCheckData", + "name": "Ground *", + "hidden": false, "notes": "" }, { "offset": "e8", "type": "float", - "name": "Height of the ceiling above Mario", + "name": "Ceiling height", "notes": "9,999,999 if none" }, { "offset": "ec", "type": "float", - "name": "Height of the floor below Mario", + "name": "Ground height", "notes": "-32,767 if none" }, { "offset": "f0", "type": "float", - "name": "Height of the water surface at Mario’s position", + "name": "Water surface height", "notes": "Y position if none" }, { diff --git a/src/dolphin.rs b/src/dolphin.rs deleted file mode 100644 index 887335d..0000000 --- a/src/dolphin.rs +++ /dev/null @@ -1,94 +0,0 @@ -/// SPDX-FileCopyrightText: 2023 sup39 -/// SPDX-License-Identifier: MIT OR Apache-2.0 - -use crate::sys::process::PidType; -use crate::sys::shared_memory::{SharedMemory, SharedMemoryOpenError}; -use crate::addr::Addr; -use crate::big_endian::DecodeBE; -use crate::sys::process::{Process32Iterator, ProcessInfo}; -use encoding_rs::SHIFT_JIS; - -pub const MEM1_START_ADDR: Addr = Addr(0x8000_0000); -pub const MEM1_END_ADDR: Addr = Addr(0x8180_0000); -pub trait Dolphin { - /// # Safety - /// - /// The offset must be smaller than the size of the memory region - unsafe fn mem>(&self, offset: T) -> *mut u8; - - fn get_ptr_mut(&self, addr: Addr, size: usize) -> Option<*mut u8> { - if MEM1_START_ADDR <= addr && addr < MEM1_END_ADDR - size as u32 { - Some(unsafe {self.mem(addr - MEM1_START_ADDR)}) - } else { - None - } - } - - #[inline] - fn read_bytes(&self, addr: Addr, size: usize) -> Option<&[u8]> { - self.get_ptr_mut(addr, size) - .map(|ptr| unsafe {std::slice::from_raw_parts(ptr, size)}) - } - #[inline] - fn read(&self, addr: Addr) -> Option { - let size = std::mem::size_of::(); - self.get_ptr_mut(addr, size) - .map(|ptr| unsafe {T::decode_be(ptr)}) - } - fn read_str(&self, addr: Addr) -> Option { - if MEM1_START_ADDR <= addr && addr < MEM1_END_ADDR { - let ptr = unsafe {self.mem(addr - MEM1_START_ADDR)}; - const MAX_LENGTH: u32 = 256; // TODO - let max_length = MAX_LENGTH; // TODO - let maxlen = std::cmp::min(max_length as usize, (MEM1_END_ADDR - addr) as usize); - // let maxlen = (MEM1_END_ADDR - addr) as usize; - let mut len = 0usize; - while len < maxlen { - if unsafe{*ptr.add(len) == 0} {break;} - len += 1; - } - SHIFT_JIS.decode_without_bom_handling_and_without_replacement(unsafe{std::slice::from_raw_parts(ptr, len)}).map(|x| x.into_owned()) - } else { - None - } - } - - #[inline] - fn write_bytes(&self, addr: Addr, payload: &[u8]) -> Option<()> { - let size = payload.len(); - self.get_ptr_mut(addr, size) - .map(|ptr| unsafe {std::ptr::copy(payload.as_ptr(), ptr, size)}) - } -} - -pub struct DolphinMemory { - shared_memory: SharedMemory, - pid: PidType, -} - -impl Dolphin for DolphinMemory { - #[inline] - unsafe fn mem>(&self, offset: T) -> *mut u8 { - self.shared_memory.get_ptr().offset(offset.into()) - } -} -impl DolphinMemory { - #[inline] - pub fn pid(&self) -> PidType { - self.pid - } - - pub fn open_pid>(pid: T) -> Result { - let pid: usize = pid.into(); - let shared_memory = SharedMemory::open(&format!("dolphin-emu.{}", pid))?; - Ok(DolphinMemory {shared_memory, pid}) - } - pub fn list_dolphin() -> impl Iterator)> { - Process32Iterator::new().filter_map(|p| p.get_name().to_str().and_then(|name| - match name { - "Dolphin.exe" => Some((p.pid(), DolphinMemory::open_pid(p.pid()))), - _ => None, - } - )) - } -} diff --git a/src/dolphin/addr.rs b/src/dolphin/addr.rs new file mode 100644 index 0000000..237b637 --- /dev/null +++ b/src/dolphin/addr.rs @@ -0,0 +1,33 @@ +use crate::dolphin::Addr; + +pub const MEM1_START_ADDR: Addr = Addr(0x8000_0000); +pub const MEM1_END_ADDR: Addr = Addr(0x8180_0000); +pub const MEM1_SIZE: u32 = MEM1_END_ADDR.0 - MEM1_START_ADDR.0; +pub const MEM2_START_ADDR: Addr = Addr(0x9000_0000); +pub const MEM2_END_ADDR: Addr = Addr(0x9400_0000); +pub const MEM2_SIZE: u32 = MEM2_END_ADDR.0 - MEM2_START_ADDR.0; + +pub enum DolphinMemAddr { + MEM1(u32), + MEM2(u32), +} +impl DolphinMemAddr { + pub fn space(&self) -> u32 { + match self { + DolphinMemAddr::MEM1(off) => MEM1_SIZE - off, + DolphinMemAddr::MEM2(off) => MEM2_SIZE - off, + } + } +} +impl TryFrom for DolphinMemAddr { + type Error = (); + fn try_from(addr: Addr) -> Result { + if (MEM1_START_ADDR..MEM1_END_ADDR).contains(&addr) { + Ok(DolphinMemAddr::MEM1(addr.0 - MEM1_START_ADDR.0)) + } else if (MEM2_START_ADDR..MEM2_END_ADDR).contains(&addr) { + Ok(DolphinMemAddr::MEM2(addr.0 - MEM2_START_ADDR.0)) + } else { + Err(()) + } + } +} diff --git a/src/dolphin/mod.rs b/src/dolphin/mod.rs new file mode 100644 index 0000000..a5cefd2 --- /dev/null +++ b/src/dolphin/mod.rs @@ -0,0 +1,118 @@ +pub use crate::big_endian::DecodeBE; +pub use crate::addr::Addr; +pub use crate::sys::process::PidType; +use crate::sys::process::{Process32Iterator, ProcessInfo}; +use encoding_rs::SHIFT_JIS; + +pub mod addr; +mod shared_memory; +mod process_memory; + +pub use addr::DolphinMemAddr; +use shared_memory::DolphinSharedMemory; +use process_memory::DolphinProcessMemory; + +pub trait Dolphin { + /// # Safety + /// `maddr + size` must be in bound + unsafe fn operate_memory_unchecked( + &self, maddr: DolphinMemAddr, size: usize, operator: F, + ) -> Option + where F: FnOnce(*mut u8) -> T; + + #[inline] + fn operate_memory(&self, addr: Addr, size: usize, operator: F) -> Option + where F: FnOnce(*mut u8) -> T + { + DolphinMemAddr::try_from(addr).ok().and_then(|maddr| { + if (maddr.space() as usize) < size {return None} + unsafe {self.operate_memory_unchecked(maddr, size, operator)} + }) + } + + #[inline] + fn operate_memory_truncated(&self, addr: Addr, max_size: usize, operator: F) -> Option + where F: FnOnce(*mut u8, usize) -> T + { + DolphinMemAddr::try_from(addr).ok().and_then(|maddr| { + let size = std::cmp::min(maddr.space() as usize, max_size); + unsafe {self.operate_memory_unchecked(maddr, size, |ptr| operator(ptr, size))} + }) + } + + fn read(&self, addr: Addr) -> Option { + let size = std::mem::size_of::(); + self.operate_memory(addr, size, |ptr| unsafe {T::decode_be(ptr)}) + } + fn read_str(&self, addr: Addr) -> Option { + let maxlen = 256; // TODO + self.operate_memory_truncated(addr, maxlen, |ptr, maxlen| { + let mut len = 0usize; + while len < maxlen && unsafe{*ptr.add(len)} != 0 { + len += 1; + } + SHIFT_JIS.decode_without_bom_handling_and_without_replacement( + unsafe{std::slice::from_raw_parts(ptr, len)} + ).map(|s| s.into_owned()) + }).unwrap_or(None) + } + fn dump_hex(&self, addr: Addr, size: usize) -> Option { + self.operate_memory(addr, size, |ptr| { + (0..size) + .map(|i| format!("{:02X}", unsafe {*ptr.add(i)})) + .collect() + }) + } + + fn write_bytes(&self, addr: Addr, payload: &[u8]) -> Option<()> { + let size = payload.len(); + self.operate_memory(addr, size, |ptr| unsafe { + std::ptr::copy(payload.as_ptr(), ptr, size); + }) + } +} + +pub enum DolphinMemory { + SharedMemory(DolphinSharedMemory), + ProcessMemory(DolphinProcessMemory), +} +impl Dolphin for DolphinMemory { + unsafe fn operate_memory_unchecked(&self, maddr: DolphinMemAddr, size: usize, operator: F) -> Option + where F: FnOnce(*mut u8) -> T + { + match self { + DolphinMemory::SharedMemory(m) => m.operate_memory_unchecked(maddr, size, operator), + DolphinMemory::ProcessMemory(m) => m.operate_memory_unchecked(maddr, size, operator), + } + } +} +impl From for DolphinMemory { + fn from(x: DolphinSharedMemory) -> Self { + Self::SharedMemory(x) + } +} +impl From for DolphinMemory { + fn from(x: DolphinProcessMemory) -> Self { + Self::ProcessMemory(x) + } +} +impl DolphinMemory { + pub fn list() -> impl Iterator)> { + Process32Iterator::new().filter_map(|p| p.get_name().to_str().and_then(|name| + match name { + "Dolphin.exe" | "DolphinQt2.exe" | "DolphinWx.exe" => { + let pid = p.pid(); + Some((pid, { + DolphinSharedMemory::open_pid(pid).ok() + .map(DolphinMemory::SharedMemory) + .or_else(|| { + DolphinProcessMemory::open_pid(pid).ok() + .map(DolphinMemory::ProcessMemory) + }) + })) + }, + _ => None, + } + )) + } +} diff --git a/src/dolphin/process_memory.rs b/src/dolphin/process_memory.rs new file mode 100644 index 0000000..6f82e64 --- /dev/null +++ b/src/dolphin/process_memory.rs @@ -0,0 +1,93 @@ +/// SPDX-FileCopyrightText: 2023 sup39 +/// SPDX-License-Identifier: MIT OR Apache-2.0 +/// +/// The `DolphinProcessMemory::open_pid` function is based on +/// `WindowsDolphinProcess::obtainEmuRAMInformations()` +/// (https://github.com/aldelaro5/Dolphin-memory-engine/blob/master/Source/DolphinProcess/Windows/WindowsDolphinProcess.cpp#L47) +/// from aldelaro5's Dolphin memory engine +/// (https://github.com/aldelaro5/Dolphin-memory-engine) +/// SPDX-FileCopyrightText: 2017 aldelaro5 +/// SPDX-License-Identifier: MIT + +use super::{Dolphin, DolphinMemAddr, PidType}; +use crate::sys::process_memory::ProcessMemoryIterator; +use core::ffi::c_void; +use windows::Win32::Foundation::{HANDLE, CloseHandle}; +use windows::Win32::System::{ + Threading::{PROCESS_QUERY_INFORMATION, PROCESS_VM_READ, PROCESS_VM_WRITE, OpenProcess}, + Memory::MEM_MAPPED, + Diagnostics::Debug::ReadProcessMemory, +}; + +pub struct DolphinProcessMemory { + h_proc: HANDLE, + base_addr_mem1: usize, + base_addr_mem2: Option, +} +impl Drop for DolphinProcessMemory { + fn drop(&mut self) { + unsafe { + CloseHandle(self.h_proc); + } + } +} +impl Dolphin for DolphinProcessMemory { + unsafe fn operate_memory_unchecked(&self, maddr: DolphinMemAddr, size: usize, operator: F) -> Option + where F: FnOnce(*mut u8) -> T + { + match maddr { + DolphinMemAddr::MEM1(offset) => Some(self.base_addr_mem1 + (offset as usize)), + DolphinMemAddr::MEM2(offset) => self.base_addr_mem2.map(|base_addr| base_addr + (offset as usize)), + }.and_then(|base_addr| { + let mut buf = Vec::with_capacity(size); + let ptr = buf.as_mut_ptr(); + match unsafe {ReadProcessMemory( + self.h_proc, base_addr as *const c_void, + ptr as *mut c_void, size, None, + ).as_bool()} { + true => Some(operator(ptr)), + false => None, + } + }) + } +} + +pub enum DolphinProcessMemoryFindError { + OpenError(windows::core::Error), + MemoryNotFound, +} +impl From for DolphinProcessMemoryFindError { + fn from(e: windows::core::Error) -> Self { + Self::OpenError(e) + } +} +impl DolphinProcessMemory { + pub fn open_pid(pid: PidType) -> Result { + unsafe { + let h_proc = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ | PROCESS_VM_WRITE, false, pid)?; + let mut itr = ProcessMemoryIterator::with_handle(h_proc); + + // find MEM1 + let Some(base_addr_mem1) = + itr.find(|meminfo| meminfo.RegionSize == 0x2000000 && meminfo.Type == MEM_MAPPED) + .map(|meminfo| meminfo.BaseAddress) + else { + CloseHandle(h_proc); + return Err(DolphinProcessMemoryFindError::MemoryNotFound); + }; + + // find MEM2 + let base_addr_mem2_check = base_addr_mem1.add(0x10000000); + let base_addr_mem2 = + itr.find(|meminfo| { + meminfo.BaseAddress == base_addr_mem2_check + && meminfo.RegionSize == 0x4000000 + && meminfo.Type == MEM_MAPPED + }).map(|_| base_addr_mem2_check as usize); + + Ok(DolphinProcessMemory { + h_proc, base_addr_mem1: base_addr_mem1 as usize, base_addr_mem2, + }) + } + } +} diff --git a/src/dolphin/shared_memory.rs b/src/dolphin/shared_memory.rs new file mode 100644 index 0000000..188de9b --- /dev/null +++ b/src/dolphin/shared_memory.rs @@ -0,0 +1,38 @@ +/// SPDX-FileCopyrightText: 2023 sup39 +/// SPDX-License-Identifier: MIT OR Apache-2.0 + +use crate::sys::process::PidType; +use crate::sys::shared_memory::{SharedMemory, SharedMemoryOpenError}; +use crate::dolphin::{Dolphin, DolphinMemAddr, addr::MEM2_SIZE}; + +pub struct DolphinSharedMemory { + shared_memory: SharedMemory, + has_mem2: bool, +} + +pub const MEM2_OFFSET: u32 = 0x4040000; +impl Dolphin for DolphinSharedMemory { + /// # Safety + /// `maddr + size` must be in bound + unsafe fn operate_memory_unchecked(&self, maddr: DolphinMemAddr, _size: usize, operator: F) -> Option + where F: FnOnce(*mut u8) -> T + { + match maddr { + DolphinMemAddr::MEM1(offset) => Some(offset), + DolphinMemAddr::MEM2(offset) => match self.has_mem2 { + true => Some(MEM2_OFFSET + offset), + false => None, + }, + }.map(|offset| { + operator(self.shared_memory.get_ptr().add(offset as usize)) + }) + } +} + +impl DolphinSharedMemory { + pub fn open_pid(pid: PidType) -> Result { + let shared_memory = SharedMemory::open(&format!("dolphin-emu.{}", pid))?; + let has_mem2 = shared_memory.size() >= MEM2_OFFSET + MEM2_SIZE; + Ok(DolphinSharedMemory {shared_memory, has_mem2}) + } +} diff --git a/src/obj_params/field_reader.rs b/src/obj_params/field_reader.rs index 0bca0aa..97c00a2 100644 --- a/src/obj_params/field_reader.rs +++ b/src/obj_params/field_reader.rs @@ -70,7 +70,6 @@ impl FieldReader for ClassNameReader { pub struct HexFieldReader(pub usize); impl FieldReader for HexFieldReader { fn read(&self, d: &D, addr: Addr) -> Option { - d.read_bytes(addr, self.0) - .map(|bytes| bytes.iter().map(|x| format!("{x:02X}")).collect()) + d.dump_hex(addr, self.0) } } diff --git a/src/server/api.rs b/src/server/api.rs index ac8b775..926dff5 100644 --- a/src/server/api.rs +++ b/src/server/api.rs @@ -63,7 +63,6 @@ impl DolphinMemoryJsExt for T { } } - pub async fn handle_command( env: &HttpEnv, dolphin: &mut Option, @@ -181,8 +180,8 @@ pub async fn handle_command( let Some(size) = size.as_u64().map(|x| x as usize) else { return_err!("\"size\" must be a positive integer"); }; - d.read_bytes(addr, size) - .map(|bytes| json!(bytes.iter().map(|x| format!("{:02X}", x)).collect::())) + d.dump_hex(addr, size) + .map(|s| json!(s)) .unwrap_or_else(|| json!(null)) }, None => { diff --git a/src/sms/mod.rs b/src/sms/mod.rs index abcb842..1be3805 100644 --- a/src/sms/mod.rs +++ b/src/sms/mod.rs @@ -1,6 +1,9 @@ /// SPDX-FileCopyrightText: 2023 sup39 /// SPDX-License-Identifier: MIT OR Apache-2.0 +use crate::addr::Addr; +use crate::dolphin::{DolphinMemory, Dolphin, DolphinMemAddr, PidType}; + #[derive(Debug, Clone, Copy)] pub enum SMSVersion { GMSJ01, GMSE01, GMSP01, GMSJ0A, @@ -11,31 +14,27 @@ impl std::fmt::Display for SMSVersion { } } -use crate::addr::Addr; -use crate::dolphin::{DolphinMemory, Dolphin}; pub struct SMSDolphin { d: DolphinMemory, + pid: PidType, ver: SMSVersion, } impl Dolphin for SMSDolphin { - #[inline] - unsafe fn mem>(&self, offset: T) -> *mut u8 { - self.d.mem(offset) + unsafe fn operate_memory_unchecked(&self, maddr: DolphinMemAddr, size: usize, operator: F) -> Option + where F: FnOnce(*mut u8) -> T + { + self.d.operate_memory_unchecked(maddr, size, operator) } } pub mod vt; impl SMSDolphin { - #[inline] - pub fn pid(&self) -> usize { - self.d.pid() - } #[inline] pub fn ver(&self) -> SMSVersion { self.ver } - pub fn from_dolphin_memory(d: DolphinMemory) -> Result> { + pub fn from_dolphin_memory(d: DolphinMemory, pid: PidType) -> Result> { match d.read::<&[u8; 8]>(Addr(0x80000000)) { None => Err(None), Some(rver) => match rver { @@ -44,7 +43,7 @@ impl SMSDolphin { b"GMSP01\x00\x00" => Ok(SMSVersion::GMSP01), b"GMSJ01\x00\x01" => Ok(SMSVersion::GMSJ0A), _ => Err(Some(rver.to_owned())), - }.map(|ver| SMSDolphin {d, ver}), + }.map(|ver| SMSDolphin {d, ver, pid}), } } pub fn get_class(&self, addr: Addr) -> Option<&'static str> { @@ -72,18 +71,22 @@ impl std::fmt::Display for SMSDolphinFindOneError { } impl SMSDolphin { + pub fn pid(&self) -> PidType { + self.pid + } + pub fn find_one() -> Result { let mut dolphin_running = false; let mut game_running = false; - for (_pid, d) in DolphinMemory::list_dolphin() { + for (pid, d) in DolphinMemory::list() { match d { - Ok(d) => { - if let Ok(o) = SMSDolphin::from_dolphin_memory(d) { + Some(d) => { + if let Ok(o) = SMSDolphin::from_dolphin_memory(d, pid) { return Ok(o) } game_running = true; }, - Err(_) => dolphin_running = true, + None => dolphin_running = true, } } Err(if game_running { diff --git a/src/sys/mod.rs b/src/sys/mod.rs index 7926b08..5144e24 100644 --- a/src/sys/mod.rs +++ b/src/sys/mod.rs @@ -3,3 +3,4 @@ pub mod process; pub mod shared_memory; +pub mod process_memory; diff --git a/src/sys/process.rs b/src/sys/process.rs index 875ebb8..ce33563 100644 --- a/src/sys/process.rs +++ b/src/sys/process.rs @@ -3,7 +3,7 @@ use std::ffi::OsString; use std::os::windows::ffi::OsStringExt; -use windows::Win32::Foundation::{HANDLE, BOOL}; +use windows::Win32::Foundation::{HANDLE, BOOL, CloseHandle}; use windows::Win32::System::Diagnostics::ToolHelp::{ CreateToolhelp32Snapshot, TH32CS_SNAPPROCESS, @@ -17,7 +17,6 @@ pub struct Process32Iterator { fn_next: unsafe fn(HANDLE, *mut PROCESSENTRY32W) -> BOOL, } -// https://learn.microsoft.com/en-us/windows/win32/api/tlhelp32/nf-tlhelp32-createtoolhelp32snapshot impl Process32Iterator { pub fn new() -> Self { Process32Iterator { @@ -31,6 +30,13 @@ impl Default for Process32Iterator { Self::new() } } +impl Drop for Process32Iterator { + fn drop(&mut self) { + unsafe { + CloseHandle(self.hsnapshot); + } + } +} impl Iterator for Process32Iterator { type Item = PROCESSENTRY32W; @@ -49,7 +55,7 @@ impl Iterator for Process32Iterator { } } -pub type PidType = usize; +pub type PidType = u32; pub trait ProcessInfo { fn pid(&self) -> PidType; fn get_name(&self) -> OsString; diff --git a/src/sys/process_memory.rs b/src/sys/process_memory.rs new file mode 100644 index 0000000..9454d3c --- /dev/null +++ b/src/sys/process_memory.rs @@ -0,0 +1,50 @@ +/// SPDX-FileCopyrightText: 2023 sup39 +/// SPDX-License-Identifier: MIT OR Apache-2.0 + +use core::ffi::c_void; +use windows::Win32::Foundation::{HANDLE, CloseHandle}; +use windows::Win32::System::{ + Threading::{PROCESS_QUERY_INFORMATION, OpenProcess}, + Memory::{MEMORY_BASIC_INFORMATION, VirtualQueryEx}, +}; + +pub struct ProcessMemoryIterator { + h_proc: HANDLE, + addr: *const c_void, + should_drop: bool, +} +impl ProcessMemoryIterator { + pub fn with_handle(h_proc: HANDLE) -> Self { + Self {h_proc, addr: std::ptr::null(), should_drop: false} + } + pub fn try_new(pid: u32) -> Result { + let h_proc = unsafe { + OpenProcess(PROCESS_QUERY_INFORMATION, false, pid)? + }; + Ok(Self {h_proc, addr: std::ptr::null(), should_drop: true}) + } +} +impl Drop for ProcessMemoryIterator { + fn drop(&mut self) { + unsafe { + if self.should_drop { + CloseHandle(self.h_proc); + } + } + } +} +impl Iterator for ProcessMemoryIterator { + type Item = MEMORY_BASIC_INFORMATION; + fn next(&mut self) -> Option { + let mut meminfo = MEMORY_BASIC_INFORMATION::default(); + unsafe {match { + VirtualQueryEx(self.h_proc, Some(self.addr), &mut meminfo, std::mem::size_of::()) > 0 + } { + true => { + self.addr = self.addr.add(meminfo.RegionSize); + Some(meminfo) + }, + false => None, + }} + } +} diff --git a/src/sys/shared_memory.rs b/src/sys/shared_memory.rs index 458cfd2..6fe82e3 100644 --- a/src/sys/shared_memory.rs +++ b/src/sys/shared_memory.rs @@ -1,6 +1,7 @@ /// SPDX-FileCopyrightText: 2023 sup39 /// SPDX-License-Identifier: MIT OR Apache-2.0 +use core::ffi::c_void; use windows::core::PCSTR; use windows::Win32::Foundation::{HANDLE, CloseHandle}; use windows::Win32::System::Memory::{ @@ -9,6 +10,8 @@ use windows::Win32::System::Memory::{ MapViewOfFile, UnmapViewOfFile, MEMORYMAPPEDVIEW_HANDLE, + MEMORY_BASIC_INFORMATION, + VirtualQuery, }; #[derive(Debug)] @@ -21,12 +24,17 @@ pub enum SharedMemoryOpenError { pub struct SharedMemory { h_file_mapping: HANDLE, h_map_view: MEMORYMAPPEDVIEW_HANDLE, + size: u32, } impl SharedMemory { #[inline] pub fn get_ptr(&self) -> *mut u8 { self.h_map_view.0 as *mut u8 } + #[inline] + pub fn size(&self) -> u32 { + self.size + } } impl SharedMemory { @@ -51,8 +59,14 @@ impl SharedMemory { return Err(SharedMemoryOpenError::MemoryUninitialized); } + let mut meminfo = MEMORY_BASIC_INFORMATION::default(); + unsafe {VirtualQuery( + Some(h_map_view.0 as *mut c_void), &mut meminfo, std::mem::size_of::(), + )}; + let size = meminfo.RegionSize as u32; + // create SharedMemory successfully - Ok(Self {h_file_mapping, h_map_view}) + Ok(Self {h_file_mapping, h_map_view, size}) } } diff --git a/www/LICENSE.html b/www/LICENSE.html index d2fd7c0..2913560 100644 --- a/www/LICENSE.html +++ b/www/LICENSE.html @@ -1,68 +1,68 @@ - - + + -
-
-

Third Party Licenses

-

This page lists the licenses of the projects used in cargo-about.

-
- -

Overview of licenses:

-
    -
  • Apache License 2.0 (27)
  • -
  • MIT License (25)
  • -
  • BSD 2-Clause "Simplified" License (1)
  • -
  • BSD 3-Clause "New" or "Revised" License (1)
  • -
  • Unicode License Agreement - Data Files and Software (2016) (1)
  • +
    +
    +

    Third Party Licenses

    +

    This page lists the licenses of the projects used in cargo-about.

    +
    + +

    Overview of licenses:

    + + +

    All license text:

    +
      +
    • +

      Apache License 2.0

      +

      Used by:

      + - -

      All license text:

      -
        -
      • -

        Apache License 2.0

        -

        Used by:

        - -
        +        
                                          Apache License
                                    Version 2.0, January 2004
                                 http://www.apache.org/licenses/
        @@ -240,14 +240,14 @@
         
            END OF TERMS AND CONDITIONS
         
        -
      • -
      • -

        Apache License 2.0

        -

        Used by:

        - -
        +      
      • +
      • +

        Apache License 2.0

        +

        Used by:

        + +
                                          Apache License
                                    Version 2.0, January 2004
                                 http://www.apache.org/licenses/
        @@ -450,14 +450,14 @@
            See the License for the specific language governing permissions and
            limitations under the License.
         
        -
      • -
      • -

        Apache License 2.0

        -

        Used by:

        - -
        +      
      • +
      • +

        Apache License 2.0

        +

        Used by:

        + +
                                          Apache License
                                    Version 2.0, January 2004
                                 http://www.apache.org/licenses/
        @@ -660,23 +660,23 @@
            See the License for the specific language governing permissions and
            limitations under the License.
         
        -
      • -
      • -

        Apache License 2.0

        -

        Used by:

        - -
                                         Apache License
        +      
      • +
      • +

        Apache License 2.0

        +

        Used by:

        + +
                                         Apache License
                                    Version 2.0, January 2004
                                 http://www.apache.org/licenses/
         
        @@ -878,14 +878,14 @@
            See the License for the specific language governing permissions and
            limitations under the License.
         
        -
      • -
      • -

        Apache License 2.0

        -

        Used by:

        - -
                                         Apache License
        +      
      • +
      • +

        Apache License 2.0

        +

        Used by:

        + +
                                         Apache License
                                    Version 2.0, January 2004
                                 http://www.apache.org/licenses/
         
        @@ -1088,16 +1088,16 @@
            limitations under the License.
         
         
        -
      • -
      • -

        Apache License 2.0

        -

        Used by:

        - -
                                         Apache License
        +      
      • +
      • +

        Apache License 2.0

        +

        Used by:

        + +
                                         Apache License
                                    Version 2.0, January 2004
                                 http://www.apache.org/licenses/
         
        @@ -1299,15 +1299,15 @@
            See the License for the specific language governing permissions and
            limitations under the License.
         
        -
      • -
      • -

        Apache License 2.0

        -

        Used by:

        - -
                                         Apache License
        +      
      • +
      • +

        Apache License 2.0

        +

        Used by:

        + +
                                         Apache License
                                    Version 2.0, January 2004
                                 http://www.apache.org/licenses/
         
        @@ -1509,19 +1509,19 @@
            See the License for the specific language governing permissions and
            limitations under the License.
         
        -
      • -
      • -

        Apache License 2.0

        -

        Used by:

        - -
                                         Apache License
        +      
      • +
      • +

        Apache License 2.0

        +

        Used by:

        + +
                                         Apache License
                                    Version 2.0, January 2004
                                 http://www.apache.org/licenses/
         
        @@ -1724,26 +1724,26 @@
            limitations under the License.
         
         
        -
      • -
      • -

        Apache License 2.0

        -

        Used by:

        - -
                                      Apache License
        +      
      • +
      • +

        Apache License 2.0

        +

        Used by:

        + +
                                      Apache License
                                 Version 2.0, January 2004
                              http://www.apache.org/licenses/
         
        @@ -1920,19 +1920,19 @@ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
         
         END OF TERMS AND CONDITIONS
         
        -
      • -
      • -

        Apache License 2.0

        -

        Used by:

        - -
                                      Apache License
        +      
      • +
      • +

        Apache License 2.0

        +

        Used by:

        + +
                                      Apache License
                                 Version 2.0, January 2004
                              http://www.apache.org/licenses/
         
        @@ -2135,14 +2135,14 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
         See the License for the specific language governing permissions and
         limitations under the License.
         
        -
      • -
      • -

        Apache License 2.0

        -

        Used by:

        - -
                                      Apache License
        +      
      • +
      • +

        Apache License 2.0

        +

        Used by:

        + +
                                      Apache License
                                 Version 2.0, January 2004
                              http://www.apache.org/licenses/
         
        @@ -2343,14 +2343,14 @@ distributed under the License is distributed on an "AS IS" BASIS,
         WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
         See the License for the specific language governing permissions and
         limitations under the License.
        -
      • -
      • -

        Apache License 2.0

        -

        Used by:

        - -
                                      Apache License
        +      
      • +
      • +

        Apache License 2.0

        +

        Used by:

        + +
                                      Apache License
                                 Version 2.0, January 2004
                              http://www.apache.org/licenses/
         
        @@ -2552,14 +2552,14 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
         See the License for the specific language governing permissions and
         limitations under the License.
         
        -
      • -
      • -

        Apache License 2.0

        -

        Used by:

        - -
                                      Apache License
        +      
      • +
      • +

        Apache License 2.0

        +

        Used by:

        + +
                                      Apache License
                                 Version 2.0, January 2004
                              http://www.apache.org/licenses/
         
        @@ -2761,14 +2761,14 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
         See the License for the specific language governing permissions and
         limitations under the License.
         
        -
      • -
      • -

        Apache License 2.0

        -

        Used by:

        - -
                                      Apache License
        +      
      • +
      • +

        Apache License 2.0

        +

        Used by:

        + +
                                      Apache License
                                 Version 2.0, January 2004
                              http://www.apache.org/licenses/
         
        @@ -2970,14 +2970,14 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
         See the License for the specific language governing permissions and
         limitations under the License.
         
        -
      • -
      • -

        Apache License 2.0

        -

        Used by:

        - -
                                      Apache License
        +      
      • +
      • +

        Apache License 2.0

        +

        Used by:

        + +
                                      Apache License
                                 Version 2.0, January 2004
                              http://www.apache.org/licenses/
         
        @@ -3179,50 +3179,50 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
         See the License for the specific language governing permissions and
         limitations under the License.
         
        -
      • -
      • -

        Apache License 2.0

        -

        Used by:

        - -
                                      Apache License
        +      
      • +
      • +

        Apache License 2.0

        +

        Used by:

        + +
                                      Apache License
                                 Version 2.0, January 2004
                              http://www.apache.org/licenses/
         
        @@ -3424,18 +3424,18 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
         See the License for the specific language governing permissions and
         limitations under the License.
         
        -
      • -
      • -

        Apache License 2.0

        -

        Used by:

        - -
                                      Apache License
        +      
      • +
      • +

        Apache License 2.0

        +

        Used by:

        + +
                                      Apache License
                                 Version 2.0, January 2004
                              http://www.apache.org/licenses/
         
        @@ -3637,14 +3637,14 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
         See the License for the specific language governing permissions and
         limitations under the License.
         
        -
      • -
      • -

        Apache License 2.0

        -

        Used by:

        - -
                                      Apache License
        +      
      • +
      • +

        Apache License 2.0

        +

        Used by:

        + +
                                      Apache License
                                 Version 2.0, January 2004
                              https://www.apache.org/licenses/
         
        @@ -3821,14 +3821,14 @@ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
         
         END OF TERMS AND CONDITIONS
         
        -
      • -
      • -

        Apache License 2.0

        -

        Used by:

        - -
                                      Apache License
        +      
      • +
      • +

        Apache License 2.0

        +

        Used by:

        + +
                                      Apache License
                                 Version 2.0, January 2004
                              https://www.apache.org/licenses/
         
        @@ -4016,15 +4016,15 @@ APPENDIX: How to apply the Apache License to your work.
            same "printed page" as the copyright notice for easier
            identification within third-party archives.
         
        -
      • -
      • -

        Apache License 2.0

        -

        Used by:

        - -
                                      Apache License
        +      
      • +
      • +

        Apache License 2.0

        +

        Used by:

        + +
                                      Apache License
                                 Version 2.0, January 2004
                              https://www.apache.org/licenses/
         
        @@ -4226,14 +4226,14 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
         See the License for the specific language governing permissions and
         limitations under the License.
         
        -
      • -
      • -

        Apache License 2.0

        -

        Used by:

        - -
                                      Apache License
        +      
      • +
      • +

        Apache License 2.0

        +

        Used by:

        + +
                                      Apache License
                                 Version 2.0, January 2004
                              https://www.apache.org/licenses/LICENSE-2.0
         
        @@ -4435,14 +4435,14 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
         See the License for the specific language governing permissions and
         limitations under the License.
         
        -
      • -
      • -

        Apache License 2.0

        -

        Used by:

        - -
        # Contributing
        +      
      • +
      • +

        Apache License 2.0

        +

        Used by:

        + +
        # Contributing
         
         ## License
         
        @@ -4459,27 +4459,27 @@ Unless you explicitly state otherwise, any contribution intentionally submitted
         for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any
         additional terms or conditions.
         
        -
      • -
      • -

        Apache License 2.0

        -

        Used by:

        - -
        // Licensed under the Apache License, Version 2.0
        +      
      • +
      • +

        Apache License 2.0

        +

        Used by:

        + +
        // Licensed under the Apache License, Version 2.0
         // <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
         // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
         // All files in the project carrying such notice may not be copied, modified, or distributed
         // except according to those terms.
         
        -
      • -
      • -

        Apache License 2.0

        -

        Used by:

        - -
        Apache License
        +      
      • +
      • +

        Apache License 2.0

        +

        Used by:

        + +
        Apache License
         Version 2.0, January 2004
         http://www.apache.org/licenses/
         
        @@ -4681,18 +4681,18 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
         See the License for the specific language governing permissions and
         limitations under the License.
         
        -
      • -
      • -

        Apache License 2.0

        -

        Used by:

        - -
        Apache License
        +      
      • +
      • +

        Apache License 2.0

        +

        Used by:

        + +
        Apache License
         Version 2.0, January 2004
         http://www.apache.org/licenses/
         
        @@ -4766,14 +4766,14 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
         See the License for the specific language governing permissions and
         limitations under the License.
         
        -
      • -
      • -

        Apache License 2.0

        -

        Used by:

        - -
        Licensed under the Apache License, Version 2.0
        +      
      • +
      • +

        Apache License 2.0

        +

        Used by:

        + +
        Licensed under the Apache License, Version 2.0
         <LICENSE-APACHE or
         http://www.apache.org/licenses/LICENSE-2.0> or the MIT
         license <LICENSE-MIT or http://opensource.org/licenses/MIT>,
        @@ -4781,22 +4781,22 @@ at your option. All files in the project carrying such
         notice may not be copied, modified, or distributed except
         according to those terms.
         
        -
      • -
      • -

        Apache License 2.0

        -

        Used by:

        - -
        MIT OR Apache-2.0
        -
      • -
      • -

        BSD 2-Clause "Simplified" License

        -

        Used by:

        - -
        Copyright 2021, Maarten de Vries <maarten@de-vri.es>
        +      
      • +
      • +

        Apache License 2.0

        +

        Used by:

        + +
        MIT OR Apache-2.0
        +
      • +
      • +

        BSD 2-Clause "Simplified" License

        +

        Used by:

        + +
        Copyright 2021, Maarten de Vries <maarten@de-vri.es>
         
         Redistribution and use in source and binary forms, with or without
         modification, are permitted provided that the following conditions are met:
        @@ -4819,14 +4819,14 @@ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
         OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
         OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
         
        -
      • -
      • -

        BSD 3-Clause "New" or "Revised" License

        -

        Used by:

        - -
        Copyright © WHATWG (Apple, Google, Mozilla, Microsoft).
        +      
      • +
      • +

        BSD 3-Clause "New" or "Revised" License

        +

        Used by:

        + +
        Copyright © WHATWG (Apple, Google, Mozilla, Microsoft).
         
         Redistribution and use in source and binary forms, with or without
         modification, are permitted provided that the following conditions are met:
        @@ -4853,14 +4853,14 @@ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
         OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
         OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
         
        -
      • -
      • -

        MIT License

        -

        Used by:

        - -
        Copyright (c) 2014 Carl Lerche and other MIO contributors
        +      
      • +
      • +

        MIT License

        +

        Used by:

        + +
        Copyright (c) 2014 Carl Lerche and other MIO contributors
         
         Permission is hereby granted, free of charge, to any person obtaining a copy
         of this software and associated documentation files (the "Software"), to deal
        @@ -4880,14 +4880,14 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
         OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
         THE SOFTWARE.
         
        -
      • -
      • -

        MIT License

        -

        Used by:

        - -
        Copyright (c) 2014-2021 Sean McArthur
        +      
      • +
      • +

        MIT License

        +

        Used by:

        + +
        Copyright (c) 2014-2021 Sean McArthur
         
         Permission is hereby granted, free of charge, to any person obtaining a copy
         of this software and associated documentation files (the "Software"), to deal
        @@ -4907,14 +4907,14 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
         OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
         THE SOFTWARE.
         
        -
      • -
      • -

        MIT License

        -

        Used by:

        - -
        Copyright (c) 2017 Daniel Abramov
        +      
      • +
      • +

        MIT License

        +

        Used by:

        + +
        Copyright (c) 2017 Daniel Abramov
         Copyright (c) 2017 Alexey Galakhov
         
         Permission is hereby granted, free of charge, to any person obtaining a copy
        @@ -4935,14 +4935,14 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
         OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
         THE SOFTWARE.
         
        -
      • -
      • -

        MIT License

        -

        Used by:

        - -
        Copyright (c) 2017 Redox OS Developers
        +      
      • +
      • +

        MIT License

        +

        Used by:

        + +
        Copyright (c) 2017 Redox OS Developers
         
         MIT License
         
        @@ -4965,14 +4965,14 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
         OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
         WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
         
        -
      • -
      • -

        MIT License

        -

        Used by:

        - -
        Copyright (c) 2017 h2 authors
        +      
      • +
      • +

        MIT License

        +

        Used by:

        + +
        Copyright (c) 2017 h2 authors
         
         Permission is hereby granted, free of charge, to any
         person obtaining a copy of this software and associated
        @@ -4998,14 +4998,14 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
         IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
         DEALINGS IN THE SOFTWARE.
         
        -
      • -
      • -

        MIT License

        -

        Used by:

        - -
        Copyright (c) 2018 Carl Lerche
        +      
      • +
      • +

        MIT License

        +

        Used by:

        + +
        Copyright (c) 2018 Carl Lerche
         
         Permission is hereby granted, free of charge, to any
         person obtaining a copy of this software and associated
        @@ -5031,14 +5031,14 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
         IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
         DEALINGS IN THE SOFTWARE.
         
        -
      • -
      • -

        MIT License

        -

        Used by:

        - -
        Copyright (c) 2018 Sean McArthur
        +      
      • +
      • +

        MIT License

        +

        Used by:

        + +
        Copyright (c) 2018 Sean McArthur
         Copyright (c) 2016 Alex Crichton
         
         Permission is hereby granted, free of charge, to any person obtaining a copy
        @@ -5060,14 +5060,14 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
         THE SOFTWARE.
         
         
        -
      • -
      • -

        MIT License

        -

        Used by:

        - -
        Copyright (c) 2018-2019 Sean McArthur
        +      
      • +
      • +

        MIT License

        +

        Used by:

        + +
        Copyright (c) 2018-2019 Sean McArthur
         
         Permission is hereby granted, free of charge, to any person obtaining a copy
         of this software and associated documentation files (the "Software"), to deal
        @@ -5088,14 +5088,14 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
         THE SOFTWARE.
         
         
        -
      • -
      • -

        MIT License

        -

        Used by:

        - -
        Copyright (c) 2019 Carl Lerche
        +      
      • +
      • +

        MIT License

        +

        Used by:

        + +
        Copyright (c) 2019 Carl Lerche
         
         Permission is hereby granted, free of charge, to any
         person obtaining a copy of this software and associated
        @@ -5121,14 +5121,14 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
         IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
         DEALINGS IN THE SOFTWARE.
         
        -
      • -
      • -

        MIT License

        -

        Used by:

        - -
        Copyright (c) 2019 Hyper Contributors
        +      
      • +
      • +

        MIT License

        +

        Used by:

        + +
        Copyright (c) 2019 Hyper Contributors
         
         Permission is hereby granted, free of charge, to any
         person obtaining a copy of this software and associated
        @@ -5154,15 +5154,15 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
         IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
         DEALINGS IN THE SOFTWARE.
         
        -
      • -
      • -

        MIT License

        -

        Used by:

        - -
        Copyright (c) 2019 Tokio Contributors
        +      
      • +
      • +

        MIT License

        +

        Used by:

        + +
        Copyright (c) 2019 Tokio Contributors
         
         Permission is hereby granted, free of charge, to any
         person obtaining a copy of this software and associated
        @@ -5188,14 +5188,14 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
         IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
         DEALINGS IN THE SOFTWARE.
         
        -
      • -
      • -

        MIT License

        -

        Used by:

        - -
        Copyright (c) 2019 Tower Contributors
        +      
      • +
      • +

        MIT License

        +

        Used by:

        + +
        Copyright (c) 2019 Tower Contributors
         
         Permission is hereby granted, free of charge, to any
         person obtaining a copy of this software and associated
        @@ -5221,15 +5221,15 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
         IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
         DEALINGS IN THE SOFTWARE.
         
        -
      • -
      • -

        MIT License

        -

        Used by:

        - -
        Copyright (c) 2023 Tokio Contributors
        +      
      • +
      • +

        MIT License

        +

        Used by:

        + +
        Copyright (c) 2023 Tokio Contributors
         
         Permission is hereby granted, free of charge, to any
         person obtaining a copy of this software and associated
        @@ -5255,14 +5255,14 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
         IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
         DEALINGS IN THE SOFTWARE.
         
        -
      • -
      • -

        MIT License

        -

        Used by:

        - -
        Copyright (c) 2023 Tokio Contributors
        +      
      • +
      • +

        MIT License

        +

        Used by:

        + +
        Copyright (c) 2023 Tokio Contributors
         
         Permission is hereby granted, free of charge, to any
         person obtaining a copy of this software and associated
        @@ -5310,15 +5310,15 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
         OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
         SOFTWARE.
         
        -
      • -
      • -

        MIT License

        -

        Used by:

        - -
        MIT License
        +      
      • +
      • +

        MIT License

        +

        Used by:

        + +
        MIT License
         
         Copyright (c) 2023 Sean Larkin
         
        @@ -5340,14 +5340,14 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
         OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
         SOFTWARE.
         
        -
      • -
      • -

        MIT License

        -

        Used by:

        - -
        Permission is hereby granted, free of charge, to any
        +      
      • +
      • +

        MIT License

        +

        Used by:

        + +
        Permission is hereby granted, free of charge, to any
         person obtaining a copy of this software and associated
         documentation files (the "Software"), to deal in the
         Software without restriction, including without
        @@ -5371,14 +5371,14 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
         IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
         DEALINGS IN THE SOFTWARE.
         
        -
      • -
      • -

        MIT License

        -

        Used by:

        - -
        The MIT License (MIT)
        +      
      • +
      • +

        MIT License

        +

        Used by:

        + +
        The MIT License (MIT)
         
         Copyright (c) 2014 Mathijs van de Nes
         
        @@ -5400,15 +5400,15 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
         OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
         SOFTWARE.
         
        -
      • -
      • -

        MIT License

        -

        Used by:

        - -
        The MIT License (MIT)
        +      
      • +
      • +

        MIT License

        +

        Used by:

        + +
        The MIT License (MIT)
         
         Copyright (c) 2015 Andrew Gallant
         
        @@ -5430,14 +5430,14 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
         OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
         THE SOFTWARE.
         
        -
      • -
      • -

        MIT License

        -

        Used by:

        - -
        The MIT License (MIT)
        +      
      • +
      • +

        MIT License

        +

        Used by:

        + +
        The MIT License (MIT)
         
         Copyright (c) 2015 Austin Bonander
         
        @@ -5460,14 +5460,14 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
         SOFTWARE.
         
         
        -
      • -
      • -

        MIT License

        -

        Used by:

        - -
        The MIT License (MIT)
        +      
      • +
      • +

        MIT License

        +

        Used by:

        + +
        The MIT License (MIT)
         
         Copyright (c) 2015 Danny Guo
         Copyright (c) 2016 Titus Wormer <tituswormer@gmail.com>
        @@ -5491,14 +5491,14 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
         OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
         SOFTWARE.
         
        -
      • -
      • -

        MIT License

        -

        Used by:

        - -
        The MIT License (MIT)
        +      
      • +
      • +

        MIT License

        +

        Used by:

        + +
        The MIT License (MIT)
         
         Copyright (c) 2015-2020 Julien Cretin
         Copyright (c) 2017-2020 Google Inc.
        @@ -5521,14 +5521,14 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
         OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
         SOFTWARE.
         
        -
      • -
      • -

        MIT License

        -

        Used by:

        - -
        The MIT License (MIT)
        +      
      • +
      • +

        MIT License

        +

        Used by:

        + +
        The MIT License (MIT)
         =====================
         
         Copyright © `2015` `Sebastian Thiel`
        @@ -5554,14 +5554,14 @@ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
         FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
         OTHER DEALINGS IN THE SOFTWARE.
         
        -
      • -
      • -

        MIT License

        -

        Used by:

        - -
        The MIT License (MIT)
        +      
      • +
      • +

        MIT License

        +

        Used by:

        + +
        The MIT License (MIT)
         
         Copyright (c) 2015 Bartłomiej Kamiński
         
        @@ -5582,26 +5582,26 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
         LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
         OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
         SOFTWARE.
        -
      • -
      • -

        MIT License

        -

        Used by:

        - -
        This project is dual-licensed under the Unlicense and MIT licenses.
        +      
      • +
      • +

        MIT License

        +

        Used by:

        + +
        This project is dual-licensed under the Unlicense and MIT licenses.
         
         You may use this code under the terms of either license.
         
        -
      • -
      • -

        MIT License

        -

        Used by:

        - -
        © 2016 Bertram Truong
        +      
      • +
      • +

        MIT License

        +

        Used by:

        + +
        © 2016 Bertram Truong
         © 2021 Kornel Lesiński
         
         Permission is hereby granted, free of charge, to any person obtaining a copy
        @@ -5622,14 +5622,14 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
         OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
         THE SOFTWARE.
         
        -
      • -
      • -

        Unicode License Agreement - Data Files and Software (2016)

        -

        Used by:

        - -
        UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE
        +      
      • +
      • +

        Unicode License Agreement - Data Files and Software (2016)

        +

        Used by:

        + +
        UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE
         
         Unicode Data Files include all data files under the directories http://www.unicode.org/Public/, http://www.unicode.org/reports/, http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and http://www.unicode.org/utility/trac/browser/.
         
        @@ -5652,9 +5652,9 @@ THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
         
         Except as contained in this notice, the name of a copyright holder shall not be used in advertising or otherwise to promote the sale, use or other dealings in these Data Files or Software without prior written authorization of the copyright holder.
         
        -
      • -
      -
    + +
+
diff --git a/www/index.css b/www/index.css index 6938537..9ceca0a 100644 --- a/www/index.css +++ b/www/index.css @@ -52,6 +52,9 @@ table.list td { #fieldsViewer td:nth-child(3) { text-align: right; } +#fieldsViewer td:nth-child(3) { + min-width: 8em; +} #fieldsViewer td:nth-child(4) { display: none; } diff --git a/www/index.html b/www/index.html index fe4f8fd..0ee33b4 100644 --- a/www/index.html +++ b/www/index.html @@ -1,14 +1,14 @@ - SMS Web Object Viewer (v0.1.0-beta.2) + SMS Web Object Viewer -

SMS Web Object Viewer (v0.1.0-beta.2)

+

SMS Web Object Viewer (v0.1.0-beta.3) (2023/07/25)