PDA

View Full Version : stamina code making error



mojo007
04-15-2008, 06:29 AM
when i compile it, i got error on stamina code

error C2660: 'WriteProcessMemory' : function does not take 6 parameters


void CTestDlg::Onstamina()
{

nt t=1120403456;
memory();
WriteProcessMemory(hProcess,(LPVOID*)(DWORD)0x1376 340, 288, &t , 4 ,NULL);
}

virus7799
04-15-2008, 06:48 AM
when i compile it, i got error on stamina code

error C2660: 'WriteProcessMemory' : function does not take 6 parameters


void CTestDlg::Onstamina()
{

nt t=1120403456;
memory();
WriteProcessMemory(hProcess,(LPVOID*)(DWORD)0x1376 340, 288, &t , 4 ,NULL);
}


Don't use WriteProcessMemory for stamina, use WritePointerFloat function.

mojo007
04-15-2008, 07:01 AM
ok now i got error

'WritePointerFloat' : function does not take 6 parameters


void WritePointerFloat(long addy, short offset, float value)
{
long maddy;
long saddy;
memory();
ReadProcessMemory(hProcess, (LPVOID*)(DWORD) addy, &maddy, sizeof(maddy), NULL);
saddy = maddy + offset;
WriteProcessMemory(hProcess, (LPVOID*)(DWORD) saddy, &value, sizeof(value), NULL);
}


void CTestDlg::Onstaminaon()
{
int t=1120403456;
memory();
WritePointerFloat(hProcess,(LPVOID*)(DWORD)0x13763 40, 288, &t , 4 ,NULL);
}

virus7799
04-15-2008, 07:07 AM
ok now i got error

'WritePointerFloat' : function does not take 6 parameters


void WritePointerFloat(long addy, short offset, float value)
{
long maddy;
long saddy;
memory();
ReadProcessMemory(hProcess, (LPVOID*)(DWORD) addy, &maddy, sizeof(maddy), NULL);
saddy = maddy + offset;
WriteProcessMemory(hProcess, (LPVOID*)(DWORD) saddy, &value, sizeof(value), NULL);
}



void CTestDlg::Onstaminaon()
{
int t=1120403456;
memory();
WritePointerFloat(hProcess,(LPVOID*)(DWORD)0x13763 40, 288, &t , 4 ,NULL);
}

You don't use the function like that.
Here is what it would look like:


WritePointerFloat(0x1376340,0x288,1120403456);

mojo007
04-15-2008, 07:13 AM
ok TY now compiled succes. imma go try ingame,

virus7799
04-15-2008, 07:17 AM
ok TY now compiled succes. imma go try ingame,

Remember, you need to put that code into a timer, not a button.

mojo007
04-15-2008, 07:18 AM
hmmm, how can i see stamina working ingame, i turned the button on

but my health damage its still normal

virus7799
04-15-2008, 07:21 AM
hmmm, how can i see stamina working ingame, i turned the button on

but my health damage its still normal

You have to put it in a timer, and then enable it in a button. I'm hoping you know how to do that....

mojo007
04-15-2008, 07:23 AM
ok but how to do it i cant find the timer, in the tab.

virus7799
04-15-2008, 07:28 AM
ok but how to do it i cant find the timer, in the tab.

My best advice is to follow Cobra's timer adding tutorial.
But I'll explain it to you anyways. I've written a timer tutorial earlier so I mind as well post some of it here.

Assuming that you have a project open, go to your "Dialog" then right click and go to "Class Wizard".
Under the "Messages" bar, scroll down until you find "WM_Timer". Double click on the "Wm_Timer".

This is what it should look like:

http://img227.imageshack.us/img227/7011/wmtimerum2.png


Now at the right side of that menu, hit "Edit Code"
This is what it should look like:


void CTestDlg::OnTimer(UINT nIDEvent)
{
// TODO: Add your message handler code here and/or call default

CDialog::OnTimer(nIDEvent);
}

You would now replace the highlighted part with the code you want.
In this case the Stamina code.
It looks like this:


void CTestDlg::OnTimer(UINT nIDEvent)
{

switch(nIDEvent)
{
case FIRSTTIMER:
{
if (GetAsyncKeyState(VK_END)&1)
WritePointerFloat(0x1376340,0288,1120403456);
}
break;
}
CDialog::OnTimer(nIDEvent);
}

You also have to define the FIRSTTIMER in Resource.h.
Enable that in a button or add a hotkey and your good to go.
The code above will activate once you press the "End" key.

If your confused about anything or need help post here and I'll try to reply as fast as I can.

mojo007
04-15-2008, 07:44 AM
ok i added

#define FIRSTTIMER in Resource.h

and the code is now

void CTestDlg::OnTimer(UINT nIDEvent)
{
switch(nIDEvent)
{
case FIRSTTIMER:
{
if (GetAsyncKeyState(VK_END)&1)
WritePointerFloat(0x1376340,0288,1120403456);
}
break;
}
CDialog::OnTimer(nIDEvent);
}


but i got error said error C2059: syntax error : ':' case FIRSTTIMER:

virus7799
04-15-2008, 07:50 AM
ok i added

#define FIRSTTIMER in Resource.h

and the code is now

void CTestDlg::OnTimer(UINT nIDEvent)
{
switch(nIDEvent)
{
case FIRSTTIMER:
{
if (GetAsyncKeyState(VK_END)&1)
WritePointerFloat(0x1376340,0288,1120403456);
}
break;
}
CDialog::OnTimer(nIDEvent);
}


