IntelSDM / RustDMACheat

Small DMA Cheat For Rust
MIT License
182 stars 55 forks source link

question regarding offsets #16

Closed Aiden-10 closed 7 months ago

Aiden-10 commented 7 months ago

How do you find the value of the static field offsets for examole in TODSky.h StaticField = 0xB8 how does one find that and where does it come from aswell as intance = 0. Thanks for the help and great source!

IntelSDM commented 7 months ago

The 0xB8 To access the static field contents is because unity creates a Heap at 0xB8, Think of it like an instance of the class for the static access of it. It will always be at 0xB8 in any static class. Whenever I have an instance set to 0 it is because I am going to get the instance from a field in the static class so I just set it to 0 until it is read.

Aiden-10 commented 7 months ago

Using your project, I was able to get all the information I need to make a radar cheat. I am having trouble however including files in the solution. I have never used pch but whenever I try and include for example imgui I get this error which prevents me from building:

"Error C2857 '#include' statement specified with the /Ycpch.h command-line option was not found in the source file"

Currently I made a new folder inside of misc named gui with all the imgui files I need to create a dx11 window. But when for example I #include "gui/imgui.h" I get this error and have tried for hours to fix it.

Thanks for the help

IntelSDM commented 7 months ago

With a PCH you need to #include "pch.h" as the first line of any c++ file.

Aiden-10 commented 7 months ago

Thanks that fixed the problem. Sorry for so many questions this will be my last. For my radar cheat I have started looping through the networkables and grabbing the positions of all ores, hemp, and TCs etc. The problem arises when I want to display all the positions on the window. Currently I re-read base networkables every 15 seconds in the main loop and then store all of the pointers to position and name and read from that. But next time I loop networkables it causes some lag so how would you go about this?

thanks

IntelSDM commented 7 months ago

The simple fix to lag with DMA is multi thread a caching and drawing thread and, mutex them together. Then use scatter reads for all your caching and only update when needed. Most static entities won't need to be updated while animals can be updated every 25ms instead of every frame.