Author Topic: Is there really no way to learn asm from a beginner's level?  (Read 68668 times)

Offline Evlesoa

  • Jr. Member
  • *
  • Posts: 20
Is there really no way to learn asm from a beginner's level?
« on: January 10, 2015, 01:27:05 PM »
From my experience the answer is YES, there is no way. Hope someone can help me! I'm very intent here, but also very confused!

Anyway, why do I say that a complete beginner can't learn asm?

Well, I've noticed that there are NO tutorials, NO books, nothing that explains stuff like this:
invoke MessageBox, NULL, addr HelloWorld, addr HelloWorld, MB_OK

MessageBox? Null? Where is this stuff from? Why is there? What does it all mean??? Ok, I know what it means, but it's not explained why in that order. In other words, the program is not usually dissected. If you give knowledge but don't explain how to use it, what good is it?

I've looked at books like The Art of Assembly, Programming from the Ground Up, The Zen of Assembly Language, Guide to Assembly Language - A Concise Introduction (yeah right), another called PC Assembly Language, etc. Very useful, I think, just not that useful for someone who doesn't know how to make an exe that "does" things. Now I've done some things in C++ a few years ago, and I could build a program with a GUI and all (forgot it now). With asm, I don't know where to start or what to do. Nothing seems to be explained as well as it is in a good ol' "Learn C" book.

My main goal is to learn asm so that I can do something more than just Cheat Engine on games like Minesweeper or Dungeon Keeper or Evil Genius. I say this because there are limitations to what I can do, and to how much I understand memory and how it works (I would hope I can actually browse memory and find things like unit production speed, which is something that I can't do now seeing how that "variable" (if it is one) doesn't change very often).

Any ideas? Or just go back to C++ and forget asm?
« Last Edit: January 10, 2015, 02:17:14 PM by Evlesoa »

Offline vzybilly

  • Jr. Member
  • *
  • Posts: 2
Re: Is there really no way to learn asm from a beginner's level?
« Reply #1 on: February 07, 2015, 03:27:42 AM »
Ok, I've been working in NASM for afew months now and have gotten most all of it, it really is very basic.

One thing I found out, Books Are Crap.

If you want to continue to learn nasm, I can pass off my set-up to you and start teaching you myself, it won't do much with GUI yet but I'm learning SDL right now.

As for editing other games and such, on my OS an app needs to request higher access or just plain can't do that. I peeked into something of the like and I think the final answer was a system call or something but that was months ago that I did that looking into.

You can learn how to assemble then how to disassemble which will allow you to completely change the game you want to play.

Offline RagingGrim

  • Jr. Member
  • *
  • Posts: 28
Re: Is there really no way to learn asm from a beginner's level?
« Reply #2 on: February 11, 2015, 04:17:05 PM »
I haven't used invoke at all , but that's probably because it's a macro :P

MessageBox is a winapi function ; If i remember correctly it's located in kernel32 but I'm not so sure.

If your unsure about any piece of code you see simply google it.
For example googling messagebox takes you straight to msdn

Now this is where knowing C++ comes in handy! :D
https://msdn.microsoft.com/en-us/library/windows/desktop/ms645505%28v=vs.85%29.aspx

as you can see messagebox is a function that takes 4 params.

You'll probably only be interested in these two params
 _In_opt_  LPCTSTR lpText,
  _In_opt_  LPCTSTR lpCaption,

lpText is the text displayed in the messagebox whilst lpCaption is the caption of the messagebox.
Ugh , i can post an example of using messagebox if you want.

Don't go back to c++. Learn assembly . Your mind will be blown.

Offline encryptor256

  • Full Member
  • **
  • Posts: 250
  • Country: lv
  • Win64 .
    • On Youtube: encryptor256
Re: Is there really no way to learn asm from a beginner's level?
« Reply #3 on: February 12, 2015, 06:05:06 PM »
MessageBox is a winapi function ; If i remember correctly it's located in kernel32 but I'm not so sure.

It is in "user32.dll", thank you.  :P
Encryptor256's Investigation \ Research Department.

Offline Evlesoa

  • Jr. Member
  • *
  • Posts: 20
Re: Is there really no way to learn asm from a beginner's level?
« Reply #4 on: February 22, 2015, 02:41:04 PM »
Wow, didn't think I'd get a reply.

Okay, let me see... the problem I have is that, for example, user32.dll. How do you even open such files? I tried with notepad but more often than not the dll files come out as messes.

And then syntax order. I don't think that I can just look at syntax and memorize its order. I need to actually practice doing that. This means that if I open a program or reverse engineer it, I probably won't understand any of it.

