Skip to content
/ vcam Public

Reimplementation of proprietary MTP responders for black-box testing

License

Notifications You must be signed in to change notification settings

petabyt/vcam

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vcam

This is a PTP (Picture Transfer Protocol) responder that reimplements the proprietary vendor extensions found in digital cameras. Everything from filesystem access to remote capture, vcam tries to mimic the exact behavior of a camera. It also replicates the USB and WiFi stack well enough that it can spoof official camera software:

All of this can be easily run on Linux - see below on instructions on how to run it.


This started out as a fork of gphoto's vcamera regression tester. Since then it has been heavily modified and improved to more closely replicate the PTP responders found in camera firmware.

Why

  • Regression testing - Do extensive client testing in CI that can check for runtime bugs
  • For easier prototyping - vcam can be used instead of a physical camera (no need to wait for a camera to recharge or reconnect to continue testing)
  • Black box testing - test against vendor software without disassembling
  • Reference - vcam tries to be a reference implementation of proprietary vendor functionality, showing what is happening behind the scenes (and sometimes why)

Roadmap

  • Basic PTP responder implementation (thanks Marcus Meissner)
  • Canon EOS implementation (WIP, Digic 4+, see canon.c)
  • libusb and vhci backends - see usb/
  • PTP/IP packet support
  • Fujifilm X TCP implementation (2015-2020)
  • Spoof Fujifilm Camera Connect
  • Spoof EOS Connect
  • Spoof Windows 11
  • Complete ISO MTP implementation
  • open-source extensions (chdkptp, ML)
  • DX + other mirrorless EOS implementation
  • Canon Powershot (non-EOS) implementation
  • Sony implementation? pmca

Compiling

sudo apt install libusb-1.0-0-dev libexif-dev
make vcam

VHCI backend

This will connects the camera to your Linux PC through a virtual host controller:

sudo modprobe vhci-hcd
sudo ./vcam vhci canon_1300d

libusb backend

The libusb API is hardly implemented, PRs improving this are welcome.

make libusb-vcam.so

Running an access point

sudo apt install haveged hostapd

Power saving mode can make the TCP handshake way too slow:

# Doesn't last a reboot (I think)
sudo iw dev wlan0 set power_save off

See the makefile for more info on starting access points.

make ap-canon WIFI_DEV=wlan0

Credits

Original Author (vusb): Marcus Meissner [email protected]
Forked from https://github.com/gphoto/libgphoto2/tree/master/libgphoto2_port/vusb
create_ap scripts from https://github.com/oblique/create_ap
Licensed under the GNU Lesser General Public License v2.1

About

Reimplementation of proprietary MTP responders for black-box testing

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published