Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › MultiPlayer Game Hacks & Cheats › Combat Arms Hacks & Cheats › Combat Arms Hack Coding / Programming / Source Code › Some codes that can be useful!

Some codes that can be useful!

Posts 1–13 of 13 · Page 1 of 1
Nubzgetkillz
Nubzgetkillz
[UPDATED] lol Some codes that can be useful!
These are some codes that you "might" find useful to use in your hacks!

Random Number Picking:
This can be used to pick random speeds for speedhacks / rgb colors for chams /or almost anything!

Code:
#include <windows.h> 
#include <stdio.h> 
#include <iostream>
#include "time.h"

using namespace std;

int RandomNumber,Hotkey;

int main()
{
    srand(time(NULL));
    RandomNumber = (int)(rand()%100);
    cout << "RandomNumber: " << RandomNumber << endl;
}
Here is another example off of a website that Music_King posted:
Code:
/* srand example */
#include <stdio.h>
#include <stdlib.h>
#include <time.h>

int main ()
{
  printf ("First number: %d\n", rand() % 100);
  srand ( time(NULL) );
  printf ("Random number: %d\n", rand() % 100);
  srand ( 1 );
  printf ("Again the first number: %d\n", rand() %100);

  return 0;
}
Code:
Output:

First number: 41
Random number: 13
Again the first number: 41
Code:
RandomNumber = (int)(rand()%100);
Saying Random Number from 1 - 100.

Like For maybe chams
Code:
(A,R,G,B)
(rand()%255,rand()%255,rand()%255,rand()%255);
Something like that.

for SpeedHack... lol maybe
Code:
SpeedHackNumber = (int)(rand()%100);
Code:
if(speedhack)
{
    *(float*) Speed_Address  =  SpeedHackNumber * 5;
}
*SpeedHackNumber * 5 -> Means The random speedhacknumber multiplied by 5.
*Just an example

May have errors, Fix them and have fun.
Besides if this is going to be used in your hack you don't need the random project that i just wrote up

All for now.. I had more in my mind but I forgot! ok haha bye!
I'm bored and having fun Thanks and comment with your snippets hehe
#1 · edited 15y ago · 15y ago
WH
whit
Oh this code is so Pro Nubz
#2 · 15y ago
MiNT
MiNT
the numbers in ur example will not give u true random numbers,
each time u run ur program u will get the same set of numbers.
do this to fix the problem

Code:
//top
#include "time.h"

//in code
srand(time(NULL));

..
..
// all of ur calls to rand()
#3 · 15y ago
Nubzgetkillz
Nubzgetkillz
Quote Originally Posted by whit View Post
Oh this code is so Pro Nubz
I kno right? Proist in this whole section
hehe thanks

*Whit's Penis --> Huge
#4 · 15y ago
CAFlames
CAFlames
Actually this could be used for hook. Go search it.
#5 · 15y ago
Nubzgetkillz
Nubzgetkillz
Quote Originally Posted by MuSiC_kInG View Post
the numbers in ur example will not give u true random numbers,
each time u run ur program u will get the same set of numbers.
do this to fix the problem

Code:
//top
#include "time.h"

//in code
srand(time(NULL));

..
..
// all of ur calls to rand()
Hehe I added it for teh nubz
#6 · 15y ago
WH
whit
Quote Originally Posted by MuSiC_kInG View Post
the numbers in ur example will not give u true random numbers,
each time u run ur program u will get the same set of numbers.
do this to fix the problem

Code:
//top
#include "time.h"

//in code
srand(time(NULL));

..
..
// all of ur calls to rand()
Depends Really what you want the Random number for..
I would use srand() for random cham color as nubz said but i use about the same code he post for my spammer to add a ramdon number to the end of the text ingame so it dont block it out..So it dont really matter in that situation as i just need any number even if it is the same every time you run..
#7 · 15y ago
MiNT
MiNT
Quote Originally Posted by whit View Post


Depends Really what you want the Random number for..
I would use srand() for random cham color as nubz said but i use about the same code he post for my spammer to add a ramdon number to the end of the text ingame so it dont block it out..So it dont really matter in that situation as i just need any number even if it is the same every time you run..
please dont act like you know more than me :P
cuz u dont .

srand() is for seeding the values that rand() uses to collect
srand - C++ Reference
#8 · 15y ago
CAFlames
CAFlames


D3D FPS


Code:
#include "time.h"

float fFps = NULL;
float fLastTickCount = NULL;
float fCurrentTickCount;
char cFrameRate[50] = {NULL};
char *GetFrameRate()
{
fCurrentTickCount = clock() * 0.001f;
++fFps;
if((fCurrentTickCount - fLastTickCount) > 1.0f)
{
fLastTickCount = fCurrentTickCount;
sprintf( cFrameRate, "[ Your FPS = %d ]", int( fFps ) );
fFps = 0;
}
return cFrameRate;
}
to use:

Code:
Directx.DrawString(10, 2, D3DCOLOR_XRGB( 255, 255, 0 ), Directx.pFont,  GetFrameRate());


EDIT: Credits to someone.. i think ac1d_burn?
#9 · 15y ago
WH
whit
Quote Originally Posted by MuSiC_kInG View Post
please dont act like you know more than me :P
cuz u dont .

srand() is for seeding the values that rand() uses to collect
srand - C++ Reference
Woe if you wanna Get cocky about it
Ya Know that Purple name dont make you Big and Bad

I know what srand is..A function that is hardly ever used, same with rand
#10 · edited 15y ago · 15y ago
MiNT
MiNT
another note,
only seed rand() 1 time or u will start getting the same numbers u got again
#11 · 15y ago
DE
Departure
Quote Originally Posted by whit View Post


Woe if you wanna Get cocky about it
Ya Know that Purple name dont make you Big and Bad

I know what srand is..A function that is hardly ever used, same with rand
Actually he's right, but its only needed to be called on initialization, Its same as "Randomize" in delphi.. its creates the seed which is then used by "Random" functions. And its always used with random(should be always used anyway) otherwise as he said, random will not be so random if you don't use it.


//Edit
didn't see post above, but yeah call it only once on initialization
#12 · edited 15y ago · 15y ago
WH
whit
Quote Originally Posted by Departure View Post
Actually he's right, but its only needed to be called on initialization, Its same as "Randomize" in delphi.. its creates the seed which is then used by "Random" functions. And its always used with random(should be always used anyway) otherwise as he said, random will not be so random if you don't use it.


//Edit
didn't see post above, but yeah call it only once on initialization
Oh i know he was right lol
I think he misunderstood me..
I was saying i didnt really care for a completely new set of number on start up for my spammer just as long as theres a different number for every line spammed
#13 · 15y ago
Posts 1–13 of 13 · Page 1 of 1

Post a Reply

Tags for this Thread

None