How do I start? I seriously just don't know what to start with first. Do I parrot hello world script over and over until I've memorized it by means of rote? or is there something more / better that I can do? I find assembly to be fascinating, honestly. I just don't get how manipulation of memory alone (turning 1s and 0s on dials for analogy) can build anything. Lastly, speaking of things like "_In_opt_  LPCTSTR lpText": what is _ for? what is In and opt for?

Anyway, pointers, please. How to learn this cryptic language and be able to do something with it? All this reading on x86 processors and how their registers work seems of no help. I'm really eager, so I'll take any help I can get!
« Last Edit: February 22, 2015, 02:47:18 PM by Evlesoa »

Offline shaynox

  • Full Member
  • **
  • Posts: 118
  • Country: gr
Re: Is there really no way to learn asm from a beginner's level?
« Reply #5 on: February 22, 2015, 03:01:06 PM »
You can open dll file with that: http://www.nirsoft.net/utils/dll_export_viewer.html

After, for learn assembly in theorical, I recommend you to read: http://www.intel.com/content/www/us/en/processors/architectures-software-developer-manuals.html.
And for learn how to use WinAPI function, just enter the function you want to learn in bing, then you will see msdn link, that's all.

Then produce a lot of code, the key to learn assembler is write asm code everyday, you can of course read other source code, (http://forum.nasm.us/index.php?topic=2041.0), for exemple, since I learn asm since 2011, I have accumulated 15 Go of courses + project + exemple in one root folder: Computer science ^-^
« Last Edit: February 22, 2015, 03:21:52 PM by shaynox »

Offline Evlesoa

  • Jr. Member
  • *
  • Posts: 20
Re: Is there really no way to learn asm from a beginner's level?
« Reply #6 on: February 22, 2015, 04:38:27 PM »
I'm willing to code every day for an hour if I can learn asm and how to use it so that I can manipulate old games like quake 1/2 and to learn how to break games down. Then I'd like to learn in general how to do macros and what not.

I will take a look at what you gave me. Thanks a lot for the links on starting. I also do have some various asm tutorials but I don't really understand them too well because I'm not at that level yet.

Offline shaynox

  • Full Member
  • **
  • Posts: 118
  • Country: gr
Re: Is there really no way to learn asm from a beginner's level?
« Reply #7 on: February 22, 2015, 04:55:35 PM »
For macro system: http://forum.nasm.us/index.php?topic=2036.0.

And for asm learning, hmm.

Well like you know it's all about mnemonic word:

Code: [Select]
Instruction      Destination, operand

After what you don't arrive to understand ? memory management, variable/value, pointer, register, ... ?




PS: I recommend you, begin to learn by newer technologies made by intel: https://software.intel.com/en-us/intel-isa-extensions, AVX instruction.
« Last Edit: February 22, 2015, 05:04:21 PM by shaynox »

Offline Evlesoa

  • Jr. Member
  • *
  • Posts: 20
Re: Is there really no way to learn asm from a beginner's level?
« Reply #8 on: February 22, 2015, 05:08:11 PM »
Okay, maybe I'm retarded or something, but how does knowing these codes make me able to create anything?

You know what I mean? Basically, I don't see how pushing memory around (like a dust sweeper sweeping the floor) = programs? :-\

I get that in, let's say Microsoft Visual C++ IDE, you can specify what the program does and all, but this concept of just memory being messed with is hard to grasp. I could make a calculator / program that asks for input in C++ (that's basically as high as I could crawl in that class), but for assembly? If it's "that easy," then why aren't there more operating systems out there or more hackers? If all it takes is to have a reference book, then everyone can just program whatever they want? I've had more success with Ruby (actually being able to make something) than any other language.

Let's say I want to start with minesweeper. Goal is to stop time. Or let's say I want to fly in Quake by changing my x,y,z coordinates, or let's say I want to make my bot opponents be unable to move or have no weapons. This clearly requires a lot of expertise, does it not? After all, I like to play games, so I figured that would be what I should try learning on.

P.S. Holy crap. That intel stuff makes no sense to me at all. This processor stuff looks way too complex, and I have no idea what any of that means. *sigh* I'll have to reinstall Microsoft IDE and stick with that because there's no way I can process that CPU stuff. It's unimaginable that you have to know so much just to create a program... jesus...
« Last Edit: February 22, 2015, 05:16:39 PM by Evlesoa »

Offline shaynox

  • Full Member
  • **
  • Posts: 118
  • Country: gr
