is my code ok?

11/15/2011 20:05 Sloob#1
hello people from the internet!
i wrote a code (My very first) its a warrock nomenu *Hack* that i use when im not *Hacking*... nothing deadly... just NFD,5th, and visual premium.

i know it work since i use it all the time but im new in coding and i would like to know if the syntax is good.

Please be friendly :)

[Only registered and activated users can see links. Click Here To Register...]

EDIT: some contnent are copy and pasted from tutorials (it was my verry first time coding with c++ so i followed some tutorials)
11/15/2011 20:12 .Infinite#2
Quote:
Code:
void HackThread()
Code:
CreateThread(0, 0, (LPTHREAD_START_ROUTINE)HackThread, 0, 0, 0);
Mr.Smith wird sich aufregen :D

Warum ist bis auf die DllMain nichts eingerückt? Ansonsten siehsts ganz ok aus würd ich sagen...
11/15/2011 20:14 Sloob#3
yes sorry i said i wrote my first code but i meant i kinda leeched it (i followed guides) since its my very first code i used some tutorial contnent i should give the credit to the actual writer of the tutorial excuse me
11/15/2011 20:26 .Infinite#4
My bad, i forgot you were writing in english... Although you apparently understood my reply.

More important is that you understand what your code is doing. If you have done that you are able to write hacks for almost any game you want. But from this

Quote:
its my very first code
I follow you did not.

You should better start off by learning the basics instead of copying code you don't understand!

This is a good introduction to start with: [Only registered and activated users can see links. Click Here To Register...]
11/15/2011 20:37 Sloob#5
Quote:
Although you apparently understood my reply.
Google traduction :P

i know the basic of c/c++ all the tutorial that i found was either copy and past or or some are of style : your already a coder so i dont explain anything.

so i took a copy and paste and i tried to understand it.... i think i have succeeded because the actual copy and paste *Tutorial* was about unl stamina superjump and NFD and i ended up *writing* a 5th slot,NFD and visual premium but as i said i am only starting c++ but i just want to say that i have a mini base of knowledge :P

so yeah... i understand the part where you put your hack
Exemple
Quote:
void allSlot()
{
DWORD dwSrvrPtr=*(DWORD*)ADR_ServerPoint;
if(dwSrvrPtr!=0)
{
*(long*)(dwSrvrPtr+OFS_5th) = 1;
}
}
but not the Hackthread or the bool, but imo any knowledge in any domain cannot hurt! so even if for now i dont realy understand 100% of what i do later im sure it will help me

BTW excuse my realy bad english.. i am french :S
11/15/2011 20:48 XxharCs#6
Quote:
Code:
Code:
void HackThread()
Code:
CreateThread(0, 0, (LPTHREAD_START_ROUTINE)HackThread, 0, 0, 0);
Mr.Smith wird sich aufregen

Warum ist bis auf die DllMain nichts eingerückt? Ansonsten siehsts ganz ok aus würd ich sagen...
^this :D

@TE
this is not nice lol
Code:
void HackThread()
Code:
CreateThread(0, 0, (LPTHREAD_START_ROUTINE)HackThread, 0, 0, 0);
ur hackthread should be DWORD and should have params
do it so:
Code:
DWORD WINAPI HackThread(LPVOID unused)
Code:
CreateThread(0, 0, &HackThread , 0, 0, 0);
11/15/2011 20:50 Sloob#7
Thanks i will give it a try :)

[Only registered and activated users can see links. Click Here To Register...]
11/15/2011 21:22 XxharCs#8
Quote:
Originally Posted by Sloob View Post
Thanks i will give it a try :)

[Only registered and activated users can see links. Click Here To Register...]
are u sure that ur addys are working ?
11/15/2011 21:24 Sloob#9
not tried today but yesterday they was
EDIT: yep they work
11/16/2011 14:10 Dr. Coxxy#10
its ok.

4 things annoy me:

1. the apple logo as your avatar. (winfag here)^^

2.
what about errors?
createthread can fail etc.
add a logfunction, or debugoutput.
is quite easy and helps alot on finding bugs especially for a beginner.

3.
indentations?
make your code like this:
Code:
for (int i = 0; i < 10; i++)
{
	if (i < 5)
	{
		printf("hi");
	}
	else
	{
		printf("bye");
	}
}
4.
use proper function names and/or use comments
NFD();

what i like:

1.
you use brackets well and are not doing shit like this:
Code:
void myFunction(bool somebool) {
	if (somebool)
		printf("i am a noob");
}
whats bad about this code you ask?
using the '{' right after your function name just sucks and makes your code crabbed while using it in a single line is easy to see which brackets are together.
just not worth sparing this single line...

Code:
if (...)
    singleline command here
you may heard that a project is NEVER really finished.
just type the {} always then you dont have to set them later.
also makes your code easier to read and prevents some logical mistakes.

not bad, but as infinite already said, start with the basics and not some c+p barely understood code.

same with your first mistake with 'void thread(...'.
just take a look in the msdn they describe most things very well there.
11/16/2011 18:30 Sloob#11
Thanks for your answer!

First sorry if my avatar annoy you but i will keep it...

Quote:
add a logfunction, or debugoutput.
is quite easy and helps alot on finding bugs especially for a beginner.
Thanks for this!

3. Thanks for the tip it realy help

4.
Quote:
use proper function names and/or use comments
NFD();
since it was my first code and i was the only one working on it, finding a easy to understand name was the least of my priority but from now on i will try to find more easy names xD

Thanks and as you and infinity said i will study the basics of c++, i just realy wanted to see if i like coding (im going to college) so i dont want to spend the rest of my life (or scolarship) on something that i hates! (i know this is only like 1% of a programer job but i can say i like this 1%)

Thanks again for your advices! :)