├── .gitignore
├── LICENSE
├── README
├── dirs
├── include
├── opcodemap.h
├── raisepanic.h
├── registers.h
└── x64emu.h
├── make.bat
├── make
├── copybin.bat
└── ddkbuild.bat
├── sample
├── dirs
├── make.bat
└── x64disasm
│ ├── main.cpp
│ ├── make.bat
│ ├── makefile
│ ├── sources
│ ├── x64disasm.vcxproj
│ └── x64disasm.vcxproj.user
├── unit_test
├── dirs
├── make.bat
├── x64emudecode32
│ ├── main.cpp
│ ├── make.bat
│ ├── makefile
│ ├── opcodesamples.h
│ ├── sources
│ ├── x64emudecode32.vcxproj
│ └── x64emudecode32.vcxproj.user
├── x64emudecode64
│ ├── DbgEng.h
│ ├── DbgHelp.h
│ ├── DbgProp.h
│ ├── libamd64
│ │ └── dbgeng.lib
│ ├── main.cpp
│ ├── make.bat
│ ├── makefile
│ ├── sources
│ ├── x64emu.cpp
│ ├── x64emudecode64.vcxproj
│ └── x64emudecode64.vcxproj.user
└── x64emuexec
│ ├── amd64
│ └── testops.asm
│ ├── main.cpp
│ ├── make.bat
│ ├── makefile
│ ├── sources
│ ├── x64emu.cpp
│ └── x64emuexec.vcxproj
├── x64emu.sln
└── x64emu
├── make.bat
├── sources
├── x64emu.cpp
├── x64emu.vcxproj
└── x64emu.vcxproj.filters
/.gitignore:
--------------------------------------------------------------------------------
1 | # Compiled Object files
2 | *.slo
3 | *.lo
4 | *.o
5 | *.obj
6 |
7 | # Precompiled Headers
8 | *.gch
9 | *.pch
10 |
11 | # Compiled Dynamic libraries
12 | *.so
13 | *.dylib
14 | *.dll
15 |
16 | # Fortran module files
17 | *.mod
18 |
19 | # Compiled Static libraries
20 | *.lai
21 | *.la
22 | *.a
23 | #*.lib
24 |
25 | # Executables
26 | *.exe
27 | *.out
28 | *.app
29 |
30 | # Log/err/wrn files
31 | *.log
32 | *.wrn
33 | *.err
34 |
35 | # VS stuff
36 | *.opensdf
37 | *.sdf
38 | *.suo
39 |
40 | # Output and object dirs
41 | amd64rel
42 | amd64dbg
43 | unit_test/x64emudecode32/objfre_win7_amd64/
44 | unit_test/x64emudecode64/objfre_win7_amd64/
45 | unit_test/x64emuexec/objfre_win7_amd64/
46 | x64emu/objfre_win7_amd64/
47 | unit_test/x64emudecode32/objchk_win7_amd64/
48 | unit_test/x64emudecode64/objchk_win7_amd64/
49 | unit_test/x64emuexec/objchk_win7_amd64/
50 | x64emu/objchk_win7_amd64/
51 | sample/x64disasm/objchk_win7_amd64/amd64
52 | sample/x64disasm/objfre_win7_amd64/amd64
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | x64 Emulator Library
2 | Copyright (c) 2010-2012 Svetoslav Vassilev
3 |
4 | -------------------------------------------------------------------------------
5 |
6 | GNU GENERAL PUBLIC LICENSE
7 | Version 3, 29 June 2007
8 |
9 | Copyright (C) 2007 Free Software Foundation, Inc.
10 | Everyone is permitted to copy and distribute verbatim copies
11 | of this license document, but changing it is not allowed.
12 |
13 | Preamble
14 |
15 | The GNU General Public License is a free, copyleft license for
16 | software and other kinds of works.
17 |
18 | The licenses for most software and other practical works are designed
19 | to take away your freedom to share and change the works. By contrast,
20 | the GNU General Public License is intended to guarantee your freedom to
21 | share and change all versions of a program--to make sure it remains free
22 | software for all its users. We, the Free Software Foundation, use the
23 | GNU General Public License for most of our software; it applies also to
24 | any other work released this way by its authors. You can apply it to
25 | your programs, too.
26 |
27 | When we speak of free software, we are referring to freedom, not
28 | price. Our General Public Licenses are designed to make sure that you
29 | have the freedom to distribute copies of free software (and charge for
30 | them if you wish), that you receive source code or can get it if you
31 | want it, that you can change the software or use pieces of it in new
32 | free programs, and that you know you can do these things.
33 |
34 | To protect your rights, we need to prevent others from denying you
35 | these rights or asking you to surrender the rights. Therefore, you have
36 | certain responsibilities if you distribute copies of the software, or if
37 | you modify it: responsibilities to respect the freedom of others.
38 |
39 | For example, if you distribute copies of such a program, whether
40 | gratis or for a fee, you must pass on to the recipients the same
41 | freedoms that you received. You must make sure that they, too, receive
42 | or can get the source code. And you must show them these terms so they
43 | know their rights.
44 |
45 | Developers that use the GNU GPL protect your rights with two steps:
46 | (1) assert copyright on the software, and (2) offer you this License
47 | giving you legal permission to copy, distribute and/or modify it.
48 |
49 | For the developers' and authors' protection, the GPL clearly explains
50 | that there is no warranty for this free software. For both users' and
51 | authors' sake, the GPL requires that modified versions be marked as
52 | changed, so that their problems will not be attributed erroneously to
53 | authors of previous versions.
54 |
55 | Some devices are designed to deny users access to install or run
56 | modified versions of the software inside them, although the manufacturer
57 | can do so. This is fundamentally incompatible with the aim of
58 | protecting users' freedom to change the software. The systematic
59 | pattern of such abuse occurs in the area of products for individuals to
60 | use, which is precisely where it is most unacceptable. Therefore, we
61 | have designed this version of the GPL to prohibit the practice for those
62 | products. If such problems arise substantially in other domains, we
63 | stand ready to extend this provision to those domains in future versions
64 | of the GPL, as needed to protect the freedom of users.
65 |
66 | Finally, every program is threatened constantly by software patents.
67 | States should not allow patents to restrict development and use of
68 | software on general-purpose computers, but in those that do, we wish to
69 | avoid the special danger that patents applied to a free program could
70 | make it effectively proprietary. To prevent this, the GPL assures that
71 | patents cannot be used to render the program non-free.
72 |
73 | The precise terms and conditions for copying, distribution and
74 | modification follow.
75 |
76 | TERMS AND CONDITIONS
77 |
78 | 0. Definitions.
79 |
80 | "This License" refers to version 3 of the GNU General Public License.
81 |
82 | "Copyright" also means copyright-like laws that apply to other kinds of
83 | works, such as semiconductor masks.
84 |
85 | "The Program" refers to any copyrightable work licensed under this
86 | License. Each licensee is addressed as "you". "Licensees" and
87 | "recipients" may be individuals or organizations.
88 |
89 | To "modify" a work means to copy from or adapt all or part of the work
90 | in a fashion requiring copyright permission, other than the making of an
91 | exact copy. The resulting work is called a "modified version" of the
92 | earlier work or a work "based on" the earlier work.
93 |
94 | A "covered work" means either the unmodified Program or a work based
95 | on the Program.
96 |
97 | To "propagate" a work means to do anything with it that, without
98 | permission, would make you directly or secondarily liable for
99 | infringement under applicable copyright law, except executing it on a
100 | computer or modifying a private copy. Propagation includes copying,
101 | distribution (with or without modification), making available to the
102 | public, and in some countries other activities as well.
103 |
104 | To "convey" a work means any kind of propagation that enables other
105 | parties to make or receive copies. Mere interaction with a user through
106 | a computer network, with no transfer of a copy, is not conveying.
107 |
108 | An interactive user interface displays "Appropriate Legal Notices"
109 | to the extent that it includes a convenient and prominently visible
110 | feature that (1) displays an appropriate copyright notice, and (2)
111 | tells the user that there is no warranty for the work (except to the
112 | extent that warranties are provided), that licensees may convey the
113 | work under this License, and how to view a copy of this License. If
114 | the interface presents a list of user commands or options, such as a
115 | menu, a prominent item in the list meets this criterion.
116 |
117 | 1. Source Code.
118 |
119 | The "source code" for a work means the preferred form of the work
120 | for making modifications to it. "Object code" means any non-source
121 | form of a work.
122 |
123 | A "Standard Interface" means an interface that either is an official
124 | standard defined by a recognized standards body, or, in the case of
125 | interfaces specified for a particular programming language, one that
126 | is widely used among developers working in that language.
127 |
128 | The "System Libraries" of an executable work include anything, other
129 | than the work as a whole, that (a) is included in the normal form of
130 | packaging a Major Component, but which is not part of that Major
131 | Component, and (b) serves only to enable use of the work with that
132 | Major Component, or to implement a Standard Interface for which an
133 | implementation is available to the public in source code form. A
134 | "Major Component", in this context, means a major essential component
135 | (kernel, window system, and so on) of the specific operating system
136 | (if any) on which the executable work runs, or a compiler used to
137 | produce the work, or an object code interpreter used to run it.
138 |
139 | The "Corresponding Source" for a work in object code form means all
140 | the source code needed to generate, install, and (for an executable
141 | work) run the object code and to modify the work, including scripts to
142 | control those activities. However, it does not include the work's
143 | System Libraries, or general-purpose tools or generally available free
144 | programs which are used unmodified in performing those activities but
145 | which are not part of the work. For example, Corresponding Source
146 | includes interface definition files associated with source files for
147 | the work, and the source code for shared libraries and dynamically
148 | linked subprograms that the work is specifically designed to require,
149 | such as by intimate data communication or control flow between those
150 | subprograms and other parts of the work.
151 |
152 | The Corresponding Source need not include anything that users
153 | can regenerate automatically from other parts of the Corresponding
154 | Source.
155 |
156 | The Corresponding Source for a work in source code form is that
157 | same work.
158 |
159 | 2. Basic Permissions.
160 |
161 | All rights granted under this License are granted for the term of
162 | copyright on the Program, and are irrevocable provided the stated
163 | conditions are met. This License explicitly affirms your unlimited
164 | permission to run the unmodified Program. The output from running a
165 | covered work is covered by this License only if the output, given its
166 | content, constitutes a covered work. This License acknowledges your
167 | rights of fair use or other equivalent, as provided by copyright law.
168 |
169 | You may make, run and propagate covered works that you do not
170 | convey, without conditions so long as your license otherwise remains
171 | in force. You may convey covered works to others for the sole purpose
172 | of having them make modifications exclusively for you, or provide you
173 | with facilities for running those works, provided that you comply with
174 | the terms of this License in conveying all material for which you do
175 | not control copyright. Those thus making or running the covered works
176 | for you must do so exclusively on your behalf, under your direction
177 | and control, on terms that prohibit them from making any copies of
178 | your copyrighted material outside their relationship with you.
179 |
180 | Conveying under any other circumstances is permitted solely under
181 | the conditions stated below. Sublicensing is not allowed; section 10
182 | makes it unnecessary.
183 |
184 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
185 |
186 | No covered work shall be deemed part of an effective technological
187 | measure under any applicable law fulfilling obligations under article
188 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
189 | similar laws prohibiting or restricting circumvention of such
190 | measures.
191 |
192 | When you convey a covered work, you waive any legal power to forbid
193 | circumvention of technological measures to the extent such circumvention
194 | is effected by exercising rights under this License with respect to
195 | the covered work, and you disclaim any intention to limit operation or
196 | modification of the work as a means of enforcing, against the work's
197 | users, your or third parties' legal rights to forbid circumvention of
198 | technological measures.
199 |
200 | 4. Conveying Verbatim Copies.
201 |
202 | You may convey verbatim copies of the Program's source code as you
203 | receive it, in any medium, provided that you conspicuously and
204 | appropriately publish on each copy an appropriate copyright notice;
205 | keep intact all notices stating that this License and any
206 | non-permissive terms added in accord with section 7 apply to the code;
207 | keep intact all notices of the absence of any warranty; and give all
208 | recipients a copy of this License along with the Program.
209 |
210 | You may charge any price or no price for each copy that you convey,
211 | and you may offer support or warranty protection for a fee.
212 |
213 | 5. Conveying Modified Source Versions.
214 |
215 | You may convey a work based on the Program, or the modifications to
216 | produce it from the Program, in the form of source code under the
217 | terms of section 4, provided that you also meet all of these conditions:
218 |
219 | a) The work must carry prominent notices stating that you modified
220 | it, and giving a relevant date.
221 |
222 | b) The work must carry prominent notices stating that it is
223 | released under this License and any conditions added under section
224 | 7. This requirement modifies the requirement in section 4 to
225 | "keep intact all notices".
226 |
227 | c) You must license the entire work, as a whole, under this
228 | License to anyone who comes into possession of a copy. This
229 | License will therefore apply, along with any applicable section 7
230 | additional terms, to the whole of the work, and all its parts,
231 | regardless of how they are packaged. This License gives no
232 | permission to license the work in any other way, but it does not
233 | invalidate such permission if you have separately received it.
234 |
235 | d) If the work has interactive user interfaces, each must display
236 | Appropriate Legal Notices; however, if the Program has interactive
237 | interfaces that do not display Appropriate Legal Notices, your
238 | work need not make them do so.
239 |
240 | A compilation of a covered work with other separate and independent
241 | works, which are not by their nature extensions of the covered work,
242 | and which are not combined with it such as to form a larger program,
243 | in or on a volume of a storage or distribution medium, is called an
244 | "aggregate" if the compilation and its resulting copyright are not
245 | used to limit the access or legal rights of the compilation's users
246 | beyond what the individual works permit. Inclusion of a covered work
247 | in an aggregate does not cause this License to apply to the other
248 | parts of the aggregate.
249 |
250 | 6. Conveying Non-Source Forms.
251 |
252 | You may convey a covered work in object code form under the terms
253 | of sections 4 and 5, provided that you also convey the
254 | machine-readable Corresponding Source under the terms of this License,
255 | in one of these ways:
256 |
257 | a) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by the
259 | Corresponding Source fixed on a durable physical medium
260 | customarily used for software interchange.
261 |
262 | b) Convey the object code in, or embodied in, a physical product
263 | (including a physical distribution medium), accompanied by a
264 | written offer, valid for at least three years and valid for as
265 | long as you offer spare parts or customer support for that product
266 | model, to give anyone who possesses the object code either (1) a
267 | copy of the Corresponding Source for all the software in the
268 | product that is covered by this License, on a durable physical
269 | medium customarily used for software interchange, for a price no
270 | more than your reasonable cost of physically performing this
271 | conveying of source, or (2) access to copy the
272 | Corresponding Source from a network server at no charge.
273 |
274 | c) Convey individual copies of the object code with a copy of the
275 | written offer to provide the Corresponding Source. This
276 | alternative is allowed only occasionally and noncommercially, and
277 | only if you received the object code with such an offer, in accord
278 | with subsection 6b.
279 |
280 | d) Convey the object code by offering access from a designated
281 | place (gratis or for a charge), and offer equivalent access to the
282 | Corresponding Source in the same way through the same place at no
283 | further charge. You need not require recipients to copy the
284 | Corresponding Source along with the object code. If the place to
285 | copy the object code is a network server, the Corresponding Source
286 | may be on a different server (operated by you or a third party)
287 | that supports equivalent copying facilities, provided you maintain
288 | clear directions next to the object code saying where to find the
289 | Corresponding Source. Regardless of what server hosts the
290 | Corresponding Source, you remain obligated to ensure that it is
291 | available for as long as needed to satisfy these requirements.
292 |
293 | e) Convey the object code using peer-to-peer transmission, provided
294 | you inform other peers where the object code and Corresponding
295 | Source of the work are being offered to the general public at no
296 | charge under subsection 6d.
297 |
298 | A separable portion of the object code, whose source code is excluded
299 | from the Corresponding Source as a System Library, need not be
300 | included in conveying the object code work.
301 |
302 | A "User Product" is either (1) a "consumer product", which means any
303 | tangible personal property which is normally used for personal, family,
304 | or household purposes, or (2) anything designed or sold for incorporation
305 | into a dwelling. In determining whether a product is a consumer product,
306 | doubtful cases shall be resolved in favor of coverage. For a particular
307 | product received by a particular user, "normally used" refers to a
308 | typical or common use of that class of product, regardless of the status
309 | of the particular user or of the way in which the particular user
310 | actually uses, or expects or is expected to use, the product. A product
311 | is a consumer product regardless of whether the product has substantial
312 | commercial, industrial or non-consumer uses, unless such uses represent
313 | the only significant mode of use of the product.
314 |
315 | "Installation Information" for a User Product means any methods,
316 | procedures, authorization keys, or other information required to install
317 | and execute modified versions of a covered work in that User Product from
318 | a modified version of its Corresponding Source. The information must
319 | suffice to ensure that the continued functioning of the modified object
320 | code is in no case prevented or interfered with solely because
321 | modification has been made.
322 |
323 | If you convey an object code work under this section in, or with, or
324 | specifically for use in, a User Product, and the conveying occurs as
325 | part of a transaction in which the right of possession and use of the
326 | User Product is transferred to the recipient in perpetuity or for a
327 | fixed term (regardless of how the transaction is characterized), the
328 | Corresponding Source conveyed under this section must be accompanied
329 | by the Installation Information. But this requirement does not apply
330 | if neither you nor any third party retains the ability to install
331 | modified object code on the User Product (for example, the work has
332 | been installed in ROM).
333 |
334 | The requirement to provide Installation Information does not include a
335 | requirement to continue to provide support service, warranty, or updates
336 | for a work that has been modified or installed by the recipient, or for
337 | the User Product in which it has been modified or installed. Access to a
338 | network may be denied when the modification itself materially and
339 | adversely affects the operation of the network or violates the rules and
340 | protocols for communication across the network.
341 |
342 | Corresponding Source conveyed, and Installation Information provided,
343 | in accord with this section must be in a format that is publicly
344 | documented (and with an implementation available to the public in
345 | source code form), and must require no special password or key for
346 | unpacking, reading or copying.
347 |
348 | 7. Additional Terms.
349 |
350 | "Additional permissions" are terms that supplement the terms of this
351 | License by making exceptions from one or more of its conditions.
352 | Additional permissions that are applicable to the entire Program shall
353 | be treated as though they were included in this License, to the extent
354 | that they are valid under applicable law. If additional permissions
355 | apply only to part of the Program, that part may be used separately
356 | under those permissions, but the entire Program remains governed by
357 | this License without regard to the additional permissions.
358 |
359 | When you convey a copy of a covered work, you may at your option
360 | remove any additional permissions from that copy, or from any part of
361 | it. (Additional permissions may be written to require their own
362 | removal in certain cases when you modify the work.) You may place
363 | additional permissions on material, added by you to a covered work,
364 | for which you have or can give appropriate copyright permission.
365 |
366 | Notwithstanding any other provision of this License, for material you
367 | add to a covered work, you may (if authorized by the copyright holders of
368 | that material) supplement the terms of this License with terms:
369 |
370 | a) Disclaiming warranty or limiting liability differently from the
371 | terms of sections 15 and 16 of this License; or
372 |
373 | b) Requiring preservation of specified reasonable legal notices or
374 | author attributions in that material or in the Appropriate Legal
375 | Notices displayed by works containing it; or
376 |
377 | c) Prohibiting misrepresentation of the origin of that material, or
378 | requiring that modified versions of such material be marked in
379 | reasonable ways as different from the original version; or
380 |
381 | d) Limiting the use for publicity purposes of names of licensors or
382 | authors of the material; or
383 |
384 | e) Declining to grant rights under trademark law for use of some
385 | trade names, trademarks, or service marks; or
386 |
387 | f) Requiring indemnification of licensors and authors of that
388 | material by anyone who conveys the material (or modified versions of
389 | it) with contractual assumptions of liability to the recipient, for
390 | any liability that these contractual assumptions directly impose on
391 | those licensors and authors.
392 |
393 | All other non-permissive additional terms are considered "further
394 | restrictions" within the meaning of section 10. If the Program as you
395 | received it, or any part of it, contains a notice stating that it is
396 | governed by this License along with a term that is a further
397 | restriction, you may remove that term. If a license document contains
398 | a further restriction but permits relicensing or conveying under this
399 | License, you may add to a covered work material governed by the terms
400 | of that license document, provided that the further restriction does
401 | not survive such relicensing or conveying.
402 |
403 | If you add terms to a covered work in accord with this section, you
404 | must place, in the relevant source files, a statement of the
405 | additional terms that apply to those files, or a notice indicating
406 | where to find the applicable terms.
407 |
408 | Additional terms, permissive or non-permissive, may be stated in the
409 | form of a separately written license, or stated as exceptions;
410 | the above requirements apply either way.
411 |
412 | 8. Termination.
413 |
414 | You may not propagate or modify a covered work except as expressly
415 | provided under this License. Any attempt otherwise to propagate or
416 | modify it is void, and will automatically terminate your rights under
417 | this License (including any patent licenses granted under the third
418 | paragraph of section 11).
419 |
420 | However, if you cease all violation of this License, then your
421 | license from a particular copyright holder is reinstated (a)
422 | provisionally, unless and until the copyright holder explicitly and
423 | finally terminates your license, and (b) permanently, if the copyright
424 | holder fails to notify you of the violation by some reasonable means
425 | prior to 60 days after the cessation.
426 |
427 | Moreover, your license from a particular copyright holder is
428 | reinstated permanently if the copyright holder notifies you of the
429 | violation by some reasonable means, this is the first time you have
430 | received notice of violation of this License (for any work) from that
431 | copyright holder, and you cure the violation prior to 30 days after
432 | your receipt of the notice.
433 |
434 | Termination of your rights under this section does not terminate the
435 | licenses of parties who have received copies or rights from you under
436 | this License. If your rights have been terminated and not permanently
437 | reinstated, you do not qualify to receive new licenses for the same
438 | material under section 10.
439 |
440 | 9. Acceptance Not Required for Having Copies.
441 |
442 | You are not required to accept this License in order to receive or
443 | run a copy of the Program. Ancillary propagation of a covered work
444 | occurring solely as a consequence of using peer-to-peer transmission
445 | to receive a copy likewise does not require acceptance. However,
446 | nothing other than this License grants you permission to propagate or
447 | modify any covered work. These actions infringe copyright if you do
448 | not accept this License. Therefore, by modifying or propagating a
449 | covered work, you indicate your acceptance of this License to do so.
450 |
451 | 10. Automatic Licensing of Downstream Recipients.
452 |
453 | Each time you convey a covered work, the recipient automatically
454 | receives a license from the original licensors, to run, modify and
455 | propagate that work, subject to this License. You are not responsible
456 | for enforcing compliance by third parties with this License.
457 |
458 | An "entity transaction" is a transaction transferring control of an
459 | organization, or substantially all assets of one, or subdividing an
460 | organization, or merging organizations. If propagation of a covered
461 | work results from an entity transaction, each party to that
462 | transaction who receives a copy of the work also receives whatever
463 | licenses to the work the party's predecessor in interest had or could
464 | give under the previous paragraph, plus a right to possession of the
465 | Corresponding Source of the work from the predecessor in interest, if
466 | the predecessor has it or can get it with reasonable efforts.
467 |
468 | You may not impose any further restrictions on the exercise of the
469 | rights granted or affirmed under this License. For example, you may
470 | not impose a license fee, royalty, or other charge for exercise of
471 | rights granted under this License, and you may not initiate litigation
472 | (including a cross-claim or counterclaim in a lawsuit) alleging that
473 | any patent claim is infringed by making, using, selling, offering for
474 | sale, or importing the Program or any portion of it.
475 |
476 | 11. Patents.
477 |
478 | A "contributor" is a copyright holder who authorizes use under this
479 | License of the Program or a work on which the Program is based. The
480 | work thus licensed is called the contributor's "contributor version".
481 |
482 | A contributor's "essential patent claims" are all patent claims
483 | owned or controlled by the contributor, whether already acquired or
484 | hereafter acquired, that would be infringed by some manner, permitted
485 | by this License, of making, using, or selling its contributor version,
486 | but do not include claims that would be infringed only as a
487 | consequence of further modification of the contributor version. For
488 | purposes of this definition, "control" includes the right to grant
489 | patent sublicenses in a manner consistent with the requirements of
490 | this License.
491 |
492 | Each contributor grants you a non-exclusive, worldwide, royalty-free
493 | patent license under the contributor's essential patent claims, to
494 | make, use, sell, offer for sale, import and otherwise run, modify and
495 | propagate the contents of its contributor version.
496 |
497 | In the following three paragraphs, a "patent license" is any express
498 | agreement or commitment, however denominated, not to enforce a patent
499 | (such as an express permission to practice a patent or covenant not to
500 | sue for patent infringement). To "grant" such a patent license to a
501 | party means to make such an agreement or commitment not to enforce a
502 | patent against the party.
503 |
504 | If you convey a covered work, knowingly relying on a patent license,
505 | and the Corresponding Source of the work is not available for anyone
506 | to copy, free of charge and under the terms of this License, through a
507 | publicly available network server or other readily accessible means,
508 | then you must either (1) cause the Corresponding Source to be so
509 | available, or (2) arrange to deprive yourself of the benefit of the
510 | patent license for this particular work, or (3) arrange, in a manner
511 | consistent with the requirements of this License, to extend the patent
512 | license to downstream recipients. "Knowingly relying" means you have
513 | actual knowledge that, but for the patent license, your conveying the
514 | covered work in a country, or your recipient's use of the covered work
515 | in a country, would infringe one or more identifiable patents in that
516 | country that you have reason to believe are valid.
517 |
518 | If, pursuant to or in connection with a single transaction or
519 | arrangement, you convey, or propagate by procuring conveyance of, a
520 | covered work, and grant a patent license to some of the parties
521 | receiving the covered work authorizing them to use, propagate, modify
522 | or convey a specific copy of the covered work, then the patent license
523 | you grant is automatically extended to all recipients of the covered
524 | work and works based on it.
525 |
526 | A patent license is "discriminatory" if it does not include within
527 | the scope of its coverage, prohibits the exercise of, or is
528 | conditioned on the non-exercise of one or more of the rights that are
529 | specifically granted under this License. You may not convey a covered
530 | work if you are a party to an arrangement with a third party that is
531 | in the business of distributing software, under which you make payment
532 | to the third party based on the extent of your activity of conveying
533 | the work, and under which the third party grants, to any of the
534 | parties who would receive the covered work from you, a discriminatory
535 | patent license (a) in connection with copies of the covered work
536 | conveyed by you (or copies made from those copies), or (b) primarily
537 | for and in connection with specific products or compilations that
538 | contain the covered work, unless you entered into that arrangement,
539 | or that patent license was granted, prior to 28 March 2007.
540 |
541 | Nothing in this License shall be construed as excluding or limiting
542 | any implied license or other defenses to infringement that may
543 | otherwise be available to you under applicable patent law.
544 |
545 | 12. No Surrender of Others' Freedom.
546 |
547 | If conditions are imposed on you (whether by court order, agreement or
548 | otherwise) that contradict the conditions of this License, they do not
549 | excuse you from the conditions of this License. If you cannot convey a
550 | covered work so as to satisfy simultaneously your obligations under this
551 | License and any other pertinent obligations, then as a consequence you may
552 | not convey it at all. For example, if you agree to terms that obligate you
553 | to collect a royalty for further conveying from those to whom you convey
554 | the Program, the only way you could satisfy both those terms and this
555 | License would be to refrain entirely from conveying the Program.
556 |
557 | 13. Use with the GNU Affero General Public License.
558 |
559 | Notwithstanding any other provision of this License, you have
560 | permission to link or combine any covered work with a work licensed
561 | under version 3 of the GNU Affero General Public License into a single
562 | combined work, and to convey the resulting work. The terms of this
563 | License will continue to apply to the part which is the covered work,
564 | but the special requirements of the GNU Affero General Public License,
565 | section 13, concerning interaction through a network will apply to the
566 | combination as such.
567 |
568 | 14. Revised Versions of this License.
569 |
570 | The Free Software Foundation may publish revised and/or new versions of
571 | the GNU General Public License from time to time. Such new versions will
572 | be similar in spirit to the present version, but may differ in detail to
573 | address new problems or concerns.
574 |
575 | Each version is given a distinguishing version number. If the
576 | Program specifies that a certain numbered version of the GNU General
577 | Public License "or any later version" applies to it, you have the
578 | option of following the terms and conditions either of that numbered
579 | version or of any later version published by the Free Software
580 | Foundation. If the Program does not specify a version number of the
581 | GNU General Public License, you may choose any version ever published
582 | by the Free Software Foundation.
583 |
584 | If the Program specifies that a proxy can decide which future
585 | versions of the GNU General Public License can be used, that proxy's
586 | public statement of acceptance of a version permanently authorizes you
587 | to choose that version for the Program.
588 |
589 | Later license versions may give you additional or different
590 | permissions. However, no additional obligations are imposed on any
591 | author or copyright holder as a result of your choosing to follow a
592 | later version.
593 |
594 | 15. Disclaimer of Warranty.
595 |
596 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
597 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
598 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
599 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
600 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
601 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
602 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
603 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
604 |
605 | 16. Limitation of Liability.
606 |
607 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
608 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
609 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
610 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
611 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
612 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
613 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
614 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
615 | SUCH DAMAGES.
616 |
617 | 17. Interpretation of Sections 15 and 16.
618 |
619 | If the disclaimer of warranty and limitation of liability provided
620 | above cannot be given local legal effect according to their terms,
621 | reviewing courts shall apply local law that most closely approximates
622 | an absolute waiver of all civil liability in connection with the
623 | Program, unless a warranty or assumption of liability accompanies a
624 | copy of the Program in return for a fee.
625 |
626 | END OF TERMS AND CONDITIONS
627 |
628 | How to Apply These Terms to Your New Programs
629 |
630 | If you develop a new program, and you want it to be of the greatest
631 | possible use to the public, the best way to achieve this is to make it
632 | free software which everyone can redistribute and change under these terms.
633 |
634 | To do so, attach the following notices to the program. It is safest
635 | to attach them to the start of each source file to most effectively
636 | state the exclusion of warranty; and each file should have at least
637 | the "copyright" line and a pointer to where the full notice is found.
638 |
639 |
640 | Copyright (C)
641 |
642 | This program is free software: you can redistribute it and/or modify
643 | it under the terms of the GNU General Public License as published by
644 | the Free Software Foundation, either version 3 of the License, or
645 | (at your option) any later version.
646 |
647 | This program is distributed in the hope that it will be useful,
648 | but WITHOUT ANY WARRANTY; without even the implied warranty of
649 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
650 | GNU General Public License for more details.
651 |
652 | You should have received a copy of the GNU General Public License
653 | along with this program. If not, see .
654 |
655 | Also add information on how to contact you by electronic and paper mail.
656 |
657 | If the program does terminal interaction, make it output a short
658 | notice like this when it starts in an interactive mode:
659 |
660 | Copyright (C)
661 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
662 | This is free software, and you are welcome to redistribute it
663 | under certain conditions; type `show c' for details.
664 |
665 | The hypothetical commands `show w' and `show c' should show the appropriate
666 | parts of the General Public License. Of course, your program's commands
667 | might be different; for a GUI interface, you would use an "about box".
668 |
669 | You should also get your employer (if you work as a programmer) or school,
670 | if any, to sign a "copyright disclaimer" for the program, if necessary.
671 | For more information on this, and how to apply and follow the GNU GPL, see
672 | .
673 |
674 | The GNU General Public License does not permit incorporating your program
675 | into proprietary programs. If your program is a subroutine library, you
676 | may consider it more useful to permit linking proprietary applications with
677 | the library. If this is what you want to do, use the GNU Lesser General
678 | Public License instead of this License. But first, please read
679 | .
680 |
681 |
--------------------------------------------------------------------------------
/README:
--------------------------------------------------------------------------------
1 | X64EMU LIBRARY
2 |
3 | The x64emu is a light-weight and stripped-down IA-32e software emulator, built
4 | as a static library. The emulator was developed as part of a bigger project
5 | called SuperCell (distributed hypervisor, which unfortunately did not come to
6 | fruition) and the x64emu main design goals were:
7 | - Small footprint
8 | - Ability to execute in user/kernel/vmx root modes
9 | - Implement full-blown decode logic for both 32 and 64 bit modes of
10 | operation.
11 | - Being able to determine if an instruction writes to memory.
12 | - Implement emulation logic for instructions that write to memory.
13 |
14 | The project produces only x64 binaries. In order to build on Windows:
15 | - install WDK 7600 or later
16 | - set env variable MSWDK to point to the WDK install path, in my case:
17 | MSWDK=C:\WinDDK\7600.16385.1
18 | - open cmd.exe
19 | - execute: "make.bat amd64dbg" or "make.bat amd64rel"
20 | - the built library and unit-test binaries will be placed in .\amd64dbg
21 | or .\amd64rel
22 | A VS2012 solution and projects are available, which essentially use the WDK
23 | build system.
24 |
25 | Three unit tests were developed:
26 | - testemudecode32 - tests the decode logic of the emulator against a limited
27 | subset of instructions
28 | - testemudecode64 - tests the decode logic of the emulator against one
29 | million+ pseudo-randomly generated instruction streams and compares the
30 | results with the output from the windbg debug engine. testemudecode64
31 | can also decode instruction stream provided as command line argument.
32 | - testemuexec - tests the instruction emulation logic by comparing the
33 | state of the emulator after instruction execution against the state of
34 | the actual CPU after executing the same instruction. An attempt was made
35 | to cover all the possible operands for the supported instructions - total
36 | of 42 million instruction variants are covered.
37 |
38 | So why would one want to use x64emu? As stated in the design goals above, the
39 | main advantage of x64emu is that it has minimal footprint, does not depend on
40 | any 3rd party libraries and/or header files, and can execute in user, kernel
41 | or vmx root modes; furthermore the code can be fairly easily made platform
42 | independent. The main disadvantage of course is that it is not a full-blown
43 | emulator as the likes of qemu.
--------------------------------------------------------------------------------
/dirs:
--------------------------------------------------------------------------------
1 | DIRS = \
2 | x64emu \
3 | unit_test \
4 | sample
5 |
--------------------------------------------------------------------------------
/include/raisepanic.h:
--------------------------------------------------------------------------------
1 | /*
2 | * x64 Software Emulator (x64emu)
3 | * Copyright (c) 2010-2012 Svetoslav Vassilev
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Svetoslav Vassilev
19 | */
20 |
21 | #ifndef _RAISE_PANIC_H
22 | #define _RAISE_PANIC_H
23 |
24 | #ifndef SUPERCELL
25 | /*
26 | * panic stop codes follow.
27 | */
28 | #define PANIC_DEBUG_BREAK 0
29 | #define PANIC_INVALID_PORT_EXIT 1
30 | #define PANIC_VA_SPACE_EXHAUSTED 2
31 | #define PANIC_EPT_CONFIGURATION 3
32 | #define PANIC_DOMAIN0_INIT 4
33 | #define PANIC_DOMAIN0_SIPI 5
34 | #define PANIC_TEST_PANIC 6
35 | #define PANIC_UNMAP_INVALID_VA 7
36 | #define PANIC_UNEXPECTED_INTERRUPT 8
37 | #define PANIC_INVALID_PAGE_STATE 9
38 | #define PANIC_DSM_ERROR 10
39 | #define PANIC_VMRESUME_FAIL 11
40 | #define PANIC_PA_LOOKUP_FAIL 12
41 | #define PANIC_PAGETABLE_CORRUPT 13
42 | #define PANIC_VMXOFF_FAILED 14
43 | #define PANIC_RINGBUFFER_CTX_MISMATCH 15
44 | #define PANIC_STACKTHAW_FAILED 16
45 | #define PANIC_RINGBUFFER_LOST 17
46 | #define PANIC_DSM_FAILED_EPTVIOLATION 18
47 | #define PANIC_NO_EVENTCALLBACKS 19
48 | #define PANIC_VMCS_LOAD_FAILED 20
49 | #define PANIC_VCPU_CONTEXT_LIST_CORRUPT 21
50 | #define PANIC_NO_IO_READ_BUFFER 22
51 | #define PANIC_SEND_PORT_IO_FAILED 23
52 | #define PANIC_DOMAIN_NOT_FOUND 24
53 | #define PANIC_IO_HANDLER_NOT_FOUND 25
54 | #define PANIC_INTERRUPT_QUEUE_FAILED 26
55 | #define PANIC_UNEXPECTED_DELIVERY_TYPE 27
56 | #define PANIC_UNEXPECTED_APIC_ACCESS 29
57 | #define PANIC_EXCEPTION_DELIVERY_FAILED 30
58 | #define PANIC_NO_TRANSPORT 31
59 | #define PANIC_UNKNOWN_ADDRESS_TYPE 32
60 | #define PANIC_MMIOCONTEXT_MISMATCH 33
61 | #define PANIC_IOCONTEXT_MISMATCH 34
62 | #define PANIC_NO_SCI_VECTOR 35
63 | #define PANIC_GUEST_INTERRUPTS_MASKED 36
64 | #define PANIC_DOMAIN0_TRIPLEFAULT 37
65 | #define PANIC_INVALID_VECTOR 38
66 | #define PANIC_NO_PAT 39
67 | #define PANIC_UNITY_EPT_VIOLATION 40
68 | #define PANIC_X64EMU_ERROR 41
69 | #define PANIC_X64EMU_INVALID_CONTEXT 42
70 | #define PANIC_APIC_EOIQUEUE_ERROR 43
71 | #define PANIC_FREEING_MAPPED_MDL 44
72 | #define PANIC_BUILDING_MDL_FROM_GUEST 45
73 | #define PANIC_UNMAPPING_VMXROOT_MDL 46
74 | #define PANIC_UNMAPPED_MDL 47
75 | #define PANIC_MAPPING_VMXROOT_MDL 48
76 | #define PANIC_INVALID_LENGTH 49
77 | #define PANIC_NULL_ADDRESS 50
78 | #define PANIC_INVALID_PARAMETER 51
79 | #define PANIC_INVALID_MTRR_INDEX 52
80 | /* API called when not in vmxroot */
81 | #define PANIC_INVALID_CALL_CONTEXT 53
82 | /* unhandled GP fault (exception flags not clear on fault) */
83 | #define PANIC_UNEXPECTED_GP_FAULT 54
84 | /* error in faulting instruction decode in GP fault handler */
85 | #define PANIC_DECODE_ERROR_IN_GP_FAULT 55
86 | #define PANIC_PAGEPOOL_CORRUPT 56
87 | #define PANIC_INTERRUPT_CONTEXT_CORRUPT 57
88 | #define PANIC_EXCEPTION_ALREADY_PENDING 58
89 | #define PANIC_UNEXPECTED_REGISTER_ID 59
90 | #define PANIC_PAGEPOOL_ALLOC_FAILED 60
91 | #endif
92 |
93 | struct PANIC_PARAMS
94 | {
95 | __inline PANIC_PARAMS(
96 | struct _CPU_CONTEXT* _pCPUContext,
97 | INT32 _panicCode,
98 | const char* _pMessage = "",
99 | INT64 p1 = 0,
100 | INT64 p2 = 0,
101 | INT64 p3 = 0,
102 | INT64 p4 = 0)
103 | {
104 | this->pCPUContext = _pCPUContext;
105 | this->PanicCode = _panicCode;
106 | this->pMessage = _pMessage;
107 | this->P1 = p1;
108 | this->P2 = p2;
109 | this->P3 = p3;
110 | this->P4 = p4;
111 | }
112 | __inline PANIC_PARAMS(
113 | INT32 _panicCode,
114 | const char* _pMessage = "",
115 | INT64 p1 = 0,
116 | INT64 p2 = 0,
117 | INT64 p3 = 0,
118 | INT64 p4 = 0)
119 | {
120 | this->pCPUContext = 0;
121 | this->PanicCode = _panicCode;
122 | this->pMessage = _pMessage;
123 | this->P1 = p1;
124 | this->P2 = p2;
125 | this->P3 = p3;
126 | this->P4 = p4;
127 | }
128 | struct _CPU_CONTEXT* pCPUContext;
129 | INT32 PanicCode;
130 | const char* pMessage;
131 | INT64 P1;
132 | INT64 P2;
133 | INT64 P3;
134 | INT64 P4;
135 | };
136 |
137 | typedef void (*PanicHandlerT)(
138 | const char* pFile,
139 | UINT32 lineNo,
140 | const PANIC_PARAMS& params
141 | );
142 |
143 | #define RAISE_PANIC(MyPanicHandler,_params_) \
144 | MyPanicHandler( \
145 | __FILE__, \
146 | __LINE__, \
147 | PANIC_PARAMS _params_)
148 |
149 | #endif //#ifndef _RAISE_PANIC_H
150 |
--------------------------------------------------------------------------------
/include/registers.h:
--------------------------------------------------------------------------------
1 | /*
2 | * x64 Software Emulator (x64emu)
3 | * Copyright (c) 2010-2012 Svetoslav Vassilev
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Svetoslav Vassilev
19 | */
20 |
21 | #ifndef REGISTERS_H
22 | #define REGISTERS_H
23 |
24 | /*
25 | * Basically offsets from VMXRoot exit stack pointer.
26 | *
27 | * In ID order for exitQualification register IDs.
28 | */
29 | #define RAX_GUEST_ID (0)
30 | #define RCX_GUEST_ID (1)
31 | #define RDX_GUEST_ID (2)
32 | #define RBX_GUEST_ID (3)
33 | // RSP - we leave a un-used register save on the stack for RSP
34 | #define RSP_GUEST_ID (4)
35 | #define RBP_GUEST_ID (5)
36 | #define RSI_GUEST_ID (6)
37 | #define RDI_GUEST_ID (7)
38 | #define R8_GUEST_ID (8)
39 | #define R9_GUEST_ID (9)
40 | #define R10_GUEST_ID (10)
41 | #define R11_GUEST_ID (11)
42 | #define R12_GUEST_ID (12)
43 | #define R13_GUEST_ID (13)
44 | #define R14_GUEST_ID (14)
45 | #define R15_GUEST_ID (15)
46 | /*
47 | * These are actually saved in the VMCS (along with RSP above)
48 | */
49 | #define RIP_GUEST_ID (16)
50 | #define CR0_GUEST_ID (17)
51 | #define CR3_GUEST_ID (18)
52 | #define CR4_GUEST_ID (19)
53 | // CR8 is not saved in the VMCS, use the TPR access page or the actual
54 | // CR8 register to determine its value.
55 | #define RFLAGS_GUEST_ID (20)
56 |
57 | /*
58 | * These are also saved in the VMCS and return/set the segment base
59 | */
60 | #define ES_GUEST_ID (21)
61 | #define CS_GUEST_ID (22)
62 | #define SS_GUEST_ID (23)
63 | #define DS_GUEST_ID (24)
64 | #define FS_GUEST_ID (25)
65 | #define GS_GUEST_ID (26)
66 |
67 | #define DR0_GUEST_ID (27)
68 | #define DR1_GUEST_ID (28)
69 | #define DR2_GUEST_ID (29)
70 | #define DR3_GUEST_ID (30)
71 | #define DR6_GUEST_ID (31)
72 | #define DR7_GUEST_ID (32)
73 |
74 | /*
75 | * Called in vmxroot context only.
76 | *
77 | * These routines operate on the current VCPU (vmcs) only
78 | */
79 |
80 | UINT_PTR
81 | GetGuestContextRegisterValue(
82 | int registerId);
83 |
84 | void
85 | SetGuestContextRegisterValue(
86 | int registerId,
87 | UINT_PTR registerValue);
88 |
89 | #define RFLAGS_DF_BIT (1 << 10)
90 | #define RFLAGS_IF_BIT (1 << 9)
91 | #define RFLAGS_IOPL_BITS (0x3 << 12)
92 | #define RFLAGS_TF_BIT (1 << 8)
93 | #define RFLAGS_RF_BIT (1 << 16)
94 | #define RFLAGS_VM_BIT (1 << 17)
95 | #define RFLAGS_IOPL_MASK 0x1800
96 |
97 | #define CR0_PG_BIT (1 << 31)
98 |
99 | #endif
100 |
--------------------------------------------------------------------------------
/include/x64emu.h:
--------------------------------------------------------------------------------
1 | /*
2 | * x64 Software Emulator (x64emu)
3 | * Copyright (c) 2010-2012 Svetoslav Vassilev
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Svetoslav Vassilev
19 | */
20 |
21 | //
22 | //
23 | // This header contains necessary public definitions and function prototypes
24 | // for the implementation of stripped down x64 software emulator. All the
25 | // logic assumes that the guest CPU operates in IA-32e mode, where both 64 &
26 | // 32 bit of operation are supportted. The main purpose of the software
27 | // emulation is to execute instuctions that write data to
28 | // a page which is not held exclusively by this node. That said a certain
29 | // attempt was made to implement full blown decode logic to the extent where
30 | // we will know whether or not we have to emulate the faulting instruction.
31 | // The actual execution logic is stripped down to the subset of instructions
32 | // that have to be emulated.
33 | //
34 |
35 | #ifndef X64EMU_H
36 | #define X64EMU_H
37 |
38 | #ifdef __cplusplus
39 | extern "C" {
40 | #endif
41 |
42 | #include "raisepanic.h"
43 |
44 | #pragma warning (disable: 4201)
45 |
46 | union MODR_M_BYTE
47 | {
48 | struct
49 | {
50 | UINT8 Rm : 3;
51 | UINT8 Reg : 3;
52 | UINT8 Mod : 2;
53 | };
54 | UINT8 AsByte;
55 | };
56 |
57 | inline size_t GetDisplacementSize(const MODR_M_BYTE& modrm)
58 | {
59 | if (modrm.Mod == 0x0 && modrm.Rm == 0x5 ||
60 | modrm.Mod == 0x2)
61 | {
62 | return 4;
63 | }
64 | else if (modrm.Mod == 0x1)
65 | {
66 | return 1;
67 | }
68 | return 0;
69 | }
70 |
71 | inline bool IsSibPresent(const MODR_M_BYTE& modrm)
72 | {
73 | return modrm.Mod != 0x3 && modrm.Rm == 0x4;
74 | }
75 |
76 | union SIB_BYTE
77 | {
78 | struct
79 | {
80 | UINT8 Base : 3;
81 | UINT8 Index : 3;
82 | UINT8 Scale : 2;
83 | };
84 | UINT8 AsByte;
85 | };
86 |
87 | static const UINT8 REX_PREFIX_BEGIN = 0x40;
88 | static const UINT8 REX_PREFIX_END = 0x4F;
89 | static const UINT8 REX_PREFIX_B = 0x1;
90 | static const UINT8 REX_PREFIX_X = 0x2;
91 | static const UINT8 REX_PREFIX_R = 0x4;
92 | static const UINT8 REX_PREFIX_W = 0x8;
93 | union REX_PREFIX
94 | {
95 | struct
96 | {
97 | UINT8 B : 1;
98 | UINT8 X : 1;
99 | UINT8 R : 1;
100 | UINT8 W : 1;
101 | UINT8 Const : 4; // always 0100b / 0x4
102 | };
103 | UINT8 AsByte;
104 | };
105 |
106 | struct DECODED_FLAGS
107 | {
108 | UINT32 PrefixLen : 2;
109 | UINT32 PrefixLock : 1;
110 | UINT32 PrefixRepne : 1;
111 | UINT32 PrefixRepz : 1;
112 | UINT32 PrefixOpSizeOvr : 1;
113 | UINT32 PrefixAddrSizeOvr : 1;
114 | UINT32 PrefixNotIntersting : 1;
115 | UINT32 MandatoryPrefix : 1;
116 | UINT32 RexPresent : 1;
117 | UINT32 OpCodeLen : 2;
118 | UINT32 OperandCount : 3;
119 | UINT32 ModRmPresent : 1;
120 | UINT32 SibPresent : 1;
121 | UINT32 InstructionDecoded : 1;
122 | UINT32 WriteOp : 1;
123 | UINT32 OpCodeExtended : 1;
124 | UINT32 FpuInstruction : 1;
125 | UINT32 ImmediateOp : 1;
126 | UINT32 DecodedMnemonic : 1;
127 | UINT32 ImmediateOpSignX : 1;
128 | UINT32 StringOp : 1;
129 | };
130 |
131 | union X64_SEG_REGISTER
132 | {
133 | UINT16 AsUint16;
134 | struct
135 | {
136 | UINT16 Cpl : 2; // Current privilege level
137 | UINT16 Ldt : 1; // 0 - Gdt; 1 - Ldt
138 | UINT16 Index : 13; // Index in the descriptor table
139 | };
140 | };
141 |
142 | struct X64_SEG_DESCRIPTOR
143 | {
144 | union
145 | {
146 | struct
147 | {
148 | UINT32 Base23_26 : 8;
149 | UINT32 Type : 4;
150 | UINT32 SysDescr : 1;
151 | UINT32 Dpl : 2;
152 | UINT32 Present : 1;
153 | UINT32 SegLimit19_16 : 4;
154 | UINT32 Avl : 1;
155 | UINT32 L : 1; // 64 bit code segment
156 | UINT32 D_B : 1; // Def operation size 0 = 16, 1 = 32
157 | UINT32 G : 1;
158 | UINT32 Base31_24 : 8;
159 | };
160 | UINT32 Lo;
161 | };
162 | union
163 | {
164 | struct
165 | {
166 | UINT32 SegLimit : 16;
167 | UINT32 Base15_00 : 16;
168 | };
169 | UINT32 Hi;
170 | };
171 | };
172 |
173 | static const UINT8 OPERAND_TYPE_REG = 0;
174 | static const UINT8 OPERAND_TYPE_MEM = 1;
175 | static const UINT8 OPERAND_TYPE_IMM = 2;
176 | static const UINT8 OPERAND_TYPE_DA = 3;
177 | static const UINT8 OPERAND_TYPE_REL_OFFS = 4;
178 | static const UINT8 OPERAND_TYPE_IMPLIED_NUM = 5;
179 |
180 | inline bool IsOperandImmediate(const UINT8 op)
181 | {
182 | return op == OPERAND_TYPE_IMM || op == OPERAND_TYPE_DA ||
183 | op == OPERAND_TYPE_REL_OFFS;
184 | }
185 |
186 | struct X64_OPERAND
187 | {
188 | union
189 | {
190 | INT8* Op;
191 | struct
192 | {
193 | union
194 | {
195 | INT64 OpAsInt64;
196 | INT32 OpAsInt32;
197 | INT16 OpAsInt16;
198 | INT8 OpAsInt8;
199 | };
200 | INT16 SegmentSelector;
201 | };
202 | union
203 | {
204 | INT8* OpAsPtr8;
205 | INT16* OpAsPtr16;
206 | INT32* OpAsPtr32;
207 | INT64* OpAsPtr64;
208 | };
209 | };
210 | union
211 | {
212 | INT8* OpGuest;
213 | INT64 OpAsInt64Guest;
214 | };
215 | struct
216 | {
217 | UINT8 Type : 3;
218 | UINT8 Register : 5; // valid only for OPERAND_TYPE_REG
219 | };
220 | UINT8 Size;
221 | UINT8 MappedToVmxRoot;
222 | };
223 |
224 | union RFLAGS
225 | {
226 | UINT32 AsUint32;
227 | struct
228 | {
229 | UINT32 CarryF : 1; //0
230 | UINT32 Reserved : 1; //1
231 | UINT32 ParityF : 1; //2
232 | UINT32 Reserved2 : 1; //3
233 | UINT32 AdjustF : 1; //4
234 | UINT32 Reserved3 : 1; //5
235 | UINT32 ZeroF : 1; //6
236 | UINT32 SignF : 1; //7
237 | UINT32 TrapF : 1; //8
238 | UINT32 InterruptF : 1; //9
239 | UINT32 DirectionF : 1; //10
240 | UINT32 OverflowF : 1; //11
241 | UINT32 IOPL : 2; //12-13
242 | UINT32 NestedTask : 1; //14
243 | UINT32 Reserved4 : 1; //15
244 | UINT32 ResumeF : 1; //16
245 | UINT32 VirtualM : 1; //17
246 | UINT32 AlignCheck : 1; //18
247 | UINT32 VIF : 1; //19
248 | UINT32 VIP : 1; //20
249 | UINT32 ID : 1; //21
250 | UINT32 Reserved5 : 10; //22-31 always 0
251 |
252 | };
253 | };
254 |
255 | #pragma warning (default: 4201)
256 |
257 | enum DECODE_STATE
258 | {
259 | DECODE_STATE_ERROR,
260 | DECODE_STATE_PREFIX,
261 | DECODE_STATE_REX,
262 | DECODE_STATE_OPCODE,
263 | DECODE_STATE_MODRM,
264 | DECODE_STATE_SIB,
265 | DECODE_STATE_DISPL,
266 | DECODE_STATE_IMM,
267 | DECODE_STATE_DONE,
268 | DECODE_STATE_LAST = DECODE_STATE_DONE
269 | };
270 |
271 | struct OPCODE_ENTRY;
272 | static const size_t X64_MAX_MNEMONIC_LENGTH = 95; // not certain, but seems reasonable
273 | struct DECODED_INSTRUCTION
274 | {
275 | INT64 Displacement;
276 | X64_OPERAND Operands[4]; // memory ops contain pointers to guest context
277 | DECODED_FLAGS Flags;
278 | const OPCODE_ENTRY* OpcodeEntry;
279 | UINT8 OperandSize; //1,2,4,8 bytes
280 | UINT8 DisplacementSize;
281 | REX_PREFIX Rex;
282 | MODR_M_BYTE Modrm;
283 | UINT8 ModrmMod; // Effective MOD
284 | UINT8 ModrmReg; // Effective Reg
285 | UINT8 ModrmRm; // Effective R/m
286 | SIB_BYTE Sib;
287 | UINT8 SibScale; // Effective Sib fields
288 | UINT8 SibIndex;
289 | UINT8 SibBase;
290 | UINT8 InstructionLen;
291 | UINT8 OpCode[3];
292 | UINT8 AddressSize;
293 | char Mnemonic[X64_MAX_MNEMONIC_LENGTH + 1];
294 | UINT16 MnemonicLength;
295 | };
296 |
297 | static const size_t X64_GPR_COUNT = 16;
298 | static const size_t X64_SEGR_COUNT = 6;
299 |
300 | union X64_REGISTER
301 | {
302 | INT8 AsInt8;
303 | INT16 AsInt16;
304 | INT32 AsInt32;
305 | INT64 AsInt64;
306 | UINT64 AsUInt64;
307 | INT8* AsPtr8;
308 | INT16* AsPtr16;
309 | INT32* AsPtr32;
310 | INT64* AsPtr64;
311 | };
312 |
313 | struct X64_CPU_STATE
314 | {
315 | X64_REGISTER Gpr[X64_GPR_COUNT];
316 | X64_REGISTER Rip; // Mapped to VMX context
317 | RFLAGS Rflags;
318 | X64_REGISTER RipOrig; // Mapped to VMX context
319 | X64_REGISTER RipGuest;
320 | UINT32 RipMappedLen;
321 | X64_SEG_REGISTER SegRegs[X64_SEGR_COUNT];
322 | bool IA32eX64;
323 |
324 | //
325 | // Not certain if we are going to need the rest of them
326 | //
327 | };
328 |
329 | typedef bool(*EmuMapVaRangeT)(
330 | IN void* guestCtx,
331 | IN UINT_PTR guestVA,
332 | IN UINT32 guestBytes,
333 | IN bool code, // true - code; false - data
334 | OUT UINT_PTR* vmxrootVA
335 | );
336 |
337 | typedef void
338 | (*EmuUnmapVaRangeT)(
339 | IN void* guestCtx,
340 | IN UINT_PTR vmxrootVA,
341 | IN UINT_PTR vmxrootBytes
342 | );
343 |
344 | typedef UINT_PTR
345 | (*EmuGetRegisterValueT)(
346 | IN void* guestCtx,
347 | IN int registerId
348 | );
349 |
350 | typedef void
351 | (*EmuSetRegisterValueT)(
352 | IN void* guestCtx,
353 | IN int registerId,
354 | IN UINT64 registerValue
355 | );
356 |
357 | typedef PanicHandlerT EmuRaisePanicT;
358 |
359 | typedef struct _X64_EMULATOR_RUNTIME
360 | {
361 | //
362 | // x64 emu run-time support routines, which are expected to be
363 | // implemented by the x64emu client. GetRegisterValue is the only mandatory
364 | // routine and in case the lib user wants to perform only instruction
365 | // decoding, there is no need in filling the rest. MapVaRange is also used
366 | // for instruction decoding in order to map the code to memory range
367 | // accessible by the environment in which x64emu runs. If Map/UnmapVaRange
368 | // are not provided, then they are stubbed internally as a NULL routines,
369 | // i.e. x64emu will assume that the address space pointed to by CPU
370 | // registersis is accessible in the x64 emu execution env, which is the case
371 | // for all the unit tests running in user-land.
372 | //
373 | // The run-time environment is per emulator context and not global, thus
374 | // allowing for multiple emulator contexts to run in paralel - each one of
375 | // them in their own bubble.
376 | //
377 |
378 | //
379 | // Set to whatever context the lib client wants to be passed to the routines
380 | // below. x64emu does not interpret this field.
381 | //
382 | void* GuestCtx;
383 |
384 | EmuGetRegisterValueT GetRegisterValue;
385 | EmuSetRegisterValueT SetRegisterValue;
386 | EmuMapVaRangeT MapVaRange;
387 | EmuUnmapVaRangeT UnmapVaRange;
388 | EmuRaisePanicT RaisePanic;
389 | } X64_EMULATOR_RUNTIME;
390 |
391 | __inline void EmuInitRuntimeStruct(
392 | OUT X64_EMULATOR_RUNTIME* xert,
393 | IN void* guestCtx,
394 | IN EmuGetRegisterValueT getRegisterValue,
395 | IN EmuSetRegisterValueT setRegisterValue = 0,
396 | IN EmuMapVaRangeT mapVaRange = 0,
397 | IN EmuUnmapVaRangeT unmapVaRange = 0,
398 | IN EmuRaisePanicT raisePanic = 0
399 | )
400 | {
401 | ASSERT(getRegisterValue);
402 | memset(xert, 0, sizeof(*xert));
403 | xert->GuestCtx = guestCtx;
404 | xert->GetRegisterValue = getRegisterValue;
405 | xert->SetRegisterValue = setRegisterValue;
406 | xert->MapVaRange = mapVaRange;
407 | xert->UnmapVaRange = unmapVaRange;
408 | xert->RaisePanic = raisePanic;
409 | }
410 |
411 | struct X64_EMULATOR_CTX
412 | {
413 | DECODED_INSTRUCTION Instruction;
414 | DECODE_STATE DecodeState;
415 | X64_CPU_STATE CpuState;
416 |
417 | //
418 | // Run-time dependencies
419 | //
420 | void* GuestCtx;
421 | EmuGetRegisterValueT GetRegisterValue;
422 | EmuSetRegisterValueT SetRegisterValue;
423 | EmuMapVaRangeT MapVaRange;
424 | EmuUnmapVaRangeT UnmapVaRange;
425 | EmuRaisePanicT RaisePanic;
426 | };
427 |
428 | bool
429 | EmuInitEmulatorCtx(
430 | IN OUT X64_EMULATOR_CTX*,
431 | IN const X64_EMULATOR_RUNTIME*,
432 | IN OPTIONAL UINT32 instructionStreamLength
433 | );
434 |
435 | typedef struct _INTERRUPT_CONTEXT *PINTERRUPT_CONTEXT;
436 |
437 | #ifdef SUPERCELL
438 | bool
439 | EmuInitEmulatorCtxFromInterruptCtx(
440 | X64_EMULATOR_CTX*,
441 | PINTERRUPT_CONTEXT); // safe only for decoding
442 | #endif
443 |
444 | bool
445 | EmuInitEmulatorCtxForDecode(
446 | IN OUT X64_EMULATOR_CTX*,
447 | IN UINT64 rip,
448 | IN OPTIONAL UINT32 instructionStreamLength,
449 | IN bool x64);
450 |
451 | inline bool
452 | EmuInitEmulatorCtxForDecode64(
453 | IN OUT X64_EMULATOR_CTX* emu,
454 | IN UINT64 rip,
455 | IN OPTIONAL UINT32 instructionStreamLength) {
456 | return EmuInitEmulatorCtxForDecode(emu, rip, instructionStreamLength, true);
457 | }
458 |
459 | inline bool
460 | EmuInitEmulatorCtxForDecode32(
461 | IN OUT X64_EMULATOR_CTX* emu,
462 | IN UINT64 rip,
463 | IN OPTIONAL UINT32 instructionStreamLength) {
464 | return EmuInitEmulatorCtxForDecode(emu, rip, instructionStreamLength, false);
465 | }
466 |
467 | void
468 | EmuCleanupEmulatorCtx(
469 | IN OUT X64_EMULATOR_CTX*);
470 |
471 | bool
472 | EmuDecodeInstruction(
473 | IN OUT X64_EMULATOR_CTX*);
474 |
475 | bool
476 | EmuExecuteInstruction(
477 | IN OUT X64_EMULATOR_CTX*);
478 |
479 | void
480 | EmuCommitCpuState(
481 | IN X64_EMULATOR_CTX*);
482 |
483 | bool
484 | EmuIsMemoryStoreInstruction(
485 | X64_EMULATOR_CTX*);
486 |
487 | bool
488 | EmuIsAtomicInstruction(
489 | X64_EMULATOR_CTX*);
490 |
491 | bool
492 | EmuIsAtomicCmpExchange(
493 | X64_EMULATOR_CTX*);
494 |
495 | bool
496 | EmuAtomicExchangeHappened(
497 | X64_EMULATOR_CTX*);
498 |
499 | bool
500 | EmuCanEmulateInstruction(
501 | X64_EMULATOR_CTX*);
502 |
503 | void
504 | OpCopyData(
505 | UINT8* pDest, // vmx root address
506 | const UINT8* pSrc, // vmx root address
507 | size_t size
508 | );
509 |
510 | const char*
511 | EmuGetDecodedMnemonic(
512 | X64_EMULATOR_CTX* pEmu
513 | );
514 |
515 | INT64
516 | EmuGetRepeatCount(
517 | X64_EMULATOR_CTX*);
518 |
519 | __inline const char*
520 | EmuGetOperandTypeAsStr(
521 | UINT32 type)
522 | {
523 | const char* asStr[] = { "OPERAND_TYPE_REG", "OPERAND_TYPE_MEM",
524 | "OPERAND_TYPE_IMM", "OPERAND_TYPE_DA", "OPERAND_TYPE_REL_OFFS" };
525 | return type < ARRAYSIZE(asStr) ? asStr[type] : "OPERAND_TYPE_INVALID";
526 | }
527 |
528 | __inline UINT8 EmuGetOperandType(
529 | const X64_EMULATOR_CTX* pEmu,
530 | UINT32 opIdx)
531 | {
532 | ASSERT(opIdx < ARRAYSIZE(pEmu->Instruction.Operands));
533 | return pEmu->Instruction.Operands[opIdx].Type;
534 | }
535 |
536 | __inline bool EmuIsOperandReg(
537 | const X64_EMULATOR_CTX* pEmu,
538 | UINT32 opIdx)
539 | {
540 | ASSERT(opIdx < ARRAYSIZE(pEmu->Instruction.Operands));
541 | return OPERAND_TYPE_REG == pEmu->Instruction.Operands[opIdx].Type;
542 | }
543 |
544 | _inline bool EmuIsOperandImm(
545 | const X64_EMULATOR_CTX* pEmu,
546 | UINT32 opIdx)
547 | {
548 | ASSERT(opIdx < ARRAYSIZE(pEmu->Instruction.Operands));
549 | return OPERAND_TYPE_IMM == pEmu->Instruction.Operands[opIdx].Type;
550 | }
551 |
552 | _inline bool EmuIsOperandMem(
553 | const X64_EMULATOR_CTX* pEmu,
554 | UINT32 opIdx)
555 | {
556 | ASSERT(opIdx < ARRAYSIZE(pEmu->Instruction.Operands));
557 | return OPERAND_TYPE_MEM == pEmu->Instruction.Operands[opIdx].Type;
558 | }
559 |
560 | __inline bool EmuIsOperandGpr(
561 | const X64_EMULATOR_CTX* pEmu,
562 | UINT32 opIdx)
563 | {
564 | ASSERT(opIdx < ARRAYSIZE(pEmu->Instruction.Operands));
565 | return OPERAND_TYPE_REG == pEmu->Instruction.Operands[opIdx].Type &&
566 | pEmu->Instruction.Operands[opIdx].Register < X64_GPR_COUNT;
567 | }
568 |
569 | __inline X64_REGISTER* EmuGetGprOperand(
570 | X64_EMULATOR_CTX* pEmu,
571 | UINT32 opIdx)
572 | {
573 | if (EmuIsOperandGpr(pEmu, opIdx)) {
574 | return &pEmu->CpuState.Gpr[pEmu->Instruction.Operands[opIdx].Register];
575 | }
576 | return 0;
577 | }
578 |
579 | __inline X64_OPERAND* EmuGetOperand(
580 | X64_EMULATOR_CTX* pEmu,
581 | UINT32 opIdx)
582 | {
583 | ASSERT(opIdx < ARRAYSIZE(pEmu->Instruction.Operands));
584 | return &pEmu->Instruction.Operands[opIdx];
585 | }
586 |
587 | __inline INT64 EmuGetOperandAsInt64(
588 | X64_EMULATOR_CTX* pEmu,
589 | UINT32 opIdx)
590 | {
591 | ASSERT(!EmuIsOperandMem(pEmu, opIdx));
592 | return pEmu->Instruction.Operands[opIdx].OpAsInt64;
593 | }
594 |
595 | #ifdef __cplusplus
596 | } // extern "C" {
597 | #endif
598 |
599 | #endif X64EMU_H
600 |
--------------------------------------------------------------------------------
/make.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 | if "%1" == "__SPAWNED__" goto main
3 | cmd.exe /c "%0" __SPAWNED__ %*
4 | if ERRORLEVEL 1 echo ERRORLEVEL=%ERRORLEVEL%
5 | goto return
6 |
7 | :main
8 | set ROOTDIR=.
9 | call %ROOTDIR%\make\ddkbuild.bat %*
10 |
11 | :return
12 |
--------------------------------------------------------------------------------
/make/copybin.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 | if "%1" == "__SPAWNED__" goto main
3 | cmd.exe /c "%0" __SPAWNED__ %*
4 | if ERRORLEVEL 1 echo ERRORLEVEL=%ERRORLEVEL%
5 | goto end
6 |
7 | :main
8 |
9 | rem copybin
10 |
11 | shift
12 |
13 | if "%1" == "" (
14 | @echo Parameter 1 should be a file name pattern
15 | exit /b 0
16 | )
17 |
18 | if "%2" == "" (
19 | @echo Parameter 2 should be a source dir patterh
20 | exit /b 0
21 | )
22 |
23 | if "%3" == "" (
24 | @echo Parameter 3 should be a dest dir
25 | exit /b 0
26 | )
27 |
28 | for /R .\ %%f in (%1) do (
29 | call :copyif %%f %2 %3
30 | )
31 |
32 | :end
33 | exit /b 0
34 |
35 | :copyif
36 |
37 | @echo %1 | findstr /i %2 > tmpobj.txt
38 | set srcFile=
39 | set /p srcFile= nul
42 | )
43 | set srcFile=
44 | del /Q tmpobj.txt 2> nul
45 |
46 | rem End of copyif
47 | exit /b 0
--------------------------------------------------------------------------------
/make/ddkbuild.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 | rem //
3 | rem // This script can build any project if it has proper sources file. The script can
4 | rem // build targets for WIN7 OS and for the x86 and x64/amd64 platforms.
5 | rem //
6 | rem // PREREQUISITES:
7 | rem // 1. WIN7 ddk installed
8 | rem // 2. The "MSWDK" environment var needs to be set pointing to the
9 | rem // actual ddk install dir.
10 | rem //
11 | rem // USAGE: ddkbuild [debug|release|amd64dbg|amd64rel] [-a]
12 | rem //
13 | rem //
14 | rem // LIMITATIONS: not certain where exactly to start
15 | rem //
16 |
17 | @echo off
18 | if "%1" == "__SPAWNED__" goto main
19 | cmd.exe /c "%0" __SPAWNED__ %*
20 | if ERRORLEVEL 1 echo ERRORLEVEL=%ERRORLEVEL%
21 | goto end
22 |
23 | :main
24 |
25 | shift
26 |
27 | rem //
28 | rem // Sanity checks
29 | rem //
30 |
31 | rem //
32 | rem // Is MSWDK set and points to an existing location?
33 | rem //
34 |
35 | if "%MSWDK%" == "" (
36 |
37 | @Echo Error: MSWDK is not set or points to a non-existing directory!
38 | @Echo Please set MSWDK to point to the DDK directory!
39 |
40 | exit /b 1
41 | )
42 |
43 | if not exist %MSWDK% (
44 |
45 | @Echo Error: MSWDK points to a non-existing directory!
46 | @Echo Please set MSWDK to point to the DDK directory!
47 |
48 | exit /b 1
49 | )
50 |
51 | rem //
52 | rem // Check whether the target root dir exists
53 | rem //
54 |
55 | if "%ROOTDIR%" == "" goto InvalidTargetRoot
56 |
57 | if not exist "%ROOTDIR%" goto InvalidTargetRoot
58 |
59 | rem //
60 | rem // End sanity checks
61 | rem //
62 |
63 | rem //
64 | rem // Parse the input arguments. We do not care about the ordering of args.
65 | rem // If no args are provided we'll build release target for win7 x64
66 | rem //
67 |
68 | set TARGETOS=WIN7
69 | set TARGETCPU=x64
70 | set BUILDCONFIG=fre
71 | set REBUILD=
72 | set CLEANME=
73 | set WDK_TARGET=
74 |
75 | set TARGET_BUILD_CONFIG=amd64rel
76 | set WDK_TARGET_CPU=amd64
77 | set WDK_TARGET_SUB_DIR=.\objfre_win7_%WDK_TARGET_CPU%
78 |
79 | :ParseArgs
80 |
81 | if "%1" == "" goto ParsArgsDone
82 |
83 | if /I "%1" == "WIN7" (
84 | set TARGETOS=WIN7
85 |
86 | ) else if /I "%1" == "debug" (
87 | set TARGETCPU=i386
88 | set BUILDCONFIG=chk
89 | set TARGET_BUILD_CONFIG=debug
90 | set WDK_TARGET_CPU = i386
91 | set WDK_TARGET_SUB_DIR=objchk_win7_%WDK_TARGET_CPU%
92 |
93 | ) else if /I "%1" == "amd64dbg" (
94 | set BUILDCONFIG=chk
95 | set TARGETCPU=x64
96 | set TARGET_BUILD_CONFIG=amd64dbg
97 | set WDK_TARGET_CPU = amd64
98 | set WDK_TARGET_SUB_DIR=objchk_win7_%WDK_TARGET_CPU%
99 |
100 | ) else if /I "%1" == "Release" (
101 | set TARGETCPU=i386
102 | set BUILDCONFIG=fre
103 | set TARGET_BUILD_CONFIG=release
104 | set WDK_TARGET_CPU = i386
105 | set WDK_TARGET_SUB_DIR=objfre_win7_%WDK_TARGET_CPU%
106 |
107 | ) else if /I "%1" == "amd64rel" (
108 | set BUILDCONFIG=fre
109 | set TARGETCPU=x64
110 | set TARGET_BUILD_CONFIG=amd64rel
111 | set WDK_TARGET_CPU = amd64
112 | set WDK_TARGET_SUB_DIR=objfre_win7_%WDK_TARGET_CPU%
113 |
114 | ) else if /I "%1" == "-a" (
115 | set REBUILD=1
116 |
117 | ) else if /I "%1" == "-clean" (
118 | set CLEANME=1
119 |
120 | ) else (
121 | goto Usage
122 |
123 | )
124 |
125 |
126 | shift
127 |
128 | goto ParseArgs
129 |
130 | :ParsArgsDone
131 |
132 | set TARGET_DIR=%ROOTDIR%\%TARGET_BUILD_CONFIG%
133 | if not exist "%TARGET_DIR%" (
134 | md %TARGET_DIR%
135 | )
136 | pushd %TARGET_DIR%
137 | set TARGET_DIR=%CD%
138 | popd
139 | @echo TARGET DIR=%TARGET_DIR%
140 |
141 | set WDK_TARGET=%WDK_TARGET_SUB_DIR%\%WDK_TARGET_CPU%
142 |
143 | @echo WDK_TARGET=%WDK_TARGET%
144 |
145 |
146 | pushd .
147 | call %MSWDK%\bin\setenv.bat %MSWDK% %BUILDCONFIG% %TARGETOS% %TARGETCPU% no_oacr
148 | popd
149 |
150 | if "%CLEANME%" == "1" (
151 | build.exe /c
152 | goto end
153 | )
154 |
155 | if "%REBUILD%" == "1" (
156 | build.exe -cwD
157 | goto end
158 | )
159 |
160 | build.exe -wD
161 | goto end
162 |
163 |
164 | :InvalidTargetRoot
165 |
166 | @Echo Please specify valid root target directory!
167 |
168 | :Usage
169 |
170 | @Echo.
171 | @Echo Usage: "ddkbuild [OS] [config] [-a]"
172 | @Echo.
173 | @Echo where:
174 | @Echo "[OS] = WIN7"
175 | @echo "[config] = debug|release|amd64dbg|amd64rel
176 | @Echo "[-a] = Rebuild all"
177 | @Echo.
178 | @Echo examples:
179 | @Echo ddkbuild
180 | @Echo ddkbuild release
181 | @Echo ddkbuild amd64fre
182 | @Echo ddkbuild debug -a
183 | @Echo ddkbuild amd64rel -a
184 | @Echo.
185 |
186 | exit /b 1
187 |
188 | :end
189 |
190 | call %ROOTDIR%\make\copybin.bat *.sys %WDK_TARGET% %TARGET_DIR%
191 | call %ROOTDIR%\make\copybin.bat *.exe %WDK_TARGET% %TARGET_DIR%
192 | call %ROOTDIR%\make\copybin.bat *.dll %WDK_TARGET% %TARGET_DIR%
193 | call %ROOTDIR%\make\copybin.bat *.pdb %WDK_TARGET% %TARGET_DIR%
194 | call %ROOTDIR%\make\copybin.bat *.lib %WDK_TARGET% %TARGET_DIR%
195 |
196 | if exist "*.inf" (
197 | xcopy /Y /Q *.inf %TARGET_DIR% 2 > nul
198 | )
199 |
200 | rem //
201 | rem // Finally unset all the env vars
202 | rem //
203 |
204 | set TARGETOS=
205 | set TARGETCPU=
206 | set BUILDCONFIG=
207 | set REBUILD=
208 | set TARGET_DIR=
209 | set TARGET_BUILD_CONFIG=
210 | set WDK_TARGET_SUB_DIR=
211 |
212 | exit /b 0
--------------------------------------------------------------------------------
/sample/dirs:
--------------------------------------------------------------------------------
1 | DIRS = \
2 | x64disasm
--------------------------------------------------------------------------------
/sample/make.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 | if "%1" == "__SPAWNED__" goto main
3 | cmd.exe /c "%0" __SPAWNED__ %*
4 | if ERRORLEVEL 1 echo ERRORLEVEL=%ERRORLEVEL%
5 | goto return
6 |
7 | :main
8 | set ROOTDIR=..
9 | call %ROOTDIR%\make\ddkbuild.bat %*
10 |
11 | :return
12 |
--------------------------------------------------------------------------------
/sample/x64disasm/main.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * x64 Software Emulator (x64emu)
3 | * Copyright (c) 2010-2012 Svetoslav Vassilev
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Svetoslav Vassilev
19 | */
20 |
21 | #include
22 | #include
23 | #include
24 | #define WIN32_MEAN_AND_LEAN
25 | #include
26 |
27 | #ifndef ASSERT
28 | #define ASSERT _ASSERT
29 | #endif
30 |
31 | #include "registers.h"
32 | #include "x64emu.h"
33 |
34 | bool g_is64bit = true;
35 | bool g_verbose = false;
36 |
37 | extern "C"
38 | VOID
39 | RtlAssert(
40 | __in PVOID VoidFailedAssertion,
41 | __in PVOID VoidFileName,
42 | __in ULONG LineNumber,
43 | __in_opt PSTR MutableMessage
44 | )
45 | {
46 | DebugBreak();
47 | }
48 |
49 | void Usage()
50 | {
51 | printf("Usage:\n");
52 | printf("\tx64disasm [-d ] [-i386] [-v]\n\n");
53 | printf("where:\n");
54 | printf("\t-d When present the specified opcode stream will be disassembled\n");
55 | printf("\t-i386 The instruction stream is treated as 32-bit opcode\n");
56 | printf("\t-v Verbose mode - print detailed info about the operands\n");
57 | printf("\nExamples: \n");
58 | printf("\tx64disasm -d c70425b000feff00000000\n");
59 | printf("\tx64disasm -d c70425b000feff00000000 -i386\n");
60 | }
61 |
62 | void PrintOperand(const X64_EMULATOR_CTX& emu, UINT32 idx)
63 | {
64 | const X64_OPERAND* op = EmuGetOperand(const_cast(&emu),idx);
65 | printf("\tOperand %d: %s size %d\n",idx,EmuGetOperandTypeAsStr(op->Type),
66 | op->Size);
67 | printf("\tOperand %d: %s\n",idx,EmuGetOperandTypeAsStr(op->Type));
68 | if (OPERAND_TYPE_MEM == op->Type)
69 | {
70 | printf("\t\tAddress: %p\n",op->Op);
71 | }
72 | else
73 | {
74 | UINT64 val = op->OpAsInt64;
75 | val &= ((UINT64)1 << 8*op->Size) - 1;
76 | printf("\t\tValue: %I64d 0x%X\n",val,val);
77 | }
78 | }
79 |
80 | void PrintDecodedInstruction(X64_EMULATOR_CTX& emu)
81 | {
82 | size_t instrLen = emu.Instruction.InstructionLen;
83 | const UINT8* pOpCode = reinterpret_cast(emu.CpuState.RipGuest.AsInt64);
84 | printf("%s\n", EmuGetDecodedMnemonic(&emu));
85 | if (g_verbose)
86 | {
87 | printf("\tOperand count: %d\n", emu.Instruction.Flags.OperandCount);
88 | printf("\tDefault operand size: %d\n", emu.Instruction.OperandSize);
89 | for (UINT32 i = 0; i < emu.Instruction.Flags.OperandCount; i++)
90 | {
91 | PrintOperand(emu, i);
92 | }
93 | }
94 | }
95 |
96 | bool DecodeInstructionStream(
97 | const UINT8* pInstr,
98 | size_t streamLen)
99 | {
100 | size_t remainingStreamLen = streamLen;
101 | UINT64 rip = (UINT64)pInstr;
102 |
103 | while (rip < (UINT_PTR)pInstr + streamLen)
104 | {
105 | X64_EMULATOR_CTX emu;
106 | EmuInitEmulatorCtxForDecode(&emu, rip, remainingStreamLen, g_is64bit);
107 | if (!EmuDecodeInstruction(&emu))
108 | {
109 | printf("ERROR: failed to decode instruction at offset 0x%I64x\n", rip);
110 | return false;
111 | }
112 | PrintDecodedInstruction(emu);
113 | rip += emu.Instruction.InstructionLen;
114 | remainingStreamLen -= emu.Instruction.InstructionLen;
115 | EmuCleanupEmulatorCtx(&emu);
116 | }
117 | return true;
118 | }
119 |
120 | bool FromStringToOpcode(const wchar_t* pStr, UINT8** ppOpcode)
121 | {
122 | UINT8* pInstr = 0;
123 | bool ret = false;
124 | size_t len = wcslen(pStr);
125 | if (len%2 != 0)
126 | {
127 | printf("Even number of chars expected, received %d!\n", len);
128 | goto __return;;
129 | }
130 | pInstr = (UINT8*)malloc(len/2);
131 | ASSERT(pInstr); // should not really fail
132 | for (size_t i = 0; i < len/2; i++)
133 | {
134 | const wchar_t* curr = pStr + i*2;
135 | char ch;
136 | if (swscanf(curr, L"%01x", &ch) != 1)
137 | {
138 | printf("Error: Invalid hex nibble %c encountered at "
139 | "position %d\n", curr, i*2);
140 | goto __return;
141 | }
142 | pInstr[i] = ch<<4;
143 | curr++;
144 | if (swscanf(curr, L"%01x", &ch) != 1)
145 | {
146 | printf("Error: Invalid hex nibble %c encountered at "
147 | "position %d\n", curr, i*2);
148 | goto __return;
149 | }
150 | pInstr[i] |= ch;
151 | }
152 | ret = true;
153 | *ppOpcode = pInstr;
154 | __return:
155 | if (!ret)
156 | {
157 | if (pInstr) {
158 | free(pInstr);
159 | }
160 | }
161 | return ret;
162 | }
163 |
164 | int __cdecl
165 | wmain(int argc, wchar_t* argv[])
166 | {
167 | int err = 0;
168 | UINT8* pInstr = 0;
169 | size_t instrLen = 0;
170 | for (int i = 1; i < argc; ++i)
171 | {
172 | if (!_wcsicmp(argv[i],L"-d"))
173 | {
174 | if (++i < argc && !pInstr)
175 | {
176 | instrLen = wcslen(argv[i]);
177 | if (instrLen % 2 != 0)
178 | {
179 | printf("Even number of chars expected, received %d!\n", instrLen);
180 | return -1;
181 | }
182 |
183 | if (!FromStringToOpcode(argv[i],&pInstr))
184 | {
185 | return -1;
186 | }
187 | }
188 | else
189 | {
190 | Usage();
191 | return -1;
192 | }
193 | }
194 | else if (!_wcsicmp(argv[i], L"-i386"))
195 | {
196 | g_is64bit = false;
197 | }
198 | else if (!_wcsicmp(argv[i], L"-v"))
199 | {
200 | g_verbose = true;
201 | }
202 | else
203 | {
204 | Usage();
205 | return -1;
206 | }
207 | }
208 |
209 | if (0 != pInstr)
210 | {
211 | err = DecodeInstructionStream(pInstr, instrLen / 2) ? 0 : -1;
212 | free(pInstr);
213 | }
214 | else
215 | {
216 | Usage();
217 | }
218 |
219 | return err;
220 | }
221 |
--------------------------------------------------------------------------------
/sample/x64disasm/make.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 | if "%1" == "__SPAWNED__" goto main
3 | cmd.exe /c "%0" __SPAWNED__ %*
4 | if ERRORLEVEL 1 echo ERRORLEVEL=%ERRORLEVEL%
5 | goto return
6 |
7 | :main
8 | set ROOTDIR=..\..
9 | call %ROOTDIR%\make\ddkbuild.bat %*
10 |
11 | :return
12 |
--------------------------------------------------------------------------------
/sample/x64disasm/makefile:
--------------------------------------------------------------------------------
1 | #
2 | # DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source
3 | # file to this component. This file merely indirects to the real make file
4 | # that is shared by all the driver components of the Windows NT DDK
5 | #
6 | !INCLUDE $(NTMAKEENV)\makefile.def
7 |
8 |
--------------------------------------------------------------------------------
/sample/x64disasm/sources:
--------------------------------------------------------------------------------
1 | TARGETNAME=x64disasm
2 | TARGETTYPE=PROGRAM
3 | UMTYPE=console
4 | UMENTRY=wmain
5 | USE_MSVCRT=1
6 |
7 | C_DEFINES=$(C_DEFINES) -DUNICODE -D_UNICODE
8 |
9 | LINKLIBS=$(SDK_LIB_PATH)\shell32.lib
10 |
11 | INCLUDES=$(INCLUDES); \
12 | $(SDK_INC_PATH); \
13 | $(DDK_INC_PATH); \
14 | ..\..\include;
15 |
16 | TARGETLIBS=$(TARGETLIBS) \
17 | ..\..\x64emu\$O\x64emu.lib
18 |
19 | SOURCES= \
20 | main.cpp
21 |
22 | !if "$(DDK_TARGET_OS)"=="WinLH"
23 | _NT_TARGET_VERSION=$(_NT_TARGET_VERSION_WINXP)
24 | !endif
25 |
26 |
--------------------------------------------------------------------------------
/sample/x64disasm/x64disasm.vcxproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | x64
7 |
8 |
9 | Release
10 | x64
11 |
12 |
13 |
14 | x64disasm
15 | {E72B5948-1FB0-4C69-93C1-79B47B1D90F0}
16 | MakeFileProj
17 |
18 |
19 |
20 | Makefile
21 |
22 |
23 | Makefile
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 | <_ProjectFileVersion>10.0.30128.1
37 | make amd64dbg
38 | make amd64dbg -a
39 |
40 |
41 | $(SolutionDir)amd64dbg\x64disasm.exe
42 | WIN32;_DEBUG;$(NMakePreprocessorDefinitions)
43 | $(NMakeIncludeSearchPath)
44 | $(NMakeForcedIncludes)
45 | $(NMakeAssemblySearchPath)
46 | $(NMakeForcedUsingAssemblies)
47 | make amd64rel
48 | make amd64rel -a
49 |
50 |
51 | $(SolutionDir)amd64rel\x64disasm.exe
52 | WIN32;NDEBUG;$(NMakePreprocessorDefinitions)
53 | $(NMakeIncludeSearchPath)
54 | $(NMakeForcedIncludes)
55 | $(NMakeAssemblySearchPath)
56 | $(NMakeForcedUsingAssemblies)
57 |
58 |
59 | .\objfre_win7_amd64\amd64
60 | .\objfre_win7_amd64\amd64
61 |
62 |
63 | .\objchk_win7_amd64\amd64\
64 | .\objchk_win7_amd64\amd64\
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
--------------------------------------------------------------------------------
/sample/x64disasm/x64disasm.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | -d c704
5 | WindowsLocalDebugger
6 | -d c704
7 |
8 |
9 | -d c70456893409498109439271f010 -i386 -v
10 | WindowsLocalDebugger
11 |
12 |
--------------------------------------------------------------------------------
/unit_test/dirs:
--------------------------------------------------------------------------------
1 | DIRS = \
2 | x64emuexec \
3 | x64emudecode64 \
4 | x64emudecode32
5 |
--------------------------------------------------------------------------------
/unit_test/make.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 | if "%1" == "__SPAWNED__" goto main
3 | cmd.exe /c "%0" __SPAWNED__ %*
4 | if ERRORLEVEL 1 echo ERRORLEVEL=%ERRORLEVEL%
5 | goto return
6 |
7 | :main
8 | set ROOTDIR=..
9 | call %ROOTDIR%\make\ddkbuild.bat %*
10 |
11 | :return
12 |
--------------------------------------------------------------------------------
/unit_test/x64emudecode32/main.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * x64 Software Emulator (x64emu)
3 | * Copyright (c) 2010-2012 Svetoslav Vassilev
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Svetoslav Vassilev
19 | */
20 |
21 | #include
22 | #include
23 |
24 | #ifdef ASSERT
25 | #undef ASSERT
26 | #define ASSERT
27 | #endif
28 |
29 | #include "ntifs.h"
30 | #include "x64emu.h"
31 | #include "registers.h"
32 | #include "raisepanic.h"
33 |
34 | void
35 | VmxRootPanicEx(
36 | const char* pFile,
37 | UINT32 lineNumber,
38 | const PANIC_PARAMS& params
39 | )
40 | {
41 | DbgBreakPoint();
42 | }
43 |
44 | UINT_PTR g_Rip = 0;
45 |
46 | UINT_PTR
47 | GetGuestContextRegisterValue(
48 | void* guestCtx,
49 | int registerId)
50 | {
51 | return (RIP_GUEST_ID == registerId) ? g_Rip : 0;
52 | }
53 |
54 | #pragma warning(disable: 4273)
55 | extern "C"
56 | VOID
57 | RtlAssert(
58 | __in PVOID VoidFailedAssertion,
59 | __in PVOID VoidFileName,
60 | __in ULONG LineNumber,
61 | __in_opt PSTR MutableMessage
62 | )
63 | {
64 | DbgBreakPoint();
65 | }
66 | #pragma warning(default: 4273)
67 |
68 | struct SAMPLE_INSTRUCTION
69 | {
70 | size_t Size;
71 | UINT8 Opcode[10];
72 | const char* Mnemonic;
73 | };
74 |
75 | const SAMPLE_INSTRUCTION samples[] =
76 | {
77 | #include "opcodesamples.h"
78 | };
79 |
80 | int __cdecl
81 | wmain(int argc, char argv[])
82 | {
83 | X64_EMULATOR_CTX emu;
84 | X64_EMULATOR_RUNTIME emuRte;
85 | size_t err = 0;
86 |
87 | EmuInitRuntimeStruct(&emuRte,0,GetGuestContextRegisterValue);
88 |
89 | printf("Decoding a sample of %d 32 bit instructions\n",
90 | ARRAYSIZE(samples));
91 |
92 | for (unsigned i = 0; i < ARRAYSIZE(samples); i++)
93 | {
94 | const SAMPLE_INSTRUCTION* pInstr = &samples[i];
95 | g_Rip = (UINT_PTR)&pInstr->Opcode[0];
96 | EmuInitEmulatorCtx(&emu, &emuRte, 0);
97 | emu.CpuState.IA32eX64 = false;
98 | EmuDecodeInstruction(&emu);
99 | if (emu.Instruction.InstructionLen != pInstr->Size)
100 | {
101 | printf("Found mismatch %s, actual length %d, decoded length %d\n",
102 | pInstr->Mnemonic, pInstr->Size, emu.Instruction.InstructionLen);
103 | err++;
104 | }
105 | }
106 |
107 | if (err)
108 | {
109 | printf("Total number of incorrectly decoded instructions: %d\n", err);
110 | }
111 | else
112 | {
113 | printf("Success!\n");
114 | }
115 |
116 | return err;
117 | }
--------------------------------------------------------------------------------
/unit_test/x64emudecode32/make.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 | if "%1" == "__SPAWNED__" goto main
3 | cmd.exe /c "%0" __SPAWNED__ %*
4 | if ERRORLEVEL 1 echo ERRORLEVEL=%ERRORLEVEL%
5 | goto return
6 |
7 | :main
8 | set ROOTDIR=..\..
9 | call %ROOTDIR%\make\ddkbuild.bat %*
10 |
11 | :return
12 |
--------------------------------------------------------------------------------
/unit_test/x64emudecode32/makefile:
--------------------------------------------------------------------------------
1 | #
2 | # DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source
3 | # file to this component. This file merely indirects to the real make file
4 | # that is shared by all the driver components of the Windows NT DDK
5 | #
6 | !INCLUDE $(NTMAKEENV)\makefile.def
7 |
8 |
--------------------------------------------------------------------------------
/unit_test/x64emudecode32/sources:
--------------------------------------------------------------------------------
1 | TARGETNAME=testemudecode32
2 | TARGETTYPE=PROGRAM
3 | UMTYPE=console
4 | UMENTRY=wmain
5 | USE_MSVCRT=1
6 |
7 | C_DEFINES=$(C_DEFINES) -DUNICODE -D_UNICODE
8 |
9 | LINKLIBS=$(SDK_LIB_PATH)\shell32.lib
10 |
11 | INCLUDES=$(INCLUDES); \
12 | $(IFSKIT_INC_PATH); \
13 | $(DDK_INC_PATH); \
14 | ..\..\include;
15 |
16 |
17 | TARGETLIBS=$(TARGETLIBS) \
18 | ..\..\x64emu\$O\x64emu.lib
19 |
20 | SOURCES= \
21 | main.cpp
22 |
23 | !if "$(DDK_TARGET_OS)"=="WinLH"
24 | _NT_TARGET_VERSION=$(_NT_TARGET_VERSION_WINXP)
25 | !endif
26 |
27 |
--------------------------------------------------------------------------------
/unit_test/x64emudecode32/x64emudecode32.vcxproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | x64
7 |
8 |
9 | Release
10 | x64
11 |
12 |
13 |
14 | testemudecode32
15 | {6019434E-0F33-4875-B320-F29A08C499BD}
16 | MakeFileProj
17 |
18 |
19 |
20 | Makefile
21 |
22 |
23 | Makefile
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 | <_ProjectFileVersion>10.0.30128.1
37 | make amd64dbg
38 | make amd64dbg -a
39 |
40 | $(SolutionDir)amd64dbg\testemudecode32.exe
41 | WIN32;_DEBUG;$(NMakePreprocessorDefinitions)
42 | $(NMakeIncludeSearchPath)
43 | $(NMakeForcedIncludes)
44 | $(NMakeAssemblySearchPath)
45 | $(NMakeForcedUsingAssemblies)
46 | make amd64rel
47 | make amd64rel -a
48 |
49 | $(SolutionDir)amd64rel\testemudecode32.exe
50 | WIN32;NDEBUG;$(NMakePreprocessorDefinitions)
51 | $(NMakeIncludeSearchPath)
52 | $(NMakeForcedIncludes)
53 | $(NMakeAssemblySearchPath)
54 | $(NMakeForcedUsingAssemblies)
55 |
56 |
57 | .\objchk_win7_amd64\amd64
58 | .\objchk_win7_amd64\amd64
59 |
60 |
61 | .\objfre_win7_amd64\amd64
62 | .\objfre_win7_amd64\amd64
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
--------------------------------------------------------------------------------
/unit_test/x64emudecode32/x64emudecode32.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/unit_test/x64emudecode64/DbgProp.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /* this ALWAYS GENERATED file contains the definitions for the interfaces */
4 |
5 |
6 | /* File created by MIDL compiler version 7.00.0499 */
7 | /* Compiler settings for dbgprop.idl:
8 | Oicf, W1, Zp8, env=Win32 (32b run)
9 | protocol : dce , ms_ext, c_ext, robust
10 | error checks: allocation ref bounds_check enum stub_data
11 | VC __declspec() decoration level:
12 | __declspec(uuid()), __declspec(selectany), __declspec(novtable)
13 | DECLSPEC_UUID(), MIDL_INTERFACE()
14 | */
15 | //@@MIDL_FILE_HEADING( )
16 |
17 | #pragma warning( disable: 4049 ) /* more than 64k source lines */
18 |
19 |
20 | /* verify that the version is high enough to compile this file*/
21 | #ifndef __REQUIRED_RPCNDR_H_VERSION__
22 | #define __REQUIRED_RPCNDR_H_VERSION__ 475
23 | #endif
24 |
25 | /* verify that the version is high enough to compile this file*/
26 | #ifndef __REQUIRED_RPCSAL_H_VERSION__
27 | #define __REQUIRED_RPCSAL_H_VERSION__ 100
28 | #endif
29 |
30 | #include "rpc.h"
31 | #include "rpcndr.h"
32 |
33 | #ifndef __RPCNDR_H_VERSION__
34 | #error this stub requires an updated version of
35 | #endif // __RPCNDR_H_VERSION__
36 |
37 | #ifndef COM_NO_WINDOWS_H
38 | #include "windows.h"
39 | #include "ole2.h"
40 | #endif /*COM_NO_WINDOWS_H*/
41 |
42 | #ifndef __dbgprop_h__
43 | #define __dbgprop_h__
44 |
45 | #if defined(_MSC_VER) && (_MSC_VER >= 1020)
46 | #pragma once
47 | #endif
48 |
49 | /* Forward Declarations */
50 |
51 | #ifndef __IDebugProperty_FWD_DEFINED__
52 | #define __IDebugProperty_FWD_DEFINED__
53 | typedef interface IDebugProperty IDebugProperty;
54 | #endif /* __IDebugProperty_FWD_DEFINED__ */
55 |
56 |
57 | #ifndef __IEnumDebugPropertyInfo_FWD_DEFINED__
58 | #define __IEnumDebugPropertyInfo_FWD_DEFINED__
59 | typedef interface IEnumDebugPropertyInfo IEnumDebugPropertyInfo;
60 | #endif /* __IEnumDebugPropertyInfo_FWD_DEFINED__ */
61 |
62 |
63 | #ifndef __IDebugExtendedProperty_FWD_DEFINED__
64 | #define __IDebugExtendedProperty_FWD_DEFINED__
65 | typedef interface IDebugExtendedProperty IDebugExtendedProperty;
66 | #endif /* __IDebugExtendedProperty_FWD_DEFINED__ */
67 |
68 |
69 | #ifndef __IEnumDebugExtendedPropertyInfo_FWD_DEFINED__
70 | #define __IEnumDebugExtendedPropertyInfo_FWD_DEFINED__
71 | typedef interface IEnumDebugExtendedPropertyInfo IEnumDebugExtendedPropertyInfo;
72 | #endif /* __IEnumDebugExtendedPropertyInfo_FWD_DEFINED__ */
73 |
74 |
75 | #ifndef __IPerPropertyBrowsing2_FWD_DEFINED__
76 | #define __IPerPropertyBrowsing2_FWD_DEFINED__
77 | typedef interface IPerPropertyBrowsing2 IPerPropertyBrowsing2;
78 | #endif /* __IPerPropertyBrowsing2_FWD_DEFINED__ */
79 |
80 |
81 | #ifndef __IDebugPropertyEnumType_All_FWD_DEFINED__
82 | #define __IDebugPropertyEnumType_All_FWD_DEFINED__
83 | typedef interface IDebugPropertyEnumType_All IDebugPropertyEnumType_All;
84 | #endif /* __IDebugPropertyEnumType_All_FWD_DEFINED__ */
85 |
86 |
87 | #ifndef __IDebugPropertyEnumType_Locals_FWD_DEFINED__
88 | #define __IDebugPropertyEnumType_Locals_FWD_DEFINED__
89 | typedef interface IDebugPropertyEnumType_Locals IDebugPropertyEnumType_Locals;
90 | #endif /* __IDebugPropertyEnumType_Locals_FWD_DEFINED__ */
91 |
92 |
93 | #ifndef __IDebugPropertyEnumType_Arguments_FWD_DEFINED__
94 | #define __IDebugPropertyEnumType_Arguments_FWD_DEFINED__
95 | typedef interface IDebugPropertyEnumType_Arguments IDebugPropertyEnumType_Arguments;
96 | #endif /* __IDebugPropertyEnumType_Arguments_FWD_DEFINED__ */
97 |
98 |
99 | #ifndef __IDebugPropertyEnumType_LocalsPlusArgs_FWD_DEFINED__
100 | #define __IDebugPropertyEnumType_LocalsPlusArgs_FWD_DEFINED__
101 | typedef interface IDebugPropertyEnumType_LocalsPlusArgs IDebugPropertyEnumType_LocalsPlusArgs;
102 | #endif /* __IDebugPropertyEnumType_LocalsPlusArgs_FWD_DEFINED__ */
103 |
104 |
105 | #ifndef __IDebugPropertyEnumType_Registers_FWD_DEFINED__
106 | #define __IDebugPropertyEnumType_Registers_FWD_DEFINED__
107 | typedef interface IDebugPropertyEnumType_Registers IDebugPropertyEnumType_Registers;
108 | #endif /* __IDebugPropertyEnumType_Registers_FWD_DEFINED__ */
109 |
110 |
111 | /* header files for imported files */
112 | #include "ocidl.h"
113 |
114 | #ifdef __cplusplus
115 | extern "C"{
116 | #endif
117 |
118 |
119 | /* interface __MIDL_itf_dbgprop_0000_0000 */
120 | /* [local] */
121 |
122 |
123 |
124 |
125 |
126 |
127 | typedef
128 | enum tagOBJECT_ATTRIB_FLAG
129 | { OBJECT_ATTRIB_NO_ATTRIB = 0,
130 | OBJECT_ATTRIB_NO_NAME = 0x1,
131 | OBJECT_ATTRIB_NO_TYPE = 0x2,
132 | OBJECT_ATTRIB_NO_VALUE = 0x4,
133 | OBJECT_ATTRIB_VALUE_IS_INVALID = 0x8,
134 | OBJECT_ATTRIB_VALUE_IS_OBJECT = 0x10,
135 | OBJECT_ATTRIB_VALUE_IS_ENUM = 0x20,
136 | OBJECT_ATTRIB_VALUE_IS_CUSTOM = 0x40,
137 | OBJECT_ATTRIB_OBJECT_IS_EXPANDABLE = 0x70,
138 | OBJECT_ATTRIB_VALUE_HAS_CODE = 0x80,
139 | OBJECT_ATTRIB_TYPE_IS_OBJECT = 0x100,
140 | OBJECT_ATTRIB_TYPE_HAS_CODE = 0x200,
141 | OBJECT_ATTRIB_TYPE_IS_EXPANDABLE = 0x100,
142 | OBJECT_ATTRIB_SLOT_IS_CATEGORY = 0x400,
143 | OBJECT_ATTRIB_VALUE_READONLY = 0x800,
144 | OBJECT_ATTRIB_ACCESS_PUBLIC = 0x1000,
145 | OBJECT_ATTRIB_ACCESS_PRIVATE = 0x2000,
146 | OBJECT_ATTRIB_ACCESS_PROTECTED = 0x4000,
147 | OBJECT_ATTRIB_ACCESS_FINAL = 0x8000,
148 | OBJECT_ATTRIB_STORAGE_GLOBAL = 0x10000,
149 | OBJECT_ATTRIB_STORAGE_STATIC = 0x20000,
150 | OBJECT_ATTRIB_STORAGE_FIELD = 0x40000,
151 | OBJECT_ATTRIB_STORAGE_VIRTUAL = 0x80000,
152 | OBJECT_ATTRIB_TYPE_IS_CONSTANT = 0x100000,
153 | OBJECT_ATTRIB_TYPE_IS_SYNCHRONIZED = 0x200000,
154 | OBJECT_ATTRIB_TYPE_IS_VOLATILE = 0x400000,
155 | OBJECT_ATTRIB_HAS_EXTENDED_ATTRIBS = 0x800000,
156 | OBJECT_ATTRIB_IS_CLASS = 0x1000000,
157 | OBJECT_ATTRIB_IS_FUNCTION = 0x2000000,
158 | OBJECT_ATTRIB_IS_VARIABLE = 0x4000000,
159 | OBJECT_ATTRIB_IS_PROPERTY = 0x8000000,
160 | OBJECT_ATTRIB_IS_MACRO = 0x10000000,
161 | OBJECT_ATTRIB_IS_TYPE = 0x20000000,
162 | OBJECT_ATTRIB_IS_INHERITED = 0x40000000,
163 | OBJECT_ATTRIB_IS_INTERFACE = 0x80000000
164 | } OBJECT_ATTRIB_FLAGS;
165 |
166 | typedef
167 | enum tagPROP_INFO_FLAGS
168 | { PROP_INFO_NAME = 0x1,
169 | PROP_INFO_TYPE = 0x2,
170 | PROP_INFO_VALUE = 0x4,
171 | PROP_INFO_FULLNAME = 0x20,
172 | PROP_INFO_ATTRIBUTES = 0x8,
173 | PROP_INFO_DEBUGPROP = 0x10,
174 | PROP_INFO_AUTOEXPAND = 0x8000000
175 | } PROP_INFO_FLAGS;
176 |
177 | #define PROP_INFO_STANDARD ( ( ( ( PROP_INFO_NAME | PROP_INFO_TYPE ) | PROP_INFO_VALUE ) | PROP_INFO_ATTRIBUTES ) )
178 |
179 | #define PROP_INFO_ALL ( ( ( ( ( ( PROP_INFO_NAME | PROP_INFO_TYPE ) | PROP_INFO_VALUE ) | PROP_INFO_FULLNAME ) | PROP_INFO_ATTRIBUTES ) | PROP_INFO_DEBUGPROP ) )
180 |
181 | typedef struct tagDebugPropertyInfo
182 | {
183 | DWORD m_dwValidFields;
184 | BSTR m_bstrName;
185 | BSTR m_bstrType;
186 | BSTR m_bstrValue;
187 | BSTR m_bstrFullName;
188 | DWORD m_dwAttrib;
189 | IDebugProperty *m_pDebugProp;
190 | } DebugPropertyInfo;
191 |
192 | typedef
193 | enum tagEX_PROP_INFO_FLAGS
194 | { EX_PROP_INFO_ID = 0x100,
195 | EX_PROP_INFO_NTYPE = 0x200,
196 | EX_PROP_INFO_NVALUE = 0x400,
197 | EX_PROP_INFO_LOCKBYTES = 0x800,
198 | EX_PROP_INFO_DEBUGEXTPROP = 0x1000
199 | } EX_PROP_INFO_FLAGS;
200 |
201 | typedef struct tagExtendedDebugPropertyInfo
202 | {
203 | DWORD dwValidFields;
204 | LPOLESTR pszName;
205 | LPOLESTR pszType;
206 | LPOLESTR pszValue;
207 | LPOLESTR pszFullName;
208 | DWORD dwAttrib;
209 | IDebugProperty *pDebugProp;
210 | DWORD nDISPID;
211 | DWORD nType;
212 | VARIANT varValue;
213 | ILockBytes *plbValue;
214 | IDebugExtendedProperty *pDebugExtProp;
215 | } ExtendedDebugPropertyInfo;
216 |
217 |
218 |
219 | extern RPC_IF_HANDLE __MIDL_itf_dbgprop_0000_0000_v0_0_c_ifspec;
220 | extern RPC_IF_HANDLE __MIDL_itf_dbgprop_0000_0000_v0_0_s_ifspec;
221 |
222 | #ifndef __IDebugProperty_INTERFACE_DEFINED__
223 | #define __IDebugProperty_INTERFACE_DEFINED__
224 |
225 | /* interface IDebugProperty */
226 | /* [unique][uuid][object] */
227 |
228 |
229 | EXTERN_C const IID IID_IDebugProperty;
230 |
231 | #if defined(__cplusplus) && !defined(CINTERFACE)
232 |
233 | MIDL_INTERFACE("51973C50-CB0C-11d0-B5C9-00A0244A0E7A")
234 | IDebugProperty : public IUnknown
235 | {
236 | public:
237 | virtual /* [local] */ HRESULT STDMETHODCALLTYPE GetPropertyInfo(
238 | /* [in] */ DWORD dwFieldSpec,
239 | /* [in] */ UINT nRadix,
240 | /* [out] */ DebugPropertyInfo *pPropertyInfo) = 0;
241 |
242 | virtual HRESULT STDMETHODCALLTYPE GetExtendedInfo(
243 | /* [in] */ ULONG cInfos,
244 | /* [size_is][in] */ __RPC__in_ecount_full(cInfos) GUID *rgguidExtendedInfo,
245 | /* [size_is][out] */ __RPC__out_ecount_full(cInfos) VARIANT *rgvar) = 0;
246 |
247 | virtual HRESULT STDMETHODCALLTYPE SetValueAsString(
248 | /* [in] */ __RPC__in LPCOLESTR pszValue,
249 | /* [in] */ UINT nRadix) = 0;
250 |
251 | virtual HRESULT STDMETHODCALLTYPE EnumMembers(
252 | /* [in] */ DWORD dwFieldSpec,
253 | /* [in] */ UINT nRadix,
254 | /* [in] */ __RPC__in REFIID refiid,
255 | /* [out] */ __RPC__deref_out_opt IEnumDebugPropertyInfo **ppepi) = 0;
256 |
257 | virtual HRESULT STDMETHODCALLTYPE GetParent(
258 | /* [out] */ __RPC__deref_out_opt IDebugProperty **ppDebugProp) = 0;
259 |
260 | };
261 |
262 | #else /* C style interface */
263 |
264 | typedef struct IDebugPropertyVtbl
265 | {
266 | BEGIN_INTERFACE
267 |
268 | HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
269 | IDebugProperty * This,
270 | /* [in] */ __RPC__in REFIID riid,
271 | /* [iid_is][out] */
272 | __RPC__deref_out void **ppvObject);
273 |
274 | ULONG ( STDMETHODCALLTYPE *AddRef )(
275 | IDebugProperty * This);
276 |
277 | ULONG ( STDMETHODCALLTYPE *Release )(
278 | IDebugProperty * This);
279 |
280 | /* [local] */ HRESULT ( STDMETHODCALLTYPE *GetPropertyInfo )(
281 | IDebugProperty * This,
282 | /* [in] */ DWORD dwFieldSpec,
283 | /* [in] */ UINT nRadix,
284 | /* [out] */ DebugPropertyInfo *pPropertyInfo);
285 |
286 | HRESULT ( STDMETHODCALLTYPE *GetExtendedInfo )(
287 | IDebugProperty * This,
288 | /* [in] */ ULONG cInfos,
289 | /* [size_is][in] */ __RPC__in_ecount_full(cInfos) GUID *rgguidExtendedInfo,
290 | /* [size_is][out] */ __RPC__out_ecount_full(cInfos) VARIANT *rgvar);
291 |
292 | HRESULT ( STDMETHODCALLTYPE *SetValueAsString )(
293 | IDebugProperty * This,
294 | /* [in] */ __RPC__in LPCOLESTR pszValue,
295 | /* [in] */ UINT nRadix);
296 |
297 | HRESULT ( STDMETHODCALLTYPE *EnumMembers )(
298 | IDebugProperty * This,
299 | /* [in] */ DWORD dwFieldSpec,
300 | /* [in] */ UINT nRadix,
301 | /* [in] */ __RPC__in REFIID refiid,
302 | /* [out] */ __RPC__deref_out_opt IEnumDebugPropertyInfo **ppepi);
303 |
304 | HRESULT ( STDMETHODCALLTYPE *GetParent )(
305 | IDebugProperty * This,
306 | /* [out] */ __RPC__deref_out_opt IDebugProperty **ppDebugProp);
307 |
308 | END_INTERFACE
309 | } IDebugPropertyVtbl;
310 |
311 | interface IDebugProperty
312 | {
313 | CONST_VTBL struct IDebugPropertyVtbl *lpVtbl;
314 | };
315 |
316 |
317 |
318 | #ifdef COBJMACROS
319 |
320 |
321 | #define IDebugProperty_QueryInterface(This,riid,ppvObject) \
322 | ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
323 |
324 | #define IDebugProperty_AddRef(This) \
325 | ( (This)->lpVtbl -> AddRef(This) )
326 |
327 | #define IDebugProperty_Release(This) \
328 | ( (This)->lpVtbl -> Release(This) )
329 |
330 |
331 | #define IDebugProperty_GetPropertyInfo(This,dwFieldSpec,nRadix,pPropertyInfo) \
332 | ( (This)->lpVtbl -> GetPropertyInfo(This,dwFieldSpec,nRadix,pPropertyInfo) )
333 |
334 | #define IDebugProperty_GetExtendedInfo(This,cInfos,rgguidExtendedInfo,rgvar) \
335 | ( (This)->lpVtbl -> GetExtendedInfo(This,cInfos,rgguidExtendedInfo,rgvar) )
336 |
337 | #define IDebugProperty_SetValueAsString(This,pszValue,nRadix) \
338 | ( (This)->lpVtbl -> SetValueAsString(This,pszValue,nRadix) )
339 |
340 | #define IDebugProperty_EnumMembers(This,dwFieldSpec,nRadix,refiid,ppepi) \
341 | ( (This)->lpVtbl -> EnumMembers(This,dwFieldSpec,nRadix,refiid,ppepi) )
342 |
343 | #define IDebugProperty_GetParent(This,ppDebugProp) \
344 | ( (This)->lpVtbl -> GetParent(This,ppDebugProp) )
345 |
346 | #endif /* COBJMACROS */
347 |
348 |
349 | #endif /* C style interface */
350 |
351 |
352 |
353 | /* [call_as] */ HRESULT STDMETHODCALLTYPE IDebugProperty_RemoteGetPropertyInfo_Proxy(
354 | IDebugProperty * This,
355 | /* [in] */ DWORD dwFieldSpec,
356 | /* [in] */ UINT nRadix,
357 | /* [out] */ __RPC__out DWORD *dwValidFields,
358 | /* [out] */ __RPC__deref_out_opt BSTR *pbstrName,
359 | /* [out] */ __RPC__deref_out_opt BSTR *pbstrType,
360 | /* [out] */ __RPC__deref_out_opt BSTR *pbstrValue,
361 | /* [out] */ __RPC__deref_out_opt BSTR *pbstrFullName,
362 | /* [out] */ __RPC__out DWORD *pdwAttrib,
363 | /* [unique][out][in] */ __RPC__deref_opt_inout_opt IDebugProperty **ppDebugProperty);
364 |
365 |
366 | void __RPC_STUB IDebugProperty_RemoteGetPropertyInfo_Stub(
367 | IRpcStubBuffer *This,
368 | IRpcChannelBuffer *_pRpcChannelBuffer,
369 | PRPC_MESSAGE _pRpcMessage,
370 | DWORD *_pdwStubPhase);
371 |
372 |
373 |
374 | #endif /* __IDebugProperty_INTERFACE_DEFINED__ */
375 |
376 |
377 | #ifndef __IEnumDebugPropertyInfo_INTERFACE_DEFINED__
378 | #define __IEnumDebugPropertyInfo_INTERFACE_DEFINED__
379 |
380 | /* interface IEnumDebugPropertyInfo */
381 | /* [unique][uuid][object] */
382 |
383 |
384 | EXTERN_C const IID IID_IEnumDebugPropertyInfo;
385 |
386 | #if defined(__cplusplus) && !defined(CINTERFACE)
387 |
388 | MIDL_INTERFACE("51973C51-CB0C-11d0-B5C9-00A0244A0E7A")
389 | IEnumDebugPropertyInfo : public IUnknown
390 | {
391 | public:
392 | virtual /* [local] */ HRESULT STDMETHODCALLTYPE Next(
393 | /* [in] */ ULONG celt,
394 | /* [out] */ DebugPropertyInfo *pi,
395 | /* [out] */ ULONG *pcEltsfetched) = 0;
396 |
397 | virtual HRESULT STDMETHODCALLTYPE Skip(
398 | /* [in] */ ULONG celt) = 0;
399 |
400 | virtual HRESULT STDMETHODCALLTYPE Reset( void) = 0;
401 |
402 | virtual HRESULT STDMETHODCALLTYPE Clone(
403 | /* [out] */ __RPC__deref_out_opt IEnumDebugPropertyInfo **ppepi) = 0;
404 |
405 | virtual HRESULT STDMETHODCALLTYPE GetCount(
406 | /* [out] */ __RPC__out ULONG *pcelt) = 0;
407 |
408 | };
409 |
410 | #else /* C style interface */
411 |
412 | typedef struct IEnumDebugPropertyInfoVtbl
413 | {
414 | BEGIN_INTERFACE
415 |
416 | HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
417 | IEnumDebugPropertyInfo * This,
418 | /* [in] */ __RPC__in REFIID riid,
419 | /* [iid_is][out] */
420 | __RPC__deref_out void **ppvObject);
421 |
422 | ULONG ( STDMETHODCALLTYPE *AddRef )(
423 | IEnumDebugPropertyInfo * This);
424 |
425 | ULONG ( STDMETHODCALLTYPE *Release )(
426 | IEnumDebugPropertyInfo * This);
427 |
428 | /* [local] */ HRESULT ( STDMETHODCALLTYPE *Next )(
429 | IEnumDebugPropertyInfo * This,
430 | /* [in] */ ULONG celt,
431 | /* [out] */ DebugPropertyInfo *pi,
432 | /* [out] */ ULONG *pcEltsfetched);
433 |
434 | HRESULT ( STDMETHODCALLTYPE *Skip )(
435 | IEnumDebugPropertyInfo * This,
436 | /* [in] */ ULONG celt);
437 |
438 | HRESULT ( STDMETHODCALLTYPE *Reset )(
439 | IEnumDebugPropertyInfo * This);
440 |
441 | HRESULT ( STDMETHODCALLTYPE *Clone )(
442 | IEnumDebugPropertyInfo * This,
443 | /* [out] */ __RPC__deref_out_opt IEnumDebugPropertyInfo **ppepi);
444 |
445 | HRESULT ( STDMETHODCALLTYPE *GetCount )(
446 | IEnumDebugPropertyInfo * This,
447 | /* [out] */ __RPC__out ULONG *pcelt);
448 |
449 | END_INTERFACE
450 | } IEnumDebugPropertyInfoVtbl;
451 |
452 | interface IEnumDebugPropertyInfo
453 | {
454 | CONST_VTBL struct IEnumDebugPropertyInfoVtbl *lpVtbl;
455 | };
456 |
457 |
458 |
459 | #ifdef COBJMACROS
460 |
461 |
462 | #define IEnumDebugPropertyInfo_QueryInterface(This,riid,ppvObject) \
463 | ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
464 |
465 | #define IEnumDebugPropertyInfo_AddRef(This) \
466 | ( (This)->lpVtbl -> AddRef(This) )
467 |
468 | #define IEnumDebugPropertyInfo_Release(This) \
469 | ( (This)->lpVtbl -> Release(This) )
470 |
471 |
472 | #define IEnumDebugPropertyInfo_Next(This,celt,pi,pcEltsfetched) \
473 | ( (This)->lpVtbl -> Next(This,celt,pi,pcEltsfetched) )
474 |
475 | #define IEnumDebugPropertyInfo_Skip(This,celt) \
476 | ( (This)->lpVtbl -> Skip(This,celt) )
477 |
478 | #define IEnumDebugPropertyInfo_Reset(This) \
479 | ( (This)->lpVtbl -> Reset(This) )
480 |
481 | #define IEnumDebugPropertyInfo_Clone(This,ppepi) \
482 | ( (This)->lpVtbl -> Clone(This,ppepi) )
483 |
484 | #define IEnumDebugPropertyInfo_GetCount(This,pcelt) \
485 | ( (This)->lpVtbl -> GetCount(This,pcelt) )
486 |
487 | #endif /* COBJMACROS */
488 |
489 |
490 | #endif /* C style interface */
491 |
492 |
493 |
494 | /* [call_as] */ HRESULT __stdcall IEnumDebugPropertyInfo_RemoteNext_Proxy(
495 | IEnumDebugPropertyInfo * This,
496 | /* [in] */ ULONG celt,
497 | /* [length_is][size_is][unique][out][in] */ __RPC__inout_ecount_part_opt(celt, *pcEltsfetched) DebugPropertyInfo *pinfo,
498 | /* [out] */ __RPC__out ULONG *pcEltsfetched);
499 |
500 |
501 | void __RPC_STUB IEnumDebugPropertyInfo_RemoteNext_Stub(
502 | IRpcStubBuffer *This,
503 | IRpcChannelBuffer *_pRpcChannelBuffer,
504 | PRPC_MESSAGE _pRpcMessage,
505 | DWORD *_pdwStubPhase);
506 |
507 |
508 |
509 | #endif /* __IEnumDebugPropertyInfo_INTERFACE_DEFINED__ */
510 |
511 |
512 | #ifndef __IDebugExtendedProperty_INTERFACE_DEFINED__
513 | #define __IDebugExtendedProperty_INTERFACE_DEFINED__
514 |
515 | /* interface IDebugExtendedProperty */
516 | /* [unique][uuid][object] */
517 |
518 |
519 | EXTERN_C const IID IID_IDebugExtendedProperty;
520 |
521 | #if defined(__cplusplus) && !defined(CINTERFACE)
522 |
523 | MIDL_INTERFACE("51973C52-CB0C-11d0-B5C9-00A0244A0E7A")
524 | IDebugExtendedProperty : public IDebugProperty
525 | {
526 | public:
527 | virtual HRESULT STDMETHODCALLTYPE GetExtendedPropertyInfo(
528 | /* [in] */ DWORD dwFieldSpec,
529 | /* [in] */ UINT nRadix,
530 | /* [out] */ __RPC__out ExtendedDebugPropertyInfo *pExtendedPropertyInfo) = 0;
531 |
532 | virtual HRESULT STDMETHODCALLTYPE EnumExtendedMembers(
533 | /* [in] */ DWORD dwFieldSpec,
534 | /* [in] */ UINT nRadix,
535 | /* [out] */ __RPC__deref_out_opt IEnumDebugExtendedPropertyInfo **ppeepi) = 0;
536 |
537 | };
538 |
539 | #else /* C style interface */
540 |
541 | typedef struct IDebugExtendedPropertyVtbl
542 | {
543 | BEGIN_INTERFACE
544 |
545 | HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
546 | IDebugExtendedProperty * This,
547 | /* [in] */ __RPC__in REFIID riid,
548 | /* [iid_is][out] */
549 | __RPC__deref_out void **ppvObject);
550 |
551 | ULONG ( STDMETHODCALLTYPE *AddRef )(
552 | IDebugExtendedProperty * This);
553 |
554 | ULONG ( STDMETHODCALLTYPE *Release )(
555 | IDebugExtendedProperty * This);
556 |
557 | /* [local] */ HRESULT ( STDMETHODCALLTYPE *GetPropertyInfo )(
558 | IDebugExtendedProperty * This,
559 | /* [in] */ DWORD dwFieldSpec,
560 | /* [in] */ UINT nRadix,
561 | /* [out] */ DebugPropertyInfo *pPropertyInfo);
562 |
563 | HRESULT ( STDMETHODCALLTYPE *GetExtendedInfo )(
564 | IDebugExtendedProperty * This,
565 | /* [in] */ ULONG cInfos,
566 | /* [size_is][in] */ __RPC__in_ecount_full(cInfos) GUID *rgguidExtendedInfo,
567 | /* [size_is][out] */ __RPC__out_ecount_full(cInfos) VARIANT *rgvar);
568 |
569 | HRESULT ( STDMETHODCALLTYPE *SetValueAsString )(
570 | IDebugExtendedProperty * This,
571 | /* [in] */ __RPC__in LPCOLESTR pszValue,
572 | /* [in] */ UINT nRadix);
573 |
574 | HRESULT ( STDMETHODCALLTYPE *EnumMembers )(
575 | IDebugExtendedProperty * This,
576 | /* [in] */ DWORD dwFieldSpec,
577 | /* [in] */ UINT nRadix,
578 | /* [in] */ __RPC__in REFIID refiid,
579 | /* [out] */ __RPC__deref_out_opt IEnumDebugPropertyInfo **ppepi);
580 |
581 | HRESULT ( STDMETHODCALLTYPE *GetParent )(
582 | IDebugExtendedProperty * This,
583 | /* [out] */ __RPC__deref_out_opt IDebugProperty **ppDebugProp);
584 |
585 | HRESULT ( STDMETHODCALLTYPE *GetExtendedPropertyInfo )(
586 | IDebugExtendedProperty * This,
587 | /* [in] */ DWORD dwFieldSpec,
588 | /* [in] */ UINT nRadix,
589 | /* [out] */ __RPC__out ExtendedDebugPropertyInfo *pExtendedPropertyInfo);
590 |
591 | HRESULT ( STDMETHODCALLTYPE *EnumExtendedMembers )(
592 | IDebugExtendedProperty * This,
593 | /* [in] */ DWORD dwFieldSpec,
594 | /* [in] */ UINT nRadix,
595 | /* [out] */ __RPC__deref_out_opt IEnumDebugExtendedPropertyInfo **ppeepi);
596 |
597 | END_INTERFACE
598 | } IDebugExtendedPropertyVtbl;
599 |
600 | interface IDebugExtendedProperty
601 | {
602 | CONST_VTBL struct IDebugExtendedPropertyVtbl *lpVtbl;
603 | };
604 |
605 |
606 |
607 | #ifdef COBJMACROS
608 |
609 |
610 | #define IDebugExtendedProperty_QueryInterface(This,riid,ppvObject) \
611 | ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
612 |
613 | #define IDebugExtendedProperty_AddRef(This) \
614 | ( (This)->lpVtbl -> AddRef(This) )
615 |
616 | #define IDebugExtendedProperty_Release(This) \
617 | ( (This)->lpVtbl -> Release(This) )
618 |
619 |
620 | #define IDebugExtendedProperty_GetPropertyInfo(This,dwFieldSpec,nRadix,pPropertyInfo) \
621 | ( (This)->lpVtbl -> GetPropertyInfo(This,dwFieldSpec,nRadix,pPropertyInfo) )
622 |
623 | #define IDebugExtendedProperty_GetExtendedInfo(This,cInfos,rgguidExtendedInfo,rgvar) \
624 | ( (This)->lpVtbl -> GetExtendedInfo(This,cInfos,rgguidExtendedInfo,rgvar) )
625 |
626 | #define IDebugExtendedProperty_SetValueAsString(This,pszValue,nRadix) \
627 | ( (This)->lpVtbl -> SetValueAsString(This,pszValue,nRadix) )
628 |
629 | #define IDebugExtendedProperty_EnumMembers(This,dwFieldSpec,nRadix,refiid,ppepi) \
630 | ( (This)->lpVtbl -> EnumMembers(This,dwFieldSpec,nRadix,refiid,ppepi) )
631 |
632 | #define IDebugExtendedProperty_GetParent(This,ppDebugProp) \
633 | ( (This)->lpVtbl -> GetParent(This,ppDebugProp) )
634 |
635 |
636 | #define IDebugExtendedProperty_GetExtendedPropertyInfo(This,dwFieldSpec,nRadix,pExtendedPropertyInfo) \
637 | ( (This)->lpVtbl -> GetExtendedPropertyInfo(This,dwFieldSpec,nRadix,pExtendedPropertyInfo) )
638 |
639 | #define IDebugExtendedProperty_EnumExtendedMembers(This,dwFieldSpec,nRadix,ppeepi) \
640 | ( (This)->lpVtbl -> EnumExtendedMembers(This,dwFieldSpec,nRadix,ppeepi) )
641 |
642 | #endif /* COBJMACROS */
643 |
644 |
645 | #endif /* C style interface */
646 |
647 |
648 |
649 |
650 | #endif /* __IDebugExtendedProperty_INTERFACE_DEFINED__ */
651 |
652 |
653 | #ifndef __IEnumDebugExtendedPropertyInfo_INTERFACE_DEFINED__
654 | #define __IEnumDebugExtendedPropertyInfo_INTERFACE_DEFINED__
655 |
656 | /* interface IEnumDebugExtendedPropertyInfo */
657 | /* [unique][uuid][object] */
658 |
659 |
660 | EXTERN_C const IID IID_IEnumDebugExtendedPropertyInfo;
661 |
662 | #if defined(__cplusplus) && !defined(CINTERFACE)
663 |
664 | MIDL_INTERFACE("51973C53-CB0C-11d0-B5C9-00A0244A0E7A")
665 | IEnumDebugExtendedPropertyInfo : public IUnknown
666 | {
667 | public:
668 | virtual HRESULT STDMETHODCALLTYPE Next(
669 | /* [in] */ ULONG celt,
670 | /* [length_is][size_is][out] */ __RPC__out_ecount_part(celt, *pceltFetched) ExtendedDebugPropertyInfo *rgExtendedPropertyInfo,
671 | /* [out] */ __RPC__out ULONG *pceltFetched) = 0;
672 |
673 | virtual HRESULT STDMETHODCALLTYPE Skip(
674 | /* [in] */ ULONG celt) = 0;
675 |
676 | virtual HRESULT STDMETHODCALLTYPE Reset( void) = 0;
677 |
678 | virtual HRESULT STDMETHODCALLTYPE Clone(
679 | /* [out] */ __RPC__deref_out_opt IEnumDebugExtendedPropertyInfo **pedpe) = 0;
680 |
681 | virtual HRESULT STDMETHODCALLTYPE GetCount(
682 | /* [out] */ __RPC__out ULONG *pcelt) = 0;
683 |
684 | };
685 |
686 | #else /* C style interface */
687 |
688 | typedef struct IEnumDebugExtendedPropertyInfoVtbl
689 | {
690 | BEGIN_INTERFACE
691 |
692 | HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
693 | IEnumDebugExtendedPropertyInfo * This,
694 | /* [in] */ __RPC__in REFIID riid,
695 | /* [iid_is][out] */
696 | __RPC__deref_out void **ppvObject);
697 |
698 | ULONG ( STDMETHODCALLTYPE *AddRef )(
699 | IEnumDebugExtendedPropertyInfo * This);
700 |
701 | ULONG ( STDMETHODCALLTYPE *Release )(
702 | IEnumDebugExtendedPropertyInfo * This);
703 |
704 | HRESULT ( STDMETHODCALLTYPE *Next )(
705 | IEnumDebugExtendedPropertyInfo * This,
706 | /* [in] */ ULONG celt,
707 | /* [length_is][size_is][out] */ __RPC__out_ecount_part(celt, *pceltFetched) ExtendedDebugPropertyInfo *rgExtendedPropertyInfo,
708 | /* [out] */ __RPC__out ULONG *pceltFetched);
709 |
710 | HRESULT ( STDMETHODCALLTYPE *Skip )(
711 | IEnumDebugExtendedPropertyInfo * This,
712 | /* [in] */ ULONG celt);
713 |
714 | HRESULT ( STDMETHODCALLTYPE *Reset )(
715 | IEnumDebugExtendedPropertyInfo * This);
716 |
717 | HRESULT ( STDMETHODCALLTYPE *Clone )(
718 | IEnumDebugExtendedPropertyInfo * This,
719 | /* [out] */ __RPC__deref_out_opt IEnumDebugExtendedPropertyInfo **pedpe);
720 |
721 | HRESULT ( STDMETHODCALLTYPE *GetCount )(
722 | IEnumDebugExtendedPropertyInfo * This,
723 | /* [out] */ __RPC__out ULONG *pcelt);
724 |
725 | END_INTERFACE
726 | } IEnumDebugExtendedPropertyInfoVtbl;
727 |
728 | interface IEnumDebugExtendedPropertyInfo
729 | {
730 | CONST_VTBL struct IEnumDebugExtendedPropertyInfoVtbl *lpVtbl;
731 | };
732 |
733 |
734 |
735 | #ifdef COBJMACROS
736 |
737 |
738 | #define IEnumDebugExtendedPropertyInfo_QueryInterface(This,riid,ppvObject) \
739 | ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
740 |
741 | #define IEnumDebugExtendedPropertyInfo_AddRef(This) \
742 | ( (This)->lpVtbl -> AddRef(This) )
743 |
744 | #define IEnumDebugExtendedPropertyInfo_Release(This) \
745 | ( (This)->lpVtbl -> Release(This) )
746 |
747 |
748 | #define IEnumDebugExtendedPropertyInfo_Next(This,celt,rgExtendedPropertyInfo,pceltFetched) \
749 | ( (This)->lpVtbl -> Next(This,celt,rgExtendedPropertyInfo,pceltFetched) )
750 |
751 | #define IEnumDebugExtendedPropertyInfo_Skip(This,celt) \
752 | ( (This)->lpVtbl -> Skip(This,celt) )
753 |
754 | #define IEnumDebugExtendedPropertyInfo_Reset(This) \
755 | ( (This)->lpVtbl -> Reset(This) )
756 |
757 | #define IEnumDebugExtendedPropertyInfo_Clone(This,pedpe) \
758 | ( (This)->lpVtbl -> Clone(This,pedpe) )
759 |
760 | #define IEnumDebugExtendedPropertyInfo_GetCount(This,pcelt) \
761 | ( (This)->lpVtbl -> GetCount(This,pcelt) )
762 |
763 | #endif /* COBJMACROS */
764 |
765 |
766 | #endif /* C style interface */
767 |
768 |
769 |
770 |
771 | #endif /* __IEnumDebugExtendedPropertyInfo_INTERFACE_DEFINED__ */
772 |
773 |
774 | #ifndef __IPerPropertyBrowsing2_INTERFACE_DEFINED__
775 | #define __IPerPropertyBrowsing2_INTERFACE_DEFINED__
776 |
777 | /* interface IPerPropertyBrowsing2 */
778 | /* [unique][uuid][object] */
779 |
780 |
781 | EXTERN_C const IID IID_IPerPropertyBrowsing2;
782 |
783 | #if defined(__cplusplus) && !defined(CINTERFACE)
784 |
785 | MIDL_INTERFACE("51973C54-CB0C-11d0-B5C9-00A0244A0E7A")
786 | IPerPropertyBrowsing2 : public IUnknown
787 | {
788 | public:
789 | virtual HRESULT STDMETHODCALLTYPE GetDisplayString(
790 | /* [in] */ DISPID dispid,
791 | /* [out] */ __RPC__deref_out_opt BSTR *pBstr) = 0;
792 |
793 | virtual HRESULT STDMETHODCALLTYPE MapPropertyToPage(
794 | /* [in] */ DISPID dispid,
795 | /* [out] */ __RPC__out CLSID *pClsidPropPage) = 0;
796 |
797 | virtual HRESULT STDMETHODCALLTYPE GetPredefinedStrings(
798 | /* [in] */ DISPID dispid,
799 | /* [out] */ __RPC__out CALPOLESTR *pCaStrings,
800 | /* [out] */ __RPC__out CADWORD *pCaCookies) = 0;
801 |
802 | virtual HRESULT STDMETHODCALLTYPE SetPredefinedValue(
803 | /* [in] */ DISPID dispid,
804 | /* [in] */ DWORD dwCookie) = 0;
805 |
806 | };
807 |
808 | #else /* C style interface */
809 |
810 | typedef struct IPerPropertyBrowsing2Vtbl
811 | {
812 | BEGIN_INTERFACE
813 |
814 | HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
815 | IPerPropertyBrowsing2 * This,
816 | /* [in] */ __RPC__in REFIID riid,
817 | /* [iid_is][out] */
818 | __RPC__deref_out void **ppvObject);
819 |
820 | ULONG ( STDMETHODCALLTYPE *AddRef )(
821 | IPerPropertyBrowsing2 * This);
822 |
823 | ULONG ( STDMETHODCALLTYPE *Release )(
824 | IPerPropertyBrowsing2 * This);
825 |
826 | HRESULT ( STDMETHODCALLTYPE *GetDisplayString )(
827 | IPerPropertyBrowsing2 * This,
828 | /* [in] */ DISPID dispid,
829 | /* [out] */ __RPC__deref_out_opt BSTR *pBstr);
830 |
831 | HRESULT ( STDMETHODCALLTYPE *MapPropertyToPage )(
832 | IPerPropertyBrowsing2 * This,
833 | /* [in] */ DISPID dispid,
834 | /* [out] */ __RPC__out CLSID *pClsidPropPage);
835 |
836 | HRESULT ( STDMETHODCALLTYPE *GetPredefinedStrings )(
837 | IPerPropertyBrowsing2 * This,
838 | /* [in] */ DISPID dispid,
839 | /* [out] */ __RPC__out CALPOLESTR *pCaStrings,
840 | /* [out] */ __RPC__out CADWORD *pCaCookies);
841 |
842 | HRESULT ( STDMETHODCALLTYPE *SetPredefinedValue )(
843 | IPerPropertyBrowsing2 * This,
844 | /* [in] */ DISPID dispid,
845 | /* [in] */ DWORD dwCookie);
846 |
847 | END_INTERFACE
848 | } IPerPropertyBrowsing2Vtbl;
849 |
850 | interface IPerPropertyBrowsing2
851 | {
852 | CONST_VTBL struct IPerPropertyBrowsing2Vtbl *lpVtbl;
853 | };
854 |
855 |
856 |
857 | #ifdef COBJMACROS
858 |
859 |
860 | #define IPerPropertyBrowsing2_QueryInterface(This,riid,ppvObject) \
861 | ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
862 |
863 | #define IPerPropertyBrowsing2_AddRef(This) \
864 | ( (This)->lpVtbl -> AddRef(This) )
865 |
866 | #define IPerPropertyBrowsing2_Release(This) \
867 | ( (This)->lpVtbl -> Release(This) )
868 |
869 |
870 | #define IPerPropertyBrowsing2_GetDisplayString(This,dispid,pBstr) \
871 | ( (This)->lpVtbl -> GetDisplayString(This,dispid,pBstr) )
872 |
873 | #define IPerPropertyBrowsing2_MapPropertyToPage(This,dispid,pClsidPropPage) \
874 | ( (This)->lpVtbl -> MapPropertyToPage(This,dispid,pClsidPropPage) )
875 |
876 | #define IPerPropertyBrowsing2_GetPredefinedStrings(This,dispid,pCaStrings,pCaCookies) \
877 | ( (This)->lpVtbl -> GetPredefinedStrings(This,dispid,pCaStrings,pCaCookies) )
878 |
879 | #define IPerPropertyBrowsing2_SetPredefinedValue(This,dispid,dwCookie) \
880 | ( (This)->lpVtbl -> SetPredefinedValue(This,dispid,dwCookie) )
881 |
882 | #endif /* COBJMACROS */
883 |
884 |
885 | #endif /* C style interface */
886 |
887 |
888 |
889 |
890 | #endif /* __IPerPropertyBrowsing2_INTERFACE_DEFINED__ */
891 |
892 |
893 | #ifndef __IDebugPropertyEnumType_All_INTERFACE_DEFINED__
894 | #define __IDebugPropertyEnumType_All_INTERFACE_DEFINED__
895 |
896 | /* interface IDebugPropertyEnumType_All */
897 | /* [unique][uuid][object] */
898 |
899 |
900 | EXTERN_C const IID IID_IDebugPropertyEnumType_All;
901 |
902 | #if defined(__cplusplus) && !defined(CINTERFACE)
903 |
904 | MIDL_INTERFACE("51973C55-CB0C-11d0-B5C9-00A0244A0E7A")
905 | IDebugPropertyEnumType_All : public IUnknown
906 | {
907 | public:
908 | virtual HRESULT STDMETHODCALLTYPE GetName(
909 | /* [out] */ __RPC__deref_out_opt BSTR *__MIDL__IDebugPropertyEnumType_All0000) = 0;
910 |
911 | };
912 |
913 | #else /* C style interface */
914 |
915 | typedef struct IDebugPropertyEnumType_AllVtbl
916 | {
917 | BEGIN_INTERFACE
918 |
919 | HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
920 | IDebugPropertyEnumType_All * This,
921 | /* [in] */ __RPC__in REFIID riid,
922 | /* [iid_is][out] */
923 | __RPC__deref_out void **ppvObject);
924 |
925 | ULONG ( STDMETHODCALLTYPE *AddRef )(
926 | IDebugPropertyEnumType_All * This);
927 |
928 | ULONG ( STDMETHODCALLTYPE *Release )(
929 | IDebugPropertyEnumType_All * This);
930 |
931 | HRESULT ( STDMETHODCALLTYPE *GetName )(
932 | IDebugPropertyEnumType_All * This,
933 | /* [out] */ __RPC__deref_out_opt BSTR *__MIDL__IDebugPropertyEnumType_All0000);
934 |
935 | END_INTERFACE
936 | } IDebugPropertyEnumType_AllVtbl;
937 |
938 | interface IDebugPropertyEnumType_All
939 | {
940 | CONST_VTBL struct IDebugPropertyEnumType_AllVtbl *lpVtbl;
941 | };
942 |
943 |
944 |
945 | #ifdef COBJMACROS
946 |
947 |
948 | #define IDebugPropertyEnumType_All_QueryInterface(This,riid,ppvObject) \
949 | ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
950 |
951 | #define IDebugPropertyEnumType_All_AddRef(This) \
952 | ( (This)->lpVtbl -> AddRef(This) )
953 |
954 | #define IDebugPropertyEnumType_All_Release(This) \
955 | ( (This)->lpVtbl -> Release(This) )
956 |
957 |
958 | #define IDebugPropertyEnumType_All_GetName(This,__MIDL__IDebugPropertyEnumType_All0000) \
959 | ( (This)->lpVtbl -> GetName(This,__MIDL__IDebugPropertyEnumType_All0000) )
960 |
961 | #endif /* COBJMACROS */
962 |
963 |
964 | #endif /* C style interface */
965 |
966 |
967 |
968 |
969 | #endif /* __IDebugPropertyEnumType_All_INTERFACE_DEFINED__ */
970 |
971 |
972 | #ifndef __IDebugPropertyEnumType_Locals_INTERFACE_DEFINED__
973 | #define __IDebugPropertyEnumType_Locals_INTERFACE_DEFINED__
974 |
975 | /* interface IDebugPropertyEnumType_Locals */
976 | /* [unique][uuid][object] */
977 |
978 |
979 | EXTERN_C const IID IID_IDebugPropertyEnumType_Locals;
980 |
981 | #if defined(__cplusplus) && !defined(CINTERFACE)
982 |
983 | MIDL_INTERFACE("51973C56-CB0C-11d0-B5C9-00A0244A0E7A")
984 | IDebugPropertyEnumType_Locals : public IDebugPropertyEnumType_All
985 | {
986 | public:
987 | };
988 |
989 | #else /* C style interface */
990 |
991 | typedef struct IDebugPropertyEnumType_LocalsVtbl
992 | {
993 | BEGIN_INTERFACE
994 |
995 | HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
996 | IDebugPropertyEnumType_Locals * This,
997 | /* [in] */ __RPC__in REFIID riid,
998 | /* [iid_is][out] */
999 | __RPC__deref_out void **ppvObject);
1000 |
1001 | ULONG ( STDMETHODCALLTYPE *AddRef )(
1002 | IDebugPropertyEnumType_Locals * This);
1003 |
1004 | ULONG ( STDMETHODCALLTYPE *Release )(
1005 | IDebugPropertyEnumType_Locals * This);
1006 |
1007 | HRESULT ( STDMETHODCALLTYPE *GetName )(
1008 | IDebugPropertyEnumType_Locals * This,
1009 | /* [out] */ __RPC__deref_out_opt BSTR *__MIDL__IDebugPropertyEnumType_All0000);
1010 |
1011 | END_INTERFACE
1012 | } IDebugPropertyEnumType_LocalsVtbl;
1013 |
1014 | interface IDebugPropertyEnumType_Locals
1015 | {
1016 | CONST_VTBL struct IDebugPropertyEnumType_LocalsVtbl *lpVtbl;
1017 | };
1018 |
1019 |
1020 |
1021 | #ifdef COBJMACROS
1022 |
1023 |
1024 | #define IDebugPropertyEnumType_Locals_QueryInterface(This,riid,ppvObject) \
1025 | ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
1026 |
1027 | #define IDebugPropertyEnumType_Locals_AddRef(This) \
1028 | ( (This)->lpVtbl -> AddRef(This) )
1029 |
1030 | #define IDebugPropertyEnumType_Locals_Release(This) \
1031 | ( (This)->lpVtbl -> Release(This) )
1032 |
1033 |
1034 | #define IDebugPropertyEnumType_Locals_GetName(This,__MIDL__IDebugPropertyEnumType_All0000) \
1035 | ( (This)->lpVtbl -> GetName(This,__MIDL__IDebugPropertyEnumType_All0000) )
1036 |
1037 |
1038 | #endif /* COBJMACROS */
1039 |
1040 |
1041 | #endif /* C style interface */
1042 |
1043 |
1044 |
1045 |
1046 | #endif /* __IDebugPropertyEnumType_Locals_INTERFACE_DEFINED__ */
1047 |
1048 |
1049 | #ifndef __IDebugPropertyEnumType_Arguments_INTERFACE_DEFINED__
1050 | #define __IDebugPropertyEnumType_Arguments_INTERFACE_DEFINED__
1051 |
1052 | /* interface IDebugPropertyEnumType_Arguments */
1053 | /* [unique][uuid][object] */
1054 |
1055 |
1056 | EXTERN_C const IID IID_IDebugPropertyEnumType_Arguments;
1057 |
1058 | #if defined(__cplusplus) && !defined(CINTERFACE)
1059 |
1060 | MIDL_INTERFACE("51973C57-CB0C-11d0-B5C9-00A0244A0E7A")
1061 | IDebugPropertyEnumType_Arguments : public IDebugPropertyEnumType_All
1062 | {
1063 | public:
1064 | };
1065 |
1066 | #else /* C style interface */
1067 |
1068 | typedef struct IDebugPropertyEnumType_ArgumentsVtbl
1069 | {
1070 | BEGIN_INTERFACE
1071 |
1072 | HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
1073 | IDebugPropertyEnumType_Arguments * This,
1074 | /* [in] */ __RPC__in REFIID riid,
1075 | /* [iid_is][out] */
1076 | __RPC__deref_out void **ppvObject);
1077 |
1078 | ULONG ( STDMETHODCALLTYPE *AddRef )(
1079 | IDebugPropertyEnumType_Arguments * This);
1080 |
1081 | ULONG ( STDMETHODCALLTYPE *Release )(
1082 | IDebugPropertyEnumType_Arguments * This);
1083 |
1084 | HRESULT ( STDMETHODCALLTYPE *GetName )(
1085 | IDebugPropertyEnumType_Arguments * This,
1086 | /* [out] */ __RPC__deref_out_opt BSTR *__MIDL__IDebugPropertyEnumType_All0000);
1087 |
1088 | END_INTERFACE
1089 | } IDebugPropertyEnumType_ArgumentsVtbl;
1090 |
1091 | interface IDebugPropertyEnumType_Arguments
1092 | {
1093 | CONST_VTBL struct IDebugPropertyEnumType_ArgumentsVtbl *lpVtbl;
1094 | };
1095 |
1096 |
1097 |
1098 | #ifdef COBJMACROS
1099 |
1100 |
1101 | #define IDebugPropertyEnumType_Arguments_QueryInterface(This,riid,ppvObject) \
1102 | ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
1103 |
1104 | #define IDebugPropertyEnumType_Arguments_AddRef(This) \
1105 | ( (This)->lpVtbl -> AddRef(This) )
1106 |
1107 | #define IDebugPropertyEnumType_Arguments_Release(This) \
1108 | ( (This)->lpVtbl -> Release(This) )
1109 |
1110 |
1111 | #define IDebugPropertyEnumType_Arguments_GetName(This,__MIDL__IDebugPropertyEnumType_All0000) \
1112 | ( (This)->lpVtbl -> GetName(This,__MIDL__IDebugPropertyEnumType_All0000) )
1113 |
1114 |
1115 | #endif /* COBJMACROS */
1116 |
1117 |
1118 | #endif /* C style interface */
1119 |
1120 |
1121 |
1122 |
1123 | #endif /* __IDebugPropertyEnumType_Arguments_INTERFACE_DEFINED__ */
1124 |
1125 |
1126 | #ifndef __IDebugPropertyEnumType_LocalsPlusArgs_INTERFACE_DEFINED__
1127 | #define __IDebugPropertyEnumType_LocalsPlusArgs_INTERFACE_DEFINED__
1128 |
1129 | /* interface IDebugPropertyEnumType_LocalsPlusArgs */
1130 | /* [unique][uuid][object] */
1131 |
1132 |
1133 | EXTERN_C const IID IID_IDebugPropertyEnumType_LocalsPlusArgs;
1134 |
1135 | #if defined(__cplusplus) && !defined(CINTERFACE)
1136 |
1137 | MIDL_INTERFACE("51973C58-CB0C-11d0-B5C9-00A0244A0E7A")
1138 | IDebugPropertyEnumType_LocalsPlusArgs : public IDebugPropertyEnumType_All
1139 | {
1140 | public:
1141 | };
1142 |
1143 | #else /* C style interface */
1144 |
1145 | typedef struct IDebugPropertyEnumType_LocalsPlusArgsVtbl
1146 | {
1147 | BEGIN_INTERFACE
1148 |
1149 | HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
1150 | IDebugPropertyEnumType_LocalsPlusArgs * This,
1151 | /* [in] */ __RPC__in REFIID riid,
1152 | /* [iid_is][out] */
1153 | __RPC__deref_out void **ppvObject);
1154 |
1155 | ULONG ( STDMETHODCALLTYPE *AddRef )(
1156 | IDebugPropertyEnumType_LocalsPlusArgs * This);
1157 |
1158 | ULONG ( STDMETHODCALLTYPE *Release )(
1159 | IDebugPropertyEnumType_LocalsPlusArgs * This);
1160 |
1161 | HRESULT ( STDMETHODCALLTYPE *GetName )(
1162 | IDebugPropertyEnumType_LocalsPlusArgs * This,
1163 | /* [out] */ __RPC__deref_out_opt BSTR *__MIDL__IDebugPropertyEnumType_All0000);
1164 |
1165 | END_INTERFACE
1166 | } IDebugPropertyEnumType_LocalsPlusArgsVtbl;
1167 |
1168 | interface IDebugPropertyEnumType_LocalsPlusArgs
1169 | {
1170 | CONST_VTBL struct IDebugPropertyEnumType_LocalsPlusArgsVtbl *lpVtbl;
1171 | };
1172 |
1173 |
1174 |
1175 | #ifdef COBJMACROS
1176 |
1177 |
1178 | #define IDebugPropertyEnumType_LocalsPlusArgs_QueryInterface(This,riid,ppvObject) \
1179 | ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
1180 |
1181 | #define IDebugPropertyEnumType_LocalsPlusArgs_AddRef(This) \
1182 | ( (This)->lpVtbl -> AddRef(This) )
1183 |
1184 | #define IDebugPropertyEnumType_LocalsPlusArgs_Release(This) \
1185 | ( (This)->lpVtbl -> Release(This) )
1186 |
1187 |
1188 | #define IDebugPropertyEnumType_LocalsPlusArgs_GetName(This,__MIDL__IDebugPropertyEnumType_All0000) \
1189 | ( (This)->lpVtbl -> GetName(This,__MIDL__IDebugPropertyEnumType_All0000) )
1190 |
1191 |
1192 | #endif /* COBJMACROS */
1193 |
1194 |
1195 | #endif /* C style interface */
1196 |
1197 |
1198 |
1199 |
1200 | #endif /* __IDebugPropertyEnumType_LocalsPlusArgs_INTERFACE_DEFINED__ */
1201 |
1202 |
1203 | #ifndef __IDebugPropertyEnumType_Registers_INTERFACE_DEFINED__
1204 | #define __IDebugPropertyEnumType_Registers_INTERFACE_DEFINED__
1205 |
1206 | /* interface IDebugPropertyEnumType_Registers */
1207 | /* [unique][uuid][object] */
1208 |
1209 |
1210 | EXTERN_C const IID IID_IDebugPropertyEnumType_Registers;
1211 |
1212 | #if defined(__cplusplus) && !defined(CINTERFACE)
1213 |
1214 | MIDL_INTERFACE("51973C59-CB0C-11d0-B5C9-00A0244A0E7A")
1215 | IDebugPropertyEnumType_Registers : public IDebugPropertyEnumType_All
1216 | {
1217 | public:
1218 | };
1219 |
1220 | #else /* C style interface */
1221 |
1222 | typedef struct IDebugPropertyEnumType_RegistersVtbl
1223 | {
1224 | BEGIN_INTERFACE
1225 |
1226 | HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
1227 | IDebugPropertyEnumType_Registers * This,
1228 | /* [in] */ __RPC__in REFIID riid,
1229 | /* [iid_is][out] */
1230 | __RPC__deref_out void **ppvObject);
1231 |
1232 | ULONG ( STDMETHODCALLTYPE *AddRef )(
1233 | IDebugPropertyEnumType_Registers * This);
1234 |
1235 | ULONG ( STDMETHODCALLTYPE *Release )(
1236 | IDebugPropertyEnumType_Registers * This);
1237 |
1238 | HRESULT ( STDMETHODCALLTYPE *GetName )(
1239 | IDebugPropertyEnumType_Registers * This,
1240 | /* [out] */ __RPC__deref_out_opt BSTR *__MIDL__IDebugPropertyEnumType_All0000);
1241 |
1242 | END_INTERFACE
1243 | } IDebugPropertyEnumType_RegistersVtbl;
1244 |
1245 | interface IDebugPropertyEnumType_Registers
1246 | {
1247 | CONST_VTBL struct IDebugPropertyEnumType_RegistersVtbl *lpVtbl;
1248 | };
1249 |
1250 |
1251 |
1252 | #ifdef COBJMACROS
1253 |
1254 |
1255 | #define IDebugPropertyEnumType_Registers_QueryInterface(This,riid,ppvObject) \
1256 | ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
1257 |
1258 | #define IDebugPropertyEnumType_Registers_AddRef(This) \
1259 | ( (This)->lpVtbl -> AddRef(This) )
1260 |
1261 | #define IDebugPropertyEnumType_Registers_Release(This) \
1262 | ( (This)->lpVtbl -> Release(This) )
1263 |
1264 |
1265 | #define IDebugPropertyEnumType_Registers_GetName(This,__MIDL__IDebugPropertyEnumType_All0000) \
1266 | ( (This)->lpVtbl -> GetName(This,__MIDL__IDebugPropertyEnumType_All0000) )
1267 |
1268 |
1269 | #endif /* COBJMACROS */
1270 |
1271 |
1272 | #endif /* C style interface */
1273 |
1274 |
1275 |
1276 |
1277 | #endif /* __IDebugPropertyEnumType_Registers_INTERFACE_DEFINED__ */
1278 |
1279 |
1280 | /* Additional Prototypes for ALL interfaces */
1281 |
1282 | unsigned long __RPC_USER BSTR_UserSize( unsigned long *, unsigned long , BSTR * );
1283 | unsigned char * __RPC_USER BSTR_UserMarshal( unsigned long *, unsigned char *, BSTR * );
1284 | unsigned char * __RPC_USER BSTR_UserUnmarshal(unsigned long *, unsigned char *, BSTR * );
1285 | void __RPC_USER BSTR_UserFree( unsigned long *, BSTR * );
1286 |
1287 | unsigned long __RPC_USER VARIANT_UserSize( unsigned long *, unsigned long , VARIANT * );
1288 | unsigned char * __RPC_USER VARIANT_UserMarshal( unsigned long *, unsigned char *, VARIANT * );
1289 | unsigned char * __RPC_USER VARIANT_UserUnmarshal(unsigned long *, unsigned char *, VARIANT * );
1290 | void __RPC_USER VARIANT_UserFree( unsigned long *, VARIANT * );
1291 |
1292 | unsigned long __RPC_USER BSTR_UserSize64( unsigned long *, unsigned long , BSTR * );
1293 | unsigned char * __RPC_USER BSTR_UserMarshal64( unsigned long *, unsigned char *, BSTR * );
1294 | unsigned char * __RPC_USER BSTR_UserUnmarshal64(unsigned long *, unsigned char *, BSTR * );
1295 | void __RPC_USER BSTR_UserFree64( unsigned long *, BSTR * );
1296 |
1297 | unsigned long __RPC_USER VARIANT_UserSize64( unsigned long *, unsigned long , VARIANT * );
1298 | unsigned char * __RPC_USER VARIANT_UserMarshal64( unsigned long *, unsigned char *, VARIANT * );
1299 | unsigned char * __RPC_USER VARIANT_UserUnmarshal64(unsigned long *, unsigned char *, VARIANT * );
1300 | void __RPC_USER VARIANT_UserFree64( unsigned long *, VARIANT * );
1301 |
1302 | /* [local] */ HRESULT STDMETHODCALLTYPE IDebugProperty_GetPropertyInfo_Proxy(
1303 | IDebugProperty * This,
1304 | /* [in] */ DWORD dwFieldSpec,
1305 | /* [in] */ UINT nRadix,
1306 | /* [out] */ DebugPropertyInfo *pPropertyInfo);
1307 |
1308 |
1309 | /* [call_as] */ HRESULT STDMETHODCALLTYPE IDebugProperty_GetPropertyInfo_Stub(
1310 | IDebugProperty * This,
1311 | /* [in] */ DWORD dwFieldSpec,
1312 | /* [in] */ UINT nRadix,
1313 | /* [out] */ __RPC__out DWORD *dwValidFields,
1314 | /* [out] */ __RPC__deref_out_opt BSTR *pbstrName,
1315 | /* [out] */ __RPC__deref_out_opt BSTR *pbstrType,
1316 | /* [out] */ __RPC__deref_out_opt BSTR *pbstrValue,
1317 | /* [out] */ __RPC__deref_out_opt BSTR *pbstrFullName,
1318 | /* [out] */ __RPC__out DWORD *pdwAttrib,
1319 | /* [unique][out][in] */ __RPC__deref_opt_inout_opt IDebugProperty **ppDebugProperty);
1320 |
1321 | /* [local] */ HRESULT STDMETHODCALLTYPE IEnumDebugPropertyInfo_Next_Proxy(
1322 | IEnumDebugPropertyInfo * This,
1323 | /* [in] */ ULONG celt,
1324 | /* [out] */ DebugPropertyInfo *pi,
1325 | /* [out] */ ULONG *pcEltsfetched);
1326 |
1327 |
1328 | /* [call_as] */ HRESULT __stdcall IEnumDebugPropertyInfo_Next_Stub(
1329 | IEnumDebugPropertyInfo * This,
1330 | /* [in] */ ULONG celt,
1331 | /* [length_is][size_is][unique][out][in] */ __RPC__inout_ecount_part_opt(celt, *pcEltsfetched) DebugPropertyInfo *pinfo,
1332 | /* [out] */ __RPC__out ULONG *pcEltsfetched);
1333 |
1334 |
1335 |
1336 | /* end of Additional Prototypes */
1337 |
1338 | #ifdef __cplusplus
1339 | }
1340 | #endif
1341 |
1342 | #endif
1343 |
1344 |
1345 |
1346 |
--------------------------------------------------------------------------------
/unit_test/x64emudecode64/libamd64/dbgeng.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sdvassilev/x64emu/c9b289fa64b28965d8d322d8c16ec6c8fa7bd239/unit_test/x64emudecode64/libamd64/dbgeng.lib
--------------------------------------------------------------------------------
/unit_test/x64emudecode64/main.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * x64 Software Emulator (x64emu)
3 | * Copyright (c) 2010-2012 Svetoslav Vassilev
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Svetoslav Vassilev
19 | */
20 |
21 | #include
22 | #include
23 | #include
24 | #include
25 |
26 | #ifndef ASSERT
27 | #define ASSERT _ASSERT
28 | #endif
29 |
30 | #include "x64emu.h"
31 |
32 | IDebugClient* g_Client = NULL;
33 | IDebugControl4* g_Control = NULL;
34 |
35 | bool g_is64bit = true;
36 |
37 | extern "C"
38 | VOID
39 | RtlAssert(
40 | __in PVOID VoidFailedAssertion,
41 | __in PVOID VoidFileName,
42 | __in ULONG LineNumber,
43 | __in_opt PSTR MutableMessage
44 | )
45 | {
46 | DebugBreak();
47 | }
48 |
49 | bool AttachDbg()
50 | {
51 | HRESULT status;
52 |
53 | if ((status = DebugCreate(__uuidof(IDebugClient),
54 | (void**)&g_Client)) != S_OK)
55 | {
56 | return false;
57 | }
58 |
59 | if ((status = g_Client->QueryInterface( __uuidof(IDebugControl4),
60 | (void**)&g_Control)) != S_OK)
61 | {
62 | return false;
63 | }
64 |
65 | if ((status = g_Client->AttachProcess( 0, GetCurrentProcessId(),
66 | DEBUG_ATTACH_NONINVASIVE | DEBUG_ATTACH_NONINVASIVE_NO_SUSPEND)) != S_OK)
67 | {
68 | return false;
69 | }
70 |
71 | if ((status = g_Control->WaitForEvent(DEBUG_WAIT_DEFAULT,
72 | INFINITE)) != S_OK)
73 | {
74 | return false;
75 | }
76 |
77 | return true;
78 | }
79 |
80 | void DetachDbg()
81 | {
82 | if( g_Control != NULL )
83 | {
84 | g_Control->Release();
85 | g_Control = NULL;
86 | }
87 |
88 | if( g_Client != NULL )
89 | {
90 | g_Client->EndSession(DEBUG_END_ACTIVE_DETACH);
91 | g_Client->Release();
92 | g_Client = NULL;
93 | }
94 |
95 | }
96 |
97 | __inline UINT32 __cdecl Ntohl(UINT32 x)
98 | {
99 | return (x >> 24) | (x << 24) | ((x << 8) & 0x00ff0000) | ((x >> 8) & 0x0000ff00);
100 | }
101 |
102 | UINT64 g_Rip = 0;
103 |
104 | extern UINT_PTR
105 | GetGuestContextRegisterValue(
106 | void* ctx,
107 | int registerId);
108 |
109 | #define SKIP_3B_OPCODE(b1, b2, b3, dw) \
110 | {\
111 | if (((UINT32)(b1) | ((UINT32)(b2) << 8) | ((UINT32)(b3) << 16)) == ((dw)&0xffffff))\
112 | continue;\
113 | }
114 |
115 | #define SKIP_2B_OPCODE(b1, b2, dw) \
116 | {\
117 | if (((UINT32)(b1) | ((UINT32)(b2) << 8)) == ((dw)&0xffff))\
118 | continue;\
119 | }
120 |
121 | #define SKIP_1B_OPCODE(b1, dw) \
122 | {\
123 | if ((UINT32)(b1) == ((dw)&0xff))\
124 | continue;\
125 | }
126 |
127 | void StrStrip(char* str, size_t len, char ch)
128 | {
129 | if (0 == len) {
130 | len = strlen(str);
131 | }
132 | size_t slow = 0;
133 | for (size_t fast = 0; fast < len; fast++)
134 | {
135 | if (str[fast] != ch)
136 | {
137 | str[slow++] = str[fast];
138 | }
139 | }
140 | str[slow] = 0;
141 | }
142 |
143 | void StrStripConsec(char* str, size_t len, char ch)
144 | {
145 | if (0 == len) {
146 | len = strlen(str);
147 | }
148 | size_t slow = 0;
149 | bool skip = !!(str[0] == ch);
150 | for (size_t fast = 0; fast < len; fast++)
151 | {
152 | if (str[fast] != ch || !skip)
153 | {
154 | str[slow++] = str[fast];
155 | }
156 | skip = !!(str[fast] == ch);
157 | }
158 | str[slow] = 0;
159 | }
160 |
161 | void NormalizeDbgMnemonic(char* str)
162 | {
163 | StrStrip(str,0,'`');
164 | StrStripConsec(str,0,' ');
165 | size_t len = strlen(str);
166 | while (len && (
167 | str[len-1] == 0xa ||
168 | str[len-1] == 0xd ||
169 | str[len-1] == '.' ||
170 | str[len-1] == ' ' ||
171 | str[len-1] == ',' ||
172 | str[len-1] == '!' ||
173 | str[len-1] == '?'))
174 | {
175 | str[--len] = 0;
176 | }
177 |
178 | char* repe;
179 | if (0 != (repe = strstr(str,"repe")))
180 | {
181 | repe += 3;
182 | memmove(repe,repe+1,(len-(repe-str))*sizeof(char));
183 | --len;
184 | }
185 |
186 | if (strstr(str,"div") ||
187 | strstr(str,"div") ||
188 | strstr(str,"mul") ||
189 | strstr(str,"imul"))
190 | {
191 | // strip the first operand as it is implied to be eax and debugger
192 | // engine uses somewhat random logic to decide whether to display it
193 | // or not. I've seen "idiv bh", as well as "idiv eax,ebx"
194 | char* opEnd = strchr(str,',');
195 | char* opBegin = 0;
196 | ASSERT(len < opEnd);
197 | if (opEnd)
198 | {
199 | opBegin = opEnd-1;
200 | while (opBegin >= str && *opBegin != ' ')
201 | {
202 | opBegin--;
203 | }
204 | if (opBegin >= str)
205 | {
206 | memmove(opBegin+1,opEnd+1,len - (opEnd - str) - 1);
207 | str[len - (opEnd-opBegin)] = 0;
208 | }
209 | }
210 | }
211 | }
212 |
213 | bool StrStripSubStr(
214 | char* str,
215 | size_t strLen,
216 | const char* _subStr)
217 | {
218 | bool ret = false;
219 | char* subStr = strstr(str,_subStr);
220 | if (subStr)
221 | {
222 | size_t subStrLen = strlen(_subStr);
223 | strLen = (0 != strLen) ? strLen : strlen(str);
224 | memmove(subStr,subStr+subStrLen,strLen-(subStr-str)-subStrLen);
225 | str[strLen-subStrLen] = 0;
226 | ret = true;
227 | }
228 | return ret;
229 | }
230 |
231 | bool SkipOrFixupMnemonic(
232 | char* dbgStr,
233 | const char* emuStr)
234 | {
235 | if (strstr(dbgStr, "fword ptr") ||
236 | strstr(dbgStr, "xlat") ||
237 | strstr(dbgStr, "xmm") ||
238 | strstr(dbgStr, "st("))
239 | {
240 | return true;
241 | }
242 | char* subStr;
243 | if (0 != (subStr = strstr(dbgStr,"xchg")))
244 | {
245 | char* opBeg = subStr+5;
246 | _strrev(opBeg);
247 | char* opEnd = strchr(dbgStr,',');
248 | if (0 == opEnd) {
249 | return false;
250 | }
251 | *opEnd = 0;
252 | _strrev(opBeg);
253 | *opEnd = ',';
254 | _strrev(opEnd + 1);
255 | if (!_stricmp(dbgStr,emuStr)) {
256 | return true;
257 | }
258 | }
259 | size_t len = strlen(dbgStr);
260 | if (StrStripSubStr(dbgStr,len,"es:") ||
261 | StrStripSubStr(dbgStr,len,"cs:") ||
262 | StrStripSubStr(dbgStr,len,"ss:") ||
263 | StrStripSubStr(dbgStr,len,"ds:") ||
264 | StrStripSubStr(dbgStr,len,"fs:") ||
265 | StrStripSubStr(dbgStr,len,"gs:"))
266 | {
267 | if (!_stricmp(dbgStr,emuStr)) {
268 | return true;
269 | }
270 | }
271 |
272 | if (StrStripSubStr(dbgStr,len,"hnt ")||
273 | StrStripSubStr(dbgStr,len,"ht "))
274 | {
275 | if (!_stricmp(dbgStr,emuStr)) {
276 | return true;
277 | }
278 | }
279 |
280 | char* sub = strchr(dbgStr, ' ');
281 | if (sub && StrStripSubStr(sub,len-(sub-dbgStr),"00000000"))
282 | {
283 | if (!_stricmp(dbgStr,emuStr)) {
284 | return true;
285 | }
286 | }
287 |
288 | return false;
289 | }
290 |
291 | bool DecodeInstrAndCompare(
292 | UINT32* opCode,
293 | char* _prevAsmBuffer = 0,
294 | bool* opcodeLenError = 0,
295 | bool* mnemonicError = 0)
296 | {
297 | HRESULT hr = S_OK;
298 | char asmBuffer[1024] = {0};
299 | ULONG asmSize = 0;
300 | ULONG64 endAddr = 0;
301 | X64_EMULATOR_RUNTIME emuRte;
302 | char prevAsmBufferSub[1024] = {0};
303 | char* prevAsmBuffer = _prevAsmBuffer;
304 | bool ret = true;
305 |
306 | if (!prevAsmBuffer) {
307 | prevAsmBuffer = prevAsmBufferSub;
308 | }
309 | if (opcodeLenError) {
310 | *opcodeLenError = false;
311 | }
312 | if (mnemonicError) {
313 | *mnemonicError = false;
314 | }
315 |
316 |
317 | EmuInitRuntimeStruct(&emuRte,0,GetGuestContextRegisterValue);
318 |
319 | g_Rip = (ULONG64)opCode;
320 |
321 | g_Control->SetEffectiveProcessorType(g_is64bit ? IMAGE_FILE_MACHINE_AMD64 : IMAGE_FILE_MACHINE_I386);
322 |
323 | hr = g_Control->GetNearInstruction( g_Rip, 1, &endAddr);
324 |
325 | if (S_OK == hr)
326 | {
327 | ULONG64 dbgInstrLen = endAddr - g_Rip;
328 | hr = g_Control->Disassemble( g_Rip, 0,
329 | asmBuffer, ARRAYSIZE(asmBuffer)-1,
330 | &asmSize, &endAddr);
331 |
332 | if (S_OK == hr &&
333 | 0 == strchr(asmBuffer, '?'))
334 | {
335 |
336 | X64_EMULATOR_CTX emu;
337 |
338 | NormalizeDbgMnemonic(asmBuffer);
339 |
340 | EmuInitEmulatorCtxForDecode(&emu,g_Rip,8,g_is64bit);
341 | emu.CpuState.IA32eX64 = g_is64bit;
342 | EmuDecodeInstruction(&emu);
343 | if (emu.Instruction.InstructionLen != dbgInstrLen)
344 | {
345 | if (!emu.Instruction.Flags.FpuInstruction) // TODO:
346 | {
347 | printf("INSTR LEN MISMATCH: x64Emu %d, dbgeng %d\n\t%s\n",
348 | emu.Instruction.InstructionLen, dbgInstrLen, asmBuffer);
349 | if (opcodeLenError) {
350 | *opcodeLenError = true;
351 | }
352 | ret = false;
353 | }
354 | }
355 | else
356 | {
357 | const char* mnemonic = EmuGetDecodedMnemonic(&emu);
358 | NormalizeDbgMnemonic(const_cast(mnemonic));
359 | if (_stricmp(asmBuffer,prevAsmBuffer) &&
360 | _stricmp(asmBuffer,mnemonic))
361 | {
362 | strncpy(prevAsmBuffer,asmBuffer,ARRAYSIZE(asmBuffer)-1);
363 | if (!SkipOrFixupMnemonic(asmBuffer,mnemonic))
364 | {
365 | printf("DISASM MISMATCH:\n");
366 | printf("\tx64 emu: %s\n",mnemonic);
367 | printf("\tdbg eng: %s\n",prevAsmBuffer);
368 | if (mnemonicError) {
369 | *mnemonicError = true;;
370 | }
371 | ret = false;
372 | }
373 | }
374 | else
375 | {
376 | strncpy(prevAsmBuffer,asmBuffer,ARRAYSIZE(asmBuffer)-1);
377 | }
378 | }
379 | }
380 | }
381 |
382 | return ret;
383 | }
384 |
385 | int GenAndDecodeInstructions(UINT32 step)
386 | {
387 | HRESULT hr = S_OK;
388 | int err = 0;
389 | int mnemonicErr = 0;
390 | UINT32 it = 0;
391 | char prevAsmBuffer[1024] = {0};
392 | ULONG asmSize = 0;
393 | ULONG64 endAddr = 0;
394 | UINT32 opCode[8] = {0,0,};
395 |
396 | g_Rip = (ULONG64)opCode;
397 |
398 | g_Control->SetEffectiveProcessorType(g_is64bit ? IMAGE_FILE_MACHINE_AMD64 : IMAGE_FILE_MACHINE_I386);
399 |
400 | do
401 | {
402 | bool opcodeLenError = false;
403 | bool itMnemonicError = false;
404 |
405 | opCode[1] -= step;
406 | opCode[0] = Ntohl( opCode[1] );
407 |
408 | //
409 | // Skip opcodes for which I think there is a discrepancy between
410 | // the debugger and intel's manual
411 | //
412 | SKIP_3B_OPCODE(0x0f,0xae,0x30, opCode[0]);
413 | SKIP_3B_OPCODE(0x0f,0xae,0x70, opCode[0]);
414 | SKIP_3B_OPCODE(0x0f,0xae,0xb0, opCode[0]);
415 |
416 | SKIP_2B_OPCODE(0x0f, 0x04, opCode[0]);
417 | SKIP_2B_OPCODE(0x0f, 0x0a, opCode[0]);
418 | SKIP_2B_OPCODE(0x0f, 0x0c, opCode[0]);
419 | SKIP_2B_OPCODE(0x0f, 0x0e, opCode[0]);
420 | SKIP_2B_OPCODE(0x0f, 0x0f, opCode[0]);
421 | SKIP_2B_OPCODE(0x0f, 0x24, opCode[0]);
422 | SKIP_2B_OPCODE(0x0f, 0x25, opCode[0]);
423 | SKIP_2B_OPCODE(0x0f, 0x26, opCode[0]);
424 | SKIP_2B_OPCODE(0x0f, 0x27, opCode[0]);
425 | SKIP_2B_OPCODE(0x0f, 0x36, opCode[0]);
426 | SKIP_2B_OPCODE(0x0f, 0x39, opCode[0]);
427 | SKIP_2B_OPCODE(0x0f, 0x3b, opCode[0]);
428 | SKIP_2B_OPCODE(0x0f, 0x3c, opCode[0]);
429 | SKIP_2B_OPCODE(0x0f, 0x3d, opCode[0]);
430 | SKIP_2B_OPCODE(0x0f, 0x3e, opCode[0]);
431 | SKIP_2B_OPCODE(0x0f, 0x3f, opCode[0]);
432 | SKIP_2B_OPCODE(0x0f, 0x7a, opCode[0]);
433 | SKIP_2B_OPCODE(0x0f, 0x7b, opCode[0]);
434 | SKIP_2B_OPCODE(0x0f, 0xb8, opCode[0]);
435 | SKIP_2B_OPCODE(0x0f, 0xa6, opCode[0]);
436 | SKIP_2B_OPCODE(0x0f, 0xa7, opCode[0]);
437 |
438 | if (g_is64bit)
439 | {
440 | SKIP_1B_OPCODE(0xc5,opCode[0]);
441 | }
442 |
443 | DecodeInstrAndCompare(opCode,prevAsmBuffer,&opcodeLenError,&itMnemonicError);
444 | if (opcodeLenError) {
445 | ++err;
446 | }
447 | if (itMnemonicError) {
448 | ++mnemonicErr;
449 | }
450 |
451 | ++it;
452 | }
453 | while (opCode[1] > (step - 1));
454 |
455 | printf("Instructions scanned: %d\n", it);
456 | printf("Opcode Len ERRORS: %d\n", err);
457 | printf("Opcode Mnemon ERRORS: %d\n", mnemonicErr);
458 |
459 | return err;
460 | }
461 |
462 | void Usage()
463 | {
464 | printf("Usage:\n");
465 | printf("\ttestemudecode64 [-d ] [-i386]\n\n");
466 | printf("where:\n");
467 | printf("\t-d When present the specified opcode stream will be decoded; if -d is\n"
468 | "\t not present, then the built-in sample of randomized instruction \n"
469 | "\t stream is tested.\n");
470 | printf("\t-i386 The instruction stream is treated as 32-bit opcode\n");
471 | printf("\nExamples: \n");
472 | printf("\ttestemudecode64 -d c70425b000feff00000000\n");
473 | printf("\ttestemudecode64 -d c70425b000feff00000000 -i386\n");
474 | printf("\ttestemudecode64\n");
475 | printf("\ttestemudecode64 -i386\n");
476 |
477 | }
478 |
479 | void PrintOperand(const X64_EMULATOR_CTX& emu, UINT32 idx)
480 | {
481 | const X64_OPERAND* op = EmuGetOperand(const_cast(&emu),idx);
482 | printf("\tOperand %d: %s size %d\n",idx,EmuGetOperandTypeAsStr(op->Type),
483 | op->Size);
484 | printf("\tOperand %d: %s\n",idx,EmuGetOperandTypeAsStr(op->Type));
485 | if (OPERAND_TYPE_MEM == op->Type)
486 | {
487 | printf("\t\tAddress: %p\n",op->Op);
488 | }
489 | else
490 | {
491 | UINT64 val = op->OpAsInt64;
492 | val &= ((UINT64)1 << 8*op->Size) - 1;
493 | printf("\t\tValue: %I64d 0x%X\n",val,val);
494 | }
495 | }
496 |
497 | void PrintDecodedInstruction(X64_EMULATOR_CTX& emu)
498 | {
499 | size_t instrLen = emu.Instruction.InstructionLen;
500 | const UINT8* pOpCode = reinterpret_cast(emu.CpuState.RipGuest.AsInt64);
501 | printf("%s\n", EmuGetDecodedMnemonic(&emu));
502 | printf("\tOperand count: %d\n", emu.Instruction.Flags.OperandCount);
503 | printf("\tDefault operand size: %d\n", emu.Instruction.OperandSize);
504 | for (UINT32 i = 0; i < emu.Instruction.Flags.OperandCount; i++)
505 | {
506 | PrintOperand(emu,i);
507 | }
508 | }
509 |
510 | bool DecodeInstructionStream(
511 | const UINT8* pInstr,
512 | size_t streamLen,
513 | const wchar_t* _pCmpMnemonic = 0)
514 | {
515 | X64_EMULATOR_CTX emu;
516 | X64_EMULATOR_RUNTIME emuRte;
517 | struct RUNTIME_CTX {
518 | size_t StreamLen;
519 | UINT64* RipPtr;
520 | };
521 | EmuInitRuntimeStruct(&emuRte,0,GetGuestContextRegisterValue);
522 | EmuInitEmulatorCtx(&emu, &emuRte, streamLen);
523 | g_Rip = (UINT64)pInstr;
524 | while (g_Rip < (UINT_PTR)pInstr + streamLen)
525 | {
526 | emu.CpuState.IA32eX64 = g_is64bit;
527 | if (!EmuDecodeInstruction(&emu))
528 | {
529 | ASSERT(false);
530 | printf("ERROR: failed to decode instruction at offset %d\n", streamLen);
531 | return false;
532 | }
533 | PrintDecodedInstruction(emu);
534 | if (_pCmpMnemonic)
535 | {
536 | size_t mnemonicLen = wcslen(_pCmpMnemonic);
537 | char* pCmpMnemonic = (char*)malloc(mnemonicLen+1);
538 | for (size_t i = 0; i < mnemonicLen; i++) {
539 | pCmpMnemonic[i] = (char)_pCmpMnemonic[i];
540 | }
541 | pCmpMnemonic[mnemonicLen]=0;
542 | NormalizeDbgMnemonic(pCmpMnemonic);
543 | if (0 != _stricmp(pCmpMnemonic,EmuGetDecodedMnemonic(&emu)))
544 | {
545 | printf("DISASM MISMATCH:\n");
546 | printf("\tx64 emu: %s\n",EmuGetDecodedMnemonic(&emu));
547 | printf("\texpected: %s\n",pCmpMnemonic);
548 | free(pCmpMnemonic);
549 | return false;
550 | }
551 | free(pCmpMnemonic);
552 | }
553 | g_Rip += emu.Instruction.InstructionLen;
554 | EmuCleanupEmulatorCtx(&emu);
555 | }
556 | return true;
557 | }
558 |
559 | bool FromStringToOpcode(const wchar_t* pStr, UINT8** ppOpcode)
560 | {
561 | UINT8* pInstr = 0;
562 | bool ret = false;
563 | size_t len = wcslen(pStr);
564 | if (len%2 != 0)
565 | {
566 | printf("Even number of chars expected, received %d!\n", len);
567 | goto __return;;
568 | }
569 | pInstr = (UINT8*)malloc(len/2);
570 | ASSERT(pInstr); // should not really fail
571 | for (size_t i = 0; i < len/2; i++)
572 | {
573 | const wchar_t* curr = pStr + i*2;
574 | char ch;
575 | if (swscanf(curr, L"%01x", &ch) != 1)
576 | {
577 | printf("Error: Invalid hex nibble %c encountered at "
578 | "position %d\n", curr, i*2);
579 | goto __return;
580 | }
581 | pInstr[i] = ch<<4;
582 | curr++;
583 | if (swscanf(curr, L"%01x", &ch) != 1)
584 | {
585 | printf("Error: Invalid hex nibble %c encountered at "
586 | "position %d\n", curr, i*2);
587 | goto __return;
588 | }
589 | pInstr[i] |= ch;
590 | }
591 | ret = true;
592 | *ppOpcode = pInstr;
593 | __return:
594 | if (!ret)
595 | {
596 | if (pInstr) {
597 | free(pInstr);
598 | }
599 | }
600 | return ret;
601 | }
602 |
603 | bool TestMove_8b04850000feff()
604 | {
605 | UINT8 opCode[256] = {0x8b,0x04,0x85,0x00,0x00,0xfe,0xff,0,0};
606 | return DecodeInstrAndCompare((UINT32*)opCode);
607 | }
608 |
609 | int __cdecl
610 | wmain(int argc, wchar_t* argv[])
611 | {
612 | size_t err = 0;
613 | UINT8* pInstr = 0;
614 | size_t instrLen = 0;
615 | for (int i = 1; i < argc; ++i)
616 | {
617 | if (!_wcsicmp(argv[i],L"-d"))
618 | {
619 | if (++i < argc && !pInstr)
620 | {
621 | instrLen = wcslen(argv[i]);
622 | if (instrLen % 2 != 0)
623 | {
624 | printf("Even number of chars expected, received %d!\n", instrLen);
625 | return -1;
626 | }
627 |
628 | if (!FromStringToOpcode(argv[i],&pInstr))
629 | {
630 | return -1;
631 | }
632 | }
633 | else
634 | {
635 | Usage();
636 | return -1;
637 | }
638 | }
639 | else if (!_wcsicmp(argv[i], L"-i386"))
640 | {
641 | g_is64bit = false;
642 | }
643 | else
644 | {
645 | Usage();
646 | return -1;
647 | }
648 | }
649 |
650 | if (0 != pInstr)
651 | {
652 | DecodeInstructionStream(pInstr, instrLen / 2);
653 | free(pInstr);
654 | }
655 | else if (AttachDbg())
656 | {
657 | TestMove_8b04850000feff();
658 | err += GenAndDecodeInstructions(0x1000);
659 | DetachDbg();
660 | }
661 |
662 | return err;
663 | }
664 |
--------------------------------------------------------------------------------
/unit_test/x64emudecode64/make.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 | if "%1" == "__SPAWNED__" goto main
3 | cmd.exe /c "%0" __SPAWNED__ %*
4 | if ERRORLEVEL 1 echo ERRORLEVEL=%ERRORLEVEL%
5 | goto return
6 |
7 | :main
8 | set ROOTDIR=..\..
9 | call %ROOTDIR%\make\ddkbuild.bat %*
10 |
11 | :return
12 |
--------------------------------------------------------------------------------
/unit_test/x64emudecode64/makefile:
--------------------------------------------------------------------------------
1 | #
2 | # DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source
3 | # file to this component. This file merely indirects to the real make file
4 | # that is shared by all the driver components of the Windows NT DDK
5 | #
6 | !INCLUDE $(NTMAKEENV)\makefile.def
7 |
8 |
--------------------------------------------------------------------------------
/unit_test/x64emudecode64/sources:
--------------------------------------------------------------------------------
1 | TARGETNAME=testemudecode64
2 | TARGETTYPE=PROGRAM
3 | UMTYPE=console
4 | UMENTRY=wmain
5 | USE_MSVCRT=1
6 |
7 | C_DEFINES=$(C_DEFINES) -DUNICODE -D_UNICODE
8 |
9 | LINKLIBS=$(SDK_LIB_PATH)\shell32.lib .\libamd64\dbgeng.lib
10 |
11 | INCLUDES=$(INCLUDES); \
12 | $(SDK_INC_PATH); \
13 | $(DDK_INC_PATH); \
14 | ..\..\include;
15 |
16 | TARGETLIBS=$(TARGETLIBS) \
17 | ..\..\x64emu\$O\x64emu.lib
18 |
19 | SOURCES= \
20 | main.cpp\
21 | x64emu.cpp
22 |
23 | !if "$(DDK_TARGET_OS)"=="WinLH"
24 | _NT_TARGET_VERSION=$(_NT_TARGET_VERSION_WINXP)
25 | !endif
26 |
27 |
--------------------------------------------------------------------------------
/unit_test/x64emudecode64/x64emu.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * x64 Software Emulator (x64emu)
3 | * Copyright (c) 2010-2012 Svetoslav Vassilev
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Svetoslav Vassilev
19 | */
20 |
21 | #include
22 | #include
23 |
24 | #include "ntifs.h"
25 | #include "opcodemap.h"
26 | #include "raisepanic.h"
27 | #include "registers.h"
28 |
29 | void
30 | VmxRootPanicEx(
31 | const char* pFile,
32 | UINT32 lineNumber,
33 | const PANIC_PARAMS& params
34 | )
35 | {
36 | DbgBreakPoint();
37 | }
38 |
39 | extern UINT_PTR g_Rip;
40 |
41 | UINT_PTR
42 | GetGuestContextRegisterValue(
43 | void* ctx,
44 | int registerId)
45 | {
46 | return (RIP_GUEST_ID == registerId) ? g_Rip : 0;
47 | }
48 |
--------------------------------------------------------------------------------
/unit_test/x64emudecode64/x64emudecode64.vcxproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | x64
7 |
8 |
9 | Release
10 | x64
11 |
12 |
13 |
14 | testemudecode64
15 | {0AFE2708-79D7-4821-B10C-87213E4E280C}
16 | MakeFileProj
17 |
18 |
19 |
20 | Makefile
21 |
22 |
23 | Makefile
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 | <_ProjectFileVersion>10.0.30128.1
37 | make amd64dbg
38 | make amd64dbg -a
39 |
40 |
41 | $(SolutionDir)amd64dbg\testemudecode64.exe
42 | WIN32;_DEBUG;$(NMakePreprocessorDefinitions)
43 | $(NMakeIncludeSearchPath)
44 | $(NMakeForcedIncludes)
45 | $(NMakeAssemblySearchPath)
46 | $(NMakeForcedUsingAssemblies)
47 | make amd64rel
48 | make amd64rel -a
49 |
50 |
51 | $(SolutionDir)amd64dbg\testemudecode64.exe
52 | WIN32;NDEBUG;$(NMakePreprocessorDefinitions)
53 | $(NMakeIncludeSearchPath)
54 | $(NMakeForcedIncludes)
55 | $(NMakeAssemblySearchPath)
56 | $(NMakeForcedUsingAssemblies)
57 |
58 |
59 | .\objfre_win7_amd64\amd64
60 | .\objfre_win7_amd64\amd64
61 |
62 |
63 | .\objchk_win7_amd64\amd64\
64 | .\objchk_win7_amd64\amd64\
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
--------------------------------------------------------------------------------
/unit_test/x64emudecode64/x64emudecode64.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | -d c704
5 | WindowsLocalDebugger
6 | -d c704
7 |
8 |
9 | -d c704
10 | WindowsLocalDebugger
11 |
12 |
--------------------------------------------------------------------------------
/unit_test/x64emuexec/amd64/testops.asm:
--------------------------------------------------------------------------------
1 | ; test ops
2 |
3 | .code
4 |
5 | TestExecShell proc public FRAME
6 | .ENDPROLOG
7 | add byte ptr[0],al; trigger access violation, so we can setup pre CPU ctx
8 |
9 | ; from this point on we have to have at least 15 nops to accomodate the
10 | ; longest instruction plust 7 more bytes for another "add byte ptr[0], al"
11 | ; in order to trigger another access violation to capture the post execution
12 | ; cpu context.
13 |
14 | nop ;1
15 | nop ;2
16 | nop ;3
17 | nop ;4
18 | nop ;5
19 | nop ;6
20 | nop ;7
21 | nop ;8
22 | nop ;9
23 | nop ;10
24 | nop ;11
25 | nop ;12
26 | nop ;13
27 | nop ;14
28 | nop ;15
29 |
30 | ; add byte ptr[0], al; trigger access violation, so we can setup post CPU ctx
31 | nop ;1
32 | nop ;2
33 | nop ;3
34 | nop ;4
35 | nop ;5
36 | nop ;6
37 | nop ;7
38 | ret
39 | TestExecShell endp
40 |
41 | end
--------------------------------------------------------------------------------
/unit_test/x64emuexec/make.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 | if "%1" == "__SPAWNED__" goto main
3 | cmd.exe /c "%0" __SPAWNED__ %*
4 | if ERRORLEVEL 1 echo ERRORLEVEL=%ERRORLEVEL%
5 | goto return
6 |
7 | :main
8 | set ROOTDIR=..\..
9 | call %ROOTDIR%\make\ddkbuild.bat %*
10 |
11 | :return
12 |
--------------------------------------------------------------------------------
/unit_test/x64emuexec/makefile:
--------------------------------------------------------------------------------
1 | #
2 | # DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source
3 | # file to this component. This file merely indirects to the real make file
4 | # that is shared by all the driver components of the Windows NT DDK
5 | #
6 | !INCLUDE $(NTMAKEENV)\makefile.def
7 |
8 |
--------------------------------------------------------------------------------
/unit_test/x64emuexec/sources:
--------------------------------------------------------------------------------
1 | TARGETNAME=testemuexec
2 | TARGETTYPE=PROGRAM
3 | UMTYPE=console
4 | UMENTRY=wmain
5 | USE_MSVCRT=1
6 |
7 | C_DEFINES=$(C_DEFINES) -DUNICODE -D_UNICODE
8 |
9 | LINKLIBS=$(SDK_LIB_PATH)\shell32.lib
10 |
11 | INCLUDES=$(INCLUDES); \
12 | $(SDK_INC_PATH); \
13 | $(DDK_INC_PATH); \
14 | ..\..\include;
15 |
16 | TARGETLIBS=$(TARGETLIBS) \
17 | ..\..\x64emu\$O\x64emu.lib
18 |
19 | SOURCES= \
20 | main.cpp\
21 | x64emu.cpp
22 |
23 | AMD64_SOURCES= \
24 | testops.asm
25 |
26 | !if "$(DDK_TARGET_OS)"=="WinLH"
27 | _NT_TARGET_VERSION=$(_NT_TARGET_VERSION_WINXP)
28 | !endif
29 |
30 |
--------------------------------------------------------------------------------
/unit_test/x64emuexec/x64emu.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * x64 Software Emulator (x64emu)
3 | * Copyright (c) 2010-2012 Svetoslav Vassilev
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Svetoslav Vassilev
19 | */
20 |
21 | #include
22 | #include
23 |
24 | #include "ntifs.h"
25 | #include "x64emu.h"
26 | #include "raisepanic.h"
27 | #include "registers.h"
28 |
29 | void
30 | VmxRootPanicEx(
31 | const char* pFile,
32 | UINT32 lineNumber,
33 | const PANIC_PARAMS& params
34 | )
35 | {
36 | DbgBreakPoint();
37 | }
38 |
39 | extern CONTEXT g_CpuCtxPre;
40 | extern CONTEXT g_EmuCtxPost;
41 |
42 | UINT_PTR
43 | GetGuestContextRegisterValue(
44 | void* ctx,
45 | int registerId)
46 | {
47 | switch (registerId)
48 | {
49 | case RAX_GUEST_ID:
50 | return g_CpuCtxPre.Rax;
51 | case RCX_GUEST_ID:
52 | return g_CpuCtxPre.Rcx;
53 | case RDX_GUEST_ID:
54 | return g_CpuCtxPre.Rdx;
55 | case RBX_GUEST_ID:
56 | return g_CpuCtxPre.Rbx;
57 | case RSP_GUEST_ID:
58 | return g_CpuCtxPre.Rsp;
59 | case RBP_GUEST_ID:
60 | return g_CpuCtxPre.Rbp;
61 | case RSI_GUEST_ID:
62 | return g_CpuCtxPre.Rsi;
63 | case RDI_GUEST_ID:
64 | return g_CpuCtxPre.Rdi;
65 | case R8_GUEST_ID :
66 | return g_CpuCtxPre.R8;
67 | case R9_GUEST_ID:
68 | return g_CpuCtxPre.R9;
69 | case R10_GUEST_ID:
70 | return g_CpuCtxPre.R10;
71 | case R11_GUEST_ID:
72 | return g_CpuCtxPre.R11;
73 | case R12_GUEST_ID:
74 | return g_CpuCtxPre.R12;
75 | case R13_GUEST_ID:
76 | return g_CpuCtxPre.R13;
77 | case R14_GUEST_ID:
78 | return g_CpuCtxPre.R14;
79 | case R15_GUEST_ID:
80 | return g_CpuCtxPre.R15;
81 | case RIP_GUEST_ID:
82 | return g_CpuCtxPre.Rip;
83 | case CR0_GUEST_ID:
84 | case CR3_GUEST_ID:
85 | case CR4_GUEST_ID:
86 | ASSERT(false);
87 | return 0;
88 | case RFLAGS_GUEST_ID:
89 | return g_CpuCtxPre.EFlags;
90 | case ES_GUEST_ID:
91 | return g_CpuCtxPre.SegEs;
92 | case CS_GUEST_ID:
93 | return g_CpuCtxPre.SegCs;
94 | case SS_GUEST_ID:
95 | return g_CpuCtxPre.SegSs;
96 | case DS_GUEST_ID:
97 | return g_CpuCtxPre.SegDs;
98 | case FS_GUEST_ID:
99 | return g_CpuCtxPre.SegFs;
100 | case GS_GUEST_ID:
101 | return g_CpuCtxPre.SegGs;
102 | }
103 | ASSERT(false);
104 | return 0;
105 | }
106 |
107 | void
108 | SetGuestContextRegisterValue(
109 | void* ctx,
110 | int registerId,
111 | UINT64 registerValue
112 | )
113 | {
114 | switch (registerId)
115 | {
116 | case RAX_GUEST_ID:
117 | g_EmuCtxPost.Rax = registerValue;
118 | break;
119 | case RCX_GUEST_ID:
120 | g_EmuCtxPost.Rcx = registerValue;
121 | break;
122 | case RDX_GUEST_ID:
123 | g_EmuCtxPost.Rdx = registerValue;
124 | break;
125 | case RBX_GUEST_ID:
126 | g_EmuCtxPost.Rbx = registerValue;
127 | break;
128 | case RSP_GUEST_ID:
129 | g_EmuCtxPost.Rsp = registerValue;
130 | break;
131 | case RBP_GUEST_ID:
132 | g_EmuCtxPost.Rbp = registerValue;
133 | break;
134 | case RSI_GUEST_ID:
135 | g_EmuCtxPost.Rsi = registerValue;
136 | break;
137 | case RDI_GUEST_ID:
138 | g_EmuCtxPost.Rdi = registerValue;
139 | break;
140 | case R8_GUEST_ID :
141 | g_EmuCtxPost.R8 = registerValue;
142 | break;
143 | case R9_GUEST_ID:
144 | g_EmuCtxPost.R9 = registerValue;
145 | break;
146 | case R10_GUEST_ID:
147 | g_EmuCtxPost.R10 = registerValue;
148 | break;
149 | case R11_GUEST_ID:
150 | g_EmuCtxPost.R11 = registerValue;
151 | break;
152 | case R12_GUEST_ID:
153 | g_EmuCtxPost.R12 = registerValue;
154 | break;
155 | case R13_GUEST_ID:
156 | g_EmuCtxPost.R13 = registerValue;
157 | break;
158 | case R14_GUEST_ID:
159 | g_EmuCtxPost.R14 = registerValue;
160 | break;
161 | case R15_GUEST_ID:
162 | g_EmuCtxPost.R15 = registerValue;
163 | break;
164 | case RIP_GUEST_ID:
165 | g_EmuCtxPost.Rip = registerValue;
166 | break;
167 | case CR0_GUEST_ID:
168 | case CR3_GUEST_ID:
169 | case CR4_GUEST_ID:
170 | ASSERT(false);
171 | break;
172 | case RFLAGS_GUEST_ID:
173 | g_EmuCtxPost.EFlags = (ULONG)registerValue;
174 | break;
175 | case ES_GUEST_ID:
176 | g_EmuCtxPost.SegEs = (USHORT)registerValue;
177 | break;
178 | case CS_GUEST_ID:
179 | g_EmuCtxPost.SegCs = (USHORT)registerValue;
180 | break;
181 | case SS_GUEST_ID:
182 | g_EmuCtxPost.SegSs = (USHORT)registerValue;
183 | break;
184 | case DS_GUEST_ID:
185 | g_EmuCtxPost.SegDs = (USHORT)registerValue;
186 | break;
187 | case FS_GUEST_ID:
188 | g_EmuCtxPost.SegFs = (USHORT)registerValue;
189 | break;
190 | case GS_GUEST_ID:
191 | g_EmuCtxPost.SegGs = (USHORT)registerValue;
192 | break;
193 | }
194 | }
195 |
196 | void InitEmuCtx(X64_EMULATOR_CTX* pEmu)
197 | {
198 | X64_EMULATOR_RUNTIME rte;
199 | EmuInitRuntimeStruct(&rte,0,
200 | GetGuestContextRegisterValue,
201 | SetGuestContextRegisterValue);
202 | EmuInitEmulatorCtx(pEmu, &rte, 0);
203 | }
--------------------------------------------------------------------------------
/unit_test/x64emuexec/x64emuexec.vcxproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | x64
7 |
8 |
9 | Release
10 | x64
11 |
12 |
13 |
14 | testemuexec
15 | {B9CAED87-19F9-4190-92FA-32C91773B9A9}
16 | MakeFileProj
17 |
18 |
19 |
20 | Makefile
21 |
22 |
23 | Makefile
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 | <_ProjectFileVersion>10.0.30128.1
37 | make amd64dbg
38 | make amd64dbg -a
39 |
40 |
41 | $(SolutionDir)amd64dbg\testemuexec.exe
42 | WIN32;_DEBUG;$(NMakePreprocessorDefinitions)
43 | $(NMakeIncludeSearchPath)
44 | $(NMakeForcedIncludes)
45 | $(NMakeAssemblySearchPath)
46 | $(NMakeForcedUsingAssemblies)
47 | make amd64rel
48 | make amd64rel -a
49 |
50 | $(SolutionDir)amd64rel\testemuexec.exe
51 | WIN32;NDEBUG;$(NMakePreprocessorDefinitions)
52 | $(NMakeIncludeSearchPath)
53 | $(NMakeForcedIncludes)
54 | $(NMakeAssemblySearchPath)
55 | $(NMakeForcedUsingAssemblies)
56 |
57 |
58 | .\objfre_win7_amd64\amd64
59 | .\objfre_win7_amd64\amd64
60 |
61 |
62 | .\objchk_win7_amd64\amd64
63 | .\objchk_win7_amd64\amd64
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
--------------------------------------------------------------------------------
/x64emu.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 2013
4 | VisualStudioVersion = 12.0.30723.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testemudecode64", "unit_test\x64emudecode64\x64emudecode64.vcxproj", "{0AFE2708-79D7-4821-B10C-87213E4E280C}"
7 | EndProject
8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testemuexec", "unit_test\x64emuexec\x64emuexec.vcxproj", "{B9CAED87-19F9-4190-92FA-32C91773B9A9}"
9 | ProjectSection(ProjectDependencies) = postProject
10 | {8E8F5023-845D-4801-B8AA-E0019C18029F} = {8E8F5023-845D-4801-B8AA-E0019C18029F}
11 | EndProjectSection
12 | EndProject
13 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testemudecode32", "unit_test\x64emudecode32\x64emudecode32.vcxproj", "{6019434E-0F33-4875-B320-F29A08C499BD}"
14 | ProjectSection(ProjectDependencies) = postProject
15 | {8E8F5023-845D-4801-B8AA-E0019C18029F} = {8E8F5023-845D-4801-B8AA-E0019C18029F}
16 | EndProjectSection
17 | EndProject
18 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "x64emu", "x64emu\x64emu.vcxproj", "{8E8F5023-845D-4801-B8AA-E0019C18029F}"
19 | EndProject
20 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "x64disasm", "sample\x64disasm\x64disasm.vcxproj", "{E72B5948-1FB0-4C69-93C1-79B47B1D90F0}"
21 | ProjectSection(ProjectDependencies) = postProject
22 | {8E8F5023-845D-4801-B8AA-E0019C18029F} = {8E8F5023-845D-4801-B8AA-E0019C18029F}
23 | EndProjectSection
24 | EndProject
25 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{CC7447E1-EE3C-48E2-8F97-6388384C9419}"
26 | ProjectSection(SolutionItems) = preProject
27 | .gitignore = .gitignore
28 | dirs = dirs
29 | EndProjectSection
30 | EndProject
31 | Global
32 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
33 | Debug|Mixed Platforms = Debug|Mixed Platforms
34 | Debug|Win64 = Debug|Win64
35 | Debug|x64 = Debug|x64
36 | Release|Mixed Platforms = Release|Mixed Platforms
37 | Release|Win64 = Release|Win64
38 | Release|x64 = Release|x64
39 | EndGlobalSection
40 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
41 | {0AFE2708-79D7-4821-B10C-87213E4E280C}.Debug|Mixed Platforms.ActiveCfg = Debug|x64
42 | {0AFE2708-79D7-4821-B10C-87213E4E280C}.Debug|Mixed Platforms.Build.0 = Debug|x64
43 | {0AFE2708-79D7-4821-B10C-87213E4E280C}.Debug|Win64.ActiveCfg = Debug|x64
44 | {0AFE2708-79D7-4821-B10C-87213E4E280C}.Debug|Win64.Build.0 = Debug|x64
45 | {0AFE2708-79D7-4821-B10C-87213E4E280C}.Debug|x64.ActiveCfg = Debug|x64
46 | {0AFE2708-79D7-4821-B10C-87213E4E280C}.Debug|x64.Build.0 = Debug|x64
47 | {0AFE2708-79D7-4821-B10C-87213E4E280C}.Release|Mixed Platforms.ActiveCfg = Release|x64
48 | {0AFE2708-79D7-4821-B10C-87213E4E280C}.Release|Mixed Platforms.Build.0 = Release|x64
49 | {0AFE2708-79D7-4821-B10C-87213E4E280C}.Release|Win64.ActiveCfg = Release|x64
50 | {0AFE2708-79D7-4821-B10C-87213E4E280C}.Release|Win64.Build.0 = Release|x64
51 | {0AFE2708-79D7-4821-B10C-87213E4E280C}.Release|x64.ActiveCfg = Release|x64
52 | {0AFE2708-79D7-4821-B10C-87213E4E280C}.Release|x64.Build.0 = Release|x64
53 | {B9CAED87-19F9-4190-92FA-32C91773B9A9}.Debug|Mixed Platforms.ActiveCfg = Debug|x64
54 | {B9CAED87-19F9-4190-92FA-32C91773B9A9}.Debug|Mixed Platforms.Build.0 = Debug|x64
55 | {B9CAED87-19F9-4190-92FA-32C91773B9A9}.Debug|Win64.ActiveCfg = Debug|x64
56 | {B9CAED87-19F9-4190-92FA-32C91773B9A9}.Debug|Win64.Build.0 = Debug|x64
57 | {B9CAED87-19F9-4190-92FA-32C91773B9A9}.Debug|x64.ActiveCfg = Debug|x64
58 | {B9CAED87-19F9-4190-92FA-32C91773B9A9}.Debug|x64.Build.0 = Debug|x64
59 | {B9CAED87-19F9-4190-92FA-32C91773B9A9}.Release|Mixed Platforms.ActiveCfg = Release|x64
60 | {B9CAED87-19F9-4190-92FA-32C91773B9A9}.Release|Mixed Platforms.Build.0 = Release|x64
61 | {B9CAED87-19F9-4190-92FA-32C91773B9A9}.Release|Win64.ActiveCfg = Release|x64
62 | {B9CAED87-19F9-4190-92FA-32C91773B9A9}.Release|Win64.Build.0 = Release|x64
63 | {B9CAED87-19F9-4190-92FA-32C91773B9A9}.Release|x64.ActiveCfg = Release|x64
64 | {B9CAED87-19F9-4190-92FA-32C91773B9A9}.Release|x64.Build.0 = Release|x64
65 | {6019434E-0F33-4875-B320-F29A08C499BD}.Debug|Mixed Platforms.ActiveCfg = Debug|x64
66 | {6019434E-0F33-4875-B320-F29A08C499BD}.Debug|Mixed Platforms.Build.0 = Debug|x64
67 | {6019434E-0F33-4875-B320-F29A08C499BD}.Debug|Win64.ActiveCfg = Debug|x64
68 | {6019434E-0F33-4875-B320-F29A08C499BD}.Debug|Win64.Build.0 = Debug|x64
69 | {6019434E-0F33-4875-B320-F29A08C499BD}.Debug|x64.ActiveCfg = Debug|x64
70 | {6019434E-0F33-4875-B320-F29A08C499BD}.Debug|x64.Build.0 = Debug|x64
71 | {6019434E-0F33-4875-B320-F29A08C499BD}.Release|Mixed Platforms.ActiveCfg = Release|x64
72 | {6019434E-0F33-4875-B320-F29A08C499BD}.Release|Mixed Platforms.Build.0 = Release|x64
73 | {6019434E-0F33-4875-B320-F29A08C499BD}.Release|Win64.ActiveCfg = Release|x64
74 | {6019434E-0F33-4875-B320-F29A08C499BD}.Release|Win64.Build.0 = Release|x64
75 | {6019434E-0F33-4875-B320-F29A08C499BD}.Release|x64.ActiveCfg = Release|x64
76 | {6019434E-0F33-4875-B320-F29A08C499BD}.Release|x64.Build.0 = Release|x64
77 | {8E8F5023-845D-4801-B8AA-E0019C18029F}.Debug|Mixed Platforms.ActiveCfg = Debug|x64
78 | {8E8F5023-845D-4801-B8AA-E0019C18029F}.Debug|Mixed Platforms.Build.0 = Debug|x64
79 | {8E8F5023-845D-4801-B8AA-E0019C18029F}.Debug|Win64.ActiveCfg = Debug|x64
80 | {8E8F5023-845D-4801-B8AA-E0019C18029F}.Debug|Win64.Build.0 = Debug|x64
81 | {8E8F5023-845D-4801-B8AA-E0019C18029F}.Debug|x64.ActiveCfg = Debug|x64
82 | {8E8F5023-845D-4801-B8AA-E0019C18029F}.Debug|x64.Build.0 = Debug|x64
83 | {8E8F5023-845D-4801-B8AA-E0019C18029F}.Release|Mixed Platforms.ActiveCfg = Release|x64
84 | {8E8F5023-845D-4801-B8AA-E0019C18029F}.Release|Mixed Platforms.Build.0 = Release|x64
85 | {8E8F5023-845D-4801-B8AA-E0019C18029F}.Release|Win64.ActiveCfg = Release|x64
86 | {8E8F5023-845D-4801-B8AA-E0019C18029F}.Release|Win64.Build.0 = Release|x64
87 | {8E8F5023-845D-4801-B8AA-E0019C18029F}.Release|x64.ActiveCfg = Release|x64
88 | {8E8F5023-845D-4801-B8AA-E0019C18029F}.Release|x64.Build.0 = Release|x64
89 | {E72B5948-1FB0-4C69-93C1-79B47B1D90F0}.Debug|Mixed Platforms.ActiveCfg = Debug|x64
90 | {E72B5948-1FB0-4C69-93C1-79B47B1D90F0}.Debug|Mixed Platforms.Build.0 = Debug|x64
91 | {E72B5948-1FB0-4C69-93C1-79B47B1D90F0}.Debug|Win64.ActiveCfg = Debug|x64
92 | {E72B5948-1FB0-4C69-93C1-79B47B1D90F0}.Debug|x64.ActiveCfg = Debug|x64
93 | {E72B5948-1FB0-4C69-93C1-79B47B1D90F0}.Debug|x64.Build.0 = Debug|x64
94 | {E72B5948-1FB0-4C69-93C1-79B47B1D90F0}.Release|Mixed Platforms.ActiveCfg = Release|x64
95 | {E72B5948-1FB0-4C69-93C1-79B47B1D90F0}.Release|Mixed Platforms.Build.0 = Release|x64
96 | {E72B5948-1FB0-4C69-93C1-79B47B1D90F0}.Release|Win64.ActiveCfg = Release|x64
97 | {E72B5948-1FB0-4C69-93C1-79B47B1D90F0}.Release|x64.ActiveCfg = Release|x64
98 | {E72B5948-1FB0-4C69-93C1-79B47B1D90F0}.Release|x64.Build.0 = Release|x64
99 | EndGlobalSection
100 | GlobalSection(SolutionProperties) = preSolution
101 | HideSolutionNode = FALSE
102 | EndGlobalSection
103 | EndGlobal
104 |
--------------------------------------------------------------------------------
/x64emu/make.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 | if "%1" == "__SPAWNED__" goto main
3 | cmd.exe /c "%0" __SPAWNED__ %*
4 | if ERRORLEVEL 1 echo ERRORLEVEL=%ERRORLEVEL%
5 | goto return
6 |
7 | :main
8 | set ROOTDIR=..
9 | call %ROOTDIR%\make\ddkbuild.bat %*
10 |
11 | :return
12 |
--------------------------------------------------------------------------------
/x64emu/sources:
--------------------------------------------------------------------------------
1 | TARGETNAME=x64emu
2 | TARGETTYPE=DRIVER_LIBRARY
3 | TARGETLIBS=
4 |
5 | MSC_WARNING_LEVEL=/W4 /WX
6 |
7 | INCLUDES= .; \
8 | ..\include;
9 |
10 | SOURCES= \
11 | x64emu.cpp
12 |
13 | RUN_WPP= $(SOURCES) -km -func:TraceEvents(LEVEL,FLAGS,MSG,...) -gen:{km-WdfDefault.tpl}*.tmh
14 |
15 | TARGET_DESTINATION=supercell
16 |
17 | ALLOW_DATE_TIME=1
--------------------------------------------------------------------------------
/x64emu/x64emu.vcxproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | x64
7 |
8 |
9 | Release
10 | x64
11 |
12 |
13 |
14 | {8E8F5023-845D-4801-B8AA-E0019C18029F}
15 | MakeFileProj
16 |
17 |
18 |
19 | Makefile
20 |
21 |
22 | Makefile
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 | <_ProjectFileVersion>10.0.30128.1
36 | make amd64dbg
37 | make amd64dbg -a
38 |
39 | x64emu.lib
40 | WIN32;_DEBUG;$(NMakePreprocessorDefinitions)
41 | $(NMakeIncludeSearchPath)
42 | $(NMakeForcedIncludes)
43 | $(NMakeAssemblySearchPath)
44 | $(NMakeForcedUsingAssemblies)
45 | make amd64rel
46 | make amd64rel -a
47 |
48 | x64emu.lib
49 | WIN32;NDEBUG;$(NMakePreprocessorDefinitions)
50 | $(NMakeIncludeSearchPath)
51 | $(NMakeForcedIncludes)
52 | $(NMakeAssemblySearchPath)
53 | $(NMakeForcedUsingAssemblies)
54 |
55 |
56 | .\objchk_win7_amd64\amd64
57 | .\objchk_win7_amd64\amd64
58 |
59 |
60 | .\objfre_win7_amd64\amd64\
61 | .\objfre_win7_amd64\amd64\
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
--------------------------------------------------------------------------------
/x64emu/x64emu.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Source
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | {2c03fbff-672e-40ff-82c7-0210eaeb5c4b}
15 |
16 |
17 | {6ee0b68c-4064-4369-9a27-b13d57e26a3b}
18 |
19 |
20 |
21 |
22 | Headers
23 |
24 |
25 | Headers
26 |
27 |
28 | Headers
29 |
30 |
31 | Headers
32 |
33 |
34 |
--------------------------------------------------------------------------------