maple_rs/
linux.rs

1use crate::{
2    Result,
3    error::MapleError,
4    memory_module::{MemoryModule, MemoryModuleBuilder},
5};
6
7pub struct LinuxMemoryModule {
8    _placeholder: (),
9}
10
11impl LinuxMemoryModule {
12    pub fn from_memory(_data: &[u8]) -> Result<Self> {
13        Err(MapleError::PlatformNotSupported(
14            "Linux implementation not yet available".to_string(),
15        ))
16    }
17
18    pub fn from_memory_with_options(_data: &[u8], _options: &MemoryModuleBuilder) -> Result<Self> {
19        Err(MapleError::PlatformNotSupported(
20            "Linux implementation not yet available".to_string(),
21        ))
22    }
23}
24
25impl MemoryModule for LinuxMemoryModule {
26    fn get_proc_address(&self, _name: &str) -> Result<*const u8> {
27        Err(MapleError::PlatformNotSupported(
28            "Linux implementation not yet available".to_string(),
29        ))
30    }
31
32    fn get_proc_address_ordinal(&self, _ordinal: u16) -> Result<*const u8> {
33        Err(MapleError::PlatformNotSupported(
34            "Linux implementation not yet available".to_string(),
35        ))
36    }
37
38    fn execute_entry_point(&self) -> Result<()> {
39        Err(MapleError::PlatformNotSupported(
40            "Linux implementation not yet available".to_string(),
41        ))
42    }
43
44    fn call_dll_entry_point(&self, _reason: u32) -> Result<bool> {
45        Err(MapleError::PlatformNotSupported(
46            "Linux implementation not yet available".to_string(),
47        ))
48    }
49
50    fn free(&mut self) -> Result<()> {
51        Err(MapleError::PlatformNotSupported(
52            "Linux implementation not yet available".to_string(),
53        ))
54    }
55
56    fn is_loaded(&self) -> bool {
57        false
58    }
59
60    fn base_address(&self) -> *const u8 {
61        std::ptr::null()
62    }
63
64    fn size(&self) -> usize {
65        0
66    }
67
68    fn find_resource(
69        &self,
70        _name: Option<&str>,
71        _resource_type: Option<&str>,
72    ) -> Result<*const u8> {
73        Err(MapleError::PlatformNotSupported(
74            "Linux implementation not yet available".to_string(),
75        ))
76    }
77
78    fn find_resource_ex(
79        &self,
80        _name: Option<&str>,
81        _resource_type: Option<&str>,
82        _language: u16,
83    ) -> Result<*const u8> {
84        Err(MapleError::PlatformNotSupported(
85            "Linux implementation not yet available".to_string(),
86        ))
87    }
88
89    fn sizeof_resource(&self, _resource: *const u8) -> Result<usize> {
90        Err(MapleError::PlatformNotSupported(
91            "Linux implementation not yet available".to_string(),
92        ))
93    }
94
95    fn load_resource(&self, _resource: *const u8) -> Result<*const u8> {
96        Err(MapleError::PlatformNotSupported(
97            "Linux implementation not yet available".to_string(),
98        ))
99    }
100
101    fn load_string(&self, _id: u32, _buffer: &mut [u16]) -> Result<usize> {
102        Err(MapleError::PlatformNotSupported(
103            "Linux implementation not yet available".to_string(),
104        ))
105    }
106
107    fn load_string_ex(&self, _id: u32, _buffer: &mut [u16], _language: u16) -> Result<usize> {
108        Err(MapleError::PlatformNotSupported(
109            "Linux implementation not yet available".to_string(),
110        ))
111    }
112}