Change background image
  1. What's up? I see you're viewing as a Guest. How about registering, it only takes like 2 minutes. This will enable you to do more on our forum and stay updated.

AS2 Flash Trainers [VB 2010 Express]

Discussion in 'PC Software' started by 3nvisi0n, Jun 20, 2011.

Thread Status:
This thread is more than 180 days old.
  1. 3nvisi0n

    3nvisi0n The R3v0lu710n Super-Mod

    The example program produced by following this tutorial no longer works. Xat just hours after the competition of this tutorial went about changing their backend and completely disabling the usage of their AS2 chat forcing all users to use the normal AS3 one. AS3 poses a problem to making trainers as there is not default access to the SetVariable procedure instead the flash coder must write in such a function(and most don't, making it difficult to change variables) So the concepts shown are still fine but the end product is not. Sorry.
    ***END WARNING***

    Hello once again everyone, at the request of jok3r I am uploading this tutorial on making a trainer for any Action Script 2 game, and for the sake of example I will be building on for XAT. Now don't get your hopes up although it will be able to do some stuff an XAT trainer is rather useless considering all changes you make are only visible by you.

    1. Download the SWF file for whatever game/flash project you would like to create a trainer for...this normally has the extension of SWF.
    So for me I am going to visit and view the page source.(Alt>View>Page Source)
    Inside that source I look for the <object tag it is within <object that flash is included into a website.
    Within <object is normally at least one of two tags, <param name="movie" or <embed src=" in this case we find both You want the URL from this
    *Since XAT is written in AS3 and in AS3 you do not have access to a method we need we need to use the AS2 version of XAT so the actual URL I will be using is
    Remember this URL for later, also remember the value of <param name="FlashVars" (if any, you will need these later)
    name="FlashVars" value="id=146704343&xc=3360&cn=1622917936&gn=NewHaxDotCom"

    2. Now that we have the flash let us start making the new VB project.(Windows Form Application)
    Open up Visual Basic 2010 Express(or whatever version you use as long as it is newer than Visual Basic 6)
    Visual Basic 6 can do this but the method is slightly different(not much)
    Start a New Project
    Open the Tool Box and by default the object you need to add to the form is not displayed so Close up all the 'tabs' and right click in an empty area
    Select Choose Items, wait a bit and a dialog box will display
    If you have been in here before to add this you DO NOT need to do it again unless the flash object has gone missing from your toolbox
    Click on the 'COM Components' and find Shockwave Flash Object
    If it is not there close the dialog and install Adobe Flash plugin on Internet Explorer(not FF not Chrome, Internet Explorer) asnd check again
    Check the box to the left and click okay
    Now add Components>Shockwave Flash Object to Form1(or whatever you called it)
    Setup your form however you like, be sure to leave some room for buttons to call
    Add a few buttons on now also we will use them later.

    3. Setting The Form Up
    Now that we have the project setup it is time for the Form to get set.
    Add a Components>Shockwave Flash Object to your form, making it whatever size you desire the flash to be in your application.
    I recommend changing the name from AxShockwaveFlash to something simpler like Flash(which is what I have done)
    Click this object and in its properties set the Movie parameter to the URL you copied earlier
    Also add a few buttons for your commands, if you are following along with my XAT Trainer than we will use 3

    4. Preparing to Code
    Before we can actually code the trainer we need to find the stuff we can change, this can be done in multiple ways.
    Two I will mention include using a SWF Decompiler to find variables, or a Variable Scanner.
    I will be using a small variable scanner since it requires less installation time and it quicker/easier to explain.
    I recommend using YoungDragon's Variable Scanner found here
    Download it and extract it then run the "Variable Scanner by YoungDragon.exe"
    *I take no responsibility if you get a virus or anything from this, although I have not.
    Click Load Movie and put the URL from earlier into it
    Click Load Scanner and a blue window will show up, click the box with the + to view it
    Click Scan and wait If you get an error message saying something is making Flash run slow, click yes to end it
    If you end it you will be unable to use the scanner any further(but you already have the vars you need)
    SO you can keep it going if you desire.
    Now copy (Ctrl+A[select all] Ctrl+C[copy]) and paste[Ctrl+V] everything into Notepad for easier reading
    Read the file and figure out what variables area of interest to you.
    You can use the Set Variable Value in the scanner to check what changing various values will do.
    The ones I will be using will be _level0.w_coins _level0.w_owner _level0.w_mainowner

    5. The Code
    First if you have any Flashvars you want to add those first into _Load for your form.
    Flash.FlashVars = "FLASH VARS HERE" ex.
    *Some of the flash vars for other applications might be setting your account and stuff like that so pay attention you are not giving information
    You don't actually want to share, with XAT there is nothing important in flashvars so I don't care :)
    Now the real coding:
    The secret to basic trainers is one procedure that is part of the Shockwave Flash Object(also part of the DOM[in Javascript] fyi) that is
    .SetVariable("VariableName", value)
    So what you do is you find a variable you want to edit in the trainer, so we will use _level0.w_coins (your XATs)
    We already made a button1 so we will use that to edit this variable inside the _Click procedure [Private Sub Button1_Click(...) Handles Button1.Click]
    You add the following code to edit the variable making your Xats = 313337
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Flash.SetVariable("_level0.w_coins", 31337)
    End Sub
    Remember I named by Shockwave Flash Object just Flash for ease of coding earlier in this tutorial
    Now when you launch the program and click button1 once all is loaded, you will have 313337 xats(only visible to you)

    The Other two variables work similarly
    For Button2 to make us owner(visible only to you) the code becomes Flash.SetVariable("_level0.w_owner", True)
    For Button3 to become main owner(visible only to you) Flash.SetVariable("_level0.w_mainowner", True)
    It really is that easy to make a trainer, just find the variables and make buttons
  2. Jok3r

    Jok3r MC-Admin/Summoner Member

    Im doing this right now I swear this is so cool,
    Um ca I appear that I have namecolor?
    cause that'd be ball'n!!!
  3. 3nvisi0n

    3nvisi0n The R3v0lu710n Super-Mod

    Not that I know of, atleast not like this there was a _powers variable you might want to look at but it won't appear to anyone else.
Thread Status:
This thread is more than 180 days old.

Share This Page