dimacotorobai / DeadSpace3ResouceManager

A resource manager for the game Dead Space 3 Steam version. The user can press the keys shown in the image in order to gain 500 extra pieces of that resource. The user can press F7 to exit the application.
11 stars 1 forks source link

Doesn't seem to work #1

Open kbrizov opened 2 months ago

kbrizov commented 2 months ago

Hello, I built the executable from the source. It successfully finds the deadspace.exe, but it doesn't work for some reason. I tried debugging it and the input keys are properly triggering, but no resources are added. I can't quite figure out what is happening. The same happens if I use the provided executable. Perhaps the offsets are no longer valid?

EDIT: I'm using the EA App version (the new Origin).

dimacotorobai commented 2 months ago

Hey, I just tested with the Steam version of the game and it seems to be working. I believe the offsets between the Steam and EA App version are different. Sorry about the confusion, I should have put it in the description.

kbrizov commented 2 months ago

Thank you for your time. How would I discover the proper offsets for the EA App version? Sorry if it's a naive question. I'm new to this.

dimacotorobai commented 2 months ago

No worries, it's quite simple. I would recommend watching the Guided Hacking YT channel in particular their GH100 series as it will provide all the required knowledge for getting started with game hacking.

Part 1 - Finding the memory addresses which store the resources

Tutorial GH102 - https://youtu.be/_THZIUELKrw?si=xhRMjQ15r_V-LbYh

Go into your Dead Space 3 game(in-game/able to move character) then open up Cheat Engine and attach to the deadspace3.exe process. Once, Cheat Engine is set up you can begin by looking for the value of Tungsten(can use any resource tbh). Search for the current value(First Scan, Scan Type = Exact Value, Value Type = 4 Bytes) and you should see a lot of results. Modify the value by either finding or spending Tungsten and search for the new value(Next Scan). You should try to narrow it down to 1 result. Copy the result into the address list and try to modify the value. If the value of Tungsten(or whatever resource you were looking for) changes then you have found the right value. Make sure you don't die or restart the game while doing this process as it will reset the addresses for the resources.

If you open up the Memory View window and right click on the bottom part and check Display Type > 4 Byte decimal, then you go to the Tungsten address that you found earlier, you should see the rest of the values which represent Semiconductor, Scrap Metal, Somatic Gel, Transducer, and Ration Seals. This means that you all the resources are close in memory and differ by 4 bytes. This will be useful for eliminating redundancy in finding the rest of the resources.

Part 2 - Finding a static pointer and offsets

Tutorial GH105 - https://youtu.be/rBe8Atevd-4?si=mVJ_VZrFYTg8gMmR

As mentioned earlier every time you die, restart the game, or reach a new chapter the addresses for the resources change as they get reallocated in memory. We need to find a static pointer and use the offsets to derive the dynamic addresses for the resources on every run. This can be done using the Pointer Scan feature in Cheat Engine, also can be done manually but will require a lot of trial and error. The GH105 video does a great job at explaining and showing how to perform the pointer scan I would suggest watching/following along in that tutorial.

But more or less you will need to find the Tungsten address then right-click and pick Generate pointermap and save the pointer map. Then you will need to restart the game(resource addresses need to change) and repeat the steps outlined in Part 1. Repeat these steps until you have generated ~3-4 pointer maps at which point you can use the Pointer Scan feature on these pointer maps(set the Max Level to 7 or greater, the offsets I got were 7). At this point, you might find that there are a lot of results pointing to the Tungsten address, usually more than 1 of them is valid, and can use any(I usually save a couple in my address list just in case I picked the wrong one).

Once you found the static pointer and offsets for the Tungsten address you can find the other resources using the information from earlier. The rest of the resources are 4 bytes apart one after the other in memory, so that means for the last offset you just have to add 4 bytes to get the next resource and so you can avoid re-doing all the work for the rest.

I hope this guide helps you find the offsets. Again, I recommend watching those tutorials and the other videos created by Guided Hacking as they are great, and feel free to ask if you have any questions.

kbrizov commented 2 months ago

Hey, thank you very much for the detailed answer! Best regards!