but i got error said error C2059: syntax error : ':' case FIRSTTIMER:


In Resource.h define the FIRSTTIMER like this:

#define FIRSTTIMER 1001

Also, are you using the timer in a button or as a hotkey??

mojo007
04-15-2008, 07:52 AM
ok ty compiled, now ingame i have to press the end key to activate stamina on

do i need to activate every rounds?=

and how can i know stamina is working ingame ?

virus7799
04-15-2008, 07:55 AM
ok ty compiled, now ingame i have to press the end key to activate stamina on

do i need to activate every rounds?=

and how can i know stamina is working ingame ?

First of all, if your trying to make it as a hotkey you have to add one more thing. In your TestDlg.cpp search for a code that looks like this:


// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon

You have to set your timer therefore it'll look like this:


// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
SetTimer(FIRSTTIMER,1,NULL);

And you'll know if it works ingame if your stamina does not change even though you are using it. To activate it press the "End" key.

mojo007
04-15-2008, 08:10 AM
ok now its working when my speed is down i press end, and its full againg


but what about the health, can i get that stronger?

virus7799
04-15-2008, 08:12 AM
ok now its working when my speed is down i press end, and its full againg


but what about the health, can i get that stronger?

You cannot get unlimited health because that is considered server sided although you can use Auto Heal.

mojo007
04-15-2008, 08:18 AM
ok when i am trying to change the end key to F button

i do VK_END to VK_F 'VK_F' : undeclared identifier

virus7799
04-15-2008, 08:23 AM
ok when i am trying to change the end key to F button

i do VK_END to VK_F 'VK_F' : undeclared identifier

Check out this website for Virtual Key or VK codes.
http://msdn2.microsoft.com/en-us/library/ms927178.aspx

mojo007
04-15-2008, 08:29 AM
ok i am looked for F key but cant find it i can see for F1 etc keys


btw how do i am adding antivotekick??

virus7799
04-15-2008, 08:32 AM
ok i am looked for F key but cant find it i can see for F1 etc keys


btw how do i am adding antivotekick??

Anti-Kick is a 6 byte NOP.

memory();
BYTE Nop[6] = {0x90, 0x90, 0x90,0x90, 0x90, 0x90};
WriteProcessMemory(hProcess, (LPVOID*)(DWORD) (0x005057A5), &Nop, sizeof(Nop), NULL);

mojo007
04-15-2008, 08:34 AM
ok do i just put in testdig.cpp files not timer for it ?

virus7799
04-15-2008, 08:34 AM
ok do i just put in testdig.cpp files not timer for it ?

You would put that in a button.

mojo007
04-15-2008, 08:40 AM
ok i puttet that code in a button without a timer


but get that error

void CTestDlg::Onantikick()
{
memory();
BYTE Nop[6] = {0x90, 0x90, 0x90,0x90, 0x90, 0x90};
WriteProcessMemory(hProcess, (LPVOID*)(DWORD) (0x005057A5), &Nop, sizeof(Nop),
}


missing ')' before '}'

virus7799
04-15-2008, 08:51 AM
ok i puttet that code in a button without a timer


but get that error

void CTestDlg::Onantikick()
{
memory();
BYTE Nop[6] = {0x90, 0x90, 0x90,0x90, 0x90, 0x90};
WriteProcessMemory(hProcess, (LPVOID*)(DWORD) (0x005057A5), &Nop, sizeof(Nop),
}


missing ')' before '}'


Your missing a piece of code at the end.
It's like this:


void CTestDlg::Onantikick()
{
memory();
BYTE Nop[6] = {0x90, 0x90, 0x90,0x90, 0x90, 0x90};
WriteProcessMemory(hProcess, (LPVOID*)(DWORD)(0x005057A5), &Nop, sizeof(Nop),NULL);
}

mojo007
04-15-2008, 08:58 AM
now 1 error


void CTestDlg::Onantikick()
{
memory();
BYTE Nop[6] = {0x90, 0x90, 0x90,0x90, 0x90, 0x90};
WriteProcessMemory(hProcess, (LPVOID*)(DWORD)(0x005057A5), &Nop, sizeof(Nop),NULL;
}



error C2143: syntax error : missing ')' before ';

in that line

WriteProcessMemory(hProcess, (LPVOID*)(DWORD)(0x005057A5), &Nop, sizeof(Nop),NULL;'

virus7799
04-15-2008, 08:59 AM
now 1 error


void CTestDlg::Onantikick()
{
memory();
BYTE Nop[6] = {0x90, 0x90, 0x90,0x90, 0x90, 0x90};
WriteProcessMemory(hProcess, (LPVOID*)(DWORD)(0x005057A5), &Nop, sizeof(Nop),NULL;
}



error C2143: syntax error : missing ')' before ';

in that line

WriteProcessMemory(hProcess, (LPVOID*)(DWORD)(0x005057A5), &Nop, sizeof(Nop),NULL;'

Your missing this ")"


WriteProcessMemory(hProcess, (LPVOID*)(DWORD)(0x005057A5), &Nop, sizeof(Nop),NULL);

mojo007
04-15-2008, 09:00 AM
ok fixed ty

virus7799
04-15-2008, 09:01 AM
ok fixed ty

Np bro, hope I helped you.

mojo007
04-15-2008, 09:06 AM
are antikickvote code detectet=

cause i got banned very fast after i turned it on