Quote:
Originally Posted by winkabean
i get the errors:
Code:
could the addresses be wrong because when i try to inject i get to the select server screen and it crashes.
|
The errors you get are the result of copying and pasting. The crashes indeed are the result of wrong adresses used. When modifying adresses like 0x0, ..., it should be obvious, that you don't remove recoil from weapons. The adresses used for bypassing hackshield are outdated as well (not 100% sure if HS and/or WR updated atm). You don't even have a bypass in this source, but to understand why not you have to understand hackshield. There are many ways, most sources you can find of this are already patched. Mainly because they are public,.... thats another topic
Also, for functions like no recoil you won't need to bypass hackshield. Bypassing hackshield is needed for example, when you are editing the games actual code (asm), ...
You'd better start wanting to understand what you are doing. Since you c&p'ed it all in there, hoping it'd work, i assume you can't or don't want to take the time to learn the programming language. Well i've been to lazy for that as well (you may just want to learn what you need to get your personal goal), some basics can come in handy though.
If there was a nice tutorial, explaining what you're actually doing, i'd place a link for it here. I just can't actually find any good right now.
So I'll explain stuff based on what you did. Please notice english isn't my native language, so if you don't get something just ask.
Code:
#include <Windows.h>
#include <stdio.h>
With this you are including already existing header files into your project. I recommend you this article if you want to know why you need them and what they are for:
Code:
#define ADR_PLAYERPOINTER 0xA5348C
#define ADR_SERVERPOINTER 0xA5341C
#define OFS_NORECOIL1 0x0
#define OFS_NORECOIL2 0x4
#define OFS_NORECOIL3 0x8
I think this should be already clear. Addresses are not easy to remember, when using them in a function, you may not want to type the actual address all the time. So you use something easier to remember. Also, when you need to update the addresses you don't need to change the address in every function that references it. I think that's easy to understand. Also definitions and declarations need to happen, before a function references them or the code that is meant to be referenced with them.
Code:
DWORD *ingame = (DWORD*)ADR_PLAYERPOINTER;
DWORD *outgame = (DWORD*)ADR_SERVERPOINTER;
Here you set pointers that you can later use to check if you are ingame (means actually when a battle starts, after the map loaded) or not (when you are in server selection, room selection (...)). For more information about pointers check:
Code:
void PlayerHacks()
{
Okay so here comes a function, in which you can place hacks related to the player. (pointer) (Superjump, Speed, ...). You are using void for this, as you don't need the function to return any values, just to execute some value changings (the actual "hack") itself. here some info on functions:
A basic void function (for this purposes) looks like this:
Code:
void FunctionName (void)
{
//here comes the code you want to be executed
}
DWORD dwPlayerPtr = *(DWORD*)ADR_PLAYERPOINTER;
if(dwPlayerPtr != 0)
[/code]
Here you use another pointer, to make clear that the function shall only be executed, if the value of ADR_PLAYERPOINTER is anything else than 0. (!= not equal to). This happens when you go ingame (like i explained before). There is already a pointer declared for this task, so you don't need to declare it again. (That happened because of C&P)
Code:
void PlayerHacks ()
{
[COLOR="Lime"]if (*ingame) [/COLOR]
See, using less code to get the exact same result.
As you maybe already noticed, with // you can comment a line of code, or "comment it out". When compiling a project the compiler will ignore text, that comes in a line after // . If you want to comment out larger sections than just a line of code (more lines of code), you can use /* and */ everthing between will get commented out, and the compiler won't care shit about it. This is good for example, if you want to keep a (or some) line(s) of code in your project, but don't want it to be compiled and being used in the final file you create. (For functions you are writing, that are not done yet, functions which reference to addresses that need to be updated first, can not be updated yet ....... endless possibilities.).
Code:
{
if(GetAsyncKeyState(VK_CONTROL) &1)
{
What you can do with
if should be clear. It is essential, to know what it's being used for (...) but you should get the main purpose of it. (If (lawl) not, check this article about control structures in c++:
) Check it anyways, it's essential as fuck.
With GetAsyncKeyState the hack will ask if a key is being pressed, and process the function, if(!) the button is actually pressed. In this case VK_CONTROL . (for a list of teh buttons: search damnit)
Code:
*(float*)(dwPlayerPtr + OFS_NORECOIL1) = 1;
*(float*)(dwPlayerPtr + OFS_NORECOIL2) = 1;
*(float*)(dwPlayerPtr + OFS_NORECOIL3) = 1;
}
}
}
Okay, to understand this you already should have very basic gamehacking expierience/knowledge. I assume you don't know what an offset is, and i'm getting rly tired right now, and don't wanna explain everything. So get your own information about Offsets and also about setting values with int, float, double,...
But very basically you disable the recoil of your weapon with this lines of code.
Code:
void HackThread()
{
for(;;)
{
if(*ingame)
{
PlayerHacks();
}
to sum things up when you are using more functions (ServerHacks, D3D... anything possible, you decide how you name your stuff, just sort it in right for the sake of clarity) and making the functions able to be called by the dllmain (... you can google the infos you need by yourself of course, problem is you won't find much explanation. source codes everywhere, but ppl don't explain shit. there are some things i'd maybe explain in a wrong way right now cuz i'm way tooo tired, long time no sleep lol)
ROFL. Speaking of sleep haha. With sleep you can pause the execution of code by a specific amount of time (in miliseconds).
Code:
BOOL WINAPI DllMain(HINSTANCE hModule, DWORD dwReason, LPVOID lpvReserved)
{
if(dwReason == DLL_PROCESS_ATTACH)
{
CreateThread(0, 0, (LPTHREAD_START_ROUTINE)HackThread, 0, 0, 0);
}
return TRUE;
}
This is the dllmain. Explanation:
NEVER place any functions or even declarations after the dllmain. I'm going to bed now cuz hell i'm falling asleep. If you need help with anything ask them fellow dudes there (
), they will be happy if someone wants to understand source code and not just wants source code.
If i can give you one final advise, the more you stick to the basics in the beginning, the more you can do in time. Maybe there should be some better tutorials, not sure if there already were, but i found nothing useful when i searched earlier. If someone sees any fails in any explanation, please correct me. i srsly go to sleep now, just wanted to make clear copying and pasting is useless without understanding anything you do. just wanna help