@@ -243,10 +243,11 @@ impl<T> Win32Keyboard<T> {
243243 {
244244 return Err (
245245 Error ( ErrorOrigin :: OsLayer , ErrorKind :: UnsupportedOptionalFeature )
246- . log_error ( "cannot find keyboard signature because regex feature is disabled" )
246+ . log_error (
247+ "cannot find keyboard signature because regex feature is disabled" ,
248+ ) ,
247249 ) ; // todo: repalce with pelite sig
248250 }
249-
250251
251252 ( sig, muddy ! ( "win32k.sys" ) , 0x824F0 , 0x3808 ) // 24H2 win32k.sys + 0x824F0
252253 } else {
@@ -273,7 +274,9 @@ impl<T> Win32Keyboard<T> {
273274 {
274275 return Err (
275276 Error ( ErrorOrigin :: OsLayer , ErrorKind :: UnsupportedOptionalFeature )
276- . log_error ( "cannot find keyboard signature because regex feature is disabled" )
277+ . log_error (
278+ "cannot find keyboard signature because regex feature is disabled" ,
279+ ) ,
277280 ) ; // todo: repalce with pelite sig
278281 }
279282
@@ -286,7 +289,7 @@ impl<T> Win32Keyboard<T> {
286289 Err ( _) => {
287290 return Err (
288291 Error ( ErrorOrigin :: OsLayer , ErrorKind :: ModuleNotFound ) . log_info (
289- [ "unable to find kernel module" , target_kernel_module_name] . join ( " " )
292+ [ "unable to find kernel module" , target_kernel_module_name] . join ( " " ) ,
290293 ) ,
291294 )
292295 }
@@ -352,13 +355,13 @@ impl<T> Win32Keyboard<T> {
352355 & win32ksgd_module_info,
353356 g_session_global_slots_signature,
354357 )
355- . and_then ( |offset| {
358+ . map ( |offset| {
356359 // santity check
357- Ok ( if offset == 0 {
360+ if offset == 0 {
358361 g_session_global_slots_offset_fallback
359362 } else {
360363 offset
361- } )
364+ }
362365 } )
363366 . unwrap_or ( g_session_global_slots_offset_fallback) ;
364367 } ;
@@ -505,8 +508,11 @@ impl<T> Win32Keyboard<T> {
505508 . data_part ( ) ?;
506509
507510 // 48 8B 05 ? ? ? ? 48 89 81 ? ? 00 00 48 8B 8F + 0x3
508- let re = Regex :: new ( ida_regex ! [ 48 8 B 05 ? ? ? ? 48 89 81 ? ? 00 00 48 8 B 8 F ] )
509- . map_err ( |_| Error ( ErrorOrigin :: OsLayer , ErrorKind :: Encoding ) . log_info ( muddy ! ( "malformed gafAsyncKeyState signature" ) ) ) ?;
511+ let re =
512+ Regex :: new ( ida_regex ! [ 48 8 B 05 ? ? ? ? 48 89 81 ? ? 00 00 48 8 B 8 F ] ) . map_err ( |_| {
513+ Error ( ErrorOrigin :: OsLayer , ErrorKind :: Encoding )
514+ . log_info ( muddy ! ( "malformed gafAsyncKeyState signature" ) )
515+ } ) ?;
510516 let buf_offs = re
511517 . find ( module_buf. as_slice ( ) )
512518 . ok_or_else ( || {
0 commit comments