Solved Help with Arrays

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

TBA

Newbie
Full Member
Oct 1, 2012
23
307
1
So I was coding stuff from one of Fleep's videos and it wasn't working for me so I changed it to where it works just great.. but the code is bulky.
Can someone help me or give me Ideas on how to shorten the code! Im sure there is a way to do it with array right?
Thanks
C++:
bool RecoilStatus;
	char RecoilOpCode1[] = "\x90\x90";
	char RecoilOpCode2[] = "\x90\x90\x90";
	char RecoilOpCode3[] = "\x90";
	char RecoilOpCode4[] = "\x90\x90\x90\x90";
	char RecoilOpCode5[] = "\x90";
	char RecoilOpCode6[] = "\x90\x90";
	char RecoilOpCode7[] = "\x90\x90";
	char RecoilDefaultOpCode1[] = "\x8B\x16";
	char RecoilDefaultOpCode2[] = "\x8B\x52\x14";
	char RecoilDefaultOpCode3[] = "\x50";
	char RecoilDefaultOpCode4[] = "\x8D\x4C\x24\1C";
	char RecoilDefaultOpCode5[] = "\x51";
	char RecoilDefaultOpCode6[] = "\x8B\xCE";
	char RecoilDefaultOpCode7[] = "\xFF\xD2";
	DWORD RecoilAddress1 = 0x00463781;
	DWORD RecoilAddress2 = 0x00463783;
	DWORD RecoilAddress3 = 0x00463786;
	DWORD RecoilAddress4 = 0x00463787;
	DWORD RecoilAddress5 = 0x0046378B;
	DWORD RecoilAddress6 = 0x0046378C;
	DWORD RecoilAddress7 = 0x0046378E;
C++:
if (GetAsyncKeyState(VK_F4))
			{
			OnePressTMR = clock();
			RecoilStatus = !RecoilStatus;
			if (RecoilStatus)
			{
			RecoilStatusLBL->Text = "ON";
			WriteToMemory(RecoilAddress1, RecoilOpCode1, 2);
			WriteToMemory(RecoilAddress2, RecoilOpCode2, 3);
			WriteToMemory(RecoilAddress3, RecoilOpCode3, 1);
			WriteToMemory(RecoilAddress4, RecoilOpCode4, 4);
			WriteToMemory(RecoilAddress5, RecoilOpCode5, 1);
			WriteToMemory(RecoilAddress6, RecoilOpCode6, 2);
			WriteToMemory(RecoilAddress7, RecoilOpCode7, 2);	
			}
			else
			{
			RecoilStatusLBL->Text = "OFF";
			WriteToMemory(RecoilAddress1, RecoilDefaultOpCode1, 2);
			WriteToMemory(RecoilAddress2, RecoilDefaultOpCode2, 3);
			WriteToMemory(RecoilAddress3, RecoilDefaultOpCode3, 1);
			WriteToMemory(RecoilAddress4, RecoilDefaultOpCode4, 4);
			WriteToMemory(RecoilAddress5, RecoilDefaultOpCode5, 1);
			WriteToMemory(RecoilAddress6, RecoilDefaultOpCode6, 2);
			WriteToMemory(RecoilAddress7, RecoilDefaultOpCode7, 2);
			}
		}
 

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,140
78,998
2,394
Fleep used arrays for some reason unknown to me. Just do like the pros do:
C++:
if (GetAsyncKeyState(VK_F8))
            {
                Hack.KeyPressTimer = clock();
                aBot.bNoRecoilStatus = !aBot.bNoRecoilStatus;
                if (aBot.bNoRecoilStatus)
                {
                    WriteProcessMemory(hProcHandle, (LPVOID)(0x463786), "\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90", 10, NULL);
                    Display.Print(&Display.sNoRecoilStatus, "ON");
                }

                else
                {
                    WriteProcessMemory(hProcHandle, (LPVOID)(0x463786), "\x50\x8D\x4C\x24\x1C\x51\x8B\xCE\xFF\xD2", 10, NULL);
                    Display.Print(&Display.sNoRecoilStatus, "OFF");
                }
            }
 
Last edited:

TBA

Newbie
Full Member
Oct 1, 2012
23
307
1
Rake;38368 said:
Fleep used arrays for some reason that didn't make any sense. Just do like the pros do:
C++:
if (GetAsyncKeyState(VK_F8))
			{
				Hack.KeyPressTimer = clock();
				aBot.bNoRecoilStatus = !aBot.bNoRecoilStatus;
				if (aBot.bNoRecoilStatus)
				{
					WriteProcessMemory(hProcHandle, (LPVOID)(0x463786), "\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90", 10, NULL);
					Display.Print(&Display.sNoRecoilStatus, "ON");
				}

				else
				{
					WriteProcessMemory(hProcHandle, (LPVOID)(0x463786), "\x50\x8D\x4C\x24\x1C\x51\x8B\xCE\xFF\xD2", 10, NULL);
					Display.Print(&Display.sNoRecoilStatus, "OFF");
				}
			}
Yea idk how to make that work :/
but thats a heck of alot shorter and cleaner..
 

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,140
78,998
2,394
assault cube?

