Checking in version 1984 release binaries.
BUG=
R=etienneb@chromium.org
Review URL: https://codereview.appspot.com/49980043
git-svn-id: http://sawbuck.googlecode.com/svn/trunk/syzygy/binaries@1985 15e8cca8-e42c-11de-a347-f34a4f72eb7d
diff --git a/Benchmark_Chrome-0.1_r1825-py2.6.egg b/Benchmark_Chrome-0.1_r1825-py2.6.egg
index 91f1d17..a3501a0 100644
--- a/Benchmark_Chrome-0.1_r1825-py2.6.egg
+++ b/Benchmark_Chrome-0.1_r1825-py2.6.egg
Binary files differ
diff --git a/ETW-0.6.5.0-py2.6.egg b/ETW-0.6.5.0-py2.6.egg
index c37120d..bc51a7a 100644
--- a/ETW-0.6.5.0-py2.6.egg
+++ b/ETW-0.6.5.0-py2.6.egg
Binary files differ
diff --git a/ETW_Db-0.1_r1543-py2.6.egg b/ETW_Db-0.1_r1543-py2.6.egg
index c653059..164fda5 100644
--- a/ETW_Db-0.1_r1543-py2.6.egg
+++ b/ETW_Db-0.1_r1543-py2.6.egg
Binary files differ
diff --git a/benchmark.bat b/benchmark.bat
index 46dd3c8..985e361 100644
--- a/benchmark.bat
+++ b/benchmark.bat
@@ -1,6 +1,6 @@
@echo off
rem = """
-:: Copyright 2013 Google Inc.
+:: Copyright 2014 Google Inc.
::
:: Licensed under the Apache License, Version 2.0 (the "License");
:: you may not use this file except in compliance with the License.
diff --git a/exe/PEHACKER.TXT b/exe/PEHACKER.TXT
new file mode 100644
index 0000000..1ff0d21
--- /dev/null
+++ b/exe/PEHACKER.TXT
@@ -0,0 +1,207 @@
+PE HACKER
+=========
+
+PE Hacker is a general purpose tool for manipulating Windows 32-bit PE files. It
+is driven by a configuration file, which may in turn be specialized via the
+command-line.
+
+
+1. Configuration File Format
+============================
+
+A configuration file consists of a UTF-8 JSON-encoded text file. The format is
+heavily inspired by the GYP format, used by the Chromium family of projects. The
+top level consists of a dictionary. It is expected that this dictionary contain
+a 'targets' entry, which itself must be a list of dictionaries. This list
+contains a description of transformations to be applied to each target, with
+the targets being processed in the order they are specified. At minimum, each
+target specifies an input module, an output and a list of operations to be
+applied:
+
+{
+ 'targets': [
+ # Module 1.
+ {
+ # Paths are relative to the current working directory by default.
+ 'input_module': 'foo.dll',
+ 'output_module': 'bar.dll',
+ 'operations': [
+ ...
+ ],
+ },
+ # Module 2.
+ {
+ ...
+ },
+ # Other modules...
+ ...
+ ]
+}
+
+Each operation is itself a dictionary describing the specific operation to be
+applied to the input module. The operations will be applied sequentially in
+their order of declaration. The format of this dictionary is specific to the
+operation in question, but they all contain a 'type' entry naming the type of
+operation to apply.
+
+1.1 Defining Variables
+----------------------
+
+The top level dictionary of a configuration file may specify a dictionary of
+named local variables that can be used in variable expansion through the rest of
+the configuration file. These have the format:
+
+{
+ 'variables': {
+ 'name': 'value',
+ },
+ ...
+}
+
+Variable names can not be repeated, and must be unique. Variable names must be
+valid C-style variable names. By convention user-defined variables use the
+naming style 'user_defined_variable'.
+
+1.2 Built-in Variables
+----------------------
+
+There are a handful of built-in variables that are defined automatically at
+runtime. By convention there use uppercase names like 'BUILT_IN_VARIABLE'. They
+consist of:
+
+ ROOT: The full path of the directory containing the root PEHacker
+ configuration file that is being processed.
+
+1.3 Default Variable Values
+---------------------------
+
+Variables may be specified via the command-line. However, it is sometimes useful
+to specify default values for variables that have not been explicitly specified.
+This can be done by suffixing the variable name with the '%' character in the
+'variables' section.
+
+1.4 Variable Expansion
+----------------------
+
+Variables are referenced via the standard shell mechanism: $(name).
+Variables are expanded immediately as they are encountered during processing.
+
+
+2. Operations
+=============
+
+Individual operations and their configuration file dictionary formats are
+defined below.
+
+2.1 Adding Imports
+------------------
+
+This operation injects imports into a PE file. It proceeds as follows:
+
+ - Injects an import data directory if none exists.
+ - Injects an import for the module if none exists.
+ - Injects an import for the function if none exists.
+
+Newly created entries will be added to the end of any existing lists. Imports
+may be specified by name or as ordinals. The operation is configured as follows:
+
+ {
+ 'type': 'add_imports',
+ 'modules': [
+ {
+ # Adds an import dependency on bar.dll, complaining if one already
+ # exists.
+ 'module_name': 'bar.dll',
+ 'must_not_exist': True,
+
+ 'imports': [
+ # Adds an import for bar.dll:FooBar, failing if one already exists.
+ { 'function_name': 'FooBar', 'must_not_exist': True },
+
+ # Adds an import for bar.dll:2, not failing if one already exists
+ # ('must_not_exist' was not explicitly specified and defaults to
+ # False.)
+ { 'ordinal': 2 },
+ ]
+ }
+ ]
+ }
+
+2.2 Ordering Imports
+--------------------
+
+This operation explicitly orders imports. Any imported modules or functions
+not explicitly specified will maintain their original relative ordering but be
+pushed to the end of any explicitly named imports.
+
+ {
+ 'type': 'order_imports',
+ 'modules': [
+ # bar.dll will be the first imported module. Its imports will be left in
+ # their original order.
+ { 'module_name': 'bar.dll' },
+
+ # foo.dll will be the second imported module.
+ {
+ 'module_name': 'foo.dll',
+ # Function 'FooBar' will be made the first import. Any other functions
+ # will be left in their original orders.
+ 'imports': [
+ { 'function_name': 'FooBar' }
+ ],
+ },
+
+ # baz.dll will be left in its original relative position, but it's
+ # imports will themselves be reordered.
+ {
+ 'module_name': 'baz.dll',
+
+ # The presence of this key indicates that the module entry itself is
+ # not to be ordered, but its imports are. If not specified this
+ # defaults to True.
+ 'order': False,
+
+ 'imports': [
+ { 'function_name': 'baz1' },
+ { 'function_name': 'baz2' }
+ ],
+ }
+ ],
+ }
+
+2.3 Removing Unused Imports
+---------------------------
+
+This operation removes any imports that are not explicitly referenced by
+anything in the PE file.
+
+ {
+ 'type': 'removed_unused_imports',
+
+ # If this is specified then modules containing no imports will be left in
+ # the import table. If not specified this defaults to True, in which case
+ # empty module imports will be removed.
+ 'remove_empty_modules': False
+ }
+
+2.4 Redirecting Imports
+-----------------------
+
+This operation hijacks an import entry and redirects all its referrers to
+another import entry.
+
+ {
+ 'type': 'redirect_imports',
+ 'redirects': [
+ {
+ # Redirects all uses of foo.dll:foo to bar.dll:3. Both imports must
+ # exist at the time of this operation.
+ 'src': { 'module_name': 'foo.dll', 'function_name': 'foo' },
+ 'dst': { 'module_name': 'bar.dll', 'ordinal': 3 },
+ },
+ {
+ # Another redirect...
+ },
+ ...
+ ],
+ }
diff --git a/exe/README.TXT b/exe/README.TXT
index 20edd19..3323038 100644
--- a/exe/README.TXT
+++ b/exe/README.TXT
@@ -1,8 +1,8 @@
Syzygy Post-Link Transformation Toolchain
=========================================
-Date: 2013/11/19
-Version: 0.7.5.0 (1908)
+Date: 2014/01/09
+Version: 0.7.7.1 (1984)
The Syzygy project consists of a suite of tools for the instrumentation of
PE binaries. The various instrumentation modes allow for computing code
@@ -57,6 +57,10 @@
pdbfind.exe
A utility for locating the PDB file that is matched to a given PE file.
+pehacker.exe
+ A utility for applying various transforms to a PE file via a text
+ configuration file.
+
relink.exe
Relinks a PE file after applying specified transformations. Combined with
output from grinder and reorder this is used to apply optimizations to a
@@ -80,6 +84,11 @@
simulate.exe
Simulates OS page faults by playing back a call_trace_client data file.
+swapimport.exe
+ Makes a named import library the first one in the import directory by
+ swapping it if necessary. This operates on a raw PE file, with no need for
+ symbols.
+
wsdump.exe
Dumps the working set associated with a running process. The output is in
JSON format.
diff --git a/exe/RELEASE-NOTES.TXT b/exe/RELEASE-NOTES.TXT
index 815b8c2..f243d58 100644
--- a/exe/RELEASE-NOTES.TXT
+++ b/exe/RELEASE-NOTES.TXT
@@ -1,6 +1,24 @@
Syzygy Release Notes
====================
+Version 0.7.7.1
+
+[r1983] Small fix to decompose_image_to_text which was causing failed official
+ builder tests.
+
+Version 0.7.7.0
+
+[r1979] Created swapimport.exe utility.
+[r1978] SyzyASAN - Fix for improperly intercepted CRT functions with custom
+ calling conventions in LTCG builds.
+[r1969] SyzyASAN - Wide character CRT string function interceptors.
+
+Version 0.7.6.0
+
+[r1957] Full VS2013 support.
+[r1955] PEHacker is now fully functional. First release.
+[r1934] Switched to using new decomposer.
+
Version 0.7.5.0
[r1906] Various fixes for VS2013 support.
diff --git a/exe/agent_logger.exe b/exe/agent_logger.exe
index 6fcbf94..4f4efe2 100644
--- a/exe/agent_logger.exe
+++ b/exe/agent_logger.exe
Binary files differ
diff --git a/exe/basic_block_entry_client.dll b/exe/basic_block_entry_client.dll
index 87e7d0f..cb6aa48 100644
--- a/exe/basic_block_entry_client.dll
+++ b/exe/basic_block_entry_client.dll
Binary files differ
diff --git a/exe/basic_block_entry_client.dll.pdb b/exe/basic_block_entry_client.dll.pdb
index ecb7c8b..2c60872 100644
--- a/exe/basic_block_entry_client.dll.pdb
+++ b/exe/basic_block_entry_client.dll.pdb
Binary files differ
diff --git a/exe/call_trace_client.dll b/exe/call_trace_client.dll
index 8a72cf7..0e25255 100644
--- a/exe/call_trace_client.dll
+++ b/exe/call_trace_client.dll
Binary files differ
diff --git a/exe/call_trace_client.dll.pdb b/exe/call_trace_client.dll.pdb
index 20695a6..c19331e 100644
--- a/exe/call_trace_client.dll.pdb
+++ b/exe/call_trace_client.dll.pdb
Binary files differ
diff --git a/exe/call_trace_control.exe b/exe/call_trace_control.exe
index cc78484..95fb24e 100644
--- a/exe/call_trace_control.exe
+++ b/exe/call_trace_control.exe
Binary files differ
diff --git a/exe/call_trace_service.exe b/exe/call_trace_service.exe
index 28433f8..9d8c064 100644
--- a/exe/call_trace_service.exe
+++ b/exe/call_trace_service.exe
Binary files differ
diff --git a/exe/coverage_client.dll b/exe/coverage_client.dll
index 87fc6b0..c1c6477 100644
--- a/exe/coverage_client.dll
+++ b/exe/coverage_client.dll
Binary files differ
diff --git a/exe/coverage_client.dll.pdb b/exe/coverage_client.dll.pdb
index 341eb90..7c48517 100644
--- a/exe/coverage_client.dll.pdb
+++ b/exe/coverage_client.dll.pdb
Binary files differ
diff --git a/exe/decompose.exe b/exe/decompose.exe
index f15a2b4..ff5a12b 100644
--- a/exe/decompose.exe
+++ b/exe/decompose.exe
Binary files differ
diff --git a/exe/decompose_image_to_text.exe b/exe/decompose_image_to_text.exe
index 7b6a880..89dd7da 100644
--- a/exe/decompose_image_to_text.exe
+++ b/exe/decompose_image_to_text.exe
Binary files differ
diff --git a/exe/dump_trace.exe b/exe/dump_trace.exe
index 0af6660..aae089f 100644
--- a/exe/dump_trace.exe
+++ b/exe/dump_trace.exe
Binary files differ
diff --git a/exe/experimental/code_tally.exe b/exe/experimental/code_tally.exe
index 5205f2e..350f5cf 100644
--- a/exe/experimental/code_tally.exe
+++ b/exe/experimental/code_tally.exe
Binary files differ
diff --git a/exe/experimental/compare.exe b/exe/experimental/compare.exe
index a7879d9..929e090 100644
--- a/exe/experimental/compare.exe
+++ b/exe/experimental/compare.exe
Binary files differ
diff --git a/exe/experimental/pdb_dumper.exe b/exe/experimental/pdb_dumper.exe
index 89c7c83..9934cbb 100644
--- a/exe/experimental/pdb_dumper.exe
+++ b/exe/experimental/pdb_dumper.exe
Binary files differ
diff --git a/exe/experimental/timed_decomposer.exe b/exe/experimental/timed_decomposer.exe
index 6be5144..8fee9f5 100644
--- a/exe/experimental/timed_decomposer.exe
+++ b/exe/experimental/timed_decomposer.exe
Binary files differ
diff --git a/exe/genfilter.exe b/exe/genfilter.exe
index 8eb093c..c5ea25a 100644
--- a/exe/genfilter.exe
+++ b/exe/genfilter.exe
Binary files differ
diff --git a/exe/grinder.exe b/exe/grinder.exe
index 31f4d06..fee75c0 100644
--- a/exe/grinder.exe
+++ b/exe/grinder.exe
Binary files differ
diff --git a/exe/instrument.exe b/exe/instrument.exe
index 1caeb8d..2b68f9b 100644
--- a/exe/instrument.exe
+++ b/exe/instrument.exe
Binary files differ
diff --git a/exe/pdbfind.exe b/exe/pdbfind.exe
index 97cd939..0c5b644 100644
--- a/exe/pdbfind.exe
+++ b/exe/pdbfind.exe
Binary files differ
diff --git a/exe/pehacker.exe b/exe/pehacker.exe
new file mode 100644
index 0000000..9cbf078
--- /dev/null
+++ b/exe/pehacker.exe
Binary files differ
diff --git a/exe/profile_client.dll b/exe/profile_client.dll
index 8f7fd15..ec1bd94 100644
--- a/exe/profile_client.dll
+++ b/exe/profile_client.dll
Binary files differ
diff --git a/exe/profile_client.dll.pdb b/exe/profile_client.dll.pdb
index 2c52de4..af1b775 100644
--- a/exe/profile_client.dll.pdb
+++ b/exe/profile_client.dll.pdb
Binary files differ
diff --git a/exe/relink.exe b/exe/relink.exe
index 2cc1ba5..8d09d6c 100644
--- a/exe/relink.exe
+++ b/exe/relink.exe
Binary files differ
diff --git a/exe/reorder.exe b/exe/reorder.exe
index 46439b4..448c294 100644
--- a/exe/reorder.exe
+++ b/exe/reorder.exe
Binary files differ
diff --git a/exe/run_in_snapshot.exe b/exe/run_in_snapshot.exe
index a7c3d32..fcc5740 100644
--- a/exe/run_in_snapshot.exe
+++ b/exe/run_in_snapshot.exe
Binary files differ
diff --git a/exe/run_in_snapshot_x64.exe b/exe/run_in_snapshot_x64.exe
index ada5a5f..df9ef2b 100644
--- a/exe/run_in_snapshot_x64.exe
+++ b/exe/run_in_snapshot_x64.exe
Binary files differ
diff --git a/exe/run_in_snapshot_xp.exe b/exe/run_in_snapshot_xp.exe
index d0221fc..5e6b7f3 100644
--- a/exe/run_in_snapshot_xp.exe
+++ b/exe/run_in_snapshot_xp.exe
Binary files differ
diff --git a/exe/sampler.exe b/exe/sampler.exe
index bfa0c13..06d80b9 100644
--- a/exe/sampler.exe
+++ b/exe/sampler.exe
Binary files differ
diff --git a/exe/simulate.exe b/exe/simulate.exe
index f549001..00dbaf2 100644
--- a/exe/simulate.exe
+++ b/exe/simulate.exe
Binary files differ
diff --git a/exe/swapimport.exe b/exe/swapimport.exe
new file mode 100644
index 0000000..81853ca
--- /dev/null
+++ b/exe/swapimport.exe
Binary files differ
diff --git a/exe/syzyasan_rtl.dll b/exe/syzyasan_rtl.dll
index a847a78..b2d18a6 100644
--- a/exe/syzyasan_rtl.dll
+++ b/exe/syzyasan_rtl.dll
Binary files differ
diff --git a/exe/syzyasan_rtl.dll.pdb b/exe/syzyasan_rtl.dll.pdb
index 66cb3f1..cb5a0eb 100644
--- a/exe/syzyasan_rtl.dll.pdb
+++ b/exe/syzyasan_rtl.dll.pdb
Binary files differ
diff --git a/exe/wsdump.exe b/exe/wsdump.exe
index 0a4d0fb..3699098 100644
--- a/exe/wsdump.exe
+++ b/exe/wsdump.exe
Binary files differ
diff --git a/exe/zap_timestamp.exe b/exe/zap_timestamp.exe
index 219cffd..fb21093 100644
--- a/exe/zap_timestamp.exe
+++ b/exe/zap_timestamp.exe
Binary files differ
diff --git a/grinder.bat b/grinder.bat
index b4b49b8..498b491 100644
--- a/grinder.bat
+++ b/grinder.bat
@@ -1,6 +1,6 @@
@echo off
rem = """
-:: Copyright 2013 Google Inc.
+:: Copyright 2014 Google Inc.
::
:: Licensed under the Apache License, Version 2.0 (the "License");
:: you may not use this file except in compliance with the License.
diff --git a/instrument.bat b/instrument.bat
index 476e460..092c5f2 100644
--- a/instrument.bat
+++ b/instrument.bat
@@ -1,6 +1,6 @@
@echo off
rem = """
-:: Copyright 2013 Google Inc.
+:: Copyright 2014 Google Inc.
::
:: Licensed under the Apache License, Version 2.0 (the "License");
:: you may not use this file except in compliance with the License.
diff --git a/lib/syzyasan_rtl.lib b/lib/syzyasan_rtl.lib
index 733a3dc..2949b84 100644
--- a/lib/syzyasan_rtl.lib
+++ b/lib/syzyasan_rtl.lib
Binary files differ
diff --git a/optimize.bat b/optimize.bat
index d82c51f..bac331d 100644
--- a/optimize.bat
+++ b/optimize.bat
@@ -1,6 +1,6 @@
@echo off
rem = """
-:: Copyright 2013 Google Inc.
+:: Copyright 2014 Google Inc.
::
:: Licensed under the Apache License, Version 2.0 (the "License");
:: you may not use this file except in compliance with the License.
diff --git a/profile.bat b/profile.bat
index 134aa85..cea1b75 100644
--- a/profile.bat
+++ b/profile.bat
@@ -1,6 +1,6 @@
@echo off
rem = """
-:: Copyright 2013 Google Inc.
+:: Copyright 2014 Google Inc.
::
:: Licensed under the Apache License, Version 2.0 (the "License");
:: you may not use this file except in compliance with the License.