• RSS
  • Twitter
  • FaceBook

Security Forums

Log in

FAQ | Search | Usergroups | Profile | Register | RSS | Posting Guidelines | Recent Posts

Pre-Assembly

Users browsing this topic:0 Security Fans, 0 Stealth Security Fans
Registered Security Fans: None
Post new topic   Reply to topic   Printer-friendly version    Networking/Security Forums Index -> Programming and More

View previous topic :: View next topic  
Author Message
thesmartestass
Just Arrived
Just Arrived


Joined: 06 Apr 2005
Posts: 0


Offline

PostPosted: Wed Apr 27, 2005 8:39 pm    Post subject: Pre-Assembly Reply with quote

Are there any prerequirements to learn assembly?
Back to top
View user's profile Send private message Send e-mail AIM Address
White Scorpion
Just Arrived
Just Arrived


Joined: 19 Sep 2003
Posts: 5
Location: The Netherlands

Offline

PostPosted: Wed Apr 27, 2005 9:22 pm    Post subject: Reply with quote

a high level programming language and a good understanding of how a computer (cpu) works internally is recommended, but of course anything can be learned without pre-knowledge. it just would take you a lot longer.

I suggest starting with masm32 if you really want to learn assembly. masm32 is for windows only but it does look alot like a highlevel language since you can use the macros in it. This makes the learning part and getting acquainted with the registers a lot easier then when you start learning a new language all over again from scratch...

here's a simple example to show what i mean:

C code:
Code:

#include <windows.h>

char Message[]="Hello World!";
char AppName[]="White Scorpion";

int main(void)
{
     MessageBoxA(NULL,Message,AppName,MB_OK);
     ExitProcess(0);
}


masm style assembly:
Code:

.586
.model flat,stdcall
option casemap:none

include masm32includewindows.inc
include masm32includekernel32.inc
include masm32includeuser32.inc

includelib masm32libkernel32.lib
includelib masm32libuser32.lib

.DATA

Message db "Hello World!",0
AppName db "White Scorpion",0

.CODE

start:

invoke MessageBoxA,NULL,addr Message,addr AppName,MB_OK

;----------------------------------------------
;Could be written as the following as well:
;------------------------------------------------

push 0
push offset AppName
push offset Message
push 0
call MessageBoxA

;-------------------

invoke ExitProcess,0

end start


as you can see it looks a lot alike by using the macros. the return value of a windows API always returns in EAX unless stated otherwise.

knowing the above you can already start writing your own programs in assembly. Try doing that with any other assembler with that speed Wink)

I hope this helps .


Last edited by White Scorpion on Thu Apr 28, 2005 6:40 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website
thaw^
Just Arrived
Just Arrived


Joined: 24 Apr 2005
Posts: 0


Offline

PostPosted: Wed Apr 27, 2005 10:11 pm    Post subject: Reply with quote

Quote:
C code:


C++ I guess..?
Back to top
View user's profile Send private message
White Scorpion
Just Arrived
Just Arrived


Joined: 19 Sep 2003
Posts: 5
Location: The Netherlands

Offline

PostPosted: Thu Apr 28, 2005 12:50 pm    Post subject: Reply with quote

Quote:
Quote:
C code:


C++ I guess..?
Nope, C.

C++ would have been something in the same line, but if you are using more functions you would definitely see the difference a lot easier...
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mekros
Just Arrived
Just Arrived


Joined: 15 Jul 2003
Posts: 1
Location: Manila

Offline

PostPosted: Tue May 03, 2005 4:26 am    Post subject: Reply with quote

if youve decided to try masm out i'd suggest for you to get a copy of the masm 6.1 manual, as per the recommendations of the people at masmforum, that manual is said to be the bible among masm users. seems to be that copies of that manual is pretty scarce, so if you want you can get a pdf copy you can get it here.
Back to top
View user's profile Send private message
Dunceor
Just Arrived
Just Arrived


Joined: 05 Sep 2003
Posts: 4
Location: Sweden

Offline

PostPosted: Sun May 08, 2005 4:21 pm    Post subject: Reply with quote

I would recommend to use nasm(http://nasm.sourceforge.net/) if you wanna do x86 assembly though and do it in *nix since Windows got a pretty complex API if you are not used to it.

In *nix you can easily send system calls directly and it's much cleaner.

But if you wanna learn for windows masm is the way to go.[/url]
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   

Post new topic   Reply to topic   Printer-friendly version    Networking/Security Forums Index -> Programming and More All times are GMT + 2 Hours
Page 1 of 1


 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Community Area

Log in | Register