Permalink
Browse files

initial bones structure and cleanup

  • Loading branch information...
1 parent a7ddee8 commit 710edb71165f9a47c23be9a301ea4c0f617c0bb1 @tduehr committed May 14, 2009
Showing with 1,130 additions and 0 deletions.
  1. +3 −0 History.txt
  2. +48 −0 README.rdoc
  3. +30 −0 Rakefile
  4. 0 { → lib}/ragweed.rb
  5. 0 { → lib/ragweed}/arena.rb
  6. 0 { → lib/ragweed}/blocks.rb
  7. 0 { → lib/ragweed}/debugger.rb
  8. 0 { → lib/ragweed}/debuggertux.rb
  9. 0 { → lib/ragweed}/debuggerx.rb
  10. 0 { → lib/ragweed}/detour.rb
  11. 0 { → lib/ragweed}/device.rb
  12. 0 { → lib/ragweed}/event.rb
  13. 0 { → lib/ragweed}/frasm/COPYING
  14. 0 { → lib/ragweed}/frasm/build.bat
  15. 0 { → lib/ragweed}/frasm/config.h
  16. 0 { → lib/ragweed}/frasm/decoder.c
  17. 0 { → lib/ragweed}/frasm/decoder.h
  18. 0 { → lib/ragweed}/frasm/distorm.c
  19. 0 { → lib/ragweed}/frasm/extconf.rb
  20. 0 { → lib/ragweed}/frasm/frasm-i386-mswin32.def
  21. 0 { → lib/ragweed}/frasm/frasm.c
  22. 0 { → lib/ragweed}/frasm/frasm.so.manifest
  23. 0 { → lib/ragweed}/frasm/instructions.c
  24. 0 { → lib/ragweed}/frasm/instructions.h
  25. 0 { → lib/ragweed}/frasm/insts.c
  26. 0 { → lib/ragweed}/frasm/insts.h
  27. 0 { → lib/ragweed}/frasm/operands.c
  28. 0 { → lib/ragweed}/frasm/operands.h
  29. 0 { → lib/ragweed}/frasm/prefix.c
  30. 0 { → lib/ragweed}/frasm/prefix.h
  31. 0 { → lib/ragweed}/frasm/textdefs.c
  32. 0 { → lib/ragweed}/frasm/textdefs.h
  33. 0 { → lib/ragweed}/frasm/wstring.c
  34. 0 { → lib/ragweed}/frasm/wstring.h
  35. 0 { → lib/ragweed}/frasm/x86defs.c
  36. 0 { → lib/ragweed}/frasm/x86defs.h
  37. 0 { → lib/ragweed}/hittracertux.rb
  38. 0 { → lib/ragweed}/hittracerx.rb
  39. 0 { → lib/ragweed}/hook_notepad.rb
  40. 0 { → lib/ragweed}/hooks.rb
  41. 0 { → lib/ragweed}/process.rb
  42. 0 { → lib/ragweed}/ptr.rb
  43. 0 { → lib/ragweed}/rasm.rb
  44. 0 { → lib/ragweed}/rasm/isa.rb
  45. 0 { → lib/ragweed}/rasm/util.rb
  46. 0 { → lib/ragweed}/sbuf.rb
  47. 0 { → lib/ragweed}/snicker.rb
  48. 0 { → lib/ragweed}/trampoline.rb
  49. 0 { → lib/ragweed}/tux-example.rb
  50. 0 { → lib/ragweed}/wrap32.rb
  51. 0 { → lib/ragweed}/wrap32/debugging.rb
  52. 0 { → lib/ragweed}/wrap32/overlapped.rb
  53. 0 { → lib/ragweed}/wrap32/process_token.rb
  54. 0 { → lib/ragweed}/wrap32/thread_context.rb
  55. 0 { → lib/ragweed}/wrap32/winx.rb
  56. 0 { → lib/ragweed}/wrap32/wrap32.rb
  57. 0 { → lib/ragweed}/wraptux.rb
  58. 0 { → lib/ragweed}/wraptux/constants.rb
  59. 0 { → lib/ragweed}/wraptux/threads.rb
  60. 0 { → lib/ragweed}/wraptux/wraptux.rb
  61. 0 { → lib/ragweed}/wrapx.rb
  62. 0 { → lib/ragweed}/wrapx/constants.rb
  63. 0 { → lib/ragweed}/wrapx/kernelerrorx.rb
  64. 0 { → lib/ragweed}/wrapx/kernx.rb
  65. 0 { → lib/ragweed}/wrapx/region_info.rb
  66. 0 { → lib/ragweed}/wrapx/thread_context.rb
  67. 0 { → lib/ragweed}/wrapx/thread_info.rb
  68. 0 { → lib/ragweed}/wrapx/wrapx.rb
  69. +49 −0 lib/ragweed_bones.rb
  70. +7 −0 spec/ragweed_spec.rb
  71. +16 −0 spec/spec_helper.rb
  72. +80 −0 tasks/ann.rake
  73. +20 −0 tasks/bones.rake
  74. +201 −0 tasks/gem.rake
  75. +40 −0 tasks/git.rake
  76. +27 −0 tasks/notes.rake
  77. +34 −0 tasks/post_load.rake
  78. +51 −0 tasks/rdoc.rake
  79. +55 −0 tasks/rubyforge.rake
  80. +292 −0 tasks/setup.rb
  81. +54 −0 tasks/spec.rake
  82. +47 −0 tasks/svn.rake
  83. +40 −0 tasks/test.rake
  84. +36 −0 tasks/zentest.rake
  85. 0 test/test_ragweed.rb
