Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit58472e7

Browse files
committed
Merged PR 706: Added a UEFI_APPLICATION version of paging audit tool
Added a UEFI_APPLICATION version of paging audit tool
1 parent63f0a2b commit58472e7

File tree

8 files changed

+583
-168
lines changed

8 files changed

+583
-168
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/** @file -- DxePagingAuditApp.c
2+
This Shell App writes page table and memory map information to SFS.
3+
4+
Copyright (c) 2017 - 2019, Microsoft Corporation
5+
6+
All rights reserved.
7+
Redistribution and use in source and binary forms, with or without
8+
modification, are permitted provided that the following conditions are met:
9+
1. Redistributions of source code must retain the above copyright notice,
10+
this list of conditions and the following disclaimer.
11+
2. Redistributions in binary form must reproduce the above copyright notice,
12+
this list of conditions and the following disclaimer in the documentation
13+
and/or other materials provided with the distribution.
14+
15+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18+
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
19+
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
20+
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
22+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
23+
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
24+
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25+
26+
**/
27+
28+
29+
#include"../DxePagingAuditCommon.h"
30+
31+
32+
/**
33+
SmmPagingAuditAppEntryPoint
34+
35+
@param[in] ImageHandle The firmware allocated handle for the EFI image.
36+
@param[in] SystemTable A pointer to the EFI System Table.
37+
38+
@retval EFI_SUCCESS The entry point executed successfully.
39+
@retval other Some error occured when executing this entry point.
40+
41+
**/
42+
EFI_STATUS
43+
EFIAPI
44+
PagingAuditDxeAppEntryPoint (
45+
INEFI_HANDLEImageHandle,
46+
INEFI_SYSTEM_TABLE*SystemTable
47+
)
48+
{
49+
EFI_STATUSStatus=EFI_SUCCESS;
50+
DEBUG((DEBUG_ERROR,__FUNCTION__" entered - %r\n",Status));
51+
52+
DumpPagingInfo (NULL,NULL);
53+
54+
DEBUG((DEBUG_ERROR,__FUNCTION__" leave - %r\n",Status));
55+
56+
returnEFI_SUCCESS;
57+
}// PagingAuditDxeAppEntryPoint()
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
## @file DxePagingAudit.inf
2+
# This Shell App writes page table and memory map information to SFS.
3+
#
4+
##
5+
# Copyright (c) 2017 - 2019, Microsoft Corporation
6+
#
7+
# All rights reserved.
8+
# Redistribution and use in source and binary forms, with or without
9+
# modification, are permitted provided that the following conditions are met:
10+
# 1. Redistributions of source code must retain the above copyright notice,
11+
# this list of conditions and the following disclaimer.
12+
# 2. Redistributions in binary form must reproduce the above copyright notice,
13+
# this list of conditions and the following disclaimer in the documentation
14+
# and/or other materials provided with the distribution.
15+
#
16+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17+
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18+
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19+
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
20+
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21+
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22+
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
23+
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
24+
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
25+
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26+
##
27+
28+
29+
[Defines]
30+
INF_VERSION = 0x00010017
31+
BASE_NAME = DxePagingAuditApp
32+
FILE_GUID = 5CA3255F-0C91-4C8D-A4CF-36E8BC49D6C4
33+
VERSION_STRING = 1.0
34+
MODULE_TYPE = UEFI_APPLICATION
35+
ENTRY_POINT = PagingAuditDxeAppEntryPoint
36+
37+
38+
[Sources]
39+
DxePagingAuditApp.c
40+
../DxePagingAuditCommon.c
41+
../DxePagingAuditCommon.h
42+
43+
44+
[Sources.X64]
45+
../X64/DxePagingAuditProcessor.c
46+
47+
48+
[Packages]
49+
MdePkg/MdePkg.dec
50+
MdeModulePkg/MdeModulePkg.dec
51+
UefiCpuPkg/UefiCpuPkg.dec
52+
ShellPkg/ShellPkg.dec
53+
54+
55+
[LibraryClasses]
56+
PrintLib
57+
DebugLib
58+
UefiBootServicesTableLib
59+
UefiLib
60+
PeCoffGetEntryPointLib
61+
UefiApplicationEntryPoint
62+
ShellLib
63+
64+
[Guids]
65+
gEfiDebugImageInfoTableGuid ## SOMETIMES_CONSUMES ## GUID
66+
gEfiMemoryAttributesTableGuid
67+
68+
[Protocols]
69+
gEfiBlockIoProtocolGuid
70+
gHeapGuardDebugProtocolGuid
71+
gEfiSimpleFileSystemProtocolGuid
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
/** @file -- DxePagingAuditApp.c
2+
This DXE Driver writes page table and memory map information to SFS when triggered
3+
by an event.
4+
5+
Copyright (c) 2017 - 2019, Microsoft Corporation
6+
7+
All rights reserved.
8+
Redistribution and use in source and binary forms, with or without
9+
modification, are permitted provided that the following conditions are met:
10+
1. Redistributions of source code must retain the above copyright notice,
11+
this list of conditions and the following disclaimer.
12+
2. Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
16+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19+
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
20+
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21+
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
23+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
24+
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
25+
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26+
27+
**/
28+
29+
30+
#include"../DxePagingAuditCommon.h"
31+
32+
33+
/**
34+
SmmPagingAuditAppEntryPoint
35+
36+
@param[in] ImageHandle The firmware allocated handle for the EFI image.
37+
@param[in] SystemTable A pointer to the EFI System Table.
38+
39+
@retval EFI_SUCCESS The entry point executed successfully.
40+
@retval other Some error occured when executing this entry point.
41+
42+
**/
43+
EFI_STATUS
44+
EFIAPI
45+
PagingAuditDxeEntryPoint (
46+
INEFI_HANDLEImageHandle,
47+
INEFI_SYSTEM_TABLE*SystemTable
48+
)
49+
{
50+
EFI_STATUSStatus=EFI_SUCCESS;
51+
DEBUG((DEBUG_ERROR,__FUNCTION__" registered - %r\n",Status));
52+
EFI_EVENTEvent;
53+
54+
Status=gBS->CreateEventEx (
55+
EVT_NOTIFY_SIGNAL,
56+
TPL_CALLBACK,
57+
DumpPagingInfo,
58+
NULL,
59+
&gEfiEventExitBootServicesGuid,
60+
&Event
61+
);
62+
// // DumpPagingInfo();
63+
DEBUG((DEBUG_ERROR,__FUNCTION__" leave - %r\n",Status));
64+
65+
returnEFI_SUCCESS;
66+
}// PagingAuditDxeEntryPoint()

