From 828698bf379c43fcea1ed29353f5dedd4f55212d Mon Sep 17 00:00:00 2001 From: Cecil Coupe Date: Wed, 3 Sep 2014 00:46:50 -0600 Subject: [PATCH] Fix bug #265. Created new ext 'winject'. It'd binject with just the Windows pe handling. No hfs/dmg. Source code for binject is still there but not used. --- fixed/bug265.rb | 4 + lib/shoes/app_package.rb | 10 +- make/linux/tasks.rb | 2 +- make/mavericks-x86_64/tasks.rb | 4 +- make/x86_64-linux/tasks.rb | 2 +- make/xarmv6-pi/tasks.rb | 2 +- make/xi386-gnu-linux/tasks.rb | 2 +- make/xmingw32/tasks.rb | 2 +- notes/Bugs.txt | 51 +- req/winject/ext/winject_c/LICENSE | 674 +++++++++++++++++ req/winject/ext/winject_c/Makefile | 239 ++++++ req/winject/ext/winject_c/README | 19 + req/winject/ext/winject_c/abstractfile.c | 317 ++++++++ req/winject/ext/winject_c/abstractfile.o | Bin 0 -> 23868 bytes req/winject/ext/winject_c/extconf.rb | 72 ++ .../ext/winject_c/includes/abstractfile.h | 70 ++ req/winject/ext/winject_c/includes/common.h | 75 ++ req/winject/ext/winject_c/mkhfz | 4 + req/winject/ext/winject_c/mkmf.log | 33 + req/winject/ext/winject_c/pe.h | 224 ++++++ req/winject/ext/winject_c/winject.bundle | Bin 0 -> 32152 bytes req/winject/ext/winject_c/winject.c | 696 ++++++++++++++++++ req/winject/ext/winject_c/winject.o | Bin 0 -> 68324 bytes 23 files changed, 2490 insertions(+), 12 deletions(-) create mode 100644 fixed/bug265.rb create mode 100644 req/winject/ext/winject_c/LICENSE create mode 100644 req/winject/ext/winject_c/Makefile create mode 100644 req/winject/ext/winject_c/README create mode 100644 req/winject/ext/winject_c/abstractfile.c create mode 100644 req/winject/ext/winject_c/abstractfile.o create mode 100644 req/winject/ext/winject_c/extconf.rb create mode 100644 req/winject/ext/winject_c/includes/abstractfile.h create mode 100644 req/winject/ext/winject_c/includes/common.h create mode 100755 req/winject/ext/winject_c/mkhfz create mode 100644 req/winject/ext/winject_c/mkmf.log create mode 100644 req/winject/ext/winject_c/pe.h create mode 100755 req/winject/ext/winject_c/winject.bundle create mode 100644 req/winject/ext/winject_c/winject.c create mode 100644 req/winject/ext/winject_c/winject.o diff --git a/fixed/bug265.rb b/fixed/bug265.rb new file mode 100644 index 00000000..0c5d9003 --- /dev/null +++ b/fixed/bug265.rb @@ -0,0 +1,4 @@ +require 'winject' +Shoes.app do + button "OK" +end diff --git a/lib/shoes/app_package.rb b/lib/shoes/app_package.rb index 2982f474..af73694b 100644 --- a/lib/shoes/app_package.rb +++ b/lib/shoes/app_package.rb @@ -1,6 +1,6 @@ # The 'New' packager for Shoes 3.2 require 'shoes/shy' -require 'binject' +require 'winject' require 'open-uri' require 'rubygems/package' require 'zlib' @@ -99,7 +99,7 @@ end end - # FIXME: Assumes lines are sorted by filename at server + # Assumes lines are sorted by filename on server (cgi select/pkg.rb) def platform_merge ln flds = ln.split(' ') return if flds[0].to_i == 0 @@ -314,7 +314,11 @@ def repack_exe script = @path size = File.size(script) f = File.open(script, 'rb') - exe = Binject::EXE.new(File.join(DIR, "static", "stubs", "blank.exe")) + begin + exe = Winject::EXE.new(File.join(DIR, "static", "stubs", "blank.exe")) + rescue StandardError => e + puts "Failed to create Winject::EXE #{e}" + end size += script.length exe.inject("SHOES_FILENAME", File.basename(script)) size += File.size(script) diff --git a/make/linux/tasks.rb b/make/linux/tasks.rb index db67ffa6..f41c3141 100644 --- a/make/linux/tasks.rb +++ b/make/linux/tasks.rb @@ -70,7 +70,7 @@ def common_build %w[req/ftsearch/lib/* req/rake/lib/*].each do |rdir| FileList[rdir].each { |rlib| cp_r rlib, "#{TGT_DIR}/lib/ruby/#{RUBY_V}" } end - %w[req/binject/ext/binject_c req/ftsearch/ext/ftsearchrt req/chipmunk/ext/chipmunk]. + %w[req/ftsearch/ext/ftsearchrt req/chipmunk/ext/chipmunk req/winject/ext/winject_c]. #%w[req/binject/ext/binject_c req/ftsearch/ext/ftsearchrt req/bloopsaphone/ext/bloops req/chipmunk/ext/chipmunk]. each { |xdir| copy_ext xdir, "#{TGT_DIR}/lib/ruby/#{RUBY_V}/#{SHOES_RUBY_ARCH}" } diff --git a/make/mavericks-x86_64/tasks.rb b/make/mavericks-x86_64/tasks.rb index 0311d54f..9edfacfd 100644 --- a/make/mavericks-x86_64/tasks.rb +++ b/make/mavericks-x86_64/tasks.rb @@ -65,7 +65,7 @@ def common_build FileList[rdir].each { |rlib| cp_r rlib, "#{TGT_DIR}/lib/ruby/#{RUBY_V}" } end #%w[req/binject/ext/binject_c req/ftsearch/ext/ftsearchrt req/bloopsaphone/ext/bloops req/chipmunk/ext/chipmunk]. - %w[req/binject/ext/binject_c req/ftsearch/ext/ftsearchrt req/chipmunk/ext/chipmunk]. + %w[req/winject/ext/winject_c req/ftsearch/ext/ftsearchrt req/chipmunk/ext/chipmunk]. each { |xdir| copy_ext xdir, "#{TGT_DIR}/lib/ruby/#{RUBY_V}/#{SHOES_RUBY_ARCH}" } gdir = "#{TGT_DIR}/lib/ruby/gems/#{RUBY_V}" @@ -364,4 +364,4 @@ def make_smaller end end -end \ No newline at end of file +end diff --git a/make/x86_64-linux/tasks.rb b/make/x86_64-linux/tasks.rb index f6572999..5295b311 100644 --- a/make/x86_64-linux/tasks.rb +++ b/make/x86_64-linux/tasks.rb @@ -87,7 +87,7 @@ def common_build %w[req/ftsearch/lib/* req/rake/lib/*].each do |rdir| FileList[rdir].each { |rlib| cp_r rlib, "#{TGT_DIR}/lib/ruby/#{RUBY_V}" } end - %w[req/binject/ext/binject_c req/ftsearch/ext/ftsearchrt req/chipmunk/ext/chipmunk]. + %w[req/winject/ext/winject_c req/ftsearch/ext/ftsearchrt req/chipmunk/ext/chipmunk]. #%w[req/binject/ext/binject_c req/ftsearch/ext/ftsearchrt req/bloopsaphone/ext/bloops req/chipmunk/ext/chipmunk]. each { |xdir| copy_ext xdir, "#{TGT_DIR}/lib/ruby/#{RUBY_V}/#{SHOES_TGT_ARCH}" } diff --git a/make/xarmv6-pi/tasks.rb b/make/xarmv6-pi/tasks.rb index f8b5c15d..84eedc01 100644 --- a/make/xarmv6-pi/tasks.rb +++ b/make/xarmv6-pi/tasks.rb @@ -90,7 +90,7 @@ def common_build %w[req/ftsearch/lib/* req/rake/lib/*].each do |rdir| FileList[rdir].each { |rlib| cp_r rlib, "#{TGT_DIR}/lib/ruby/#{TGT_RUBY_V}" } end - %w[req/binject/ext/binject_c req/ftsearch/ext/ftsearchrt req/chipmunk/ext/chipmunk]. + %w[req/winject/ext/winject_c req/ftsearch/ext/ftsearchrt req/chipmunk/ext/chipmunk]. #%w[req/binject/ext/binject_c req/ftsearch/ext/ftsearchrt req/bloopsaphone/ext/bloops req/chipmunk/ext/chipmunk]. each { |xdir| copy_ext xdir, "#{TGT_DIR}/lib/ruby/#{TGT_RUBY_V}/#{SHOES_TGT_ARCH}" } diff --git a/make/xi386-gnu-linux/tasks.rb b/make/xi386-gnu-linux/tasks.rb index a67ed8e7..94bec565 100644 --- a/make/xi386-gnu-linux/tasks.rb +++ b/make/xi386-gnu-linux/tasks.rb @@ -87,7 +87,7 @@ def common_build %w[req/ftsearch/lib/* req/rake/lib/*].each do |rdir| FileList[rdir].each { |rlib| cp_r rlib, "#{TGT_DIR}/lib/ruby/#{RUBY_V}" } end - %w[req/binject/ext/binject_c req/ftsearch/ext/ftsearchrt req/chipmunk/ext/chipmunk]. + %w[req/winject/ext/winject_c req/ftsearch/ext/ftsearchrt req/chipmunk/ext/chipmunk]. #%w[req/binject/ext/binject_c req/ftsearch/ext/ftsearchrt req/bloopsaphone/ext/bloops req/chipmunk/ext/chipmunk]. each { |xdir| copy_ext xdir, "#{TGT_DIR}/lib/ruby/#{RUBY_V}/#{SHOES_TGT_ARCH}" } diff --git a/make/xmingw32/tasks.rb b/make/xmingw32/tasks.rb index 98efc248..ec40f07e 100644 --- a/make/xmingw32/tasks.rb +++ b/make/xmingw32/tasks.rb @@ -80,7 +80,7 @@ def common_build %w[req/ftsearch/lib/* req/rake/lib/*].each do |rdir| FileList[rdir].each { |rlib| cp_r rlib, "#{TGT_DIR}/lib/ruby/#{RUBY_V}" } end - %w[req/ftsearch/ext/ftsearchrt req/chipmunk/ext/chipmunk req/binject/ext/binject_c]. + %w[req/ftsearch/ext/ftsearchrt req/chipmunk/ext/chipmunk req/winject/ext/winject_c]. #%w[req/binject/ext/binject_c req/ftsearch/ext/ftsearchrt req/bloopsaphone/ext/bloops req/chipmunk/ext/chipmunk]. each { |xdir| copy_ext xdir, "#{TGT_DIR}/lib/ruby/#{RUBY_V}/#{SHOES_TGT_ARCH}" } diff --git a/notes/Bugs.txt b/notes/Bugs.txt index 6e6f6b96..b4ddf696 100644 --- a/notes/Bugs.txt +++ b/notes/Bugs.txt @@ -1,8 +1,55 @@ Bugs/Status - stick with Ruby 2.0.0 and gtk2 until things get sorted out with GKt3 +2014-09-02 + Interesting possibilities with jfxruby toolkit. When Shoes is too + limited? The jfxruby wiki has good info. https://github.com/jruby/jrubyfx + + Might work for Android, iOS building. see: + http://www.infoq.com/articles/Building-JavaFX-Android-Apps?utm_campaign=infoq_content&utm_source=infoq&utm_medium=feed&utm_term=global + + +done: select/pkg.rb cgi script sorts by file name. +done: minimized winject to just Windows slinging . Test: creating isp.exe +done: dist: 9551872 Sep 2 23:13 isp.exe + x86_64 9551872 + i686 9551872 + armhf 9551872 + osx 9551872 + xmingw32 9551872 +done: yes Windows started working again. Not sure why (other than winject + name change and try/catch + which shouldn't have changed anything but it did +----> git commit +----> update issue 265 +----> blog post + +2014-09-01 +done: copy binject to winject and remove the osx/dmg stuff. + +2014-08-31 + pay attention to the error message: + '126: the specified module could not be found C:/Users/Cecil.../binject.so' + + If the file is actually missing the error is: + 'cannot load such file -- binject' + + Did I screw something related to gem building/handling when I + did the hpricot/sqlite3 gem building and loading? I did write + the packaging first and reading below I did have gem loading/path + issues - perhaps I screwed something up? + +2014-08-28 +===>: Bug #266 App freezes on Windows (backgrounding) + 2014-08-27 3.2.15 release -----> Build all +done: Build all & upload +done: update shoesrb.mvmanila.com and issue pull request to mothership +done: Blog announcement + +===>: Bug #265 reported. binject.so won't load on Win7. reproducible. + co-ext's Ftsearch and chipmonk work fine. It's not the stripped + symbols. No problem on Linux. 2014-08-26 Wiki ----> place holder wiki posts for these topics: @@ -26,7 +73,7 @@ done: for Dist/shoes, changes inside static/ need a rake clean; rake. done: Update manual for edit_line finish= ----> Many changes to manual and pngs to get it current. ====> embed 3.2.{teeny} [app.yaml] version number in compiled in constant -====> Add a tips section at the end of manual - link to wiki articles on +done: Add a tips section at the end of manual - link to wiki articles on command line things, Cobbler, Packaging ====> Convert some of my blog posts/pages to Wiki (cobbler, gems) diff --git a/req/winject/ext/winject_c/LICENSE b/req/winject/ext/winject_c/LICENSE new file mode 100644 index 00000000..94a9ed02 --- /dev/null +++ b/req/winject/ext/winject_c/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/req/winject/ext/winject_c/Makefile b/req/winject/ext/winject_c/Makefile new file mode 100644 index 00000000..3cc0516a --- /dev/null +++ b/req/winject/ext/winject_c/Makefile @@ -0,0 +1,239 @@ + +SHELL = /bin/sh + +# V=0 quiet, V=1 verbose. other values don't work. +V = 0 +Q1 = $(V:1=) +Q = $(Q1:0=@) +ECHO1 = $(V:1=@:) +ECHO = $(ECHO1:0=@echo) + +#### Start of system configuration section. #### + +srcdir = . +topdir = /Users/ccoupe/.rvm/rubies/ruby-2.1.2/include/ruby-2.1.0 +hdrdir = $(topdir) +arch_hdrdir = /Users/ccoupe/.rvm/rubies/ruby-2.1.2/include/ruby-2.1.0/x86_64-darwin13.0 +PATH_SEPARATOR = : +VPATH = $(srcdir):$(arch_hdrdir)/ruby:$(hdrdir)/ruby +prefix = $(DESTDIR)/Users/ccoupe/.rvm/rubies/ruby-2.1.2 +rubysitearchprefix = $(rubylibprefix)/$(sitearch) +rubyarchprefix = $(rubylibprefix)/$(arch) +rubylibprefix = $(libdir)/$(RUBY_BASE_NAME) +exec_prefix = $(prefix) +vendorarchhdrdir = $(vendorhdrdir)/$(sitearch) +sitearchhdrdir = $(sitehdrdir)/$(sitearch) +rubyarchhdrdir = $(rubyhdrdir)/$(arch) +vendorhdrdir = $(rubyhdrdir)/vendor_ruby +sitehdrdir = $(rubyhdrdir)/site_ruby +rubyhdrdir = $(includedir)/$(RUBY_VERSION_NAME) +vendorarchdir = $(vendorlibdir)/$(sitearch) +vendorlibdir = $(vendordir)/$(ruby_version) +vendordir = $(rubylibprefix)/vendor_ruby +sitearchdir = $(sitelibdir)/$(sitearch) +sitelibdir = $(sitedir)/$(ruby_version) +sitedir = $(rubylibprefix)/site_ruby +rubyarchdir = $(rubylibdir)/$(arch) +rubylibdir = $(rubylibprefix)/$(ruby_version) +sitearchincludedir = $(includedir)/$(sitearch) +archincludedir = $(includedir)/$(arch) +sitearchlibdir = $(libdir)/$(sitearch) +archlibdir = $(libdir)/$(arch) +ridir = $(datarootdir)/$(RI_BASE_NAME) +mandir = $(datarootdir)/man +localedir = $(datarootdir)/locale +libdir = $(exec_prefix)/lib +psdir = $(docdir) +pdfdir = $(docdir) +dvidir = $(docdir) +htmldir = $(docdir) +infodir = $(datarootdir)/info +docdir = $(datarootdir)/doc/$(PACKAGE) +oldincludedir = $(DESTDIR)/usr/include +includedir = $(prefix)/include +localstatedir = $(prefix)/var +sharedstatedir = $(prefix)/com +sysconfdir = $(prefix)/etc +datadir = $(datarootdir) +datarootdir = $(prefix)/share +libexecdir = $(exec_prefix)/libexec +sbindir = $(exec_prefix)/sbin +bindir = $(exec_prefix)/bin +archdir = $(rubyarchdir) + + +CC = gcc +CXX = g++ +LIBRUBY = $(LIBRUBY_SO) +LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a +LIBRUBYARG_SHARED = -l$(RUBY_SO_NAME) +LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)-static -framework CoreFoundation +empty = +OUTFLAG = -o $(empty) +COUTFLAG = -o $(empty) + +RUBY_EXTCONF_H = +cflags = $(optflags) $(debugflags) $(warnflags) +optflags = -O3 -fno-fast-math +debugflags = -ggdb3 +warnflags = -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wextra-tokens +CCDLFLAGS = -fno-common +CFLAGS = $(CCDLFLAGS) $(cflags) -fno-common -pipe -Iincludes -DRUBY_2_1 $(ARCH_FLAG) +INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir)/ruby/backward -I$(hdrdir) -I$(srcdir) +DEFS = +CPPFLAGS = -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/include -I/usr/local/opt/openssl/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT $(DEFS) $(cppflags) +CXXFLAGS = $(CCDLFLAGS) $(cxxflags) $(ARCH_FLAG) +ldflags = -L. -fstack-protector -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib +dldflags = -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib +ARCH_FLAG = +DLDFLAGS = $(ldflags) $(dldflags) $(ARCH_FLAG) +LDSHARED = $(CC) -dynamic -bundle +LDSHAREDXX = $(CXX) -dynamic -bundle +AR = ar +EXEEXT = + +RUBY_INSTALL_NAME = ruby +RUBY_SO_NAME = ruby.2.1.0 +RUBYW_INSTALL_NAME = +RUBY_VERSION_NAME = $(RUBY_BASE_NAME)-$(ruby_version) +RUBYW_BASE_NAME = rubyw +RUBY_BASE_NAME = ruby + +arch = x86_64-darwin13.0 +sitearch = $(arch) +ruby_version = 2.1.0 +ruby = $(bindir)/ruby +RUBY = $(ruby) +ruby_headers = $(hdrdir)/ruby.h $(hdrdir)/ruby/ruby.h $(hdrdir)/ruby/defines.h $(hdrdir)/ruby/missing.h $(hdrdir)/ruby/intern.h $(hdrdir)/ruby/st.h $(hdrdir)/ruby/subst.h $(arch_hdrdir)/ruby/config.h + +RM = rm -f +RM_RF = $(RUBY) -run -e rm -- -rf +RMDIRS = rmdir -p +MAKEDIRS = mkdir -p +INSTALL = /usr/bin/install -c +INSTALL_PROG = $(INSTALL) -m 0755 +INSTALL_DATA = $(INSTALL) -m 644 +COPY = cp +TOUCH = exit > + +#### End of system configuration section. #### + +preload = + +libpath = . $(libdir) /usr/local/opt/libyaml/lib /usr/local/opt/readline/lib /usr/local/opt/libksba/lib /usr/local/opt/openssl/lib +LIBPATH = -L. -L$(libdir) -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib +DEFFILE = + +CLEANFILES = mkmf.log +DISTCLEANFILES = +DISTCLEANDIRS = + +extout = +extout_prefix = +target_prefix = +LOCAL_LIBS = +LIBS = $(LIBRUBYARG_SHARED) -lz -lpthread -ldl -lobjc +ORIG_SRCS = winject.c abstractfile.c +SRCS = $(ORIG_SRCS) +OBJS = winject.o abstractfile.o +HDRS = $(srcdir)/pe.h +TARGET = winject +TARGET_NAME = winject +TARGET_ENTRY = Init_$(TARGET_NAME) +DLLIB = $(TARGET).bundle +EXTSTATIC = +STATIC_LIB = + +TIMESTAMP_DIR = . +BINDIR = $(bindir) +RUBYCOMMONDIR = $(sitedir)$(target_prefix) +RUBYLIBDIR = $(sitelibdir)$(target_prefix) +RUBYARCHDIR = $(sitearchdir)$(target_prefix) +HDRDIR = $(rubyhdrdir)/ruby$(target_prefix) +ARCHHDRDIR = $(rubyhdrdir)/$(arch)/ruby$(target_prefix) + +TARGET_SO = $(DLLIB) +CLEANLIBS = $(TARGET).bundle +CLEANOBJS = *.o *.bak + +all: $(DLLIB) +static: $(STATIC_LIB) +.PHONY: all install static install-so install-rb +.PHONY: clean clean-so clean-static clean-rb + +clean-static:: +clean-rb-default:: +clean-rb:: +clean-so:: +clean: clean-so clean-static clean-rb-default clean-rb + -$(Q)$(RM) $(CLEANLIBS) $(CLEANOBJS) $(CLEANFILES) .*.time + +distclean-rb-default:: +distclean-rb:: +distclean-so:: +distclean-static:: +distclean: clean distclean-so distclean-static distclean-rb-default distclean-rb + -$(Q)$(RM) Makefile $(RUBY_EXTCONF_H) conftest.* mkmf.log + -$(Q)$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES) + -$(Q)$(RMDIRS) $(DISTCLEANDIRS) 2> /dev/null || true + +realclean: distclean +install: install-so install-rb + +install-so: $(DLLIB) $(TIMESTAMP_DIR)/.RUBYARCHDIR.time + $(INSTALL_PROG) $(DLLIB) $(RUBYARCHDIR) +clean-static:: + -$(Q)$(RM) $(STATIC_LIB) +install-rb: pre-install-rb install-rb-default +install-rb-default: pre-install-rb-default +pre-install-rb: Makefile +pre-install-rb-default: Makefile +pre-install-rb-default: + $(ECHO) installing default winject libraries +$(TIMESTAMP_DIR)/.RUBYARCHDIR.time: + $(Q) $(MAKEDIRS) $(@D) $(RUBYARCHDIR) + $(Q) $(TOUCH) $@ + +site-install: site-install-so site-install-rb +site-install-so: install-so +site-install-rb: install-rb + +.SUFFIXES: .c .m .cc .mm .cxx .cpp .C .o + +.cc.o: + $(ECHO) compiling $(<) + $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $< + +.mm.o: + $(ECHO) compiling $(<) + $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $< + +.cxx.o: + $(ECHO) compiling $(<) + $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $< + +.cpp.o: + $(ECHO) compiling $(<) + $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $< + +.C.o: + $(ECHO) compiling $(<) + $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $< + +.c.o: + $(ECHO) compiling $(<) + $(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $< + +.m.o: + $(ECHO) compiling $(<) + $(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $< + +$(DLLIB): $(OBJS) Makefile + $(ECHO) linking shared-object $(DLLIB) + -$(Q)$(RM) $(@) + $(Q) $(LDSHARED) -o $@ $(OBJS) $(LIBPATH) $(DLDFLAGS) $(LOCAL_LIBS) $(LIBS) + $(Q) $(POSTLINK) + + + +$(OBJS): $(HDRS) $(ruby_headers) diff --git a/req/winject/ext/winject_c/README b/req/winject/ext/winject_c/README new file mode 100644 index 00000000..65ea992c --- /dev/null +++ b/req/winject/ext/winject_c/README @@ -0,0 +1,19 @@ +This library is a Ruby binding for injecting into a raw HFS+ file +and converting it to DMG. Also, this binding injects resources +into EXEs. + +The DMG / HFS+ is GPL'd code that is part of the amazing XPwn +tool: http://github.com/planetbeing/xpwn. The authors are +many: http://wikee.iphwn.org/#who_we_are. + +I also am including a header (pe.h) by Michael Kohn, author of +the anal_pe inspection tool. + +As such, this library is also GPL. See the LICENSE file for +more. + +NOTE TO SELF: To cross-compile a static zlib under mingw. + + CC=i586-mingw32msvc-gcc RANLIB=i586-mingw32msvc-ranlib \ + AR="i586-mingw32msvc-ar rc" ./configure + make diff --git a/req/winject/ext/winject_c/abstractfile.c b/req/winject/ext/winject_c/abstractfile.c new file mode 100644 index 00000000..1544df7b --- /dev/null +++ b/req/winject/ext/winject_c/abstractfile.c @@ -0,0 +1,317 @@ +#include +#include +#include +#include +#include + +#include "abstractfile.h" +#include "common.h" + +size_t freadWrapper(AbstractFile* file, void* data, size_t len) { + return fread(data, 1, len, (FILE*) (file->data)); +} + +size_t fwriteWrapper(AbstractFile* file, const void* data, size_t len) { + return fwrite(data, 1, len, (FILE*) (file->data)); +} + +int fseekWrapper(AbstractFile* file, off_t offset) { + return fseeko((FILE*) (file->data), offset, SEEK_SET); +} + +off_t ftellWrapper(AbstractFile* file) { + return ftello((FILE*) (file->data)); +} + +void fcloseWrapper(AbstractFile* file) { + fclose((FILE*) (file->data)); + free(file); +} + +off_t fileGetLength(AbstractFile* file) { + off_t length; + off_t pos; + + pos = ftello((FILE*) (file->data)); + + fseeko((FILE*) (file->data), 0, SEEK_END); + length = ftello((FILE*) (file->data)); + + fseeko((FILE*) (file->data), pos, SEEK_SET); + + return length; +} + +AbstractFile* createAbstractFileFromFile(FILE* file) { + AbstractFile* toReturn; + + if(file == NULL) { + return NULL; + } + + toReturn = (AbstractFile*) malloc(sizeof(AbstractFile)); + toReturn->data = file; + toReturn->read = freadWrapper; + toReturn->write = fwriteWrapper; + toReturn->seek = fseekWrapper; + toReturn->tell = ftellWrapper; + toReturn->getLength = fileGetLength; + toReturn->close = fcloseWrapper; + toReturn->type = AbstractFileTypeFile; + toReturn->user = 0; + toReturn->progress = 0; + return toReturn; +} + +size_t dummyRead(AbstractFile* file, void* data, size_t len) { + return 0; +} + +size_t dummyWrite(AbstractFile* file, const void* data, size_t len) { + *((off_t*) (file->data)) += len; + return len; +} + +int dummySeek(AbstractFile* file, off_t offset) { + *((off_t*) (file->data)) = offset; + return 0; +} + +off_t dummyTell(AbstractFile* file) { + return *((off_t*) (file->data)); +} + +void dummyClose(AbstractFile* file) { + free(file); +} + +AbstractFile* createAbstractFileFromDummy() { + AbstractFile* toReturn; + toReturn = (AbstractFile*) malloc(sizeof(AbstractFile)); + toReturn->data = NULL; + toReturn->read = dummyRead; + toReturn->write = dummyWrite; + toReturn->seek = dummySeek; + toReturn->tell = dummyTell; + toReturn->getLength = NULL; + toReturn->close = dummyClose; + toReturn->type = AbstractFileTypeDummy; + toReturn->user = 0; + toReturn->progress = 0; + return toReturn; +} + +size_t memRead(AbstractFile* file, void* data, size_t len) { + MemWrapperInfo* info = (MemWrapperInfo*) (file->data); + memcpy(data, (void*)((uint8_t*)(*(info->buffer)) + (uint32_t)info->offset), len); + info->offset += (size_t)len; + return len; +} + +size_t memWrite(AbstractFile* file, const void* data, size_t len) { + MemWrapperInfo* info = (MemWrapperInfo*) (file->data); + + while((info->offset + (size_t)len) > info->bufferSize) { + info->bufferSize <<= 1; + *(info->buffer) = realloc(*(info->buffer), info->bufferSize); + } + + memcpy((void*)((uint8_t*)(*(info->buffer)) + (uint32_t)info->offset), data, len); + info->offset += (size_t)len; + return len; +} + +int memSeek(AbstractFile* file, off_t offset) { + MemWrapperInfo* info = (MemWrapperInfo*) (file->data); + info->offset = (size_t)offset; + return 0; +} + +off_t memTell(AbstractFile* file) { + MemWrapperInfo* info = (MemWrapperInfo*) (file->data); + return (off_t)info->offset; +} + +off_t memGetLength(AbstractFile* file) { + MemWrapperInfo* info = (MemWrapperInfo*) (file->data); + return info->bufferSize; +} + +void memClose(AbstractFile* file) { + free(file->data); + free(file); +} + +AbstractFile* createAbstractFileFromMemory(void** buffer, size_t size) { + MemWrapperInfo* info; + AbstractFile* toReturn; + toReturn = (AbstractFile*) malloc(sizeof(AbstractFile)); + + info = (MemWrapperInfo*) malloc(sizeof(MemWrapperInfo)); + info->offset = 0; + info->buffer = buffer; + info->bufferSize = size; + + toReturn->data = info; + toReturn->read = memRead; + toReturn->write = memWrite; + toReturn->seek = memSeek; + toReturn->tell = memTell; + toReturn->getLength = memGetLength; + toReturn->close = memClose; + toReturn->type = AbstractFileTypeMem; + toReturn->user = 0; + toReturn->progress = 0; + return toReturn; +} + +void abstractFilePrint(AbstractFile* file, const char* format, ...) { + va_list args; + char buffer[1024]; + size_t length; + + buffer[0] = '\0'; + va_start(args, format); + length = vsprintf(buffer, format, args); + va_end(args); + ASSERT(file->write(file, buffer, length) == length, "fwrite"); +} + +int absFileRead(io_func* io, off_t location, size_t size, void *buffer) { + AbstractFile* file; + file = (AbstractFile*) io->data; + file->seek(file, location); + if(file->read(file, buffer, size) == size) { + return TRUE; + } else { + return FALSE; + } +} + +int absFileWrite(io_func* io, off_t location, size_t size, void *buffer) { + AbstractFile* file; + file = (AbstractFile*) io->data; + file->seek(file, location); + if(file->write(file, buffer, size) == size) { + return TRUE; + } else { + return FALSE; + } +} + +void closeAbsFile(io_func* io) { + AbstractFile* file; + file = (AbstractFile*) io->data; + file->close(file); + free(io); +} + + +io_func* IOFuncFromAbstractFile(AbstractFile* file) { + io_func* io; + + io = (io_func*) malloc(sizeof(io_func)); + io->data = file; + io->read = &absFileRead; + io->write = &absFileWrite; + io->close = &closeAbsFile; + + return io; +} + +size_t memFileRead(AbstractFile* file, void* data, size_t len) { + MemFileWrapperInfo* info = (MemFileWrapperInfo*) (file->data); + memcpy(data, (void*)((uint8_t*)(*(info->buffer)) + (uint32_t)info->offset), len); + info->offset += (size_t)len; + return len; +} + +size_t memFileWrite(AbstractFile* file, const void* data, size_t len) { + MemFileWrapperInfo* info = (MemFileWrapperInfo*) (file->data); + + while((info->offset + (size_t)len) > info->actualBufferSize) { + info->actualBufferSize <<= 1; + *(info->buffer) = realloc(*(info->buffer), info->actualBufferSize); + } + + if((info->offset + (size_t)len) > (*(info->bufferSize))) { + *(info->bufferSize) = info->offset + (size_t)len; + } + + memcpy((void*)((uint8_t*)(*(info->buffer)) + (uint32_t)info->offset), data, len); + info->offset += (size_t)len; + return len; +} + +int memFileSeek(AbstractFile* file, off_t offset) { + MemFileWrapperInfo* info = (MemFileWrapperInfo*) (file->data); + info->offset = (size_t)offset; + return 0; +} + +off_t memFileTell(AbstractFile* file) { + MemFileWrapperInfo* info = (MemFileWrapperInfo*) (file->data); + return (off_t)info->offset; +} + +off_t memFileGetLength(AbstractFile* file) { + MemFileWrapperInfo* info = (MemFileWrapperInfo*) (file->data); + return *(info->bufferSize); +} + +void memFileClose(AbstractFile* file) { + free(file->data); + free(file); +} + +AbstractFile* createAbstractFileFromMemoryFile(void** buffer, size_t* size) { + MemFileWrapperInfo* info; + AbstractFile* toReturn; + toReturn = (AbstractFile*) malloc(sizeof(AbstractFile)); + + info = (MemFileWrapperInfo*) malloc(sizeof(MemFileWrapperInfo)); + info->offset = 0; + info->buffer = buffer; + info->bufferSize = size; + info->actualBufferSize = (1024 < (*size)) ? (*size) : 1024; + if(info->actualBufferSize != *(info->bufferSize)) { + *(info->buffer) = realloc(*(info->buffer), info->actualBufferSize); + } + + toReturn->data = info; + toReturn->read = memFileRead; + toReturn->write = memFileWrite; + toReturn->seek = memFileSeek; + toReturn->tell = memFileTell; + toReturn->getLength = memFileGetLength; + toReturn->close = memFileClose; + toReturn->type = AbstractFileTypeMemFile; + toReturn->user = 0; + toReturn->progress = 0; + return toReturn; +} + +AbstractFile* createAbstractFileFromMemoryFileBuffer(void** buffer, size_t* size, size_t actualBufferSize) { + MemFileWrapperInfo* info; + AbstractFile* toReturn; + toReturn = (AbstractFile*) malloc(sizeof(AbstractFile)); + + info = (MemFileWrapperInfo*) malloc(sizeof(MemFileWrapperInfo)); + info->offset = 0; + info->buffer = buffer; + info->bufferSize = size; + info->actualBufferSize = actualBufferSize; + + toReturn->data = info; + toReturn->read = memFileRead; + toReturn->write = memFileWrite; + toReturn->seek = memFileSeek; + toReturn->tell = memFileTell; + toReturn->getLength = memFileGetLength; + toReturn->close = memFileClose; + toReturn->type = AbstractFileTypeMemFile; + toReturn->user = 0; + toReturn->progress = 0; + return toReturn; +} + diff --git a/req/winject/ext/winject_c/abstractfile.o b/req/winject/ext/winject_c/abstractfile.o new file mode 100644 index 0000000000000000000000000000000000000000..cc69549c4e7bf17e47f8d74aa898230775d9e1aa GIT binary patch literal 23868 zcmb_^34D~*-R}ENCSj5R684A$fwwlc>fJ-fkDAR}q ztgYJROKV$~s-<4Fe62{XdWEX(hu+qrZ7sI7T9-;~MeD|Wo^zh_&Loo{-|v10&ikDI zdiL`!=S=?VgSS2z;CX(AhYKRn%R($JLdTG>=v z-Ii9q>)Egf#TL9DjFfPk*L-EtOTh{k`4GU+&DLBc=NE*M50RpYkW|h;p^ZJDS$lH?57w%NAHmdo4fJVxj!CoMzX~@+F?9q20@0bzQus6}@5Y zdiQV3=PiFlrp0Y@v=&>^i+Wz2k_PCUV`0Vlh`8%C6+i8>&$)Bhixpe_maQSNA9@mjH_dkcb+xvIcv7f=y#swoOq;{md6qw#yV%e zMvt+?A7h)Ih+LGSKX>`u3wr33CZ2@)w8KARD_AR8mnQa7@?2Tsu;G^_-Z$Rnu9_Ra z@A52OAMMC zx%{VfvnVO;*Et~O=fx8HFL_+;Ga!~IrdCZrcY3rbG3B>SQ;POlX}{)5)pdoRf(Ye&>N+R=VP7YVx5a3of)wVKbCkemUz-MW0`+yS>n(|b5|wH zYx}P>@!QhGVOYI!Vol8ySO1uQIF@M3i*?SA#5!jg5A+&K_%V3yY|Hz?)`7EPr~P9+ z@>>)^?`E8azAa09pv-3X?BSrjj@EuLw0CDoUQnMNW2@ishr*X8j-<48;_*G4fws)H z;mZ;mB4vpd^kqhDtC`8M#C-IDOJXd!B*v0UVl25N#*#}G@0~x3H@Dc{`7zT$d*_!J zOdLoV(wskR-?m&o43jwjj)_eoE)q6DjLf%4(LfHssqSSL@CH z{QS=EcYf!m%zTuA#?zzrlPeP5i4g@k!4KA2cd% zG^Kk7pozW3iS?1iiP}6f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gxJyZ`NzbOC*0n@?En3E@b#01pX7{*-F}VlR4hFB)h3cwWz) z=d~1==CEFptFwDO4g<#x)ePnKloP?0BG()TOuEqNKxBtAf;?E5Jo^|w%IV*DV`T&X zSZq9b64fT{`AVBM$182poUXJi9EUZ{DN!b>S}ym9@{D$|IfG?0K*G95 zBBk`8j+)hCdrUQslc?smlRN-u&#A_7sIk4W>e6^s-KFu`j>^`xI9C{7*Ve*QtTp74 zPO8*Y);Czr+UAb-7PMncLq{79b5dz7jt!D!jd8%!9wWqI%X*x?)G=6FSrMwJ=@}e> zWx2d~Kc`~ZFjNRyi-a6V6f_b=K|_(~*;wQpLxWKbhf2{6=?BAYlTyQ;twgn<=Z5i= zYBWiYA#6E3j;aA^87TwTGE7tSP)RMl(doNDEQ%2a!!${mR!Wj=rXZj-4B2-! zX4D!v+MHeC(#bp^2y#F=@Q-xR4bJM*vRiCMuF*~#ypGG72PH`zSVqA#sK%CI^gX +#include +#include + +#ifdef WIN32 +#define fseeko fseeko64 +#define ftello ftello64 +#define off_t off64_t +#define mkdir(x, y) mkdir(x) +#endif + +#define TRUE 1 +#define FALSE 0 + +#define FLIPENDIAN(x) flipEndian((unsigned char *)(&(x)), sizeof(x)) +#define FLIPENDIANLE(x) flipEndianLE((unsigned char *)(&(x)), sizeof(x)) + +#define IS_BIG_ENDIAN 0 +#define IS_LITTLE_ENDIAN 1 + +#define TIME_OFFSET_FROM_UNIX 2082844800L +#define APPLE_TO_UNIX_TIME(x) ((x) - TIME_OFFSET_FROM_UNIX) +#define UNIX_TO_APPLE_TIME(x) ((x) + TIME_OFFSET_FROM_UNIX) + +#define ASSERT(x, m) if(!(x)) { fflush(stdout); fprintf(stderr, "error: %s\n", m); perror("error"); fflush(stderr); exit(1); } + +extern char endianness; + +static inline void flipEndian(unsigned char* x, int length) { + int i; + unsigned char tmp; + + if(endianness == IS_BIG_ENDIAN) { + return; + } else { + for(i = 0; i < (length / 2); i++) { + tmp = x[i]; + x[i] = x[length - i - 1]; + x[length - i - 1] = tmp; + } + } +} + +static inline void flipEndianLE(unsigned char* x, int length) { + int i; + unsigned char tmp; + + if(endianness == IS_LITTLE_ENDIAN) { + return; + } else { + for(i = 0; i < (length / 2); i++) { + tmp = x[i]; + x[i] = x[length - i - 1]; + x[length - i - 1] = tmp; + } + } +} + +struct io_func_struct; + +typedef int (*readFunc)(struct io_func_struct* io, off_t location, size_t size, void *buffer); +typedef int (*writeFunc)(struct io_func_struct* io, off_t location, size_t size, void *buffer); +typedef void (*closeFunc)(struct io_func_struct* io); + +typedef struct io_func_struct { + void* data; + readFunc read; + writeFunc write; + closeFunc close; +} io_func; + +#endif diff --git a/req/winject/ext/winject_c/mkhfz b/req/winject/ext/winject_c/mkhfz new file mode 100755 index 00000000..54cd9c75 --- /dev/null +++ b/req/winject/ext/winject_c/mkhfz @@ -0,0 +1,4 @@ +dd if=/dev/zero of=blank.hfs bs=512K count=1 +mkfs.hfsplus -v Shoes blank.hfs +gzip blank.hfs +mv blank.hfs.gz blank.hfz diff --git a/req/winject/ext/winject_c/mkmf.log b/req/winject/ext/winject_c/mkmf.log new file mode 100644 index 00000000..3a4ef305 --- /dev/null +++ b/req/winject/ext/winject_c/mkmf.log @@ -0,0 +1,33 @@ +have_library: checking for main() in -lz... -------------------- yes + +"gcc -o conftest -I/Users/ccoupe/.rvm/rubies/ruby-2.1.2/include/ruby-2.1.0/x86_64-darwin13.0 -I/Users/ccoupe/.rvm/rubies/ruby-2.1.2/include/ruby-2.1.0/ruby/backward -I/Users/ccoupe/.rvm/rubies/ruby-2.1.2/include/ruby-2.1.0 -I. -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/include -I/usr/local/opt/openssl/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wextra-tokens -fno-common -pipe -Iincludes -DRUBY_2_1 conftest.c -L. -L/Users/ccoupe/.rvm/rubies/ruby-2.1.2/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -L. -fstack-protector -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -lruby.2.1.0 -lpthread -ldl -lobjc " +checked program was: +/* begin */ +1: #include "ruby.h" +2: +3: int main(int argc, char **argv) +4: { +5: return 0; +6: } +/* end */ + +"gcc -o conftest -I/Users/ccoupe/.rvm/rubies/ruby-2.1.2/include/ruby-2.1.0/x86_64-darwin13.0 -I/Users/ccoupe/.rvm/rubies/ruby-2.1.2/include/ruby-2.1.0/ruby/backward -I/Users/ccoupe/.rvm/rubies/ruby-2.1.2/include/ruby-2.1.0 -I. -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/include -I/usr/local/opt/openssl/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wextra-tokens -fno-common -pipe -Iincludes -DRUBY_2_1 conftest.c -L. -L/Users/ccoupe/.rvm/rubies/ruby-2.1.2/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -L. -fstack-protector -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -lruby.2.1.0 -lz -lpthread -ldl -lobjc " +checked program was: +/* begin */ + 1: #include "ruby.h" + 2: + 3: /*top*/ + 4: extern int t(void); + 5: int main(int argc, char **argv) + 6: { + 7: if (argc > 1000000) { + 8: printf("%p", &t); + 9: } +10: +11: return 0; +12: } +13: int t(void) { void ((*volatile p)()); p = (void ((*)()))main; return 0; } +/* end */ + +-------------------- + diff --git a/req/winject/ext/winject_c/pe.h b/req/winject/ext/winject_c/pe.h new file mode 100644 index 00000000..070004f1 --- /dev/null +++ b/req/winject/ext/winject_c/pe.h @@ -0,0 +1,224 @@ +// +// pe.h, a description of the windows binary +// Originally part of anal_pe, Copyright 2005-2007 by Michael Kohn +// +// This header was licensed under the LGPL, so it's +// possible that this program may also be LGPL. +// + +struct dos_header_t +{ + unsigned short int e_magic; // Magic number + unsigned short int e_cblp; // Bytes on last page of file + unsigned short int e_cp; // Pages in file + unsigned short int e_crlc; // Relocations + unsigned short int e_cparhdr; // Size of header in paragraphs + unsigned short int e_minalloc; // Minimum extra paragraphs needed + unsigned short int e_maxalloc; // Maximum extra paragraphs needed + unsigned short int e_ss; // Initial (relative) SS value + unsigned short int e_sp; // Initial SP value + unsigned short int e_csum; // Checksum + unsigned short int e_ip; // Initial IP value + unsigned short int e_cs; // Initial (relative) CS value + unsigned short int e_lfarlc; // File address of relocation table + unsigned short int e_ovno; // Overlay number + unsigned char e_res[8]; // Reserved words + unsigned short int e_oemid; // OEM identifier (for e_oeminfo) + unsigned short int e_oeminfo; // OEM information; e_oemid specific + unsigned char e_res2[20]; // Reserved words + int e_lfanew; // File address of new exe header +}; + +struct image_file_header_t +{ + unsigned short int Machine; + unsigned short int NumberOfSections; + unsigned int TimeDateStamp; + unsigned int PointerToSymbolTable; + unsigned int NumberOfSymbols; + unsigned short int SizeOfOptionalHeader; + unsigned short int Characteristics; +}; + +struct image_data_directory_t +{ + unsigned int VirtualAddress; + unsigned int Size; +}; + +struct image_optional_header_t +{ + unsigned short int Magic; + unsigned char MajorLinkerVersion; + unsigned char MinorLinkerVersion; + unsigned int SizeOfCode; + unsigned int SizeOfInitializedData; + unsigned int SizeOfUninitializedData; + unsigned int AddressOfEntryPoint; + unsigned int BaseOfCode; + unsigned int BaseOfData; + unsigned int ImageBase; + unsigned int SectionAlignment; + unsigned int FileAlignment; + unsigned short int MajorOperatingSystemVersion; + unsigned short int MinorOperatingSystemVersion; + unsigned short int MajorImageVersion; + unsigned short int MinorImageVersion; + unsigned short int MajorSubsystemVersion; + unsigned short int MinorSubsystemVersion; + unsigned int Reserved1; + unsigned int SizeOfImage; + unsigned int SizeOfHeaders; + unsigned int CheckSum; + unsigned short int Subsystem; + unsigned short int DllCharacteristics; + unsigned int SizeOfStackReserve; + unsigned int SizeOfStackCommit; + unsigned int SizeOfHeapReserve; + unsigned int SizeOfHeapCommit; + unsigned int LoaderFlags; + unsigned int NumberOfRvaAndSizes; + int DataDirectoryCount; + int image_data_dir[32]; +}; + +struct section_header_t +{ + unsigned char Name[8]; + union + { + unsigned int PhysicalAddress; + unsigned int VirtualSize; + } Misc; + unsigned int VirtualAddress; + unsigned int SizeOfRawData; + unsigned int PointerToRawData; + unsigned int PointerToRelocations; + unsigned int PointerToLinenumbers; + unsigned short int NumberOfRelocations; + unsigned short int NumberOfLinenumbers; + unsigned int Characteristics; +}; + +struct resource_dir_t +{ + unsigned int Characteristics; + unsigned int TimeDateStamp; + unsigned short int MajorVersion; + unsigned short int MinorVersion; + unsigned short int NumberOfNamedEntries; + unsigned short int NumberOfIdEntries; +}; + +struct resource_dir_entry_t +{ + unsigned int Name; + unsigned int OffsetToData; +}; + +struct resource_data_t +{ + unsigned int OffsetToData; + unsigned int Size; + unsigned int CodePage; + unsigned int Reserved; +}; + +struct import_dir_t +{ + unsigned int FunctionNameList; + unsigned int TimeDateStamp; + unsigned int ForwardChain; + unsigned int ModuleName; + unsigned int FunctionAddressList; +}; + +struct export_dir_t +{ + unsigned int Characteristics; + unsigned int TimeDateStamp; + unsigned short int MajorVersion; + unsigned short int MinorVersion; + unsigned int Name; + unsigned int Base; + unsigned int NumberOfFunctions; + unsigned int NumberOfNames; + unsigned int AddressOfFunctions; + unsigned int AddressOfNames; + unsigned int AddressOfNameOrdinals; +}; + +struct vb_header_t +{ + char szVbMagic[5]; + unsigned short int wRuntimeBuild; + char szLangDll[15]; + char szSecLangDll[15]; + unsigned short int wRuntimeRevision; + unsigned int dwLCID; + unsigned int dwSecLCID; + unsigned int lpSubMain; + unsigned int lpProjectData; + unsigned int fMdlIntCtls; + unsigned int fMdlIntCtls2; + unsigned int dwThreadFlags; + unsigned int dwThreadCount; + unsigned short int wFormCount; + unsigned short int wExternalCount; + unsigned int dwThunkCount; + unsigned int lpGuiTable; + unsigned int lpExternalTable; + unsigned int lpComRegisterData; + unsigned int bSzProjectDescription; + unsigned int bSzProjectExeName; + unsigned int bSzProjectHelpFile; + unsigned int bSzProjectName; +}; + +struct com_reg_data_t +{ + unsigned int bRegInfo; + unsigned int bSZProjectName; + unsigned int bSZHelpDirectory; + unsigned int bSZProjectDescription; + unsigned char uuidProjectClsId[16]; + unsigned int dwTlbLcid; + unsigned short int wUnknown; + unsigned short int wTlbVerMajor; + unsigned short int wTlbVerMinor; +}; + +struct reg_info_t +{ + unsigned int bNextObject; + unsigned int bObjectName; + unsigned int bObjectDescription; + unsigned int dwInstancing; + unsigned int dwObjectId; + unsigned char uuidObject[16]; + unsigned int fIsInterface; + unsigned int bUidObjectIFace; + unsigned int bUidEventsIFace; + unsigned int fHasEvents; + unsigned int dwMiscStatus; + unsigned int fClassType; + unsigned short int fObjectType; + unsigned short int wToolboxBitmap32; + unsigned short int wDefaultIcon; + unsigned short int fIsDesigner; + unsigned int bDesignerData; + unsigned char szObjectName[1024]; +}; + +struct debug_directory_t +{ + unsigned int Characteristics; + unsigned int TimeDateStamp; + unsigned short int MajorVersion; + unsigned short int MinorVersion; + unsigned int Type; + unsigned int SizeOfData; + unsigned int AddressOfRawData; + unsigned int PointerToRawData; +}; + diff --git a/req/winject/ext/winject_c/winject.bundle b/req/winject/ext/winject_c/winject.bundle new file mode 100755 index 0000000000000000000000000000000000000000..778023329700756e32969860ad12d70e744a3463 GIT binary patch literal 32152 zcmeHw4|r6?x%WAnzd~Tw78R|Q2&kY15(FheGz+_Ww%uSXq0$yyLb4GQl9+4&t<F@;39pYx053N`&uBaD#WLF`&d($#h&o{?)D~%9 z(UuO%&F{6jcGL$l1+kt^jk?PGGV(FM(8}=YmT)W5<>vS5Je&DvG81B`CG#97UwvDo zbyd^#GDU8FTQ0XFmdSX9Rfbu4BQO+dZ(6sisUftgsj*q$?DlwD=GQMXP*~-c>xV+& zm7&Jgx;0@tCRe_`E9`LD92znE$VWYye&X}idL5~%B+ZV+r%JeXM+3=z!hAFBaDB6* zo1oq!=cnXieoncV&xLr^6ACr04z=C9W<~SrP)nrsxcthh?37A8;@tewWg%%Ow7Tx& z@~e{h)yRHA?97k#orzaHp-@9zq)s8`pIzThsY{McKE%%a?9hxG3ax0%jEdv)+amKD zpJB<$Pj`fq429~O*Q{x7Qo*_MZIk)s@~QN>;p``d$Tt{R_&L8XplnKwccNGhK9 z;qtuqr}TT zDlo(FKop@D@={h!hl{r=ygppt9;sWgIvi@Li>#b6efo^mt5)!BZC`Qo^qJGkr0T$7rk#&etasnFnzjV~REbLo@LYtK@d7&=oRKG=lNvawfs-2ezo>!5 zhWUrR1>d{`HgMT)_XLf&v8T7#{YY;byPq|WE!*Abp5W6&y!Q)>0_KOiJeY1$`Is~e zbN5aH!#tRJ55_pv0mm>qhG5c--i~ANIAs~h(>^V{F_*#%n(r9qfiHWnTQ<;&FtHX9lr!}KO(a5xgRO>Cnt~f$6j^c zJ{od)J9<6Hs|6VwroSKLdYkO_CjGkUf7~B?)4iz;VN_^ZpHlu*=M1V~?+7Zm0WqrX zY(`Oc!`jfF@`)JH41xNitUm%!|5>Piq%6@9VI{3~aN`!~cn9f3N4p4LE5b>~J4jnU zWt!MgcYG^Kv8sRB@$RUgwWfRB-0faW(e5Ag5w%S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0w2x4sT~VfxC)rtj|3vJWV|b6)m8EeNCbJRc z2t#n||+H +#include +#include +#include +#include +#include +#include "common.h" +#include "pe.h" + +char *pe_pad = "PADDINGXXPADDING"; +char endianness; + +void TestByteOrder() +{ + short int word = 0x0001; + char *byte = (char *) &word; + endianness = byte[0] ? IS_LITTLE_ENDIAN : IS_BIG_ENDIAN; +} + +unsigned short int swap16(unsigned short int x) +{ + return (x >> 8) | (x << 8); +} + +unsigned int swap32(unsigned int x) +{ + return (x >> 24) | (x << 24) | + ((x << 8) & 0x00FF0000) | + ((x >> 8) & 0x0000FF00); +} + +#if 0 +unsigned long long swap64(unsigned long long x) +{ + return (x >> 56) | (x << 56) | + ((x << 40) & 0x00FF000000000000) | + ((x >> 40) & 0x000000000000FF00) | + ((x << 24) & 0x0000FF0000000000) | + ((x >> 24) & 0x0000000000FF0000) | + ((x << 8) & 0x000000FF00000000) | + ((x >> 8) & 0x00000000FF000000); +} +#endif + +typedef struct { + struct dos_header_t dos_header; + struct image_file_header_t image_file_header; + struct image_optional_header_t image_optional_header; + struct section_header_t section_header; + struct resource_dir_t resource_dir; + struct resource_dir_entry_t resource_dir_entry; + struct resource_data_t resource_data; + int resource_type[16]; + struct resource_data_t resources[16]; + int resource_count; + int ids, resids; + unsigned int namestart, datastart, datapos, dataend, vdelta; + char signature[4]; + VALUE adds, proc; + FILE *file, *out; +} winject_exe_t; + +#define BUFSIZE 16384 + +static void +winject_exe_mark(winject_exe_t *binj) +{ + rb_gc_mark_maybe(binj->adds); +} + +static void +winject_exe_free(winject_exe_t *binj) +{ + if (binj->file != NULL) + fclose(binj->file); + free(binj); +} + +VALUE +winject_exe_alloc(VALUE klass) +{ + winject_exe_t *binj = ALLOC(winject_exe_t); + MEMZERO(binj, winject_exe_t, 1); + binj->adds = rb_ary_new(); + binj->proc = Qnil; + return Data_Wrap_Struct(klass, winject_exe_mark, winject_exe_free, binj); +} + +#define BINJ_READ(binj, stct) \ + fread(&(stct), sizeof(stct), 1, binj->file) +#define BINJ_READ_POS(binj, stct, pos) \ + { \ + int mark = ftell(binj->file); \ + fseek(binj->file, pos, SEEK_SET); \ + BINJ_READ(binj, stct); \ + fseek(binj->file, mark, SEEK_SET); \ + } +#define BINJ_WRITE(binj, stct) \ + fwrite(&(stct), sizeof(stct), 1, binj->out) + +void +winject_exe_resources(winject_exe_t *binj, int offset, int level, int res_type) +{ + int count = 0, i = 0; + BINJ_READ_POS(binj, binj->resource_dir, binj->section_header.PointerToRawData + offset); + FLIPENDIANLE(binj->resource_dir.NumberOfNamedEntries); + FLIPENDIANLE(binj->resource_dir.NumberOfIdEntries); + if (level == 1) + binj->ids++; + if (level == 2) + binj->resids++; + + offset += 16; + count = binj->resource_dir.NumberOfNamedEntries + binj->resource_dir.NumberOfIdEntries; + for (i = 0; i < count; i++) + { + BINJ_READ_POS(binj, binj->resource_dir_entry, binj->section_header.PointerToRawData + offset); + FLIPENDIANLE(binj->resource_dir_entry.OffsetToData); + + if ((binj->resource_dir_entry.OffsetToData & 0x80000000) == 0) + { + struct resource_data_t *rdata = &binj->resource_data; + if (res_type == 0 || res_type == 10 || res_type == 6) + { + binj->resource_type[binj->resource_count] = res_type; + rdata = &binj->resources[binj->resource_count]; + binj->resource_count++; + } + + BINJ_READ_POS(binj, *rdata, binj->section_header.PointerToRawData + + binj->resource_dir_entry.OffsetToData); + } + else + { + if (level == 0) + { + // print_resource_type(binj->resource_dir_entry.Name, level); + winject_exe_resources(binj, + (binj->resource_dir_entry.OffsetToData & 0x7fffffff), level + 1, + binj->resource_dir_entry.Name); + } + else + { + winject_exe_resources(binj, + (binj->resource_dir_entry.OffsetToData & 0x7fffffff), level + 1, + res_type); + } + } + offset += 8; + } +} + +#define BINJ_COPY(dest, src, stct, off, off2) \ + src = (stct *)(buf + off); \ + dest = (stct *)(out + off2); \ + MEMCPY(dest, src, stct, 1) + +VALUE +winject_exe_get_key(winject_exe_t *binj, VALUE klass, int index) +{ + long i; + for (i = 0; i < RARRAY_LEN(binj->adds); i++) + { + VALUE obj = rb_ary_entry(binj->adds, i); + if (rb_obj_is_kind_of(rb_ary_entry(obj, 1), klass)) + { + if (index == 0) return rb_ary_entry(obj, 0); + index--; + } + } + return Qnil; +} + +unsigned int +winject_exe_write_name(winject_exe_t *binj, char *out, VALUE klass, int index) +{ + long i; + char *str; + unsigned short int *datlen; + VALUE key = winject_exe_get_key(binj, klass, index); + datlen = (unsigned short int *)(out + binj->namestart); + *datlen = (unsigned short int)RSTRING_LEN(key); + FLIPENDIANLE(*datlen); + str = RSTRING_PTR(key); + for (i = 0; i < RSTRING_LEN(key); i++) + { + datlen = (unsigned short int *)(out + binj->namestart + 2 + (i * 2)); + *datlen = (unsigned short int)str[i]; + FLIPENDIANLE(*datlen); + } + return 2 + (RSTRING_LEN(key) * 2); +} + +VALUE +winject_exe_get_type(winject_exe_t *binj, VALUE klass, int index) +{ + long i; + for (i = 0; i < RARRAY_LEN(binj->adds); i++) + { + VALUE obj = rb_ary_entry(rb_ary_entry(binj->adds, i), 1); + if (rb_obj_is_kind_of(obj, klass)) + { + if (index == 0) return obj; + index--; + } + } + return Qnil; +} + +int +winject_exe_count_type(winject_exe_t *binj, VALUE klass) +{ + long i, count = 0; + for (i = 0; i < RARRAY_LEN(binj->adds); i++) + { + VALUE obj = rb_ary_entry(binj->adds, i); + if (rb_obj_is_kind_of(rb_ary_entry(obj, 1), klass)) + count++; + } + return count; +} + +int +winject_exe_new_ids(winject_exe_t *binj) +{ + long i = 0; + if (winject_exe_count_type(binj, rb_cString)) i++; + if (winject_exe_count_type(binj, rb_cFile)) i++; + return i; +} + +int +winject_exe_names_len(winject_exe_t *binj) +{ + int i, len = 0; + for (i = 0; i < RARRAY_LEN(binj->adds); i++) + { + VALUE obj = rb_ary_entry(rb_ary_entry(binj->adds, i), 0); + len += 2 + (RSTRING_LEN(obj) * 2); + } + return len; +} + +long AnotherGetFileSize ( FILE * hFile ) +{ + long lCurPos, lEndPos; + if ( hFile == NULL ) + return 0; + lCurPos = ftell ( hFile ); + fseek ( hFile, 0, 2 ); + lEndPos = ftell ( hFile ); + fseek ( hFile, lCurPos, 0 ); + return lEndPos; +} + +unsigned int +winject_exe_file_size(VALUE obj) +{ + struct stat st; + rb_io_t *fptr; + FILE *fres; + GetOpenFile(obj, fptr); + rb_io_check_readable(fptr); +#ifndef RUBY_1_8 + fres = rb_io_stdio_file(fptr); + st.st_size = AnotherGetFileSize(fres); +#else + fres = GetReadFile(fptr); + fstat(fileno(fres), &st); +#endif + return (unsigned int)st.st_size; +} + +int +winject_exe_data_len(winject_exe_t *binj) +{ + unsigned int i, len = 0; + for (i = 0; i < RARRAY_LEN(binj->adds); i++) + { + VALUE obj = rb_ary_entry(rb_ary_entry(binj->adds, i), 1); + if (rb_obj_is_kind_of(obj, rb_cFile)) + len += winject_exe_file_size(obj); + else if (rb_obj_is_kind_of(obj, rb_cFile)) + len += RSTRING_LEN(obj); + } + return len; +} + +void +winject_exe_string_copy(winject_exe_t *binj, char *str, unsigned int size, unsigned int pos, VALUE proc) +{ + int mark = ftell(binj->out); + fseek(binj->out, pos, SEEK_SET); + fwrite(str, sizeof(char), size, binj->out); + if (RTEST(proc)) + rb_funcall(proc, rb_intern("call"), 1, INT2NUM(size)); + fseek(binj->out, mark, SEEK_SET); +} + +void +winject_exe_file_copy(FILE *file, FILE *out, unsigned int size, unsigned int pos1, unsigned int pos2, VALUE proc) +{ + char buf[BUFSIZE]; + int mark1 = ftell(file), mark2 = ftell(out); + fseek(file, pos1, SEEK_SET); + fseek(out, pos2, SEEK_SET); + while (size > 0) + { + unsigned int len = size > BUFSIZE ? BUFSIZE : size; + fread(buf, sizeof(char), len, file); + fwrite(buf, sizeof(char), len, out); + if (RTEST(proc)) + rb_funcall(proc, rb_intern("call"), 1, INT2NUM(len)); + size -= len; + } + fseek(file, mark1, SEEK_SET); + fseek(out, mark2, SEEK_SET); +} + +#ifndef RUBY_1_8 +void +winject_exe_file_copy1(rb_io_t *fptr, FILE *out, unsigned int size, unsigned int pos1, unsigned int pos2, VALUE proc) +{ + char buf[BUFSIZE]; + FILE *file; + file = rb_io_stdio_file(fptr); + + int mark1 = ftell(file), mark2 = ftell(out); + fseek(file, pos1, SEEK_SET); + fseek(out, pos2, SEEK_SET); + while (size > 0) + { + unsigned int len = size > BUFSIZE ? BUFSIZE : size; + //fread(buf, sizeof(char), len, file); + read(fptr->fd, buf, sizeof(char) * len); + fwrite(buf, sizeof(char), len, out); + if (RTEST(proc)) + rb_funcall(proc, rb_intern("call"), 1, INT2NUM(len)); + size -= len; + } + fseek(file, mark1, SEEK_SET); + fseek(out, mark2, SEEK_SET); +} +#endif + +int +winject_exe_offset(winject_exe_t *binj, int level, int res_type) +{ + unsigned int offset = winject_exe_new_ids(binj) * 8; + if (level > 0 || (level == 0 && res_type > 10)) + offset += (RARRAY_LEN(binj->adds) * 8) + (winject_exe_new_ids(binj) * 16); + if (level > 1 || (level == 1 && res_type > 10)) + offset += (RARRAY_LEN(binj->adds) * 24); + if (level == 2 && res_type > 10) + offset += RARRAY_LEN(binj->adds) * 16; + return offset; +} + +#define BINJ_PAD(num, base) \ + ((((num - 1) / base) + 1) * base) + +// +// This rewrite assumes the .rsrc section doesn't include any strings or user data +// and that the other data sections include only items without names and with one +// locale leaf each. +// +int +winject_exe_rewrite(winject_exe_t *binj, char *buf, char *out, int offset, int offset2, int level, int res_type) +{ + int count = 0, i = 0, ins = 0; + unsigned int newoff; + struct resource_dir_t *rd, *rd2; + struct resource_dir_entry_t *rde, *rde2; + struct resource_data_t *rdat, *rdat2; + // printf("DIR[%d]: %x TO %x\n", level, offset, offset2); + BINJ_COPY(rd2, rd, struct resource_dir_t, offset, offset2); + FLIPENDIANLE(rd->NumberOfIdEntries); + FLIPENDIANLE(rd->NumberOfNamedEntries); + FLIPENDIANLE(rd2->NumberOfIdEntries); + FLIPENDIANLE(rd2->NumberOfNamedEntries); + if (level == 0) + { + ins = winject_exe_new_ids(binj); + rd2->NumberOfIdEntries += winject_exe_new_ids(binj); + binj->ids = rd2->NumberOfIdEntries; + binj->namestart = 16 + + (rd2->NumberOfIdEntries * (8 + sizeof(struct resource_data_t))) + + ((binj->resids + RARRAY_LEN(binj->adds)) * ((2 * 8) + (2 * sizeof(struct resource_dir_t)))); + binj->datastart = BINJ_PAD(binj->namestart + winject_exe_names_len(binj), 4); + binj->datapos = binj->section_header.PointerToRawData + binj->datastart; + binj->vdelta = binj->section_header.VirtualAddress - binj->section_header.PointerToRawData; + // printf("DATAPOS: %x\n", binj->datapos); + } + else + { + ins = RARRAY_LEN(binj->adds); + } + FLIPENDIANLE(rd2->NumberOfIdEntries); + FLIPENDIANLE(rd2->NumberOfNamedEntries); + + offset += 16; + offset2 += 16; + count = rd->NumberOfNamedEntries + rd->NumberOfIdEntries; + for (i = 0; i < count; i++) + { + rde = (struct resource_dir_entry_t *)(buf + offset); + FLIPENDIANLE(rde->Name); + FLIPENDIANLE(rde->OffsetToData); + if (level == 0) + res_type = rde->Name; + if (level == 0 && res_type > 10 && ins > 0) + { + VALUE obj, key, ctype; + unsigned int ti = 0, i2 = 0, doff = 0, doff2 = 0, doff3 = 0, doff4 = 0, + btype = 0, oc = 0, padlen = 0, oo = 0; + for (ti = 0; ti < 2; ti++) + { + ctype = (ti == 0 ? rb_cString : rb_cFile); + btype = (ti == 0 ? 6 : 10); + // printf("\nNEW ID\n"); + if (winject_exe_count_type(binj, ctype)) + { + rde = (struct resource_dir_entry_t *)(buf + offset); + rde2 = (struct resource_dir_entry_t *)(out + offset2); + + rde2->Name = btype; + rde2->OffsetToData = rde->OffsetToData + winject_exe_offset(binj, 0, btype) + (ti * 16) + (oc * 8); + // printf("STRING ENTRY[0] @ %x (%u, %x)\n", (char *)rde2 - out, rde2->Name, rde2->OffsetToData); + oo = rde->OffsetToData & 0x7fffffff; + doff = rde2->OffsetToData & 0x7fffffff; + FLIPENDIANLE(rde2->Name); + FLIPENDIANLE(rde2->OffsetToData); + + rd2 = (struct resource_dir_t *)(out + doff); + rd2->NumberOfNamedEntries = winject_exe_count_type(binj, ctype); + FLIPENDIANLE(rd2->NumberOfNamedEntries); + // printf("STRING DIR[1]: %x\n", doff); + + for (i2 = 0; i2 < winject_exe_count_type(binj, ctype); i2++) + { + rde = (struct resource_dir_entry_t *)(buf + oo + 16); + doff3 = rde->OffsetToData; + FLIPENDIANLE(doff3); + rde2 = (struct resource_dir_entry_t *)(out + doff + 16 + (i2 * 8)); + // printf("STRING ENTRY[1] @ %x / NAME(%x)\n", (char *)rde2 - out, binj->namestart); + rde2->Name = 0x80000000 | binj->namestart; + rde2->OffsetToData = doff3 + winject_exe_offset(binj, 1, btype) + (oc * 24); + binj->namestart += winject_exe_write_name(binj, out, ctype, i2); + + doff2 = rde2->OffsetToData & 0x7fffffff; + FLIPENDIANLE(rde2->Name); + FLIPENDIANLE(rde2->OffsetToData); + + rd2 = (struct resource_dir_t *)(out + doff2); + rd2->NumberOfIdEntries = 1; + FLIPENDIANLE(rd2->NumberOfIdEntries); + // printf("STRING DIR[2]: %x / %x (%x)\n", rde2->Name, rde2->OffsetToData, doff3); + rde = (struct resource_dir_entry_t *)(buf + (doff3 & 0x7fffffff) + 16); + doff4 = rde->OffsetToData; + FLIPENDIANLE(doff4); + + rde2 = (struct resource_dir_entry_t *)(out + doff2 + 16); + // printf("STRING ENTRY[2] @ %x\n", (char *)rde2 - out); + rde2->OffsetToData = doff4 + winject_exe_offset(binj, 2, btype) + (oc * 16); + // printf("RESDATA: %x / %x\n", doff4, rde2->OffsetToData); + obj = winject_exe_get_type(binj, ctype, i2); + // printf("DATA: %x\n", binj->datapos); + rdat = (struct resource_data_t *)(out + (rde2->OffsetToData)); + rdat->OffsetToData = binj->datapos + binj->vdelta; + if (ctype == rb_cString) + { + rdat->Size = RSTRING_LEN(obj); + winject_exe_string_copy(binj, RSTRING_PTR(obj), RSTRING_LEN(obj), binj->datapos, binj->proc); + } + else + { + rb_io_t *fptr; + rdat->Size = winject_exe_file_size(obj); + GetOpenFile(obj, fptr); +#ifndef RUBY_1_8 +#ifdef SHOES_MINGW32 + winject_exe_file_copy1(fptr, binj->out, rdat->Size, 0, binj->datapos, binj->proc); +#else + winject_exe_file_copy(rb_io_stdio_file(fptr), binj->out, rdat->Size, 0, binj->datapos, binj->proc); +#endif +#else + winject_exe_file_copy(GetReadFile(fptr), binj->out, rdat->Size, 0, binj->datapos, binj->proc); +#endif + } + binj->datapos += rdat->Size; + padlen = BINJ_PAD(rdat->Size, 4) - rdat->Size; + if (padlen > 0) + { + winject_exe_string_copy(binj, pe_pad, padlen, binj->datapos, binj->proc); + binj->datapos += padlen; + } + + FLIPENDIANLE(rdat->Size); + FLIPENDIANLE(rdat->OffsetToData); + FLIPENDIANLE(rde2->OffsetToData); + oc++; + } + offset2 += 8; + } + } + } + + // printf("ENTRY[%d]: %x TO %x\n", level, offset, offset2); + BINJ_COPY(rde2, rde, struct resource_dir_entry_t, offset, offset2); + + // offset every entry to leave a hole for new stuff + rde2->OffsetToData += winject_exe_offset(binj, level, res_type); + if ((rde->OffsetToData & 0x80000000) == 0) + { + unsigned int dataoff = offset2 + rde2->OffsetToData; + BINJ_COPY(rdat2, rdat, struct resource_data_t, rde->OffsetToData, rde2->OffsetToData); + FLIPENDIANLE(rdat->Size); + FLIPENDIANLE(rdat->OffsetToData); + FLIPENDIANLE(rdat2->Size); + FLIPENDIANLE(rdat2->OffsetToData); + rdat2->OffsetToData = binj->datapos + binj->vdelta; + // printf("RESDATA: %x TO %x AT %x / %x\n", rde->OffsetToData, rde2->OffsetToData, + // binj->namestart, binj->datastart); + winject_exe_file_copy(binj->file, binj->out, rdat->Size, + rdat->OffsetToData - binj->vdelta, binj->datapos, binj->proc); + // printf("DATA: %x TO %x\n", rdat->OffsetToData, binj->datapos); + binj->datapos += rdat->Size; + binj->dataend = (rdat->OffsetToData - binj->vdelta) + rdat->Size; + FLIPENDIANLE(rdat2->Size); + FLIPENDIANLE(rdat2->OffsetToData); + } + else + { + if (level == 0) + { + winject_exe_rewrite(binj, buf, out, + rde->OffsetToData & 0x7fffffff, rde2->OffsetToData & 0x7fffffff, level + 1, + res_type); + } + else + { + winject_exe_rewrite(binj, buf, out, + rde->OffsetToData & 0x7fffffff, rde2->OffsetToData & 0x7fffffff, level + 1, + res_type); + } + } + + FLIPENDIANLE(rde2->Name); + FLIPENDIANLE(rde2->OffsetToData); + offset += 8; + offset2 += 8; + } + return offset; +} + +VALUE +winject_exe_load(VALUE self, VALUE file) +{ + int i, lfanew; + winject_exe_t *binj; + Data_Get_Struct(self, winject_exe_t, binj); +#ifndef RUBY_1_8 + binj->file = fopen(RSTRING_PTR(file), "rb"); +#else + binj->file = rb_fopen(RSTRING_PTR(file), "rb"); +#endif + BINJ_READ(binj, binj->dos_header); + FLIPENDIANLE(binj->dos_header.e_lfanew); + fseek(binj->file, binj->dos_header.e_lfanew, SEEK_SET); + BINJ_READ(binj, binj->signature); + BINJ_READ(binj, binj->image_file_header); + FLIPENDIANLE(binj->image_file_header.SizeOfOptionalHeader); + FLIPENDIANLE(binj->image_file_header.NumberOfSections); + if (binj->image_file_header.SizeOfOptionalHeader != 0) + { + fread(&binj->image_optional_header, sizeof(char), + binj->image_file_header.SizeOfOptionalHeader, binj->file); + } + + for (i = 0; i < binj->image_file_header.NumberOfSections; i++) + { + BINJ_READ(binj, binj->section_header); + FLIPENDIANLE(binj->section_header.VirtualAddress); + FLIPENDIANLE(binj->section_header.PointerToRawData); + + if (strcmp(binj->section_header.Name, ".rsrc") == 0) + winject_exe_resources(binj, 0, 0, 0); + } +} + +VALUE +winject_exe_inject(VALUE self, VALUE key, VALUE obj) +{ + winject_exe_t *binj; + Data_Get_Struct(self, winject_exe_t, binj); + rb_ary_push(binj->adds, rb_ary_new3(2, key, obj)); +} + +VALUE +winject_exe_save(VALUE self, VALUE file) +{ + int i; + size_t len, pos; + winject_exe_t *binj; + char buf[BUFSIZE]; + char buf2[BUFSIZE]; + Data_Get_Struct(self, winject_exe_t, binj); +#ifndef RUBY_1_8 + binj->out = fopen(RSTRING_PTR(file), "wb"); +#else + binj->out = rb_fopen(RSTRING_PTR(file), "wb"); +#endif + binj->ids = 0; + binj->namestart = 0; + binj->datastart = 0; + binj->datapos = 0; + binj->proc = rb_block_proc(); + fseek(binj->file, 0, SEEK_SET); + + pos = 0; + while (!feof(binj->file)) + { + int rlen = BUFSIZE; + if (pos < binj->section_header.PointerToRawData && pos + rlen > binj->section_header.PointerToRawData) + rlen = binj->section_header.PointerToRawData - pos; + + len = fread(buf, sizeof(char), rlen, binj->file); + if (pos == binj->section_header.PointerToRawData) + { + MEMZERO(buf2, char, BUFSIZE); + len = winject_exe_rewrite(binj, buf, buf2, 0, 0, 0, 0); + fwrite(buf2, sizeof(char), binj->datastart, binj->out); + // printf("FINISHING AT: %x / %x\n", binj->dataend, binj->datapos); + fseek(binj->out, binj->datapos, SEEK_SET); + fseek(binj->file, 0, SEEK_END); + } + else + { + fwrite(buf, sizeof(char), len, binj->out); + } + pos += len; + } + + unsigned int posend = BINJ_PAD(binj->datapos, 0x1000); + unsigned int grow = posend - ftell(binj->file); + unsigned int actual = binj->datapos - binj->section_header.PointerToRawData; + // printf("GROW: %x / ACTUAL: %x (%x / %x)\n", grow, actual, binj->datapos, binj->dataend); + fseek(binj->file, 0, SEEK_SET); + fseek(binj->out, 0, SEEK_SET); + fread(buf, sizeof(char), 1024, binj->file); + unsigned int *uninit = (unsigned int *)(buf + (binj->dos_header.e_lfanew + 32)); + FLIPENDIANLE(*uninit); + *uninit += grow - binj->vdelta; + FLIPENDIANLE(*uninit); + uninit = (unsigned int *)(buf + (binj->dos_header.e_lfanew + 80)); + FLIPENDIANLE(*uninit); + *uninit += grow; + FLIPENDIANLE(*uninit); + int *resd = (int *)(buf + (binj->dos_header.e_lfanew + 140)); + *resd = actual; + FLIPENDIANLE(*resd); + resd = (int *)(buf + (binj->dos_header.e_lfanew + 376)); + *resd = actual; + FLIPENDIANLE(*resd); + uninit = (unsigned int *)(buf + (binj->dos_header.e_lfanew + 384)); + FLIPENDIANLE(*uninit); + *uninit += grow; + FLIPENDIANLE(*uninit); + fwrite(buf, sizeof(char), 1024, binj->out); + + fseek(binj->out, binj->datapos, SEEK_SET); + while (binj->datapos < posend) + { + int len = posend - binj->datapos; + if (len > 16) len = 16; + fwrite(pe_pad, sizeof(char), len, binj->out); + binj->datapos += len; + } + // printf("SIZE: %x\n", ftell(binj->out)); + fclose(binj->out); + binj->out = NULL; +} + + +void Init_winject() +{ + VALUE cWinject = rb_define_module("Winject"); + VALUE cEXE = rb_define_class_under(cWinject, "EXE", rb_cObject); + rb_define_alloc_func(cEXE, winject_exe_alloc); + rb_define_method(cEXE, "initialize", winject_exe_load, 1); + rb_define_method(cEXE, "inject", winject_exe_inject, 2); + rb_define_method(cEXE, "save", winject_exe_save, 1); + + TestByteOrder(); +} diff --git a/req/winject/ext/winject_c/winject.o b/req/winject/ext/winject_c/winject.o new file mode 100644 index 0000000000000000000000000000000000000000..7f94434c0cf8e23b9f4930746f8e59aade7c6fea GIT binary patch literal 68324 zcmdSCd3+RA7C&0m-3gtAB*=~+k$@p6OV|Vjr6Iv?NFa~|L6#F5ouexG}B_3I;(y#StA87gSVGFwTe@qNsV_bL*U{PIodtXWsAq@#@o6XSwH| zd+xdCE>+c4^~TTt`mK$o>2?hV>;$(&;*f|PTUYEOh;C)uvdc(lV3{>cL#IZ2d(P+e z`U;o&m;ms4bJC~hShQdzeGQECIe?CNS<`+dmP1=ZKsK+ppm1K*d~b1SQ5o^P-n6S- zQ^!lPCVCe3H&~YpG+@H(n)aN5+Du^}qAzdWyo$ob;rfo`8q)2^LD=q?Wx$|g%lazv zO6M0=hS_&=x{-4(E7-4Dbqm`kL`qDYqT<8nlni+=#=qp>asH{|ELhX}&%55oP zCJg0!z4Iz7%~TaH&FWjr{k}_(40jd93D=ibUS3k@EzMhm-Vq*uC%C@9u#yM4zFXnH z%ZxIbRoUw`^p(xKHlLD1gbjZD1_pxyfnBNk{;pR%t!FF#aY#1qZ+z5F}%`IeQp zSl<-Zx0mDZ6zf}hR?}`YiVCq0?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