flat assembler
Message board for the users of flat assembler.

Index > Windows > Need guidence - looking for a good tutorial

Author
Thread Post new topic Reply to topic
redsimplex



Joined: 13 May 2016
Posts: 4
redsimplex
I started learning assembly 5-6 weeks ago form a text book a friend gave me. It was used mainly in TASM for 16 bit DOS systems.
After that I searched the web for another recommended assembler ,I got the impression that FASM is pretty popular.
So I adjusted to the new syntax and made some programs (pong game, snake game and primitive 'paint').
This was fine but lately I decided I want to do 'real' stuff and actually program for 32 bit systems.

As I started it was fine. I could use 'AllocConsole' and do simple stuff like array-sorting and 'hello world'. And here I got the problem - I have no idea how to go from here.
I want to do stuff other the 'console' and build stuff like the 'BEER', 'DIALOG' and other EXAMPLES the fasm folder contains, but it does'nt matter how much I try I just dont get it. Every window API has tons of libraries and procedures I dont understand - How does 'MessageBox' works exactly? what the 'HWND_DESKTOP' and 'MB_OK' parameters mean? even the simplest thing I dont understand!

I went through the manual and the windows-programing-documantation and it didnt help.
I searched the web and found mainly tutorials for MASM.
I think something like Iczelion's WIN32 tutorial would be great (http://win32assembly.programminghorizon.com/tutorials.html)
but it's for MASM and I dont want to switch again to another assembler and learn the syntax all over again.

TL:DR
Is there any good tutorial for FASM to learn windows API? So in the end I could do applications like notepad-clone, minesweeper or something-alike?
Post 21 May 2016, 19:32
View user's profile Send private message Reply with quote
l_inc



Joined: 23 Oct 2009
Posts: 881
l_inc
redsimplex
Quote:
but it's for MASM and I dont want to switch again to another assembler and learn the syntax all over again

Then don't. The WinAPI is the same, the instructions are the same. Translating the examples into fasm is gonna be just a little exercise to get used to fasm syntax.

_________________
Faith is a superposition of knowledge and fallacy
Post 21 May 2016, 21:46
View user's profile Send private message Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1409
Location: Toronto, Canada
AsmGuru62
Isn't there a set of FASM examples for Win32 going from a very simple to a complex one?
Just like Iczelion, but using FASM?
If not, would anyone please code it for new generation?
Smile
Post 22 May 2016, 14:56
View user's profile Send private message Send e-mail Reply with quote
Mikl___



Joined: 30 Dec 2014
Posts: 116
Mikl___
Hi, redsimplex!
You have not tried to use the Search button? For: newbies : Iczelion's Assembly Tutorial in FASMImage
Post 23 May 2016, 00:11
View user's profile Send private message Visit poster's website Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 2915
Location: [RSP+8*5]
bitRAKE
Basically put, everything is a number used internally by Windows to track stuff. There are different types of handles and IDs, but they are all just 32bit numbers. (If you delve deeper, some are memory addresses, or RGB values, or constants which never change.) All the names are confusing at first, but you'll get the hang of it.

"Oh, Windows needs a ThreadID for this API. Do I set the ThreadID, or is there an API that returns it?" You'll find the answer just reading the API's that create/control threads. So, tackle the API in small batches when you are trying to do something.

Are you familiar with any other programming languages?
Post 23 May 2016, 02:14
View user's profile Send private message Visit poster's website Reply with quote
redsimplex



Joined: 13 May 2016
Posts: 4
redsimplex
AsmGuru62 - There is, but I find it difficelt to understand even the most basic of them 'TEMPLATE'.
For example, I dont understand how the CreateWindowEx with all its parameters works and how the OS transforms this procedure into an actual window.

Mikl___ - I already came across this thread. But it looks like the links are broken or that the sites are down.

bitRAKE - thanks for the replay. I think I start understanding a little better now.
And I learned Java and C# at school, so I am not sure I can say that I am 'familiar' but I do know some very basic stuff.

For now, I'll go through Iczelions guide.
Post 23 May 2016, 05:53
View user's profile Send private message Reply with quote
Mikl___



Joined: 30 Dec 2014
Posts: 116
Mikl___
Quote:
But it looks like the links are broken or that the sites are down

redsimplex,
catch it


Description:
Download
Filename: sulaiman.zip
Filesize: 243.52 KB
Downloaded: 166 Time(s)

Post 23 May 2016, 06:56
View user's profile Send private message Visit poster's website Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1409
Location: Toronto, Canada
AsmGuru62
redsimplex:
I see.
Well, the Windows API is a set of functions, you pass parameters and you get back the result, in this case the window will appear on screen.
Are you trying to understand how the functions work internally?
Or you want to understand the parameters to API functions?
To understand internals - is, of course, the next stage of Windows Programming.
But for now, you can just accept the API function as the black box, which does what you specify in parameters.

For more explanation on parameters always go to MSDN, just google the function name
and visit link to MSDN:

CreateWindowEx

Full API is here:
Windows API Index

And, of course, ask questions here or search this forum - there are code samples for some common problems.
Post 23 May 2016, 13:27
View user's profile Send private message Send e-mail Reply with quote
El Tangas



Joined: 11 Oct 2003
Posts: 120
Location: Sunset Empire
El Tangas
The win32 API has become so bloated over time, that I decided to put here a link for the classic win32 help files from Borland, much easier to grasp for someone new to this stuff. Main file is win32.hlp:
http://s000.tinyupload.com/index.php?file_id=38814393278340232853
Post 28 May 2016, 15:51
View user's profile Send private message Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 8900
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
sleepsleep
i found something cool and nice,

http://www.pentesteracademy.com/course?id=7
Quote:
x86_64 Assembly Language and Shellcoding on Linux

This course focuses on teaching the basics of 64-bit assembly language for the x86_64 family of processors on the Linux platform and applying it to Infosec. Once we are through with the basics, we will look at writing shellcode, encoders, decoders, crypters and other advanced low level applications.

The course outline follows the exact same outline of our 32-bit course but all the topics will be taught with x86_64 64-bit assembly.


if you don't like to join the course, you could download the whole stuff from torrent, kat.cr
Post 29 May 2016, 15:16
View user's profile Send private message Reply with quote
knell



Joined: 13 Nov 2014
Posts: 3
knell
You're asking the very question that I wanted to ask. But I refrained to ask because it would be too broad.

I suggest you to try converting your previous code (or some algorithm that you understood before) in other language to FASM. So you can be more comfortable with FASM and assembly in general.

I learned on how to write Lisp Interpreter from buildyourownlisp.com (although it's tutorial written in C) using FASM but right now I'm stuck with GC implementation.

For example, I didn't know on how to write linked list in FASM before so I looked the example/tutorial on how to write it. From there, it's just snowballing, like on how to read from the console, on how to to parse the input, on how allocate the memory (and releasing it), etc.

Good luck in your adventure Very Happy
Post 08 Jun 2016, 14:05
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
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
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.