flat assembler
Message board for the users of flat assembler.
Index
> Windows > Interrupt Question |
Author |
|
revolution 26 Aug 2008, 17:01
In windows you can't use any INT instructions. Those are for DOS.
I think you misunderstand the situation. Have a look at the Windows examples that come with the fasm download. |
|||
26 Aug 2008, 17:01 |
|
LocoDelAssembly 26 Aug 2008, 17:03
Because you are using BIOS interrupts on a Win32 executable.
Code: org $100 mov bh,0 mov dl,0 mov dh,0 int 10h int 20h That would work but it wouldn't be a win32 executable anymore but a DOS one (which supports BIOS calls). |
|||
26 Aug 2008, 17:03 |
|
pal 26 Aug 2008, 17:39
Ahh, I was wondering if it wouldn't work on Windows. Cheers for the quick replies. So if I compile it to be a COM application will it work then? Basically I want to be able to do things APIs can do eg. set the cursor position; but without the APIs.
Also a quick question; if I decompile for example kernel32.dll with a program such as OllyDbg; can I view the code for certain API's such as the actual code which is executed when SetCursorPos API is called (even though SetCursorPos API is in user32.dll, but you get what I mean)? |
|||
26 Aug 2008, 17:39 |
|
LocoDelAssembly 26 Aug 2008, 18:05
You'll find a bunch of things that are Windows version specific. If you are writting for the Win32 subsystem then use the APIs of that subsystem (user32.dll, kernel32.dll, gdi32.dll, etc).
BTW, note that SetCursorPos refers to the MOUSE cursor, not the blinking vertical or horizontal bar on the text console. Follow with OllyDbg the code below but remember that what you'll see is specific to your Windows version, there could be differences even on the same Windows version but with different ServicePack. Code: include 'win32a.inc' format PE GUI 4.0 push 0 push 0 call dword [SetCursorPos] ; Now the mouse pointer should be placed in the upper left corner of the screen push 0 call dword [ExitProcess] data import library kernel32,'KERNEL32.DLL',\ user32,'USER32.DLL' import kernel32,\ ExitProcess, 'ExitProcess' import user32,\ SetCursorPos, 'SetCursorPos' end data |
|||
26 Aug 2008, 18:05 |
|
revolution 26 Aug 2008, 18:05
You can disassemble any of the system DLLs. But I doubt you will gain much knowledge from them unless you want to spend many many hours in deciphering the code. They are very complex and do many things. Also you need to keep in mind that the DLLs don't always do the work, there is another layer behind there, the heart of the OS, that is not user accessible.
|
|||
26 Aug 2008, 18:05 |
|
pal 26 Aug 2008, 20:35
Yeah I see I see. Alright cool cheers for the help guys.
|
|||
26 Aug 2008, 20:35 |
|
ChrisLeslie 27 Aug 2008, 05:12
If only we could do those sorts of things without the APIs
|
|||
27 Aug 2008, 05:12 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.