Wireless API for Linux in C\C++ [closed] - c++

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I'm trying to find a proper way how to reuse existing implementations of wifi tools(iw) in own code(c\c++). I need to get information about available AccessPoints in range(signal strength, mac addr., etc). I found couple example codes(WEXT and others) that uses ioctl approach, but it makes passive scans(and i get new information only once in two minutes in my network)[UPDATE1: Thanks to #fluter, i know that WEXT can do active scanning, too.]. I found that iw makes an active scan and that is what i need. So my question:
Is there a way to use iw code in my own app without parsing its source code in chunks, or, maybe, there is an Wireless API for such purpose?
(UPDATE1: with basic code examples to start with.)
Similar question
UPDATE2: I have reviewed my task and found that AP information is not enough for me, i need to capture clients data, too. That leads me to wifi packet sniffing and the best tool i have found to do that is Horst. So, i'm trying to reuse its code in my app, now.

You might wish to start with cfg80211.
cfg80211 replaces Wireless-Extensions and it is suggested that :
All new Linux wireless drivers should be written targeting either cfg80211 for fullmac devices or mac80211 for softmac devices.
Also, it is written:
Instead of writing wext ioctls you now write cfg80211 operation
callbacks and fill in the wiphy struct to indicate to cfg80211 its
device capabilities.
To start with active scanning start here

You can use the wext api provided by kernel, basically, call ioctl with SIOCSIWSCAN, and get the scanned result with SIOCGIWSCAN.
You can set to scan all by using flag IW_SCAN_ALL_ESSID, and choose scan type with flag IW_SCAN_TYPE_ACTIVE or IW_SCAN_TYPE_PASSIVE.

Related