View
@@ -0,0 +1,3 @@
+== 0.0.1 / 2009-05-13
+
+* initial pull from svn
View
@@ -0,0 +1,48 @@
+test_empty
+ by FIXME (your name)
+ FIXME (url)
+
+== DESCRIPTION:
+
+FIXME (describe your package)
+
+== FEATURES/PROBLEMS:
+
+* FIXME (list of features or problems)
+
+== SYNOPSIS:
+
+ FIXME (code sample of usage)
+
+== REQUIREMENTS:
+
+* FIXME (list of requirements)
+
+== INSTALL:
+
+* FIXME (sudo gem install, anything else)
+
+== LICENSE:
+
+(The MIT License)
+
+Copyright (c) 2008 FIXME (different license?)
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
@@ -0,0 +1,30 @@
+# Look in the tasks/setup.rb file for the various options that can be
+# configured in this Rakefile. The .rake files in the tasks directory
+# are where the options are used.
+
+begin
+ require 'bones'
+ Bones.setup
+rescue LoadError
+ begin
+ load 'tasks/setup.rb'
+ rescue LoadError
+ raise RuntimeError, '### please install the "bones" gem ###'
+ end
+end
+
+ensure_in_path 'lib'
+require 'ragweed'
+
+task :default => 'spec:run'
+
+PROJ.name = 'ragweed'
+PROJ.authors = 'FIXME (who is writing this software)'
+PROJ.email = 'FIXME (your e-mail)'
+PROJ.url = 'FIXME (project homepage)'
+PROJ.version = Ragweed::VERSION
+PROJ.rubyforge.name = 'ragweed'
+
+PROJ.spec.opts << '--color'
+
+# EOF
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
View
@@ -0,0 +1,49 @@
+
+module Ragweed
+
+ # :stopdoc:
+ VERSION = '0.0.1'
+ LIBPATH = ::File.expand_path(::File.dirname(__FILE__)) + ::File::SEPARATOR
+ PATH = ::File.dirname(LIBPATH) + ::File::SEPARATOR
+ # :startdoc:
+
+ # Returns the version string for the library.
+ #
+ def self.version
+ VERSION
+ end
+
+ # Returns the library path for the module. If any arguments are given,
+ # they will be joined to the end of the libray path using
+ # <tt>File.join</tt>.
+ #
+ def self.libpath( *args )
+ args.empty? ? LIBPATH : ::File.join(LIBPATH, args.flatten)
+ end
+
+ # Returns the lpath for the module. If any arguments are given,
+ # they will be joined to the end of the path using
+ # <tt>File.join</tt>.
+ #
+ def self.path( *args )
+ args.empty? ? PATH : ::File.join(PATH, args.flatten)
+ end
+
+ # Utility method used to require all files ending in .rb that lie in the
+ # directory below this file that has the same name as the filename passed
+ # in. Optionally, a specific _directory_ name can be passed in such that
+ # the _filename_ does not have to be equivalent to the directory.
+ #
+ def self.require_all_libs_relative_to( fname, dir = nil )
+ dir ||= ::File.basename(fname, '.*')
+ search_me = ::File.expand_path(
+ ::File.join(::File.dirname(fname), dir, '**', '*.rb'))
+
+ Dir.glob(search_me).sort.each {|rb| require rb}
+ end
+
+end # module TestEmpty
+
+TestEmpty.require_all_libs_relative_to(__FILE__)
+
+# EOF
@@ -0,0 +1,7 @@
+
+require File.join(File.dirname(__FILE__), %w[spec_helper])
+
+describe Ragweed do
+end
+
+# EOF
View
@@ -0,0 +1,16 @@
+
+require File.expand_path(
+ File.join(File.dirname(__FILE__), %w[.. lib ragweed]))
+
+Spec::Runner.configure do |config|
+ # == Mock Framework
+ #
+ # RSpec uses it's own mocking framework by default. If you prefer to
+ # use mocha, flexmock or RR, uncomment the appropriate line:
+ #
+ # config.mock_with :mocha
+ # config.mock_with :flexmock
+ # config.mock_with :rr
+end
+
+# EOF
View
@@ -0,0 +1,80 @@
+
+begin
+ require 'bones/smtp_tls'
+rescue LoadError
+ require 'net/smtp'
+end
+require 'time'
+
+namespace :ann do
+
+ # A prerequisites task that all other tasks depend upon
+ task :prereqs
+
+ file PROJ.ann.file do
+ ann = PROJ.ann
+ puts "Generating #{ann.file}"
+ File.open(ann.file,'w') do |fd|
+ fd.puts("#{PROJ.name} version #{PROJ.version}")
+ fd.puts(" by #{Array(PROJ.authors).first}") if PROJ.authors
+ fd.puts(" #{PROJ.url}") if PROJ.url.valid?
+ fd.puts(" (the \"#{PROJ.release_name}\" release)") if PROJ.release_name
+ fd.puts
+ fd.puts("== DESCRIPTION")
+ fd.puts
+ fd.puts(PROJ.description)
+ fd.puts
+ fd.puts(PROJ.changes.sub(%r/^.*$/, '== CHANGES'))
+ fd.puts
+ ann.paragraphs.each do |p|
+ fd.puts "== #{p.upcase}"
+ fd.puts
+ fd.puts paragraphs_of(PROJ.readme_file, p).join("\n\n")
+ fd.puts
+ end
+ fd.puts ann.text if ann.text
+ end
+ end
+
+ desc "Create an announcement file"
+ task :announcement => ['ann:prereqs', PROJ.ann.file]
+
+ desc "Send an email announcement"
+ task :email => ['ann:prereqs', PROJ.ann.file] do
+ ann = PROJ.ann
+ from = ann.email[:from] || Array(PROJ.authors).first || PROJ.email
+ to = Array(ann.email[:to])
+
+ ### build a mail header for RFC 822
+ rfc822msg = "From: #{from}\n"
+ rfc822msg << "To: #{to.join(',')}\n"
+ rfc822msg << "Subject: [ANN] #{PROJ.name} #{PROJ.version}"
+ rfc822msg << " (#{PROJ.release_name})" if PROJ.release_name
+ rfc822msg << "\n"
+ rfc822msg << "Date: #{Time.new.rfc822}\n"
+ rfc822msg << "Message-Id: "
+ rfc822msg << "<#{"%.8f" % Time.now.to_f}@#{ann.email[:domain]}>\n\n"
+ rfc822msg << File.read(ann.file)
+
+ params = [:server, :port, :domain, :acct, :passwd, :authtype].map do |key|
+ ann.email[key]
+ end
+
+ params[3] = PROJ.email if params[3].nil?
+
+ if params[4].nil?
+ STDOUT.write "Please enter your e-mail password (#{params[3]}): "
+ params[4] = STDIN.gets.chomp
+ end
+
+ ### send email
+ Net::SMTP.start(*params) {|smtp| smtp.sendmail(rfc822msg, from, to)}
+ end
+end # namespace :ann
+
+desc 'Alias to ann:announcement'
+task :ann => 'ann:announcement'
+
+CLOBBER << PROJ.ann.file
+
+# EOF
View
@@ -0,0 +1,20 @@
+
+if HAVE_BONES
+
+namespace :bones do
+
+ desc 'Show the PROJ open struct'
+ task :debug do |t|
+ atr = if t.application.top_level_tasks.length == 2
+ t.application.top_level_tasks.pop
+ end
+
+ if atr then Bones::Debug.show_attr(PROJ, atr)
+ else Bones::Debug.show PROJ end
+ end
+
+end # namespace :bones
+
+end # HAVE_BONES
+
+# EOF
Oops, something went wrong.

0 comments on commit 710edb7

Please sign in to comment.