rs-process-memory icon indicating copy to clipboard operation
rs-process-memory copied to clipboard

Only part of a ReadProcessMemory or WriteProcessMemory request was completed.

Open supported opened this issue 4 years ago • 14 comments

Hello, I've used the example 'FastyBoy.rs' and changed the application name to what I'd be using, aswell as addresses,

However whenever running my program I receive the following image

supported avatar Aug 27 '21 13:08 supported

At which line in the FastyBoy.rs example you get this error? Have you tried again multiple times, is it always the same error? Which OS? Which arch (32bit, 64bit) does the FastBoy.rs example run on, which arch the target process (they may be different)?

Kiiyya avatar Aug 27 '21 13:08 Kiiyya

I'm getting the error at 69

I have tried it many times; results the same each time And I was using my own exe (x86), complied with nightly in x86

supported avatar Aug 27 '21 13:08 supported

L69 is just a call to set_offset, which does no API calls.

Kiiyya avatar Aug 27 '21 14:08 Kiiyya

Correction, My bad #77

Edit: This happens when reading/writing any memory.

supported avatar Aug 27 '21 14:08 supported

I am able to reproduce the error, but I have no clue what might cause it. The syscall issued looks correct, I have permissions, and the address on the other process exists too. Sorry, no clue :/

Kiiyya avatar Aug 27 '21 14:08 Kiiyya

Alright, glad to know it wasn't just me.

Will a fix be put in place? (If even possible).

supported avatar Aug 27 '21 14:08 supported

I won't fix stuff, and I'm not the maintainer. Your guess is as good as mine.

Kiiyya avatar Aug 27 '21 14:08 Kiiyya

Alright, Hopefully this is fixed, I suppose all we can do in the meantime is wait.

Thanks for the help :).

supported avatar Aug 27 '21 14:08 supported

The fastyboy.rs example is specifically for Mirror's Edge Catalyst, so I can't really help if you've changed it to use a different program. What's probably happening (given your error message) is that the types of data members are too wide for the offsets you're using. Could you try changing them to DataMember::<bool>s instead of DataMember::<f32>s?

Tommoa avatar Sep 01 '21 05:09 Tommoa

I also have the same issue with a simple assaultcube game test (which is supposed to be super easily hackable). I ran the executable as admin and even tried building for 32 bit (considering the game is also 32bit) but the issue persists. It happens whenever I try to read/get something (.get_offset(), .read()). When I use .write(...) it doesnt output any error but it doesn't actually change the value at the address either (i triple-checked the offsets and they work fine in C++).

I should also mention that I tried changing the type in DataMember::<> to bool / other more narrow int types but there's no difference (I know for a fact that the value the address is pointing to is a 4byte int since I'm using it in C++ as a normal int)

wowvain-dev avatar Jun 12 '22 11:06 wowvain-dev

@wowvain-dev would you be able to give some example code for assaultcube? I'd like to try this out to track down what might be happening here

Tommoa avatar Jun 29 '22 09:06 Tommoa

I may not be correct about this because im new to rust still. But this is what I have and I'm getting the same error

fn main() -> std::io::Result<()> {

   let name = "ac_client.exe";
   let mut pid = None;
   while pid.is_none() {
      pid = get_pid(name);
   }

   let test = 3000_u32;
   
   let process_handle = (pid.unwrap() as Pid).try_into_process_handle()?;
   let mut player_health = DataMember::<u32>::new(process_handle);
   player_health.set_offset(vec![0x00_17_E3_06, 0xE8 ]);
   player_health.write(&test); 
   unsafe {
      println!("Player Health: {}", player_health.read().unwrap());
   }
  Ok(())
}
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 299, kind: Uncategorized, message: "Only part of a ReadProcessMemory or WriteProcessMemory request was completed." }', src\main.rs:22:56
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: process didn't exit successfully: `target\debug\mk.exe` (exit code: 101)

DeadDior avatar Feb 02 '23 09:02 DeadDior

0x00_17_E3_06 is the ptr cheatengine-x86_64-SSE4-AVX2_FhFOPrXGMX and this is where it shows in kinda new to this player_health.set_offset(vec![0x00_17_E3_06, 0xE8 ]); is just the playerobj I think its vec![0x00_17_E3_06, 0xE8, 0x04 ] for the health still? cheatengine-x86_64-SSE4-AVX2_cFgdu4Zokh But still getting the error

DeadDior avatar Feb 02 '23 09:02 DeadDior

0x00_17_E3_06 is the ptr cheatengine-x86_64-SSE4-AVX2_FhFOPrXGMX and this is where it shows in kinda new to this player_health.set_offset(vec![0x00_17_E3_06, 0xE8 ]); is just the playerobj I think its vec![0x00_17_E3_06, 0xE8, 0x04 ] for the health still? cheatengine-x86_64-SSE4-AVX2_cFgdu4Zokh But still getting the error

I may find out the reason why your program is panicked: player_health.set_offset(vec![0x00_17_E3_06, 0xE8 ]); acctually you should change your code to: player_health.set_offset(vec![0x00_82_61_48]); or: player_health.set_offset(vec![0x00_82_60_60, 0xE8 ]) That's because "???.exe" + 0017E306 is a pointer point to an address(0x00826060), not an offset.

Note: I'm not a native English speaker, please ignore my writing mistakes.Hope my solution is of help to you.

asss-whom avatar May 28 '23 07:05 asss-whom