« Last Edit: February 22, 2015, 05:23:11 PM by shaynox »

Offline Evlesoa

  • Jr. Member
  • *
  • Posts: 20
Re: Is there really no way to learn asm from a beginner's level?
« Reply #10 on: February 22, 2015, 05:18:49 PM »
No, that's OK. I just wanted to do stuff like this and understand it (I wrote this, but it crashes, and I don't really understand it too well):

Code: [Select]
alloc(health,1024)
label(original) //reference
label(quit)
label(return)

health:
mov [ebx+00000480],#100

original:
//sub [ebx+00000480],eax

quit:
jmp return

"Tutorial-i386.exe"+24FFB:
jmp health
nop

return:
//blank

I hope I can figure out how to work with a program's memory and code applications that can change it for learning purposes, and then move on to creating some sort of application purely in assembly. I'm hoping to use this in application security / testing. Everyone kept telling me to learn assembly to do that because it can teach you how to reverse engineer and directly manipulate a program's allocation that's stored in RAM. I think the most basic, as said, is to start with hacking silly games. I'm not trying to be a hacker or anything. I just like computers a lot.

Edit: okay, and if I read all of that? what happens then? I read the Art of Assembly (like 1/3rd of it) and the only thing I got was that I am probably not genius enough to memorize everything word for word.

Edit 2: I can understand this: http://aelinik.free.fr/c/ch06.htm, or something more beginner-like http://aelinik.free.fr/c/ch02.htm, but I can't understand the stuff you've given me. Isn't there a guide on assembly in this style? Or is it that people do not write stuff like this in assembly? It seems assembly is incapable of doing so based on what you've given me. It's just a bunch of instructions. How does giving instructions to a CPU create apps?

For example, there it says: "No previous programming experience is required for you to learn the C language from this book, although some knowledge of computers helps. Also, it's up to you to determine how quickly to go through the 24 hours of this book: You could sit up with a big pot of coffee and power through the book in a sitting or you could take an hour a day for 24 days."

This doesn't hold true for asm, does it? You need to be a mozart of CPU architecture and understand RAM like the back of your hand in order to do anything?

I apologize for my confusion. I'm truly a noob.
« Last Edit: February 22, 2015, 05:32:45 PM by Evlesoa »

Offline shaynox

  • Full Member
  • **
  • Posts: 118
  • Country: gr
Re: Is there really no way to learn asm from a beginner's level?
« Reply #11 on: February 22, 2015, 05:32:15 PM »
Hmm, sorry I have take the other way of the force: build program :p

And yes, you need assembly knowledge for hacking program, after for hacking, sorry, don't have any knowledge :p

If you are good in French language, you can navigate in this site: http://www.newbiecontest.org/
« Last Edit: February 22, 2015, 05:34:20 PM by shaynox »

Offline Evlesoa

  • Jr. Member
  • *
  • Posts: 20
Re: Is there really no way to learn asm from a beginner's level?
« Reply #12 on: February 22, 2015, 05:33:51 PM »
Hmm, sorry I have take the other way of the force: build program :p

And yes, you need assembly knowledge for hacking program, after for hacking, sorry, don't have any knowledge :p

That's okay. I'm just trying to learn basics here, and I thought minesweeper or some easy game like that could be a good starting point because I get to understand how memory works. From there, I could try to create my own things. I appreciate, very much so, all of your help and your intent on helping me! Thanks so much.