‎UefiTestingPkg/AuditTests/PagingAudit/DxePagingAudit/DxePagingAudit.inf‎renamed to ‎UefiTestingPkg/AuditTests/PagingAudit/DxePagingAudit/Dxe/DxePagingAuditDxe.inf‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# by an event.
44
#
55
##
6-
# Copyright (c) 2017, Microsoft Corporation
6+
# Copyright (c) 2017 - 2019, Microsoft Corporation
77
#
88
# All rights reserved.
99
# Redistribution and use in source and binary forms, with or without
@@ -26,19 +26,24 @@
2626
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2727
##
2828

29-
# MS_CHANGE - Entire file created.
3029

3130
[Defines]
3231
INF_VERSION = 0x00010017
33-
BASE_NAME =DxePagingAudit
32+
BASE_NAME =DxePagingAuditDxeDriver
3433
FILE_GUID = 8C8CEAB1-6062-4777-BD21-7A1C034EF034
3534
VERSION_STRING = 1.0
3635
MODULE_TYPE = DXE_DRIVER
3736
ENTRY_POINT = PagingAuditDxeEntryPoint
3837

3938

4039
[Sources]
41-
DxePagingAudit.c
40+
DxePagingAuditDxe.c
41+
../DxePagingAuditCommon.c
42+
../DxePagingAuditCommon.h
43+
44+
45+
[Sources.X64]
46+
../X64/DxePagingAuditProcessor.c
4247

4348

4449
[Packages]

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp