r/code • • Jan 12 '20

Halp pls! Mining

I have always wondered how people are able to dig into a game developer’s code and leak possible information. I don’t know code at all so I was wondering if someone in this community could explain to me how people are able to do that.

9 Upvotes

8 comments sorted by

View all comments

Show parent comments

1

u/Omega_Girthquake Jan 12 '20

How are you able to reverse the binary? I’m like clueless when it comes to code this is all new to me lmao. I was asking because I kept seeing miners leak possible stuff from APEX and always wondered how tf people did that.

2

u/[deleted] Jan 12 '20 edited Jan 12 '20

.NET isn’t compiled into binary, it’s compiled into an intermediate language in the form of bytecode, if on Windows, this bytecode is called MSIL. MSIL (Microsoft Intermediate Language) is a simple set of instructions that will get executed through the CLR (Common Language Runtime) which is a virtual machine and compiled into assembly on the fly using a JIT (Just in Time) compiler.

MSIL isn’t very difficult to expose and decompile, it’s also relatively easy to transpile into a higher level language which could be the language it used to be before it was compiled, such as C# or VB. There are quite a bit of decompilers out there capable of decompiling .NET assemblies such as iLSpy, DotPeek, and .NET Reflector by RedGate. Decompiling will only get you so close to the original source code though since a lot of guess work is involved inside of the decompiler. Some assemblies can prevent decompiling by obfuscating assemblies, while not 100% protected, it surely does slow down the process as well for the application and most of the time increasing the assemblies size.

For code outside of the .NET Framework and Mono, such as C++ which compiles directly into assembly, a separate set of tools need to be involved. Such tools are often used by the NSA, other government agencies, as well for white hats and antivirus developers for reverse engineering. They are very difficult to use and also require a fair level of guess work by both the software and the user.

Outside of decompiling we also have memory editors and hex editors. These can be used to dump and modify information that resides in the games memory during runtime. Using reverse engineering and exposing some information from memory dumps we can then begin to learn more about the games code and architecture which allows us to write our own code and inject it into the games memory.

1

u/Omega_Girthquake Jan 12 '20

Fuckkkk this sounds complicated it’s pretty cool though thanks!

1

u/[deleted] Jan 13 '20 edited Jan 14 '20

It’s not complicated, it’s very easy. Don’t let big words and acronyms intimidate you. Most decompilers are as easy as dragging and dropping the executable or library into the program and the rest is taken care of for you. Decompilers have definitely come a very long way and are constantly improving.