NASM in Windows

Programming, for all ages and all languages.
Post Reply
hazique35
Posts: 6
Joined: Sun Mar 31, 2013 9:57 am

NASM in Windows

Post by hazique35 »

I know I shouldnt ask this here because it is such a newbie question, but I have thoroughly looked everywhere and cannot find anything! All I have been able to find out is how to run a program which is pretty useless considering I cannot write any code. Ive fouund a couple of websites, but they all use this 'extern' stuff. Like 'ExitProcess', isnt there a way to do this without using this? All I really need is a point in the right direction and I will pretty much be able to work out the rest.

thanks
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: NASM in Windows

Post by Brendan »

Hi,
hazique35 wrote:I know I shouldnt ask this here because it is such a newbie question, but I have thoroughly looked everywhere and cannot find anything! All I have been able to find out is how to run a program which is pretty useless considering I cannot write any code. Ive fouund a couple of websites, but they all use this 'extern' stuff. Like 'ExitProcess', isnt there a way to do this without using this? All I really need is a point in the right direction and I will pretty much be able to work out the rest.
The short answer is: no, there's no easy way to use the Windows kernel API directly, without (either directly or indirectly) using one or more DLLs.

The longer answer is that Microsoft don't provide any public documentation to allow this, because they want to make sure they can change the kernel API without breaking lots of people's code. They give you DLLs so that they can change the kernel and the DLLs at the same time and not break anything. Also note that POSIX is similar for similar reasons - your code is dynamically linked against the system's shared library, so that the same binary can run on any "POSIX compatible" OS regardless of how different the underlying kernel APIs may be (because the shared library hides any differences).

The even longer answer is that it actually is possible (with enough reverse engineering and large quantities of hacks and testing to make the code adapt to any differences in kernel APIs in different versions of Windows). This is not the even longer answer. This is just a tribute. I couldn't remember the even longer answer. This is a tribute, to the even longer answer. #-o


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
hazique35
Posts: 6
Joined: Sun Mar 31, 2013 9:57 am

Re: NASM in Windows

Post by hazique35 »

alright, thanks.
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: NASM in Windows

Post by Love4Boobies »

Brendan wrote:This is not the even longer answer. This is just a tribute. I couldn't remember the even longer answer. This is a tribute, to the even longer answer. #-o
Ti Tuga digga tu Gi Friba fligugibu Uh Fligugigbu Uh Di Ei Friba Du Gi Fligu fligugigugi Flilibili Ah
(Bow) (Bow) (Bow) (Ooh) (Bow) (Bi)
Fligu wene mamamana Sacrebleu!
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
Mikemk
Member
Member
Posts: 409
Joined: Sat Oct 22, 2011 12:27 pm

Re: NASM in Windows

Post by Mikemk »

It's completely possible, if you read the dll symbol tables to find what to execute. Of course, you'd have to find a way to open the files without the windows api, and to load the files into your applications code segment rather than data . . . sounds like a fun challenge.
Programming is 80% Math, 20% Grammar, and 10% Creativity <--- Do not make fun of my joke!
If you're new, check this out.
Gigasoft
Member
Member
Posts: 856
Joined: Sat Nov 21, 2009 5:11 pm

Re: NASM in Windows

Post by Gigasoft »

This is ridiculous. Nasm works just fine. Of course you can use extern. And if you had read the manual, you would have figured out how to use it. Do you really think they would make an assembler for Windows and not let you import anything from DLLs?
Mikemk
Member
Member
Posts: 409
Joined: Sat Oct 22, 2011 12:27 pm

Re: NASM in Windows

Post by Mikemk »

I think the OP is asking about doing the interface himself.
Programming is 80% Math, 20% Grammar, and 10% Creativity <--- Do not make fun of my joke!
If you're new, check this out.
Post Reply