Solved

Port Address Detection - URGENT

Posted on 2006-10-27
7
168 Views
Last Modified: 2010-04-05
I am using INPOUT32.DLL to send data to a printer (serial, parallel or usb) and therefore require the port address to send the data to.

I am detecting the port name using GetPrinter(Device, DriverName, Port, DevHandle);

However this simply gives me the name of the port in the format "COM1:", "LPT1:", etc

I need the actual memory address ie "$378", etc to send to the INPOUT32.DLL

This is for an urgent project so i am assigning max points for it! help!
0
Comment
Question by:loonyroony
  • 3
  • 3
7 Comments
 
LVL 19

Accepted Solution

by:
MerijnB earned 500 total points
ID: 17818581
normally I use http://www.mitec.cz/msi.htm for these things, but the author doesn't sell at this moment.
I have a license and it permits me to write you a dll (no sources) to do this. I've looked if it's possible and it seems it is.
The only strange thing when I look for the address of for example LTP1 is that it returns _two_ addresses: $378 and $778.
Device manager in windows XP does the same. If you think you can use this and know a what to distinguish these two addresses I'll make the DLL for you.
0
 

Author Comment

by:loonyroony
ID: 17818767
hey man

that sounds great to me :-) i'm sure with a little trial and error i should be able to work out which port is the right one - in the case of LPT1 it's usually 378 so i'd assume that if order of returned ports numbers is always the same then the correct one should always be in the same position. Dangerous things assumptions are but i don't think this one will cast the end of the world spell! :-)
0
 
LVL 19

Expert Comment

by:MerijnB
ID: 17818913
ok, in for my machine for lpt1 I get:
$0378-$037F
and
$0778-$077B

if anyone knows a brilliant way to determine which is which please let me know :)
I'll make the DLL, for now I think I'll only pass the first range which is 7 long, because that seems to be the case almost always.
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 

Author Comment

by:loonyroony
ID: 17818949
cool man thanks :-)
0
 
LVL 19

Expert Comment

by:MerijnB
ID: 17819254
do you have some place I can upload or send the dll to?
0
 

Author Comment

by:loonyroony
ID: 17819293
sure - email me on haroun@mcomputer.com
0
 
LVL 17

Expert Comment

by:Wim ten Brink
ID: 17832401
Guys, in Windows XP the port addresses are protected resources. Doing direct reads and writes to an address is risky at least since you never know what it connects to.

The reason for two ports is easy, btw. One port is used to send command and receive responses. The second port is used to send and receive related data for these commands and responses.

Also, take a look at the following links:
http://www.logix4u.net/inpout32.htm
http://www.logix4u.net/inpout_theory.htm
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now