Monday, April 23, 2012

User program write to IO ports on Windows

http://retired.beyondlogic.org/porttalk/porttalk.htm

Download the PortTalk 2.2 folder.
Look at the README file, you will know how to use it.

C:\porttalk>allowio beep /a
allow program beep.exe to write all the ports

C:\porttalk\AllowIO>allowio 0x42 0x43 0x61 beep.exe
allow the beep.exe to access port 0x42 0x43 and 0x61


Look at the IoExample folder, you will know how to write the sample user program to write ports.

In addition, we could use assembly IO instruction to write to port.
out dx, al
compile the assembly code into WritePort.exe file, and use AllowIo.exe to set the bitmap permission for this executable program
AllowIo.exe WritePort.exe /a

Again, AllowIo.exe provides the facility to modify the IO permission bitmap and write/read to IO ports via IOCTL calls.

No comments: