I would like to learn Assembly Programming for Windows. But I am having some problems to found material for learning. All the material I see don't give enough code to program (they show just snippets), are too old, or are just theory.
For a long time, the 'standard' tutorial beginners start with for Windows assembly programming is Iczelion's tutorial. Also for Windows assembler programming, the best forum (IMO) to get started is probably MASM32. It has a very active community which is very welcoming and helpful to newcomers and beginners. It sort of depends which particular flavour of assembler you want to learn but IMO, for Windows MASM32 has the best userbase (both in terms of community and resources around) for beginners.
You mention you want to learn RCE (reverse code engineering) also. A very common starting place for reversing on Windows is lena151's tutorials which potentially is also a nice start if you already know assembler conceptually from having done Linux assembler programming.
-
-
@yegle: Try this mirror: win32assembly.programminghorizon.com/tutorials.html – Mike Kwan Oct 28 '13 at 16:41
Most assembly language programming you would do, especially in a full-OS environment like Windows, will just be snippets anyway (as opposed to a 100% assembly program). The easiest way to get started is to write a C program as a test harness and have it call your assembly language functions. Here's a simple example:
asm.s:
.text
.globl _asm_add
_asm_add:
mov %rdi, %rax
add %rsi, %rax
ret
example.c:
#include <stdio.h>
int asm_add(int, int);
int main(int argc, char **argv)
{
int a = 12;
int b = 6;
int c = asm_add(a, b);
printf("%d + %d = %d\n", a, b, c);
return 0;
}
Build and run (on my Mac with clang; modify for your compiler on windows):
$ clang -o example example.c asm.s
$ ./example
12 + 6 = 18
-
1@Victor, so then what's the difference? That same program runs exactly the same on windows as it does on linux or on a mac (well, after exchanging
rdi&rsiforrcx&rdx, anyway). – Carl Norum Jun 9 '11 at 22:54 -
1The difference is that different operating systems have different ways to call system services like opening files, output to the screen and so on. – Victor Jun 9 '11 at 23:03
-
@Victor, but those are just function calls. Do you mean you don't want to link against the Windows libraries? – Carl Norum Jun 9 '11 at 23:15
-
i want to link against the Windows libraries, but if the function calls are different how do I know how to call them? – Victor Jun 9 '11 at 23:25
-
3@Victor, you can call the same functions from an assembly program as you can from a C program. It sounds more like you need to learn about the Win32 API than you do about assembly language. Maybe I'm misunderstanding your question? – Carl Norum Jun 9 '11 at 23:31
The most important thing to get is the Intel manuals (other manufacturers like AMD will also have their own, but the instructions are very similar):
http://www.intel.com/products/processor/manuals/
Those have all the instructions , costs and some guides to programming.
windows assemblerreturns a pretty good PDF with good decent examples. The Art of Assembly includes Windows programming as well. – Synetech Jun 9 '11 at 22:08