Last active
December 5, 2016 02:00
-
-
Save z448/d51beb0141a4a6111e0a5d21fa501daa to your computer and use it in GitHub Desktop.
read contents of iOS pasteboard
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/perl | |
use 5.010; | |
use strict; | |
use warnings; | |
use Mac::PropertyList; | |
my $data; | |
{ | |
local $/; | |
open(my $fh,"<",'/private/var/mobile/Library/Caches/com.apple.UIKit.pboard/pasteboardDB'); | |
$data = <$fh>; | |
close $fh; | |
} | |
sub read_pasteboard { | |
my $plist = Mac::PropertyList::parse_plist( $data ); | |
for(@{$plist}){ | |
my $s = $_->as_perl; | |
unless($s eq 1){ | |
if($s->{name} eq 'com.apple.UIKit.pboard.general'){ | |
for(@{$s->{items}->{mobile}}){ | |
say $_->{'public.utf8-plain-text'}; | |
} | |
} | |
} | |
} | |
} | |
read_pasteboard(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment