foone , Englisch
@foone@digipres.club avatar

I wonder how hard it is to make a fake USB printer.
Like, a printer that takes any printout and goes "yep, that printed just fine" but nothing ever comes out anywhere

Pyxaron ,
@Pyxaron@dragonchat.org avatar

@foone Because this was bugging me, i played with it, and i found that you can actually just create a printer on the nul: port under Windows, and have it successfully print jobs to the void.

foone OP ,
@foone@digipres.club avatar

@Pyxaron hah! nice. And it doesn't throw any errors when you print to it?

Pyxaron ,
@Pyxaron@dragonchat.org avatar

@foone No errors, print jobs just vanish from the spooler after being successfully written to nul:

lucas ,
@lucas@fitt.au avatar

@foone I have real printers that will do that randomly, making a fake printer not work seems like a pretty low bar 🤣

juliank ,
@juliank@mastodon.social avatar

@foone that would be convenient as like a usb stick that you can print too and then read back pdf.

CiscoJunkie ,
@CiscoJunkie@techhub.social avatar

@foone I can't think of many things more malicious than a fuck-you printer. Actual printers are bad enough.

jak2k ,
@jak2k@mastodontech.de avatar

@foone
You don't even need a USB device for that. Just cups…

mehdi_benadel ,
@mehdi_benadel@mastodon.balamb.fr avatar

@foone Uh we've been doing that with PDF for years

scalonnec ,
@scalonnec@pouet.chapril.org avatar

@foone it's called "Hewlett-Packard Company".

andwhyisit ,
@andwhyisit@ohai.social avatar

@foone Give it the printer name "/dev/null".

Pyxaron ,
@Pyxaron@dragonchat.org avatar

@foone If it can be a network printer instead of USB, it's pretty easy to do, PCL uses port 9100 to send the print job, it's possible to just have some software listen locally (or remotely) to that port, accept the data, and just discard it.

I've done that in the past with a generic LaserJet PCL driver, both to discard unwanted print jobs that would never clear until successful, or capture it for data extraction.

zarbet ,

@foone ah! a fax machine. I've heard of those.

foone OP ,
@foone@digipres.club avatar

My point is not a printer that's broken, my point is a printer that appears TO THE COMPUTER to print instantly and successfully.

Just I don't care if any paper comes out anywhere, and would prefer not.

bloomnobly ,
@bloomnobly@cyberplace.social avatar

@foone Not sure myself, but I'm p sure the functionality's there since MS already has a 'Print to PDF' function in windows so ideally. that should lay groundwork for that

SteveSyfuhs ,
@SteveSyfuhs@hachyderm.io avatar

@foone every printer I've ever owned had that feature built in. The problem was that it only worked half the time.

yakkoj ,
@yakkoj@fosstodon.org avatar

@foone hell, that seems like it'd be easy: have a thing that looks like a printer and accepts the print job, then does nothing with it!

piersg ,

@foone it's not as exciting as hardware but you could just write a driver that's returns "OK" but does nothing else

lukeshu ,
@lukeshu@fosstodon.org avatar

@foone At my dad's business, there's a printer that dumps paper straight a trash can, because something insists that it MUST print logs that no human cares about, and if you unplug the printer the fuel pumps will stop working, and they won't be able to refuel their fleet for trucks.

(It's serial, not USB, but it's the same problem.)

cliffordheath ,
@cliffordheath@mastodon.social avatar

@foone USB-Centronix adapter with the appropriate ACK signal wired high? Or pulsed by a monostable, IDK how Centonix works any more

fgrosshans ,
@fgrosshans@mathstodon.xyz avatar

@foone No such device can last long: it would quickly be broken into small pieces by the angry user

tk ,

@foone you can progam usb devices with an arduino pro micro aka atmega 32u4, could work as a dummy printer as well?

neocturne ,
@neocturne@chaos.social avatar

@foone The Linux kernel includes a USB printer gadget driver, with docs and example code here: https://www.kernel.org/doc/Documentation/usb/gadget_printer.rst

So if you have a computer with a device-mode-capable USB controller (many SBCs as long as there is no USB hub between the SoC and the physical ports; maybe even some desktop PCs with USB-C nowadays?), it should just be a matter of building a kernel with the printer gadget module.

bayindirh ,
@bayindirh@mastodon.sdf.org avatar

@foone Two solutions:

  1. Install a soft printer like boomaga or similar which can print to files.

  2. Get a Raspberry Pi, set up CUPS, add a PDF printing soft-printer on it, and make it discoverable on network (or share it)

A printer which instantly prints, plus it's network enabled! A 90s nerd dream comes true.

robert ,
@robert@irrelevant.me.uk avatar

@foone
There's this thing.. https://www.pclviewer.com/resources/capture/print2usb.html
Though it's more designed to capture the print file. And no idea on pricing.
You could use a RPi Zero and the Linux printer gadget..
https://www.kernel.org/doc/Documentation/usb/gadget_printer.txt

SteakPinball ,
@SteakPinball@mastodon.social avatar

@foone Pretty sure there are lots of printers which already do that

meldrop ,
@meldrop@mas.to avatar

@foone almost certainly completely overkill for this task but there's the USB raw gadget samples: https://github.com/xairy/raw-gadget

I've used this to simulate USB devices in the past, and it includes a printer.c example

Gazoche ,
@Gazoche@mastodon.au avatar
WooShell ,
@WooShell@chaosfurs.social avatar

@foone Can it at least throw a message about an expired subscription or lack of cyan, to make it more realistic?

blami ,
@blami@mastodon.online avatar

@foone That's basically my Brother inkjet without any mods. Plus it starts cleaning itself making burglar noises at 4AM.

heretohinder ,
@heretohinder@mastodon.sdf.org avatar

@foone the linux g_printer module and a raspberry pi is probably the most straightforward path, someone already has a project for it: https://github.com/Raspberryy/Emulated_USB_Printer

corycarson ,
@corycarson@gnu.gl avatar

@foone Mobius strip the paper feed and fill the ink tank with water

maruel ,
@maruel@pourparler.ca avatar

@foone I did that by accident in 2003 on Windows 2000.
I wrote a printer driver that was a virtualized printer, saving the EMF stream. It automatically selected the nearest one based on the room location and streamed it there. Sometimes it didn't go anywhere.

My biggest surprise was to reuse this knowledge in 2007 to implement printing in Chrome, given the renderer didn't have direct access to the printer. Heck I got a patent for that.

redthewizard ,
@redthewizard@wandering.shop avatar

@foone
I have a printer like that.

fishidwardrobe ,
@fishidwardrobe@mastodon.me.uk avatar

@foone lpadmin blah blah blah /dev/null

brouhaha ,
@brouhaha@mastodon.social avatar

@foone Take a real ink tank printer, disable the paper-out and ink-out sensors,

darksecond ,
@darksecond@chaos.social avatar

@foone isn’t that just any printer? They almost malfunction.

foone OP ,
@foone@digipres.club avatar

@darksecond yeah but I specifically want it to lie about the print succeeding

smammy ,
@smammy@hachyderm.io avatar

@foone Linux is happy to be a USB printer for you: https://www.kernel.org/doc/Documentation/usb/gadget_printer.rst (I've done the gadget side of the USB mass storage class and it was basically fun and easy. I'm guessing the gadget side of the printer class is similar but who knows.)

jackemled ,
@jackemled@furry.engineer avatar

@foone Those exist! You can buy them anywhere that sells printers. Just ask where they have printers & you can buy any of those & it will do this.

  • Alle
  • Abonniert
  • Moderiert
  • Favoriten
  • random
  • haupteingang
  • Alle Magazine