Edit - unfortunately English is what I'm best at, and I never learned French. I can try translating it, but it may be difficult because translations suck. That is kind of what I'd be interested in, based on what I see. Like where it talks about computer memory (http://www.newbiecontest.org/forums/index.php?PHPSESSID=ab7b64064758e3fe62d61365436b9220&topic=3327.0) it's relevant to what I want to learn. But I can't understand it, haha.
« Last Edit: February 22, 2015, 05:40:35 PM by Evlesoa »

Offline shaynox

  • Full Member
  • **
  • Posts: 118
  • Country: gr
Re: Is there really no way to learn asm from a beginner's level?
« Reply #13 on: February 22, 2015, 05:39:58 PM »
No problem, it's too rare to found people who need help lol, programmers community aren't enough social :D (I talk but me too i'm not).

Well first you need to assemble your asm source code by nasm in binary dialect understand by CPU, then you need to integrate header for help OS execute your program.
And it's golink who do that: http://www.godevtool.com/GolinkHelp/GoLink.htm

After for hacking, you need binary language comprehension too (opcode), honestly I don't find any complete tutorial about that.
I started to do this:

Code: [Select]
; OPCODE INTEL X86/x64

; MOV  {dest.} {source}

 0xB0   01 = 'mov  al, 1'
 0xB1   01         = 'mov  cl, 1'
 0xB2   01     = 'mov  dl, 1'
 0xB3   01     = 'mov  bl, 1'
 0xB4   01     = 'mov  ah, 1'
 0xB5   01     = 'mov  ch, 1'
 0xB6   01     = 'mov  dh, 1'
 0xB7   01     = 'mov  dh, 1'
 0xB8   0100 = 'mov  ax, 1'
 0xB9   0100 = 'mov  cx, 1'
 0xBA   0100 = 'mov  dx, 1'
 0xBB   0100 = 'mov  bx, 1'
 0xBC   0100 = 'mov  sp, 1'
 0xBD   0100 = 'mov  bp, 1'
 0xBE   0100 = 'mov  si, 1'
 0xBF   0100 = 'mov  di, 1'
 0x66B8 01000000 = 'mov  eax, 1'
 0x66B9 01000000 = 'mov  ecx, 1'
 0x66BA 01000000 = 'mov  edx, 1'
 0x66BB 01000000 = 'mov  ebx, 1'
 0x66BC 01000000 = 'mov  esp, 1'
 0x66BD 01000000 = 'mov  ebp, 1'
 0x66BE 01000000 = 'mov  esi, 1'
 0x66BF 01000000 = 'mov  edi, 1'
 0x48B8 0100000000000000 = 'mov  rax, 1'
 0x48B9 0100000000000000 = 'mov  rcx, 1'
 0x48BA 0100000000000000 = 'mov  rdx, 1'
 0x48BB 0100000000000000 = 'mov  rbx, 1'
 0x48BC 0100000000000000 = 'mov  rsp, 1'
 0x48BD 0100000000000000 = 'mov  rbp, 1'
 0x48BE 0100000000000000 = 'mov  rsi, 1'
 0x48BF 0100000000000000 = 'mov  rdi, 1'

 0x48B0 01     = 'mov  r8b, 1'
 0x48B1 01     = 'mov  r9b, 1'
 0x48B2 01     = 'mov  r10b, 1'
 0x48B3 01     = 'mov  r11b, 1'
 0x48B4 01     = 'mov  r12b, 1'
 0x48B5 01     = 'mov  r13b, 1'
 0x48B6 01     = 'mov  r14b, 1'
 0x48B7 01     = 'mov  r15b, 1'
 0x48B8 0100     = 'mov  r8w, 1'
 0x48B9 0100     = 'mov  r9w, 1'
 0x48BA 0100     = 'mov  r10w, 1'
 0x48BB 0100     = 'mov  r11w, 1'
 0x48BC 0100     = 'mov  r12w, 1'
 0x48BD 0100     = 'mov  r13w, 1'
 0x48BE 0100     = 'mov  r14w, 1'
 0x48BF 0100     = 'mov  r15w, 1'
 0x41B8 01000000 = 'mov  r8d, 1'
 0x41B9 01000000 = 'mov  r9d, 1'
 0x41BA 01000000 = 'mov  r10d, 1'
 0x41BB 01000000 = 'mov  r11d, 1'
 0x41BC 01000000 = 'mov  r12d, 1'
 0x41BD 01000000 = 'mov  r13d, 1'
 0x41BE 01000000 = 'mov  r14d, 1'
 0x41BF 01000000 = 'mov  r15d, 1'
 0x49B8 0100000000000000 = 'mov  r8, 1'
 0x49B9 0100000000000000 = 'mov  r9, 1'
 0x49BA 0100000000000000 = 'mov  r10, 1'
 0x49BB 0100000000000000 = 'mov  r11, 1'
 0x49BC 0100000000000000 = 'mov  r12, 1'
 0x49BD 0100000000000000 = 'mov  r13, 1'
 0x49BE 0100000000000000 = 'mov  r14, 1'
 0x49BF 0100000000000000 = 'mov  r15, 1'
« Last Edit: February 22, 2015, 05:42:50 PM by shaynox »

Offline Evlesoa

  • Jr. Member
  • *
  • Posts: 20
Re: Is there really no way to learn asm from a beginner's level?
« Reply #14 on: February 22, 2015, 05:42:33 PM »
Yes, I noticed that programmers aren't very social. That's unfortunate.

Ya, I'll read that. I know the GoLink is important if you want to do anything. I did look at the documentation, but it seems to be geared towards people who already are familiar with assembly to some extent. As a total newbie, it doesn't tell me enough to do anything on my own.