C++ Windows API Syscall Hook Example [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
Im just starting to learn C++ programming and for exercise I want to learn how to write Windows API Syscall Hook. For example, if I will try to delete a file with a specific name, for exmaple 'test.txt', then instead of deleting it a message would pop up. I tried searching for a tutorial on how to do something like that but I couldn't find anything.
Maybe someone could share a link to a tutorial on how to do something like this or maybe a very simple code example?
I am working on Windows 10 machine and Visual Studio 2015.
Write a File System (Mini-)Filter Driver.
https://msdn.microsoft.com/en-us/library/windows/hardware/ff548202%28v=vs.85%29.aspx
A file system filter driver is an optional driver that adds value to
or modifies the behavior of a file system. A file system filter driver
is a kernel-mode component that runs as part of the Windows executive.
A file system filter driver can filter I/O operations for one or more
file systems or file system volumes. Depending on the nature of the
driver, filter can mean log, observe, modify, or even prevent. Typical
applications for file system filter drivers include antivirus
utilities, encryption programs, and hierarchical storage management
systems.
The windows driver samples contain a minifilter driver to detect deletions of files or streams.
See: https://github.com/Microsoft/Windows-driver-samples/tree/master/filesys/miniFilter/delete

How to capture audio from specific application and route to specific audio device in Windows 7? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
The community reviewed whether to reopen this question 6 months ago and left it closed:
Original close reason(s) were not resolved
Improve this question
Ok, my question is this:
How can I programmatically capture audio from a specific application and then send it to a specific audio device in Windows 7?
I know for a fact this can be done, since SoundLeech captures audio from individual programs, and theoretically once you have the sound you can do what you want with it (including play it to any sound output device).
I'm a C++ programmer but I know very little about Windows programming. I need some pointers to capturing sound from individual programs. I work with audio recording very frequently and I would be willing to put in a large amount of work to develop a way to better handle sound in Windows given how difficult to use it currently is.
So how can I capture audio streams directly from applications without first routing them through Virtual Audio Cables or the like?
You cannot do it using standard user mode APIs. You need to either hook APIs or create virtual devices to accept application streams/sessions.
Intercepting and postprocessing all audio streams on Windows
Recording Audio Output from a Specific Program on Windows
Is it possible to caputre the rendering audio session from another process?
Capture audio of a single application on Windows 7

C++ USB communicate with USB Composite Device (usbccgp.sys) [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I'm using C++ and libusb-win32 to try and communicate with a commercial USB device ... I don't know much about USB programming, but I want to send some commands to the device that I know from using a sniffer program. Libusb-win32 seemed OK, but it looks like it can only be used on a device that uses the libusb driver for the device.
I want to use it on a device with a driver "USB Composite Device" driver provided by windows usbccgp.sys ... is it even possible? If not, how can I do this?
I just need to send some Control Transfers
This is currently not possible. libusb is designed around the Linux driver model where composite devices are treated as a single device by the system. Windows treats composite devices as multiple separate ones - a parent composite device and child devices for each interface.
As such libusb cannot access the child devices without first changing the parent driver to a libusb supported one. It can be done but then the device won't work with the vendor supplied software.
If you want to talk to a commercial device you need to contact the manufacturer and find out if there is an interface to that device that is published through their driver. Most manufacturers won't have a way to interface with generic control requests in a product. There may be an undocumented IOCTL, but again you'll need to work with them to get this information.
If you just want to hook the device and send it a control request then you need to replace the manufacturer's driver with the libusb driver. The problem here is that while you can get at the device it may not function the way you want unless you spoof what the manufacturer does (for example, the device might expect some vendor specific communication to get the device ready to interact with the host). If you do see problems then you can reverse engineer the vendor specific protocol by looking at the USB line through some hardware analyzer.
Read USB Complete, it's a great introduction to the USB protocol and will help you understand more of what's going on between a USB device and your host PC.

Detect other iPhones in a range [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I'm looking to create a mobile app on IOS devices before I started I just needed to check up on one thing. How can I detect other IOS mobile devices within local rage e.g same room, same train, etc..
I want to be able to do it while the phone is locked, so bluetooth wouldn't be a great example as most people have it turned off.
Thanks!
The application has to send its location to the server.
Then the server knows where every devices that shared its location are.
Then your application can ask "who is around?" to your server... and your server calculates (let's suppose within a radius of 2 miles) who is around... and sends back to you.
It doesn't have anything to do with bluetooth. It's done via regular internet.
For other users of your app who want to be discovered you could use Bluetooth LE and the new iBeacon support added in iOS 7. Each user would have to launch your app and give it permission to start "advertising" their presence. However, the range of Bluetooth LE is like 10-20 meters (I forget the exact figure) and that will go down in "RF hostile" environments.
If everybody's connected to the same WiFi network you could use Bonjour.
Another option, as suggested by Wagner, above, is to have the devices send their locations to a central server.

What is your favorite free Netstat GUI / Connection Monitor app for Windows? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I need something a little more feature rich than Sysinternals TCPView (which I regularly use) ... but it also must be freeware. :)
Well, the question is a bit old and I realize that probably you already found the software you were looking for... just in case, an interesting connection monitor utility is CurrPorts, by Nir Sofer.
Freely adapted from the program's home page:
displays the list of all currently opened TCP/IP and UDP ports on your local computer;
for each port in the list, information about the process that opened the port is also displayed, including the process name, full path of the process, version information of the process (product name, file description, and so on), the time that the process was created, and the user that created it;
allows you to close unwanted TCP connections, and kill the process that opened the ports;
allows custom filters for inclusion/exclusion of connections.
Maybe a full blown traffic sniffer like Wireshark will complement your tool set?
Amongst wiresharks features are:
packet analysis
traffic statistics
capture
coloring
data export
I recommend TCPView for Windows v2.53.
image http://i.technet.microsoft.com/bb897437.TcpView(en-us,MSDN.10).gif
TCPView is a Windows program that will show you detailed listings of all TCP and UDP endpoints on your system, including the local and remote addresses and state of TCP connections. On Windows Server 2008, Vista, NT, 2000 and XP TCPView also reports the name of the process that owns the endpoint. TCPView provides a more informative and conveniently presented subset of the Netstat program that ships with Windows. The TCPView download includes Tcpvcon, a command-line version with the same functionality.
Not sure what features you are looking for so this is my suggestion.
Without having used it, I have seen TCPStat advertised a few times.
It looks like it was a discontinued project somewhere around 2003 and it's an awful blue color.
There's the MS Network Monitor.
Process Hacker shows also send/receive bytes, speed, country flag etc.