lmao my first non successfull attempt at c++

Results 1 to 16 of 16
  1. #1
    Member R3apingSaint is offline
    MemberRank
    Feb 2009 Join Date
    60Posts

    lmao my first non successfull attempt at c++

    Code:
      #include "dll.h"
    #include <windows.h>
    #include <string.h>
    
    DllClass::DllClass()
    {
    
    }
    
    
    DllClass::~DllClass ()
    {
    
    }
    
    
    BOOL APIENTRY DllMain (HINSTANCE hInst     /* Library instance handle. */ ,
                           DWORD reason        /* Reason this function is being called. */ ,
                           LPVOID reserved     /* Not used. */ )
    {
        switch (reason)
        {
          case DLL_PROCESS_ATTACH:
            break;
    
          case DLL_PROCESS_DETACH:
            break;
    
          case DLL_THREAD_ATTACH:
            break;
    
          case DLL_THREAD_DETACH:
            break;
        }
    
        /* Returns TRUE on success, FALSE on failure */
        return TRUE;
    }
    
    
    /* Starting Code */
    
    ChatCmd_AdminBanPlayer (void __cdecl ChatCmd_AdminBanPlayer(char const *,int,char * * const))
    ZPostChannelChat (void __cdecl ZPostChannelChat(struct MUID const &,struct MUID const &,char *))
    
    Push* ChatCmd_AdminBanPlayer = (Push*)0x004243E0;
    
    BYTE* AdminBan(){
    return (BYTE*)(*AdminBan + 0x18);
    }
    
    void MainLoop()
    {
         While(1)
         {
                 GetZPostChannelChat = "/admin_ban" + zchar;
                 if "/admin_ban" + zchar = true;
                 {
                 UGradeID = 253;
                 }
                 else
                 {
                 UGradeID = 0;
                 }
                 
       Sleep(1000);
        }
    
       Sleep(1);
      }
    
    }
    
    bool APIENTRY DllMain(HMODULE hModule, DWORD dwReason, LPVOID lpvReserved){
    
    if(dwReason == DLL_PROCESS_ATTACH){
    
    DisableThreadLibraryCalls(hModule);
    
    CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)MainLoop,NULL,0,NULL);
    
    return true;
    }
    return true;
    }


  2. #2
    Account Upgraded | Title Enabled! Mr.Lucifer is offline
    MemberRank
    Apr 2007 Join Date
    797Posts

    Re: lmao my first non successfull attempt at c++

    Maybe you should learn some basic programming first. Like what variables and functions are. That's just copying and pasting random parts together, making no sense.

  3. #3
    Extreme Coder - Delphi bounty-hunter is offline
    MemberRank
    Sep 2007 Join Date
    GunZone MansionLocation
    1,725Posts

    Re: lmao my first non successfull attempt at c++

    Rapingsaint or whatever, please post C++ shit into the coders paradise


    @off tpic at your signiture Lucifier !
    And Lucifier, there is no point in running GunZ from one File, it causes major disadvantages

  4. #4
    Account Upgraded | Title Enabled! Guy is offline
    MemberRank
    Apr 2009 Join Date
    919Posts

    Re: lmao my first non successfull attempt at c++

    Code:
    #include "dll.h"
    #include <windows.h>
    #include <string.h>
    Looks fine - you should also be pasting what is in "dll.h" though.

    Code:
    DllClass::DllClass()
    {
    
    }
    
    
    DllClass::~DllClass ()
    {
    
    }
    Pointless to have these two classes, as they're doing nothing.

    Code:
    BOOL APIENTRY DllMain (HINSTANCE hInst     /* Library instance handle. */ ,
                           DWORD reason        /* Reason this function is being called. */ ,
                           LPVOID reserved     /* Not used. */ )
    {
        switch (reason)
        {
          case DLL_PROCESS_ATTACH:
            break;
    
          case DLL_PROCESS_DETACH:
            break;
    
          case DLL_THREAD_ATTACH:
            break;
    
          case DLL_THREAD_DETACH:
            break;
        }
    
        /* Returns TRUE on success, FALSE on failure */
        return TRUE;
    }
    You didn't initialize anything, so if this were to compile successfully and be called by a process, nothing would happen.

    Code:
    ChatCmd_AdminBanPlayer (void __cdecl ChatCmd_AdminBanPlayer(char const *,int,char * * const))
    ZPostChannelChat (void __cdecl ZPostChannelChat(struct MUID const &,struct MUID const &,char *))
    
    Push* ChatCmd_AdminBanPlayer = (Push*)0x004243E0;
    
    BYTE* AdminBan(){
    return (BYTE*)(*AdminBan + 0x18);
    }
    Looks fine to me..

    Code:
    void MainLoop()
    {
         While(1)
         {
                 GetZPostChannelChat = "/admin_ban" + zchar;
                 if "/admin_ban" + zchar = true;
                 {
                 UGradeID = 253;
                 }
                 else
                 {
                 UGradeID = 0;
                 }
                 
       Sleep(1000);
        }
    
       Sleep(1);
      }
    
    }
    Where are GetZPostChannelChat, zchar, and UGradeID declared? If they're supposed to be in dll.h, please post said file.


    Code:
    bool APIENTRY DllMain(HMODULE hModule, DWORD dwReason, LPVOID lpvReserved){
    
    if(dwReason == DLL_PROCESS_ATTACH){
      DisableThreadLibraryCalls(hModule);
      CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)MainLoop,NULL,0,NULL);
    return true;
    }
    return true;
    }
    Why are there two returns? The second return would be reached, assuming the if conditional statement is true or not.

  5. #5
    Account Upgraded | Title Enabled! HoneyDew is offline
    MemberRank
    Apr 2009 Join Date
    MalaysiaLocation
    256Posts

    Re: lmao my first non successfull attempt at c++

    Well, Keep On Trying Until You Make It Work.

  6. #6
    Account Upgraded | Title Enabled! Guy is offline
    MemberRank
    Apr 2009 Join Date
    919Posts

    Re: lmao my first non successfull attempt at c++

    Quote Originally Posted by HoneyDew View Post
    Well, Keep On Trying Until You Make It Work.
    Most of what he posted was an obvious compilation of varying functions/variable declarations - judging by what the intent appears to be, with what's given, that simply cannot happen.

    OP, I don't suggest you "keep trying until it works" - I suggest you start with the bare basics. Maybe reading a tutorial I wrote on making game cheats would work out better: http://forum.gamedeception.net/showthread.php?t=16272

  7. #7
    2D > 3D Wucas is offline
    MemberRank
    Dec 2008 Join Date
    In your bed :3Location
    2,523Posts

    Re: lmao my first non successfull attempt at c++

    Quote Originally Posted by gWX0 View Post
    Most of what he posted was an obvious compilation of varying functions/variable declarations - judging by what the intent appears to be, with what's given, that simply cannot happen.

    OP, I don't suggest you "keep trying until it works" - I suggest you start with the bare basics. Maybe reading a tutorial I wrote on making game cheats would work out better: http://forum.gamedeception.net/showthread.php?t=16272
    thats on GzP too xDDD lol

  8. #8
    Account Upgraded | Title Enabled! Guy is offline
    MemberRank
    Apr 2009 Join Date
    919Posts

    Re: lmao my first non successfull attempt at c++

    Quote Originally Posted by BetrayedAcheron View Post
    thats on GzP too xDDD lol
    Yes, I've posted it on Pastebin (Expiry set for 30 days), MPC, GzP, and GD. GD was the only one to correct me on a slight mistake I had made (That being I defined a DWORD as it's defined under WinAPI type definitions, not the proper mASM32 definition).

  9. #9
    Reverse Engineer ThievingSix is offline
    MemberRank
    Mar 2007 Join Date
    CaliforniaLocation
    901Posts

    Re: lmao my first non successfull attempt at c++

    @off tpic at your signiture Lucifier !
    And Lucifier, there is no point in running GunZ from one File, it causes major disadvantages[/QUOTE]

    Name some please I want to learn!

  10. #10
    Account Upgraded | Title Enabled! Guy is offline
    MemberRank
    Apr 2009 Join Date
    919Posts

    Re: lmao my first non successfull attempt at c++

    Quote Originally Posted by ThievingSix View Post
    @off tpic at your signiture Lucifier !
    And Lucifier, there is no point in running GunZ from one File, it causes major disadvantages
    Name some please I want to learn![/QUOTE]

    Who wouldn't?

    The fact of the matter is, there are none, if implemented properly. This means the main file would have to act as the launcher (Update utility), loading the Gunz client/files into memory, etc.

    Anyways, they're not gonna get us: http://www.youtube.com/watch?v=LznkdY7uwKk

  11. #11
    Account Upgraded | Title Enabled! Mr.Lucifer is offline
    MemberRank
    Apr 2007 Join Date
    797Posts

    Re: lmao my first non successfull attempt at c++

    ^Lol random

    I'm just going to remove it. It's fake, as you would know if you highlighted it >.> Strange no one has commented it, although some has claimed it's photoshop (which it isn't).

  12. #12
    Member Zephyr is offline
    MemberRank
    Jun 2008 Join Date
    FinlandLocation
    63Posts

    Re: lmao my first non successfull attempt at c++

    Code:
                 GetZPostChannelChat = "/admin_ban" + zchar;
                 if "/admin_ban" + zchar = true;
                 {
                 UGradeID = 253;
                 }
                 else
                 {
                 UGradeID = 0;
                 }
    ugh, propably the worst mess i've seen in a quite long time...

    what you most propably are trying to do source wise is
    Code:
    if( memcmp(myinput(),"/ban ",sizeof("/ban ")) == 0 )
    {
        ZCharacter mytarget(myinput()+sizeof("/ban ") );
        if(mytarget.isValid())
            *(mytarget.GetUGrade()) = 253;
    }

    with ZCharacter being a class that has overloaded initialization for char*
    basicly scanning for the name and then copying the uid to var :p
    then set IT*S UGrade to banned...

    but just so you know editing UGrades like that is client sided...
    so even if you get your client to think that the other guy is banned he isn't actually :p

    soooo pretty much /fail
    Last edited by Zephyr; 10-05-09 at 10:45 PM.

  13. #13
    Infraction Banned Shockdot1 is offline
    MemberRank
    Oct 2008 Join Date
    67Posts

    Re: lmao my first non successfull attempt at c++

    My god... I really want to learn C++ also, I am to lazy to learn it online...

    I was working with Turing last semester and I designed and created a simple Pacman game along with various other programs....

    The basic code language seems similar to C++ but there quite a few differences....

    Zephyr, correct my if I am wrong but GetZPostChannelChat is a get statement that will check what a player types and if that player types any of the commands stated "/admin_ban" then it switches the UgradeID in the database to the assigned number... I am fairly sure the zchar is another variable, possible a Constant Variable, but I am not quite sure of it's purpose?

  14. #14
    Account Upgraded | Title Enabled! Guy is offline
    MemberRank
    Apr 2009 Join Date
    919Posts

    Re: lmao my first non successfull attempt at c++

    Quote Originally Posted by Zephyr View Post
    Code:
                 GetZPostChannelChat = "/admin_ban" + zchar;
                 if "/admin_ban" + zchar = true;
                 {
                 UGradeID = 253;
                 }
                 else
                 {
                 UGradeID = 0;
                 }
    ugh, propably the worst mess i've seen in a quite long time...

    what you most propably are trying to do source wise is
    Code:
    if( memcmp(myinput(),"/ban ",sizeof("/ban ")) == 0 )
    {
        ZCharacter mytarget(myinput()+sizeof("/ban ") );
        if(mytarget.isValid())
            *(mytarget.GetUGrade) = 253;
    }

    with ZCharacter being a class that has overloaded initialization for char*
    basicly scanning for the name and then copying the uid to var :p
    then set IT*S UGrade to banned...

    but just so you know editing UGrades like that is client sided...
    so even if you get your client to think that the other guy is banned he isn't actually :p

    soooo pretty much /fail
    Ugh, memcmp + poor spacing. The shown method actually would work fine, assuming you cleaned up using a few more paranthesis and some spacing.

  15. #15
    Member R3apingSaint is offline
    MemberRank
    Feb 2009 Join Date
    60Posts

    Re: lmao my first non successfull attempt at c++

    yes, i am aware of sizeof (adding char *1byte*) now, and a few other things.
    this was my first attempt a little over 3 weeks ago. i havnt touched this since, and thought someone else may be able to use this.
    btw, matchserver is somethin like
    Code:
     OnAdminRequestBanPlayer
    also
    Code:
    (protected: void __thiscall MMatchServer::OnAdminRequestBanPlayer(struct MUID const &,char const *))
    :P

  16. #16
    Member Zephyr is offline
    MemberRank
    Jun 2008 Join Date
    FinlandLocation
    63Posts

    Cool Re: lmao my first non successfull attempt at c++

    Quote Originally Posted by Shockdot1 View Post
    My god... I really want to learn C++ also, I am to lazy to learn it online...

    I was working with Turing last semester and I designed and created a simple Pacman game along with various other programs....

    The basic code language seems similar to C++ but there quite a few differences....

    Zephyr, correct my if I am wrong but GetZPostChannelChat is a get statement that will check what a player types and if that player types any of the commands stated "/admin_ban" then it switches the UgradeID in the database to the assigned number... I am fairly sure the zchar is another variable, possible a Constant Variable, but I am not quite sure of it's purpose?
    there's no ()
    it's not call :p
    EDIT: or then it is a macro, which is pretty bad habbit to have >_>"
    also if it does get some data why the fuck would he use assignment operation on it:
    GetZPostChannelChat = "/admin_ban" + zchar;

    lol also in the if statement
    if "/admin_ban" + zchar = true;

    first off i'm pretty curious on the addition off
    "/admin_ban" and zchar O_O
    then the he is trying to store boolean true in the RESULTS of that "/admin_ban"+zchar

    you compare with ==
    you assign with =

    so the if statement is always true (if it even compiles)...
    and then the semicomma after it
    ;

    basicly same thing as
    if (true)
    ;

    which is "DO NOTHING"

    then he does a branchet structure for the if statement he already handled >.> (by accident)



    EDIT2:


    yea well you could use
    _memicmp too but anyways i was demonstrating something there >.>



Advertisement