Solved Infinite ammo, multiple weapons

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

KISKE

Game Developer
Meme Tier VIP
Fleep Tier Donator
Jul 27, 2016
170
4,038
16
Hi everyone,
Who do I achieve what the title says ?

I have the addresses of my three current weapons, and not even the static ones because I can't find them.

My current weapons:
C++:
Weapon 1
4552FA7C (max ammo, float)
4B3C6718 (current ammo, int)

Weapon 2
455354DC (max ammo, float)
4B3C6BF8 (current ammo, int)

Weapon 3
4553098C (max ammo, float)
4B3C6D38 (current ammo, int)

I don't know what to do and I can't find any tutorial that explain infinite ammo on all weapons, all I can find is infinite ammo on one weapon.
 

Traxin

Escobar Tier VIP
Dank Tier Donator
Aug 3, 2015
1,041
25,378
154
Code is always static and will have a consistent offset from the module base.
For example, if you open cheat engine's memory view and make sure View -> Show Module Addresses is enabled and you'll see what r4z0r was talking about.
"Game.exe+5CDB84" or whatever.
Game.exe being the module the code is located in, with 5CDB84 being it's offset from the base.
Lets say Game.exe has a base address of 00400000 which is usually the case for the main module, we add our offset "5CDB84" and end up with an address of 0x9CDB84 (BaseAddress+Offset).
These are just hypothetical numbers, just explaining the concepts here.

Hope it helped :)
 

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,164
78,998
2,399
If you do "find what writes to" on the current weapon ammo, do they all use the same function to decrease ammo when you shoot? If so NOP the necessary instructions to stop decrementing the ammo.

There may be a pointer called CurrentWeapon that points to whatever pointer object you are currently holding, in this case you would just use this pointer and overwrite 99999 over the ammo. In this manner, whatever weapon you're holding will always have unlimited ammo. That has worked for me in several games
 

KISKE

Game Developer
Meme Tier VIP
Fleep Tier Donator
Jul 27, 2016
170
4,038
16
Hi Rake,
Sorry for the delay.

I saw this tutorial series www.youtube.com/watch?v=BHYjxsDROn4 and I'm progressing.
I went for the path of NOP because I don't have any clue about how to get the CurrentWeapon pointer.

Thank you!
 

KISKE

Game Developer
Meme Tier VIP
Fleep Tier Donator
Jul 27, 2016
170
4,038
16
Hi again Rake,
I'm trying to make in code what I achieve in x32dbg, filling with NOP.





My code is this:
C#:
private ProcessMemoryReader videoGame = new ProcessMemoryReader();

Process[] gameProcess = Process.GetProcessesByName("Borderlands");
if(gameProcess.Length > 0) {
	this.videoGame.ReadProcess = gameProcess[0];

	byte nopCode = 0x90;
	this.videoGame.WriteByte(0x58bd45, nopCode);
	this.videoGame.WriteByte(0x58bd46, nopCode);

	// Doesn't work either
	//this.videoGame.WriteMem(0x58bd45, new byte[] { nopCode, nopCode });
}
I'm aware that you don't know C#, but the game just crash when I re-open the tab, any ideas of where I can investigate ?

Just to be clear, when I do this through x32dbg the game doesn't crash.
 
Last edited:

r4z0r

Coder
Meme Tier VIP
Jul 21, 2016
246
2,678
13
Attach the debugger to the game, pause the game and run your code, check if the addresses changed how they should and if not you code or your addresses are wrong.
 

KISKE

Game Developer
Meme Tier VIP
Fleep Tier Donator
Jul 27, 2016
170
4,038
16
Attach the debugger to the game, pause the game and run your code, check if the addresses changed how they should and if not you code or your addresses are wrong.
Hi r4z0r, you are right, the addresses didn't change on x32dbg, so I look at the code because I know the address was correct.
My problem was on OpenProcess, I have to give them all access (0x1F0FFF) and now it works.

Thank you.
I'm so happy right now.

One more question:


That address is static or can change ?
 

r4z0r

Coder
Meme Tier VIP
Jul 21, 2016
246
2,678
13
Static, but open it with show disassemble in the right of this screen, check if there's something before this address 'cause I don't know if this window show those. E.g: some.dll + CD56B3 or some.exe + CD56B3, if you see one of these cases fell free to reply to this post and i'll help you.
 

KISKE

Game Developer
Meme Tier VIP
Fleep Tier Donator
Jul 27, 2016
170
4,038
16
Thank you r4z0r and Traxin for your explanations.

I don't know if create a new post because has nothing to do with the first question, but nevermind, here we are.
I have a new problem that I don't understand.



That line highlighted has something to do with the ammo being decremented when I shoot.
I just NOP the entire thing:



And of course, my ammo is now freezed, but also my armor and health values, and the armor/health of enemies aswell.
It's really confusing, I don't understand why this is happening.
 
Last edited:

r4z0r

Coder
Meme Tier VIP
Jul 21, 2016
246
2,678
13
Okay, I'll explain as better as I can. If you only NOPED this operation and all the things of all entities are now frozen I can only think that the guy/team who coded this game had this idea: They created a global decrease function which receives an entity as parameter or the atribute of the entity as a pointer and decrease it by a certain amount. There are one way I know to solve your problem, you traceback this function as deep as you can until you see only the health/armor/ammo changing (I recommend you ChrisFayte tutorials for this) and about the enemies having infinite ammo/health/ammo as well you need to Hook this function and use CMP to check if the ENTITY sent to the function is an enemy or you. Example, if the entity is yourself -> do nothing else -> run the code. I highly recommend ChrisFayte tutorials for this either, they're amazing, 30min of an amazing explanation.
 

KISKE

Game Developer
Meme Tier VIP
Fleep Tier Donator
Jul 27, 2016
170
4,038
16
Hi again,
I understand perfectly what you said and I saw videos and I tried for some couple of hours without achieve nothing, however, I learned things that I didn't know, so, thank you for that.

About my problem with freeze the ammo, I just saw something, I have many many weapons, but, I notice that the game has only seven types of ammo (caliber) used by all the weapons, so, find base address of that seven types of ammo and freeze them, the result it's the same, so, I did it.

Image just for reference:


Thank you again!
 

Traxin

Escobar Tier VIP
Dank Tier Donator
Aug 3, 2015
1,041
25,378
154
Hi again,
I understand perfectly what you said and I saw videos and I tried for some couple of hours without achieve nothing, however, I learned things that I didn't know, so, thank you for that.

About my problem with freeze the ammo, I just saw something, I have many many weapons, but, I notice that the game has only seven types of ammo (caliber) used by all the weapons, so, find base address of that seven types of ammo and freeze them, the result it's the same, so, I did it.

Image just for reference:


Thank you again!
What game is this anyways?
 

r4z0r

Coder
Meme Tier VIP
Jul 21, 2016
246
2,678
13
You can do this but there's no way running away from that xD. If you are going to create more advanced cheats (onehit,autokill,etc...) you'll need to cave really deep so I recommend doing that, ofc the method you used is simpler for this ocasion.
 

Traxin

Escobar Tier VIP
Dank Tier Donator
Aug 3, 2015
1,041
25,378
154
You know.... I've never played the borderlands series.... been on the list though for a while lol
 
Attention! Before you post:

Read the How to Ask Questions Guide
99% of questions are answered in the Beginner's Guide, do it before asking a question.

No Hack Requests. Post in the correct section.  Search the forum first. Read the rules.

How to make a good post:

  • Fill out the form correctly
  • Tell us the game name & coding language
  • Post everything we need to know to help you
  • Ask specific questions, be descriptive
  • Post errors, line numbers & screenshots
  • Post code snippets using code tags
  • If it's a large project, zip it up and attach it

If you do not comply, your post may be deleted.  We want to help, please make a good post and we will do our best to help you.

Community Mods