#include "../ioaddr.c" int main(int argc, char *argv[]) { unsigned char val1,val2,val3; if (iopl(3) != 0){ fprintf(stdout,"\r\nNo Permissions for special ports, start program as root, or with sudo\r\n"); exit(0); } val1 = read_port( 0x378 + 1 ); val2 = read_port( 0x278 + 1 ); val3 = read_port( 0x3bc + 1 ); fprintf(stdout,"\n"); fprintf(stdout,"\nreaded value: %x on status inport parallelport 0x378",val1); if(val1 != 0xff){ fprintf(stdout,"\nThis seems to be an active parallelport"); } fprintf(stdout,"\nreaded value: %x on status inport parallelport 0x278",val2); if(val2 != 0xff){ fprintf(stdout,"\nThis seems to be an active parallelport"); } fprintf(stdout,"\nreaded value: %x on status inport parallelport 0x3bc",val3); if(val3 != 0xff){ fprintf(stdout,"\nThis seems to be an active parallelport"); } fprintf(stdout,"\n"); iopl(0); }