code
stringlengths
1
1.73M
language
stringclasses
1 value
# This file is part of Virtdbg # Copyright (C) 2010-2011 Damien AUMAITRE # # Licence is GPLv3, see LICENCE.txt in the top-level directory require 'metasm' require 'metasm/dynldr' include Metasm module VirtDbg class VirtDbgMem < VirtualString def initialize(impl, addr=0, length=nil) ...
Ruby
# This file is part of Virtdbg # Copyright (C) 2010-2011 Damien AUMAITRE # # Licence is GPLv3, see LICENCE.txt in the top-level directory require 'metasm' require 'metasm/dynldr' require 'iconv' class String def utf16_to_iso converter = Iconv.new('ISO-8859-1//IGNORE//TRANSLIT', 'UTF-16') ...
Ruby
# This file is part of Virtdbg # Copyright (C) 2010-2011 Damien AUMAITRE # # Licence is GPLv3, see LICENCE.txt in the top-level directory require 'metasm' require 'metasm/dynldr' include Metasm def calc_checksum(data) data.unpack('C*').inject(0) { |sum, byte| sum+byte } end module VirtDbg class ...
Ruby
# ripped from metasm/misc class IO def hexdump(ctx={}) ctx[:noend] = true while buf = read(512) and not buf.empty? buf.hexdump(ctx) end ctx.delete :noend ''.hexdump(ctx) end end class String def hexdump(ctx={}) fmt = ctx[:fmt] ||= ['c', 'd', 'a'] ...
Ruby
class CreateUsers < ActiveRecord::Migration def up create_table :users do |t| t.string :profile_id t.string :email t.string :refresh_token end add_index :users, :profile_id end def down drop_table :users end 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
source :gemcutter gem 'sinatra', :require => 'sinatra/base' gem 'thin', '~> 1.3' gem 'pg' gem 'sinatra-activerecord' gem 'google-api-client', '>= 0.4.4', :require => 'google/api_client' group :development do gem 'rake' gem 'sqlite3-ruby' end
Ruby
require 'sinatra.rb' # Sinatra defines #set at the top level as a way to set application configuration set :run, false set :env, (ENV['RACK_ENV'] ? ENV['RACK_ENV'].to_sym : :development) require './main' run Sinatra::Application
Ruby
require 'sinatra/activerecord/rake' require './main'
Ruby
require 'net/http' server = "msdl.microsoft.com" pdb = "ntkrnlmp" guid = "30092be745b24fe2a311a936e7b7486f2" uri = "/download/symbols/#{pdb}.pdb/#{guid}/#{pdb}.pd_" dest = "#{pdb}.pd_" puts uri Net::HTTP.start(server) { |http| headers = {"User-Agent" => "Microsoft-Symbol-Server/6.6.0007.5"} resp = http.get(u...
Ruby
# This file is part of Virtdbg # Copyright (C) 2010-2011 Damien AUMAITRE # # Licence is GPLv3, see LICENCE.txt in the top-level directory require 'metasm' require 'virtdbg' require 'optparse' $VERBOSE = false # parse arguments opts = { :device => 0 } OptionParser.new { |opt| opt.banner = 'Usage: virtdbg....
Ruby
# This file is part of Virtdbg # Copyright (C) 2010-2011 Damien AUMAITRE # # Licence is GPLv3, see LICENCE.txt in the top-level directory module VirtDbg VIRTDBGDIR = File.dirname(__FILE__) # add it to the ruby library path $: << VIRTDBGDIR end %w[forensic1394 virtdbg util main system].each { |f| require ...
Ruby
# This file is part of Metasm, the Ruby assembly manipulation suite # Copyright (C) 2006-2009 Yoann GUILLOT # # Licence is LGPL, see LICENCE in the top-level directory # # this exemple illustrates the use of the cparser/preprocessor #factorize functionnality: # we write some code using standard headers, and t...
Ruby
# This file is part of Virtdbg # Copyright (C) 2010-2011 Damien AUMAITRE # # Licence is GPLv3, see LICENCE.txt in the top-level directory require 'metasm' require 'metasm/dynldr' include Metasm module VirtDbg class Forensic1394 < Metasm::DynLdr new_api_c File.read(File.join(VIRTDBGDIR, "inc", ...
Ruby
# This file is part of Virtdbg # Copyright (C) 2010-2011 Damien AUMAITRE # # Licence is GPLv3, see LICENCE.txt in the top-level directory require 'metasm' require 'metasm/dynldr' include Metasm module VirtDbg class VirtDbgMem < VirtualString def initialize(impl, addr=0, length=nil) ...
Ruby
# This file is part of Virtdbg # Copyright (C) 2010-2011 Damien AUMAITRE # # Licence is GPLv3, see LICENCE.txt in the top-level directory require 'metasm' require 'metasm/dynldr' require 'iconv' class String def utf16_to_iso converter = Iconv.new('ISO-8859-1//IGNORE//TRANSLIT', 'UTF-16') ...
Ruby
# This file is part of Virtdbg # Copyright (C) 2010-2011 Damien AUMAITRE # # Licence is GPLv3, see LICENCE.txt in the top-level directory require 'metasm' require 'metasm/dynldr' include Metasm def calc_checksum(data) data.unpack('C*').inject(0) { |sum, byte| sum+byte } end module VirtDbg class ...
Ruby
# ripped from metasm/misc class IO def hexdump(ctx={}) ctx[:noend] = true while buf = read(512) and not buf.empty? buf.hexdump(ctx) end ctx.delete :noend ''.hexdump(ctx) end end class String def hexdump(ctx={}) fmt = ctx[:fmt] ||= ['c', 'd', 'a'] ...
Ruby
require 'rubygems' require 'bundler' require 'fileutils' begin Bundler.setup(:default, :development) rescue Bundler::BundlerError => e $stderr.puts e.message $stderr.puts "Run `bundle install` to install missing gems" exit e.status_code end ROOT = File.dirname(__FILE__) require 'rake' require 'uglifier' task...
Ruby
source 'https://rubygems.org' gem 'rake' gem 'therubyracer' gem 'uglifier'
Ruby
# $ext_path: This should be the path of where the ExtJS SDK is installed # Generally this will be in a lib/extjs folder in your applications root # <root>/lib/extjs $ext_path = "../../" # sass_path: the directory your Sass files are in. THIS file should also be in the Sass folder # Generally this will be in a resource...
Ruby
# include the utils rb file which has extra functionality for the ext theme dir = File.dirname(__FILE__) require File.join(dir, 'lib', 'utils.rb') # register ext4 as a compass framework Compass::Frameworks.register 'ext4', dir
Ruby
# $ext_path: This should be the path of the Ext JS SDK relative to this file $ext_path = "../../extjs" # sass_path: the directory your Sass files are in. THIS file should also be in the Sass folder # Generally this will be in a resources/sass folder # <root>/resources/sass sass_path = File.dirname(__FILE__) # css_pat...
Ruby
# Compass configurations sass_path = File.dirname(__FILE__) css_path = File.join(sass_path, "..", "css") # Require any additional compass plugins here. images_dir = File.join(sass_path, "..", "img") output_style = :expanded environment = :production
Ruby
module ExtJS4 module SassExtensions module Functions module Utils def parsebox(list, n) assert_type n, :Number if !n.int? raise ArgumentError.new("List index #{n} must be an integer") elsif n.to_i < 1 raise ArgumentError.new("List index #{n} must...
Ruby
class CreateUsers < ActiveRecord::Migration def up create_table :users do |t| t.string :profile_id t.string :email t.string :refresh_token end add_index :users, :profile_id end def down drop_table :users end 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
source :gemcutter gem 'sinatra', :require => 'sinatra/base' gem 'thin', '~> 1.3' gem 'pg' gem 'sinatra-activerecord' gem 'google-api-client', '>= 0.4.4', :require => 'google/api_client' group :development do gem 'rake' gem 'sqlite3-ruby' end
Ruby
require 'sinatra.rb' # Sinatra defines #set at the top level as a way to set application configuration set :run, false set :env, (ENV['RACK_ENV'] ? ENV['RACK_ENV'].to_sym : :development) require './main' run Sinatra::Application
Ruby
require 'sinatra/activerecord/rake' require './main'
Ruby
class CreateUsers < ActiveRecord::Migration def up create_table :users do |t| t.string :profile_id t.string :email t.string :refresh_token end add_index :users, :profile_id end def down drop_table :users end 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
source :gemcutter gem 'sinatra', :require => 'sinatra/base' gem 'thin', '~> 1.3' gem 'pg' gem 'sinatra-activerecord' gem 'google-api-client', '>= 0.4.4', :require => 'google/api_client' group :development do gem 'rake' gem 'sqlite3-ruby' end
Ruby
require 'sinatra.rb' # Sinatra defines #set at the top level as a way to set application configuration set :run, false set :env, (ENV['RACK_ENV'] ? ENV['RACK_ENV'].to_sym : :development) require './main' run Sinatra::Application
Ruby
require 'sinatra/activerecord/rake' require './main'
Ruby
#!/usr/bin/env ruby require 'net/http' require 'uri' LANGS_URI = 'http://ath.darshancomputing.com/bi/langs/' langs = Net::HTTP.get(URI.parse(LANGS_URI)) langs.split.each do |lang| if lang.length == 2 dir = 'res/values-' << lang else dir = 'res/values-' << lang[0,2] << '-r' << lang[2,2] end if ! Dir...
Ruby
require 'RMagick' class NumberImageGenerator @@IMAGE_DIR = 'numbers-hdpi/' def generate(text, fs=18) #filename = "b" + sprintf("%03d", text) + ".png"; filename = "" + sprintf("%03d", text) + ".png"; font_size = fs; height = 35; width = 35; image = Magick::Image.new(width, height) {self.ba...
Ruby
# Exploit Title: ZyXEL ZyWALL/Prestige Router Web Console # Default Password Scanner # Google Dork: inurl:rpAuth.html # Date: 2014-09-30 # Exploit Author: Jonathan Racicot <cyberrecce [at] gmail [dot] com> # Vendor Homepage: http://www.zyxel.com/us/en/homepage.shtml # Software Link: # http://www.zyxel.com/us/en/produc...
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
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
# include the utils rb file which has extra functionality for the ext theme dir = File.dirname(__FILE__) require File.join(dir, 'lib', 'utils.rb') # register ext4 as a compass framework Compass::Frameworks.register 'ext4', dir
Ruby
# $ext_path: This should be the path of the Ext JS SDK relative to this file $ext_path = "../../extjs" # sass_path: the directory your Sass files are in. THIS file should also be in the Sass folder # Generally this will be in a resources/sass folder # <root>/resources/sass sass_path = File.dirname(__FILE__) # css_pat...
Ruby
module ExtJS4 module SassExtensions module Functions module Utils def parsebox(list, n) assert_type n, :Number if !n.int? raise ArgumentError.new("List index #{n} must be an integer") elsif n.to_i < 1 raise ArgumentError.new("List index #{n} must...
Ruby