Thread: C# Game Hacking

Results 1 to 15 of 15
  1. #1
    Anirak's Avatar
    Join Date
    Oct 2009
    Gender
    male
    Posts
    9
    Reputation
    10
    Thanks
    0

    C# Game Hacking

    Hello all,

    There's a game being developed right now in what I believe to be in C#. It's a multiplayer online game, based off of an old java game which I used to play but is now no longer existant.

    Basically, I used to "hack" (or whatever you'd like to call it) this old java game by decompiling the code, making changes, then recompiling. This gave me great versatility for changing things within the game, as I wasn't limited to simply doing memory searches to give unlimited health (which wouldn't have worked anyway since it was stored server side). Getting to the point:

    The Point:

    I'd like to begin doing this for this new game while it is still in it's early stages. I know very little about c#, but I'm intelligent enough that I should be able to mess around with it to get the effect I'd like. I've downloaded the decompiler (or is it better referred to as disassembler?) Reflector, but it gives quite a few source files for one DLL, and I'm not sure how to go about getting it recompiled and packaged back into the DLL.

    Is there anyone out there that might be able to help me?

    Thanks in advance
    Last edited by Anirak; 10-13-2009 at 04:23 PM.

  2. #2
    pimpinallovertheworld666's Avatar
    Join Date
    Jan 2009
    Gender
    female
    Posts
    972
    Reputation
    10
    Thanks
    93
    My Mood
    Fine
    hmmmmmmmmmmm u say a game....but won't tell...

  3. #3
    Anirak's Avatar
    Join Date
    Oct 2009
    Gender
    male
    Posts
    9
    Reputation
    10
    Thanks
    0
    Quote Originally Posted by pimpinallovertheworld666 View Post
    hmmmmmmmmmmm u say a game....but won't tell...
    Is that... relevant? If someone wants to work on it privately with me I'd love to, but as it is a very small community of players right now and very much in development, I don't want to post it publicly as I think it would cause more harm to the game than good.

  4. #4
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,304
    Reputation
    170
    Thanks
    2,203
    My Mood
    Flirty
    Quote Originally Posted by Anirak View Post
    Reflector, but it gives quite a few source files for one DLL, and I'm not sure how to go about getting it recompiled and packaged back into the DLL.

    Is there anyone out there that might be able to help me?

    Thanks in advance
    I would call it a reflector, but on to your main point.

    The source could come out any which way. It all depends on the nature of the reflector. The good thing is C# is a lot like Java... which you probably already know. It will be impossible for anyone to tell exactly what should be done without posting the source as far as I can tell. And even then it might take a while. It all depends on your deflector too. name your deflector, the game, and the decompiled source.

    Quote Originally Posted by Anirak View Post
    Is that... relevant? If someone wants to work on it privately with me I'd love to, but as it is a very small community of players right now and very much in development, I don't want to post it publicly as I think it would cause more harm to the game than good.
    Trust me I will probably never play whatever game ur talking about.

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

  5. #5
    B1ackAnge1's Avatar
    Join Date
    Aug 2009
    Gender
    male
    Posts
    455
    Reputation
    74
    Thanks
    344
    My Mood
    Cynical
    Any DLL (for any major project) is usually Multiple (upon multiple) files.
    I work on DLLs that have easily 50/100+ files in them
    Reflector will indeed 'decompile' or at least attempt but you will not the source code 100% since it's been compiled already into MSIL so it makes it's best guess what the C# code looked like (which usually , at least from my experiments with reflector) isn't even close
    Of course that's not even getting into obfuscation etc which will make that even messier (if they bothered to go through that step).

  6. #6
    Anirak's Avatar
    Join Date
    Oct 2009
    Gender
    male
    Posts
    9
    Reputation
    10
    Thanks
    0
    Quote Originally Posted by B1ackAnge1 View Post
    Any DLL (for any major project) is usually Multiple (upon multiple) files.
    I work on DLLs that have easily 50/100+ files in them
    Reflector will indeed 'decompile' or at least attempt but you will not the source code 100% since it's been compiled already into MSIL so it makes it's best guess what the C# code looked like (which usually , at least from my experiments with reflector) isn't even close
    Of course that's not even getting into obfuscation etc which will make that even messier (if they bothered to go through that step).
    Well, is the code typically recompilable as is despite whether or not it resembles closely the original code?

  7. #7
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,304
    Reputation
    170
    Thanks
    2,203
    My Mood
    Flirty
    Quote Originally Posted by Anirak View Post
    Well, is the code typically recompilable as is despite whether or not it resembles closely the original code?
    Should be. It should be able to be recompiled perfectly, you just won't understand what it says as much as you would like too. Reversing is an art in itself.

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

  8. #8
    Anirak's Avatar
    Join Date
    Oct 2009
    Gender
    male
    Posts
    9
    Reputation
    10
    Thanks
    0
    Quote Originally Posted by why06 View Post
    Should be. It should be able to be recompiled perfectly, you just won't understand what it says as much as you would like too. Reversing is an art in itself.
    Attempting to recompile a few of the source files gives me a variety of errors. On the most simple of files I get the following three errors:

    Code:
    ExtraRadar.cs(3,21): error CS0234: The type or namespace name 'Xna' does not
            exist in the namespace 'Microsoft' (are you missing an assembly
            reference?)
    ExtraRadar.cs(14,27): error CS0246: The type or namespace name 'Rectangle' could
            not be found (are you missing a using directive or an assembly
            reference?)
    ExtraRadar.cs(22,16): error CS0246: The type or namespace name 'Rectangle' could
            not be found (are you missing a using directive or an assembly
            reference?)
    At the beginning of the source code:

    Code:
    using Microsoft.Xna.Framework;
    Could this be a result of having too old of a version of the .NET SDK? I googled and saw the first download was v2.0, but apparently there is a 3.5.

    Nevertheless, a variety of other errors appear depending on which file I attempt to compile.

    Thanks again for all the help!

  9. #9
    Anirak's Avatar
    Join Date
    Oct 2009
    Gender
    male
    Posts
    9
    Reputation
    10
    Thanks
    0
    So just as a test I made a small hello world program and attempted to decompile it then recompile.

    Several source files were created despite my original single source file. Attempting to recompile any of the files gave errors, which seems to result from not having other "using directives" or "assembly references" present.

  10. #10
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,304
    Reputation
    170
    Thanks
    2,203
    My Mood
    Flirty
    Quote Originally Posted by Anirak View Post
    So just as a test I made a small hello world program and attempted to decompile it then recompile.

    Several source files were created despite my original single source file. Attempting to recompile any of the files gave errors, which seems to result from not having other "using directives" or "assembly references" present.
    Ok. here's the thing. Even a simple program like hello World takes tons of information from other classes (such as the I/O system). And the I/O class probably takes from other classes too. Maybe it's you decompiler. I'm not sure. It could really be a number of things... sorry

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

  11. #11
    Matrix_NEO006's Avatar
    Join Date
    Feb 2008
    Gender
    male
    Posts
    240
    Reputation
    12
    Thanks
    33
    My Mood
    Lonely
    hmm idk about C# but in C++ u have to use like this

    Code:
    using namespace Microsoft.Xna.Framework;
    try it like that

  12. #12
    zeco's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    Canada
    Posts
    683
    Reputation
    12
    Thanks
    78
    My Mood
    Cynical
    Ok, I Made a quick C# hello world (no i don't know C#), and used reflector to disassemble it and the code came back exactly the same basically. Then i found a random C# code snippet and disassembled it with Reflector and though a couple things were done differently, it was essentially the same.

    And Matrix: The using Directive in C# has very slightly different syntax, so what Anni has is correct i beleive. But i recommend you not listen to me cause i don't actually know C# :/

  13. #13
    B1ackAnge1's Avatar
    Join Date
    Aug 2009
    Gender
    male
    Posts
    455
    Reputation
    74
    Thanks
    344
    My Mood
    Cynical
    It's obviously using the XNA Framework so download & install that
    creators.xn*****m

  14. #14
    Anirak's Avatar
    Join Date
    Oct 2009
    Gender
    male
    Posts
    9
    Reputation
    10
    Thanks
    0
    Quote Originally Posted by B1ackAnge1 View Post
    It's obviously using the XNA Framework so download & install that
    creators.xn*****m
    Thanks. I downloaded it and installed. However, am I still getting the same dialog box from reflector when attempting to disassemble that it cannot find microsoft.xna.framework version 3.0.0.0. It asks me to find it manually, so I click "browse" and go to C:\windows\assembly\ and find it easily, however selecting and clicking "open" does nothing. It doesn't even close the dialog box. Any ideas?

    Edit: Cancel that. I believe I've figured it out. My problem is now it wants MySql.data version 6.0.3.0. I'm gonna google around to see if I can find it.
    Last edited by Anirak; 10-21-2009 at 02:59 PM.

  15. #15
    Anirak's Avatar
    Join Date
    Oct 2009
    Gender
    male
    Posts
    9
    Reputation
    10
    Thanks
    0
    Well I managed to get all of those .dlls found just fine, but upon exporting the visual c# file I get gobs of errors. I feel like I might be messing up something very simple here, perhaps with version settings or something like that. Can anyone possibly think of some settings I might have wrong on import/export that could cause all of these errors?

    Also, I'm trying to build to a DLL but it seems as it it's trying to build to a .sln file when I hit build?

Similar Threads

  1. What would you look for in a game hacking tool kit?
    By Dave84311 in forum General Game Hacking
    Replies: 23
    Last Post: 06-02-2015, 06:34 AM
  2. MPGH Game Hacking Group
    By Dave84311 in forum General Game Hacking
    Replies: 22
    Last Post: 08-08-2007, 12:43 PM
  3. Web-based game hacking..
    By Krilliam in forum General Game Hacking
    Replies: 7
    Last Post: 02-20-2006, 01:12 PM
  4. how can i make game hack?!!!!
    By UnknownID in forum General Game Hacking
    Replies: 2
    Last Post: 02-07-2006, 07:21 PM
  5. Game Hacking IMPOSSIBLE IN VISTA?
    By Dave84311 in forum General Game Hacking
    Replies: 13
    Last Post: 01-09-2006, 08:58 PM

Tags for this Thread