[Tutorial] Creating a trainer with AutoIt
Hello, today I will show you how you make a trainer at the AutoIt you understand what he is doing well! The first thing you should have installed Scite and AutoIt Script Editor. Then it depends on your right. But first I must tell you yet that this tutorial was written only in German. English from the ground, since this tutorial is intended more for the people of the German language is powerful, and also I can not speak English so well.
So, you created a new au3 script. Well it depends on your right. First, we want a GUI (graphical user interface = GUI) make when we make two check boxes (ie two different functions). Since I do not have the fan on such a start button, we do it right so that our small program checks to S4. So here are the tasks as a list:
First Creating a GUI with two different functions
Second Automatic Wartner on S4Client
Third Change the values
4th Exit the program
So, I hope you understand a bit AutoIt and dealing with the Koda Form Designer. Well, there goes Scite click on Tools. Now click on Koda Form Designer. There you can adjust everything to your GUI. But because we want to have only two check boxes, we add them.
Which we call a checkbox Shop Hack, No Fog others. Please do not forget to rename your GUI!
So now we add this in Scite.
But this code is just plain ugly. Why? Well, first are 1-2 Includes are also many things unnecessarily waste lines and the variables must be renamed. So, which includes are as unnecessary? So definitely the ButtonConstants.au3 and then caused the GUIConstantsEx.au3. What's she doing so useless? This includes are pumped full of variables. But most of us here do not bulge. So please remove the following:
Code:
# Include <ButtonConstants.au3>
# Include <GUIConstantsEx.au3> Then you see another one of
Code:
# Region # # # START Koda GUI section # # # Form = and a
Code:
EndRegion # # # # END Koda GUI section # # # These are a survey. But since we are not in our small coaches have so much code they are useless. So we remove this as well. The next thing that
Code:
GUISetState (@ SW_HIDE) What's wrong with that? Actually nothing, but that "@ SW_HIDE" plays no role for us here. So does the way. It should look like this:
Code:
GUISetState () So, next we should rename the variables. Why? Asy on that account because it is clearer and the $ Form1 as goofy looks. So we call for example to the Form1 variable $ to $ hGUI. The $ to $ Checkbox1 shop hack. Ultimately even the $ Checkbox2 to $ No_Fog. So if we now want to look at our GUI, we can run a short test run. Simply pressing F5. Yikes! What happened there? A mistake? We have done everything right but really you? In principle, yes, but some games we go through what he wants to tell us. He says "$ GUI_EVENT_CLOSE: undeclared global variable.". What are we to understand by this? He wants to tell us that the variable $ GUI_EVENT_CLOSE is defined with no value, and now he does not know what to do. Why is that? We have removed the unnecessary includes, and I said that we need the GUIConstantsEx.au3 limited. I define in this case due to time "We need only one variable and that this $ GUI_EVENT_CLOSE". But what shall we do now? Quite simply, we would would find out that we look at the includes $ GUI_EVENT_CLOSE is defined with the value "-3". So we replace the variable with a -3. It looks like this
Code:
Case-3SO, now we can start our program with F5 again. For me, the GUI looks quite okay, but now is nothing special.
So far. They say you always want the coaches start as admin. But we can also deal with the command # RequireAdmin. Thus, the program checks whether admin rights are available, and tells the one with which this program requires. So we use the command # RequireAdmin top out at the beginning of our script.
Oh, and if you do not understand a function, then it marks and press F1. Then you see the AutoIt Help window and there is the function explained in most cases with examples.
Now it continues to check whether the process is called S4Client.exe available. If so, he will call a function. But how do we go to the best? Let's look more closely at this piece of code:
Code:
While 1
$ NMsg GUIGetMsg = ()
Switch $ nMsg
Case -3
Exit
EndSwitch
This is applicable in a typical example of a loop. Use $ nMsg GUIGetMsg = () is the GUI as it were asked whether any actions are done. With Switch $ nMsg we do speak in a lower loop switch in which everything revolves around the variable $ nMsg. $ NMsg is the variable for the demand function usnerer GUI. -3, It represents a case with "If condition" her. So if there is -3 (ie, the GUI is closed) then he should run the command exit which means the end of the program. EndSwitch we go out with this "GUI loop" out of the command and closes the loop Wend completely. Phu, strong stuff but we'll get through this. So where should we hintun query our best? I will directly under the
Code:
Case -3
. Take Exit An "If condition" If we do with the command. The interrogation of a process we do with ProcessExists. So good to, I'll do that here as follows:
Code:
If ProcessExists ("S4Client.exe") <> 0 Then
_Werte_Ändern ()
EndIfDas bedeuted following, if the process is then S4Client.exe orhanden _Werte_Aendern, the function () is called. We slept with all these EndIf If, Then things off. So, but now the problem is that we have _Werte_Aendern () has not done. So we go to such function. We do this with the command Func. We write the very bottom to the following:
Code:
_Werte_Aendern Func ()
EndFuncSo, our function is ready now, but there is nothing in it. So we fill them. The first thing you should definitely check the downlaod NomadMemory.au3 UDF (UDF = User definied function = User-defined function). These are found virtually everywhere, but at best you're looking at Google. Have you gedownlaodet them, so you go into your program folder and open the AutoIt folder. There you will open the include folder and paste it there. So, on to the script. First we have (include) included from it in our script so we can use them. This follows from the WindowsConstants.au3 over the command from # include. Only with the include command, there are the Different Types 2, I declare these times.
Code:
# Include "NomadMemory.au3" and
Code:
# Include <NomadMemory.au3> Broadly ganzn they look very similar. Only place in the "" is the second Command <> used. Where is the difference? If you use "" then do you say that the program is located in the same area of your include file / folder as your script. But her Schriebt <> as the program tells you that your include file in the include folder of AutoIt. By and large, simple. Now that we have done but the NomadMemory.au3 in the include folder of AutoIt, we must therefore assume what warrant?
Spoiler:
Code:
# Include <NomadMemory.au3>
This we are now back at the top WindowsConstants.au3, it does not matter whether over or under it.
So, now it goes to the Memory Chan Ching. This is not particularly difficult if you understand the functions. We must make the following workflows:
First Open the Memory of S4Client.exe
Second Reading if a tick was placed in the box
Third Write to memory
4th The memory of S4 close Client.exe
5th Exit the program
So we'll start. First we must tell the program what process he should open. We use ProcessExists. This command gets the PID (Process ID) of the specified process and returns the value. As he returns this so we need to save somewhere. We use this simple command in a variable. This should look like this:
Code:
$ PID = ProcessExists ("S4Client.exe") So we put this command now in our purely functional. This now looks like this:
Code:
_Werte_Aendern Func ()
$ PID = ProcessExists ("S4Client.exe")
EndFuncGut, now we should open the first store of the S4Client. There are command _MemoryOpen. And as the process we give our variable $ PID to even the process ID (or PID) has by S4Client.exe. It should look like this:
Code:
$ Open = _MemoryOpen ($ PID) to take advantage of the open space (aka. memory) we can store this in a variable. To orient myself better because I can take the variable $ Open. Remember this, each variable in AutoIt must begin with a $, because otherwise the program does not know you want to declare a variable.
So, now we have to query whether or Chophack has been selected No Fog. There are command GuiCtrlReat. This problem will be solved in an If request. This time the solution:
Code:
GUICtrlRead if ($ shop hack) = 1 Then
EndIf
If GUICtrlRead ($ No_Fog) = 1 Then
EndIfZuerst we ask whether it came from the shop hack variable to read Who do first A value of 1 bedeuted for programming (or in this case the script) True. Consequently, what number would represent False?
Spoiler:
0
So after we now know what is 1 and 0, we can also start directly with the values change. We have orders _MemoryWrite. This is somewhat complicated. Let's take a look at the syntax.
Code:
_MemoryWrite ($ Iv_Address, $ ah_Handle, v_Data $, $ sv_Type = 'dword') So, here once the declaration:
$ Iv_Address -> Here is our address. Do not forget the 0x before that because the requested addresses with Cheat Engine are almost always hexadecimal.
$ Ah_Handle -> The process handle. So our variable $ Open
$ V_Data -> our value we want to change the address. Remember this, the value to write to "".
$ Sv_Type = 'dword' -> The type of the value we use. There are many different types, listed here a few times:
Float -> Floats are floating point numbers, so numbers like 1.4 or 1 or 6.7846485 or 23512873.23768123. Floats are 4 bytes in size.
Doule -> Double are double floats. Accordingly, they are 8 bytes in size. This can be calculated much more precise figures.
char -> chars are strings. So values like "Hello" or "Your Mudda123" or "elite34_5"
long -> the values are 4 bytes in the range
So, that enough data types, if you need more you can even just googled it again. Only one thing I must make clear to you yet, namely the use of char. Suppose I have the word "Hello", then I would write the following at $ sv_Type = 'dword':
char [6]
Why char [6]? Char to say about our program we take a word. The 6 stands for the number of characters + 1 Our word "Hello" has 5 letters. Plus, this one counted the number 6 ergiebt But why +1? This is because when writing the Dasman memory must use one byte more. But why? Because a string is terminated with "\ 00" bytes. Dess is due at Cheat Engine also asked "Terminate string with zero".
But from here on Memory Change command. Suppose we have the address 0x00D3F00C (do not worry, the address is very old and is long gone). This is a string called "Off". We want changen On this string in order to achieve our shop hack. So our command looks like this:
Spoiler:
Code:
_MemoryWrite (0x00D3F00C, $ Open, "On", "char [3]")
Super, as this is the shop we have to hack the reintun but also in the interrogation of the shop hack. What was that again?
Spoiler:
Code:
GUICtrlRead if ($ shop hack) = 1 Then
EndIf
So would that look like this:
Spoiler:
Code:
GUICtrlRead if ($ shop hack) = 1 Then
_MemoryWrite (0x00D3F00C, $ Open, "On", "char [3]")
EndIf
Well done now but still no fog. Suppose we have the address 0x00F87CD1 (This address does not work either because it is invented). This address is a float and we wish to change in the value of 6.2 (original value is not because No Fog is actually a string but I still want to show you how to do it in float). So same question again. Where we'll put it in?
Spoiler:
Code:
If GUICtrlRead ($ No_Fog) = 1 Then
EndIf
Okay, and how it would look like with the memory write command?
Spoiler:
Code:
If GUICtrlRead ($ No_Fog) = 1 Then
_MemoryWrite (0x00F87CD1, $ Open, "6.2", "float")
EndIf
So, I have to say but that her "float" not necessarily have to capitalize. You can also write as FLOAT or float that is no matter. The main thing is that the program understands.
So, that was almost there, too. We are still missing two operations. The close of the memory (memory in English) and the end of the program. First time we close the Memory. Where? If among all our queries. To close the store there is the command _MemoryClose. This is very similar to the _MemoryOpen command. But how do we use it? Quite simply, we have opened with the Memory _MemoryOpen and have it stored in the variable $ Open. Since we now want to close the open memory, we simply re-open the $ variable and overwrite it. It should look like this:
Spoiler:
Code:
_MemoryClose ($ Open)
Finely made. Now exiting the program. There is the Exit command. So we write our direct our _MemoryClose command exit.
Respect, you've just made your coach ready. Your function should look like now so _Werte_Aendern
Spoiler:
Code:
_Werte_Aendern Func ()
$ PID = ProcessExists ("S4Client.exe")
$ Open = _MemoryOpen ($ PID)
GUICtrlRead if ($ shop hack) = 1 Then
_MemoryWrite (0x00D3F00C, $ Open, "On", "char [3]")
EndIf
If GUICtrlRead ($ No_Fog) = 1 Then
_MemoryWrite (0x00F87CD1, $ Open, "6.2", "float")
EndIf
_MemoryClose ($ Open)
Exit
EndFunc ;==>_ Werte_Aendern
One more thing, if you want to comment on your source then uses before your comments ",". , Like that
Code:
; Hi, this is a comment Comments are displayed in green AutoIt and have the purpose to help you with the clarity of your program.
Since you're almost done with your program now, it's about fine-tuning. Pressing CTRL + T. Even this simple AutoIt is your source into the right shape and is made much the same Überswichtlicher. Now it's about the compiler. This is your source of written and stored in an executable file kompressiert on your computer. If your compiler do you want pressing CTRL + F7. Then you come into the Compile AutoIt window. Now there are still a few questions. I would recommend for odor A3X select Output type.
On the ground because this is your script in the runtime environment started with AutoIt and therefore has more rights. The disadvantage is that the coach AutoIt users have installed. If you have selected for output executable then type the user need not a AutoIt but it will most likely not work because your program does not have enough rights. So I empehle A3X you select.
Output now arch.
There, you have to choose which bits systems for your program is running. I recommend you "compile X86 version. (Default)" option, because it then at 32-bit and 64 bit works.
So, whether you use UPX want you need to know. If you still want your program in connection with Themida pack (works only if you do compile it as an EXE) then you are allowed to choose not UPX.
When you are finished you hit on Compile Script and your program is created.
That was even with my little tutorial. I do hope you've learned something and not just C & P made. One should finally know what you are doing
For any questions I'll get up of course. It would please me, but if you would post the questions in this thread because I'm not on PM.
Otherwise, nice day!
Btw, google who can not find various files in the appendix below Among other things, this is the Nomad memory or script as our coach.