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
NASM in Windows
Re: NASM in Windows
Hi,
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.
Cheers,
Brendan
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.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 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.
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.
- Love4Boobies
- Member
- Posts: 2111
- Joined: Fri Mar 07, 2008 5:36 pm
- Location: Bucharest, Romania
Re: NASM in Windows
Ti Tuga digga tu Gi Friba fligugibu Uh Fligugigbu Uh Di Ei Friba Du Gi Fligu fligugigugi Flilibili AhBrendan 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.
(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 ]
[ Project UDI ]
Re: NASM in Windows
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.
If you're new, check this out.
Re: NASM in Windows
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?
Re: NASM in Windows
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.
If you're new, check this out.