C# Game Hacking

Posts 1–15 of 15 · Page 1 of 1
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
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.
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.
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).
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?
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.
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!
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.
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
hmm idk about C# but in C++ u have to use like this

Code:
using namespace Microsoft.Xna.Framework;
try it like that
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# :/
It's obviously using the XNA Framework so download & install that
creators.xna.com
Quote Originally Posted by B1ackAnge1 View Post
It's obviously using the XNA Framework so download & install that
creators.xna.com
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.
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?
Posts 1–15 of 15 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

Talk with us