Skip to content
This repository has been archived by the owner on Jul 5, 2023. It is now read-only.

Commit

Permalink
Enable the IAT patcher unittests in x64.
Browse files Browse the repository at this point in the history
  • Loading branch information
sebmarchand authored and Commit bot committed Oct 19, 2016
1 parent 13e6df9 commit 5466bca
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 4 deletions.
11 changes: 7 additions & 4 deletions syzygy/agent/asan/asan.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,9 @@
'LargeAddressAware': 1,
},
},
'dependencies': [
'<(src)/syzygy/pe/pe.gyp:test_dll',
],
}, {
'sources!': [
# Static shadow doesn't work for large address spaces.
Expand All @@ -225,13 +228,13 @@
'memory_interceptors_patcher_unittest.cc',
# Relies on full set of probes.
'memory_interceptors_unittest.cc',
# PE lib for win64 is sort of stub, so there's nothing
# to test there.
'iat_patcher_unittest.cc',
# Uses 32bit assembler.
'heap_managers/block_heap_manager_unittest.cc',
],
'sources': ['dummy_shadow.cc']
'sources': ['dummy_shadow.cc'],
'dependencies': [
'<(src)/syzygy/pe/pe.gyp:test_dll_x64',
],
}],
],
'dependencies': [
Expand Down
4 changes: 4 additions & 0 deletions syzygy/agent/asan/iat_patcher_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ class LenientIATPatcherTest : public testing::Test {

void SetUp() override {
base::FilePath path =
#ifndef _WIN64
testing::GetExeRelativePath(L"test_dll.dll");
#else
testing::GetExeRelativePath(L"test_dll_x64.dll");
#endif
test_dll_ = ::LoadLibrary(path.value().c_str());
ASSERT_NE(nullptr, test_dll_);
}
Expand Down
23 changes: 23 additions & 0 deletions syzygy/pe/export_dll_x64.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
; Copyright 2016 Google Inc. All Rights Reserved.
;
; Licensed under the Apache License, Version 2.0 (the "License");
; you may not use this file except in compliance with the License.
; You may obtain a copy of the License at
;
; http://www.apache.org/licenses/LICENSE-2.0
;
; Unless required by applicable law or agreed to in writing, software
; distributed under the License is distributed on an "AS IS" BASIS,
; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
; See the License for the specific language governing permissions and
; limitations under the License.
;
; Export declarations for the export DLL 64-bit build.
LIBRARY export_dll_x64.dll

EXPORTS
; Export some functions to make sure the DLL has an exports section.
kExportedData
function1
function2 @7 NONAME
function3
25 changes: 25 additions & 0 deletions syzygy/pe/pe.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,7 @@
'test_dll_x64.rc',
],
'dependencies': [
'export_dll_x64',
'<(src)/syzygy/version/version.gyp:syzygy_version',
],
'msvs_settings': {
Expand Down Expand Up @@ -504,6 +505,30 @@
},
},
},
{
'target_name': 'export_dll_x64',
'type': 'shared_library',
'sources': [
'export_dll.cc',
'export_dll_x64.def',
],
'msvs_settings': {
},
'configurations': {
'Common_Base': {
'msvs_settings': {
'VCLinkerTool': {
'VCLinkerTool': {
# Force MSVS to produce the same output name as Ninja.
'ImportLibrary': '$(OutDir)lib\$(TargetFileName).lib'
},
},
},
'msvs_target_platform': 'x64',
'msvs_configuration_platform': 'x64',
},
},
},
{
'target_name': 'decompose_image_to_text',
'type': 'executable',
Expand Down
4 changes: 4 additions & 0 deletions syzygy/pe/test_dll_x64.def
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,7 @@ EXPORTS
; Export some functions to make sure the DLL has an exports section.
DllMain @7 PRIVATE
Hello
function1 @17 PRIVATE
; Export by ordinal only.
function2 @1 NONAME PRIVATE
function3 @9 PRIVATE

0 comments on commit 5466bca

Please sign in to comment.