11use std:: {
22 arch:: global_asm,
33 ffi:: { c_void, CStr } ,
4- mem, ptr ,
4+ mem,
55 sync:: atomic:: { AtomicPtr , Ordering } ,
66} ;
77
8- use hooklet:: windows:: x86:: { deploy_rel32_raw, hook_call_rel32, CallRel32Hook , X86Rel32Type } ;
8+ use hooklet:: windows:: x86:: { deploy_rel32_raw, hook_call_rel32, hook_call_rel32_with_module , CallRel32Hook , X86Rel32Type } ;
99use log:: debug;
1010use p3_api:: {
1111 data:: { class27:: Class27Ptr , ddraw_fill_solid_rect, ddraw_set_constant_color, ddraw_set_render_dest, get_resolution_height, get_resolution_width} ,
1212 latin1_ptr_to_string,
1313 ui:: class73:: Class73Ptr ,
1414} ;
15- use windows:: core:: PCSTR ;
1615
1716const FULLHD_STRING : & CStr = c"1920 x 1080" ;
1817
@@ -103,7 +102,7 @@ pub unsafe extern "C" fn start() -> u32 {
103102
104103 // Fix empty bottom right corner
105104 debug ! ( "Deploying render_all_objects_hook" ) ;
106- match hook_call_rel32 ( PCSTR :: from_raw ( ptr :: null ( ) ) , 0x28649 , maybe_render_all_objects_hook as usize as u32 ) {
105+ match hook_call_rel32 ( 0x28649 , maybe_render_all_objects_hook as usize as u32 ) {
107106 Ok ( hook) => {
108107 HOOK_PTR . store ( Box :: into_raw ( Box :: new ( hook) ) , Ordering :: SeqCst ) ;
109108 }
@@ -112,11 +111,7 @@ pub unsafe extern "C" fn start() -> u32 {
112111
113112 // Fix acceleration map
114113 debug ! ( "Deploying dddraw_dll.dll decode_supported_files hook to replace the background image" ) ;
115- match hook_call_rel32 (
116- PCSTR :: from_raw ( c"aim.dll" . as_ptr ( ) as _ ) ,
117- 0x2984 ,
118- ddraw_dll_decode_supported_files_hook as usize as u32 ,
119- ) {
114+ match hook_call_rel32_with_module ( "aim.dll" , 0x2984 , ddraw_dll_decode_supported_files_hook as usize as u32 ) {
120115 Ok ( hook) => {
121116 debug ! ( "Hook {hook:?} set" ) ;
122117 DECODE_SUPPORTED_FILES_HOOK_PTR . store ( Box :: into_raw ( Box :: new ( hook) ) , Ordering :: SeqCst ) ;
@@ -126,7 +121,7 @@ pub unsafe extern "C" fn start() -> u32 {
126121
127122 // Fix acceleration map
128123 debug ! ( "Deploying load screen settings from accelMap.ini" ) ;
129- match hook_call_rel32 ( PCSTR :: from_raw ( ptr :: null ( ) ) , 0x12C5 , class73_place_ui_element_hook as usize as u32 ) {
124+ match hook_call_rel32 ( 0x12C5 , class73_place_ui_element_hook as usize as u32 ) {
130125 Ok ( hook) => {
131126 debug ! ( "Hook {hook:?} set" ) ;
132127 LOAD_ACCEL_MAP_INI_HOOK_PTR . store ( Box :: into_raw ( Box :: new ( hook) ) , Ordering :: SeqCst ) ;
0 commit comments