[Release+Source=C++] Generate FULL JASS Natives List (Work to all war3 versions)

This is a discussion on [Release+Source=C++] Generate FULL JASS Natives List (Work to all war3 versions) within the Warcraft 3 Hacks, bots and tools board part of the Warcraft 3 forum category; .mix file: JassFinder.zip How to use: - Just extract it on your war3 folder and start the war3 , it ...

Page 1 of 4 123 ... LastLast
Results 1 to 10 of 38
  1. #1
    DarkSupremo is offline Premium Member
    Array
    Join Date
    Feb 2008
    Posts
    790
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    13
    Reputation
    606

    [Release+Source=C++] Generate FULL JASS Natives List (Work to all war3 versions)

    .mix file:
    JassFinder.zip

    How to use:
    - Just extract it on your war3 folder and start the war3, it will generate instantly an file named Functions.txt on your war3 folder

    List generated with it:
    http://www.garenamaster.com/war3jass/24b.txt
    http://www.garenamaster.com/war3jass/24c.txt
    http://www.garenamaster.com/war3jass/24d.txt
    http://www.garenamaster.com/war3jass/24e.txt
    http://www.garenamaster.com/war3jass/25b.txt
    http://www.garenamaster.com/war3jass/26a.txt

    Thanks to YourName and n00b32 that give me the base to do it...

    Just an tip to developers:
    I did an class based on it that populate an list with the offset and jass name, with that you can just do an function like CJass->find("CreateUnit") to return the offset of this jass, its really simple and usefull to make hacks to work with every war3 version with no much code ^^



    DLL Source (Originally generated with Visual Studio 2010):

    Code:
    // dllmain.cpp : Defines the entry point for the DLL application.#include "stdafx.h"
    #include <Strsafe.h>
    #include <direct.h>
    
    
    
    
    bool bDataCompare(const BYTE* pData, const BYTE* bMask, const char* szMask)
    {
        for(;*szMask;++szMask,++pData,++bMask)
        {
            if(*szMask=='x' && *pData!=*bMask)
            {
                return false;
            }
        }
        return (*szMask) == NULL;
    }
    //---------------------------------------------------------------------------
    DWORD dwFindPattern(DWORD dwAddress,DWORD dwLen,BYTE *bMask,char * szMask)
    {
        for(DWORD i=0; i < dwLen; i++)
        {
            if(bDataCompare((BYTE*)(dwAddress+i ),bMask,szMask))
            {
                return (DWORD)(dwAddress+i);
            }
        }
    
    
        return 0;
    }
    //---------------------------------------------------------------------------
    
    
    BOOL APIENTRY DllMain( HMODULE hModule,
        DWORD  ul_reason_for_call,
        LPVOID lpReserved
        )
    {
        switch (ul_reason_for_call)
        {
        case DLL_PROCESS_ATTACH:
            {
                FILE *pFile;
                char path[MAX_PATH];
                sprintf(path, "%s\\Functions.txt", getcwd(NULL,MAX_PATH)); 
                DeleteFileA(path);  
                pFile = fopen (path,"a");
    
    
                int factor;
                int interval = 5;
    
    
                DWORD g_dwGameBase = (DWORD) GetModuleHandle("game.dll");
    
    
                DWORD list1 = dwFindPattern(g_dwGameBase,0xA6BFFF,(BYTE*)"\xB0\x00\xFF\xFF\x68\x00\x00\x00\x00\xBA\x00\x00\x00\x00\xB9\x00\x00\x00\x00\xE8\x00\x00\x00\x00", "x?xxx????x????x????x????");
                DWORD list2 = dwFindPattern(g_dwGameBase,0xA6BFFF,(BYTE*)"\xCC\xE8\x00\x00\x00\x00\x68\x00\x00\x00\x00\xBA\x00\x00\x00\x00\xB9\x00\x00\x00\x00", "xx????x????x????x????") + 2;
    
    
                if (list1 == 0 || list2 == 0)
                {
                    MessageBox(NULL, "war3 version not supported??", "", 0);
                }
                DWORD searchBase[2] = {list1, list2};
                for (int i = 0; i < 2; i++)
                {
                    factor = 0;
                    while(1)
                    {
                        BYTE SIGNTEST = *(BYTE*)(searchBase[i]-1+(1*interval) + factor);
                        if (SIGNTEST != 0x68) // if params is different from PUSH, then the list is finished
                        {
                            break;
                        }
                        //DWORD ignore    = *(DWORD*)(searchBase[i] + (0*interval) + factor);
                        DWORD params    = *(DWORD*)(searchBase[i] + (1*interval) + factor);
                        DWORD name        = *(DWORD*)(searchBase[i] + (2*interval) + factor);
                        DWORD address    = *(DWORD*)(searchBase[i] + (3*interval) + factor);
    
    
                        char text[MAX_PATH];
                        sprintf(text, "\"%s\" located at 0x%X with parameters \"%s\"\n", &(*(char**)name), address, &(*(char**)params) );
                        fputs(text, pFile);
    
    
                        factor = factor + 0x14; // go to next block
                    }
                }
                fclose(pFile);
                break;
            }
        case DLL_THREAD_ATTACH:
        case DLL_THREAD_DETACH:
        case DLL_PROCESS_DETACH:
            break;
        }
        return TRUE;
    }
    Last edited by DarkSupremo; 04-18-2012 at 06:22 PM.

  2. The Following 9 Users Say Thank You to DarkSupremo For This Useful Post:


  3. #2
    Farid.Agl's Avatar
    Farid.Agl is offline Advanced Hacker

    Array
    Join Date
    Sep 2011
    Posts
    448
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    8
    Reputation
    322
    Thank you for this.
    I have a simple question about its DataTypes, would be great if you let us know what are the characters that are listed as DataTypes (Return values and Parameters).
    I saw, 'S', 'V', 'I', 'R', 'C', 'B', 'Hplayer', 'Hunit', 'Hhandle', ...
    So far, i have understood that 'B' is bool, and i know the 'H' before its other DataTypes means a handle to something, but i do not know what DataTypes should i use for them in C++.


    Edit: The links you have provided do not work, but the JassFinder itself works perfect.
    http://faridaghili.ir

  4. #3
    YourName's Avatar
    YourName is offline THE ONE AND ONLY DARK KNIGHTY


    Array
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    1,553
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    16
    Reputation
    1088
    s -> string
    v -> void (If there's a v in parameters it means there is no parameter)
    i -> int
    r -> float
    c -> wat?
    b -> bool

    Stuff with H are obviously handles as you stated so you need a pointer to a handle class in order to use them.
    Providing you with foolish stuff since 2007.

  5. The Following User Says Thank You to YourName For This Useful Post:


  6. #4
    DarkSupremo is offline Premium Member
    Array
    Join Date
    Feb 2008
    Posts
    790
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    13
    Reputation
    606
    Quote Originally Posted by YourName View Post
    s -> string
    v -> void (If there's a v in parameters it means there is no parameter)
    i -> int
    r -> float
    c -> wat?
    b -> bool

    Stuff with H are obviously handles as you stated so you need a pointer to a handle class in order to use them.
    R = real, but its basically the same as float...

    some functions return an "HXXXX" (handle) that you can store it as DWORD and use it in other functions that get the same (HXXXX) as parameter...

    this site explain better the parameters, you can find the function on the list and use this site to understand the parameters:
    CreateUnit - WarCraft3

  7. The Following User Says Thank You to DarkSupremo For This Useful Post:


  8. #5
    Farid.Agl's Avatar
    Farid.Agl is offline Advanced Hacker

    Array
    Join Date
    Sep 2011
    Posts
    448
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    8
    Reputation
    322
    Thanks, this helped me so much.

    2 more questions:
    I found ClearSelection from the list, here it is: "ClearSelection" located at 0x6F3BBAA0 with parameters "()V"
    Then, first of all, I declared it this way ( I'm not sure if I'm correct ):
    Code:
    typedef void (__cdecl *GAME_ClearSelection)();
    GAME_ClearSelection ClearSelection = (GAME_ClearSelection)(GameDll + 0x3BBAA0);
    Finally, I have assigned a HotKey to call the ClearSelection function and I called it this way (!): ClearSelection();
    If it's important ( I'm sure it is ), I pressed the HotKey when I was in game and my hero was selected by me.
    I don't know what was the problem, but WC3 just crashes each time :|

    The second question:
    As you said,
    Stuff with H are obviously handles as you stated so you need a pointer to a handle class in order to use them.
    For example, this one:
    "GetLocalPlayer" located at 0x6F3BBB60 with parameters "()Hplayer;"
    This should return a handle to the Local player as far as I can guess, am I correct? If Yes, which DataType should I use? I tried DWORD (!) with no success :|

    Edit: DS, when I was posting this, you didn't posted yet, thank you, you made it more clear.

    ---------- Post added at 02:05 AM ---------- Previous post was at 12:40 AM ----------

    Just to understand how things are working, let me ask, should this work?
    Code:
    typedef DWORD __cdecl GAME_GetLocalPlayer();
    GAME_GetLocalPlayer *GetLocalPlayer = (GAME_GetLocalPlayer *)(GameDll + 0x3BBB60);
    
    
    typedef string __cdecl GAME_GetPlayerName(DWORD);
    GAME_GetPlayerName *GetPlayerName = (GAME_GetPlayerName *)(GameDll + 0x3C0F60);
    
    
    void ShowName()
    {
    	DWORD LocalPlayer = GetLocalPlayer();
    	string PlayerName = GetPlayerName(LocalPlayer);
    
    
    	MessageBox(NULL, PlayerName.c_str(), "", MB_OK);
    }
    Last edited by Farid.Agl; 04-18-2012 at 09:13 PM.
    http://faridaghili.ir

  9. #6
    DarkSupremo is offline Premium Member
    Array
    Join Date
    Feb 2008
    Posts
    790
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    13
    Reputation
    606
    i don't know... i normally do it with inline asm...

  10. The Following User Says Thank You to DarkSupremo For This Useful Post:


  11. #7
    Farid.Agl's Avatar
    Farid.Agl is offline Advanced Hacker

    Array
    Join Date
    Sep 2011
    Posts
    448
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    8
    Reputation
    322
    May i ask for a working example of doing this using inline asm? Just if you have the time for this.
    Cause the snippet code on my previous post just fails every time with a fatal error.
    http://faridaghili.ir

  12. #8
    YourName's Avatar
    YourName is offline THE ONE AND ONLY DARK KNIGHTY


    Array
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    1,553
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    16
    Reputation
    1088
    That's because the tls isn't set.
    Providing you with foolish stuff since 2007.

  13. The Following User Says Thank You to YourName For This Useful Post:


  14. #9
    Farid.Agl's Avatar
    Farid.Agl is offline Advanced Hacker

    Array
    Join Date
    Sep 2011
    Posts
    448
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    8
    Reputation
    322
    Sorry, i do not know anything about TLS, any help? What is TLS even?
    http://faridaghili.ir

  15. #10
    YourName's Avatar
    YourName is offline THE ONE AND ONLY DARK KNIGHTY


    Array
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    1,553
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    16
    Reputation
    1088
    Quote Originally Posted by GoDLiKe.ON3 View Post
    Sorry, i do not know anything about TLS, any help? What is TLS even?
    Thread-local storage - Wikipedia, the free encyclopedia
    Providing you with foolish stuff since 2007.

  16. The Following User Says Thank You to YourName For This Useful Post:


Page 1 of 4 123 ... LastLast

Similar Threads

  1. [Release] [1.26(a)] JASS Natives List by n00b32
    By Jan Ra in forum Warcraft 3 Hacks, bots and tools
    Replies: 8
    Last Post: 07-10-2015, 05:35 PM
  2. Calling Jass Natives
    By BullJam in forum Warcraft 3 Hacks, bots and tools
    Replies: 7
    Last Post: 02-14-2012, 09:18 AM
  3. [1.26] List of all JASS functions (SEACH)
    By Skino in forum Warcraft 3 Hacks, bots and tools
    Replies: 4
    Last Post: 06-29-2011, 03:01 PM
  4. [Release]All of my work/Full DB
    By Ganom in forum WoW Private Servers
    Replies: 8
    Last Post: 12-13-2007, 03:52 PM
  5. Without CD loader All Versions, will work forever
    By NoplaN in forum Starcraft Tools
    Replies: 10
    Last Post: 10-12-2007, 11:30 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •