Valhalla Legends Archive

Programming => General Programming => Assembly Language (any cpu) => Topic started by: Networks on October 24, 2005, 09:01 AM

Title: Where to start?
Post by: Networks on October 24, 2005, 09:01 AM
I was wondering if anyone experienced can point me in the right direction as to where I can start learning about overall game hacking and cracking. Things to do or not to do. Places to learn. Is it just practice or what? Are eBooks helpful? Thank you in advance.
Title: Re: Where to start?
Post by: MyndFyre on October 24, 2005, 10:37 AM
Chances are good you'll need to be familiar with disassembly tools.  I'd suggest picking up Hacker Disassembling Uncovered (http://www.amazon.com/exec/obidos/tg/detail/-/1931769222/qid=1130168185/sr=8-5/ref=pd_bbs_5/102-4230089-5444912?v=glance&s=books&n=507846) -- it's very good.  If you search, you might find an e-book on here that someone posted before.  *shrug*
Title: Re: Where to start?
Post by: Warrior on October 24, 2005, 04:18 PM
Let's see..learn ASM ;).
Title: Re: Where to start?
Post by: DeTaiLs on October 25, 2005, 10:29 AM
I started learning asm off stuff I like for example Starcraft because I understood how Starcraft works so i could follow the disassembly code and understand where it was trying to go.
Title: Re: Where to start?
Post by: Networks on October 27, 2005, 08:51 AM
I understand some things, I've learned basics, I was really just curious what was the best method for learning.
Title: Re: Where to start?
Post by: Warrior on October 27, 2005, 09:17 AM
Learn how parameters are passed to the stack and how to read them. Also learn how code is translated to ASM through C.

Try converting ASM -> C and vice versa. Start off simple and gradually get better.

You will also want to get good with a debugger (such as softice or windbg) and a dissasembler (IDA)
Title: Re: Where to start?
Post by: noob on November 15, 2005, 07:50 PM
Start by disassembling to learn assembler in higher-level terms. It helps to become familiar with debugging and reverse engineering to some extent. Games are generally complex monsters, so start off small with some trivial "Hello World"s and similar.
Title: Re: Where to start?
Post by: Warrior on November 15, 2005, 08:20 PM
Learn how Direct3D works and OpenGL, learn about the Windows API in depth for you will need it to hijack the process and hook into all your functions.
Title: Re: Where to start?
Post by: noob on November 15, 2005, 10:26 PM
Also, don't bother with any books on ASM. They teach you bad habits. Learn on your own.

Write something, for example:


int main(void)
{
   printf("string\n");
   return 0;
}


and gcc with -S:


        .file   "asdf.c"
        .section        .rodata
.LC0:
        .string "string\n"
        .text
.globl main
        .type   main, @function
main:
        pushl   %ebp
        movl    %esp, %ebp
        subl    $8, %esp
        andl    $-16, %esp
        movl    $0, %eax
        subl    %eax, %esp
        movl    $.LC0, (%esp)
        call    printf
        movl    $0, %eax
        leave
        ret


Learn how functions are called, how conditionals are evaluated and acted upon, etc. Since you're interesting in game hacking, which is largely disassembling, knowing how certain chunks of C code looks in assembler is key. You don't really have to understand ASM deeply, just know what to look for.
Title: Re: Where to start?
Post by: Dan on November 19, 2005, 12:34 PM
Quote from: noob on November 15, 2005, 10:26 PM
Also, don't bother with any books on ASM. They teach you bad habits. Learn on your own.

Write something, for example:


int main(void)
{
   printf("string\n");
   return 0;
}


and gcc with -S:


        .file   "asdf.c"
        .section        .rodata
.LC0:
        .string "string\n"
        .text
.globl main
        .type   main, @function
main:
        pushl   %ebp
        movl    %esp, %ebp
        subl    $8, %esp
        andl    $-16, %esp
        movl    $0, %eax
        subl    %eax, %esp
        movl    $.LC0, (%esp)
        call    printf
        movl    $0, %eax
        leave
        ret


Learn how functions are called, how conditionals are evaluated and acted upon, etc. Since you're interesting in game hacking, which is largely disassembling, knowing how certain chunks of C code looks in assembler is key. You don't really have to understand ASM deeply, just know what to look for.
I dont agree with you there. E-books and books are a great resource for learning. Learning off generated code from a C compiler wont teach you how to optimize your code. And it never hurts to have a good understanding of ASM, programs may be written in ASM and not C (or even a different langauge) so you wont know what you're looking at becuase the code wasnt generated from the compiler you're familiar with.
Title: Re: Where to start?
Post by: MyndFyre on November 23, 2005, 02:34 AM
I think at the end of the day, the most absolutely critical thing to understand is how to address memory.  Because that's all you have in assembly, not silly things like variables.  (This isn't always 100% true, but :P)

IIRC Intel-based processors have 16 different addressing modes.  It's utter insanity.

I have a book on Intel assembly if you want it Networks.  It was from the intro to assembly class at ASU.
Title: Re: Where to start?
Post by: Warrior on November 23, 2005, 10:22 AM
You can order thier official manuals for free! Ordered book 3 :)

iirc most modern OSes use "Virtual Flat" model. No segentation, linear adresing, virtual memory. Don't think hed have to worry about any of that though.(Intel Sys programming section 3.4
Title: Re: Where to start?
Post by: MyndFyre on November 23, 2005, 01:21 PM
Quote from: Warrior on November 23, 2005, 10:22 AM
You can order thier official manuals for free! Ordered book 3 :)

iirc most modern OSes use "Virtual Flat" model. No segentation, linear adresing, virtual memory. Don't think hed have to worry about any of that though.(Intel Sys programming section 3.4

Maybe so, but they support them because processors do.  Knowing [ds:4fh] means 0x4f bytes off the start of the data segment is handy.
Title: Re: Where to start?
Post by: Networks on January 03, 2006, 05:49 PM
Well a little update for me, I cracked my first worthy program. :) (Not a crackme)

For those who want to learn, this is where I got started:

- http://www.crack-mes.de
- http://www.exetools.com

- Get some basic ASM tutorials
- Be famaliar with your debugger
- Do crack-mes's
- Try to physically understand what the asm code is doing, make sense of it.

- Read up on some Reverse engineering eBooks/books.

Reading lots of cracking tutorials is extremely helpful, just search around.