C++:
if (GetAsyncKeyState(VK_F4))
{
OnePressTMR = clock();
RecoilStatus = !RecoilStatus;
if (RecoilStatus)
{
RecoilStatusLBL->Text = "ON";
WriteProcessMemory(hProcHandle, (LPVOID)(0x463786), "\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90", 10, NULL);
}

else
{
RecoilStatusLBL->Text = "OFF";
WriteProcessMemory(hProcHandle, (LPVOID)(0x463786), "\x50\x8D\x4C\x24\x1C\x51\x8B\xCE\xFF\xD2", 10, NULL);
}
}
 

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,140
78,998
2,394
just rename hprochandle to whatever your handle variable is for ac_client.exe
 

TBA

Newbie
Full Member
Oct 1, 2012
23
307
1
I did
HANDLE hProcHandle = NULL;

and theres no errors but when I run AC it doesnt give me no recoil?

I'm also using the DLL Window Form that i was talking about yesterday
I just downloaded VS2013
and put the code in and it all works
so there is no hProcHandle....
 
Last edited:

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,140
78,998
2,394
I did
HANDLE hProcHandle = NULL;

and theres no errors but when I run AC it doesnt give me no recoil?

I'm also using the DLL Window Form that i was talking about yesterday
I just downloaded VS2013
and put the code in and it all works
so there is no hProcHandle....
rename hProcHandle to hProc, that is what Fleep defines it as in that tutorial you are following
 

TBA

Newbie
Full Member
Oct 1, 2012
23
307
1
Thats for the first part I have that done and correct the second part of the videos with the DLL injector is where im at.
He make a console injector..
Then goes to Win32 Project and makes a Window Form To use the F1-F2, etc.
I got all the code to work... Im just trying to make it smaller and neater.
And in the second part with the DLL he never used hProc or hProchandle.
 

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,140
78,998
2,394
ok so try this:

C++:
if (GetAsyncKeyState(VK_F4))
{
OnePressTMR = clock();
RecoilStatus = !RecoilStatus;
DWORD old_protect;
if (RecoilStatus)
{
RecoilStatusLBL->Text = "ON";
VirtualProtect((void*)0x463786, 10, PAGE_EXECUTE_READWRITE, &old_protect);
memcpy((void*)0x463786, (PBYTE)("\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90"), 10);
VirtualProtect((void*)0x463786, 10, old_protect, &old_protect);
}

else
{
RecoilStatusLBL->Text = "OFF";
VirtualProtect((void*)0x463786, 10, PAGE_EXECUTE_READWRITE, &old_protect);
memcpy((void*)0x463786, (PBYTE)("\x50\x8D\x4C\x24\x1C\x51\x8B\xCE\xFF\xD2"), 10);
VirtualProtect((void*)0x463786, 10, old_protect, &old_protect);
}
}
 

TBA

Newbie
Full Member
Oct 1, 2012
23
307
1
And it worked

I'm assuming that you can do that with all the other addresses
Like the FullAuto, Ammo Freeze, and or whatever else i put in
Rather than declaring the Address first?


Thanks alot btw
 

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,140
78,998
2,394
And it worked

I'm assuming that you can do that with all the other addresses
Like the FullAuto, Ammo Freeze, and or whatever else i put in
Rather than declaring the Address first?


Thanks alot btw
You'll have to figure the rest out yourself :) You have alot to learn!
 

bitm0de

Newbie
Full Member
Feb 28, 2016
19
358
2
Rake;38376 said:
ok so try this:

C++:
if (GetAsyncKeyState(VK_F4))
{
OnePressTMR = clock();
RecoilStatus = !RecoilStatus;
DWORD old_protect;
if (RecoilStatus)
{
RecoilStatusLBL->Text = "ON";
VirtualProtect((void*)0x463786, 10, PAGE_EXECUTE_READWRITE, &old_protect);
memcpy((void*)0x463786, (PBYTE)("\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90"), 10);
VirtualProtect((void*)0x463786, 10, old_protect, &old_protect);
}

else
{
RecoilStatusLBL->Text = "OFF";
VirtualProtect((void*)0x463786, 10, PAGE_EXECUTE_READWRITE, &old_protect);
memcpy((void*)0x463786, (PBYTE)("\x50\x8D\x4C\x24\x1C\x51\x8B\xCE\xFF\xD2"), 10);
VirtualProtect((void*)0x463786, 10, old_protect, &old_protect);
}
}
0.o

The old protection is overwritten and saved either way, why have that repeated code in both code branches?

C++:
if (GetAsyncKeyState(VK_F4))
{
   OnePressTMR = clock();
   RecoilStatus = !RecoilStatus;
   DWORD old_protect;
   VirtualProtect((void *)0x463786, 10, PAGE_EXECUTE_READWRITE, &old_protect);
   if (RecoilStatus)
   {
      RecoilStatusLBL->Text = "ON";
      memcpy((void *)0x463786, (PBYTE)("\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90"), 10);
   }
    
   else
   {
      RecoilStatusLBL->Text = "OFF";
      memcpy((void *)0x463786, (PBYTE)("\x50\x8D\x4C\x24\x1C\x51\x8B\xCE\xFF\xD2"), 10);
   }
   VirtualProtect((void *)0x463786, 10, old_protect, &old_protect);
}
 
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