Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for PE #34

Merged
merged 87 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
0a2a74e
Improve SliceStream
xoofx Sep 14, 2024
715155d
Add basic support for nullable
xoofx Sep 14, 2024
cbd3b43
Change sealed
xoofx Sep 14, 2024
924f8ba
Improve SliceStream
xoofx Sep 15, 2024
f0f5957
Rename SliceStream to SubStream
xoofx Sep 15, 2024
2892df6
Add initial files for PE
xoofx Sep 15, 2024
d5886f7
Add PEImageWriter
xoofx Sep 15, 2024
e7635b8
Improve support for PE, add PEBaseRelocation
xoofx Sep 16, 2024
f80727c
Add ReadOnlyList to replace IReadOnlyList interface
xoofx Sep 17, 2024
3d2312e
Add base PEObject.Read virtual method
xoofx Sep 17, 2024
194bd29
Rename BaseRelocationType enum
xoofx Sep 17, 2024
c855cea
Start to add support for import directory
xoofx Sep 17, 2024
b46e2bc
Add ObjectList to manage ownership/parent more easily
xoofx Sep 18, 2024
f5f2382
Extend usage of ObjectList
xoofx Sep 18, 2024
5ad7a90
Breaking change refactoring - Uniformize all ObjectFileElement
xoofx Sep 18, 2024
2ea5f34
Cleanup namespaces / usings
xoofx Sep 18, 2024
ec9dad0
Cleanup more code
xoofx Sep 18, 2024
10824a7
Fix ObjectList.Clear
xoofx Sep 19, 2024
2673448
Extend usage of ObjectList
xoofx Sep 19, 2024
b09d57c
Use ObjectFileElement.ResetIndex
xoofx Sep 19, 2024
b150726
Remove ObjectFileElement.AssignChild/AttachChild/AttachNullableChild …
xoofx Sep 19, 2024
5880e15
Some cleanup in ObjectFileElement
xoofx Sep 19, 2024
e851b44
Add PEVirtualObject
xoofx Sep 19, 2024
1ed56b8
Revert ObjectFileElement.Size to non virtual
xoofx Sep 19, 2024
416833e
Fix loading of import table
xoofx Sep 19, 2024
ede482c
Fix parents in PE objects
xoofx Sep 19, 2024
c60b1e7
Improve loading of sections/directories
xoofx Sep 20, 2024
daea0d4
Fixes IAT
xoofx Sep 20, 2024
d595071
Add support for HintName and fix Import directory
xoofx Sep 20, 2024
61533b8
Improve handling of directories and sub section data
xoofx Sep 21, 2024
6af8e78
Fix handling of PEExportAddressTable
xoofx Sep 21, 2024
9ab7ba0
Add concept of RVO
xoofx Sep 21, 2024
3a5b653
Improve naming
xoofx Sep 21, 2024
f15dc0c
Add ObjectElement
xoofx Sep 22, 2024
5dff882
Add resource directory
xoofx Sep 22, 2024
ed16740
Add exception directory
xoofx Sep 22, 2024
1a6a69b
Add PESecurityDirectory
xoofx Sep 22, 2024
ac58eeb
Allow to update only the size when doing an UpdateLayout within a PEI…
xoofx Sep 22, 2024
3aa7097
Remove Pkcs dependency for now
xoofx Sep 22, 2024
ce899f7
Add support for reading base relocation addresses from PETlsDirectory…
xoofx Sep 22, 2024
f40ba86
Improve support for PETlsDirectory and PELoadConfigDirectory
xoofx Sep 22, 2024
c56b571
Cleanup VA
xoofx Sep 22, 2024
9469837
Add Bound Import Directory
xoofx Sep 23, 2024
5aec28d
Add support for the delay import directory
xoofx Sep 23, 2024
8321b89
Add missing PEDelayImportDirectoryEntry attributes
xoofx Sep 23, 2024
9519751
Add GetRVA() method to PEBaseRelocationPageBlockPart
xoofx Sep 23, 2024
f9a3c51
Add PEPrinter
xoofx Sep 23, 2024
335e1a0
Improve PEPrinter
xoofx Sep 23, 2024
d3f6062
Improve handling of directories dependent on 32/64 bits
xoofx Sep 24, 2024
6f8a180
Add Debug Directory, refactor Tls / LoadConfig directories
xoofx Sep 24, 2024
b51129b
Improve support for debug directory
xoofx Sep 25, 2024
a77d364
Add TextWriterIndenter and update PEPrinter to use it
xoofx Sep 25, 2024
7191b00
Improve PEPrinter
xoofx Sep 25, 2024
a84775b
Add ResolveOriginalStream extension method
xoofx Sep 25, 2024
90c901d
Rename PESecurityDirectory to PESecurityCertificateDirectory
xoofx Sep 25, 2024
37586de
Add Win64 native projects for PE tests
xoofx Sep 25, 2024
0c340ee
Add pseudo printer tests
xoofx Sep 25, 2024
6430157
Migrate tests to MSTest
xoofx Sep 26, 2024
81e7cd8
Add Verify for testing PE
xoofx Sep 26, 2024
bfd0d63
Add PE diagram
xoofx Sep 26, 2024
60988b6
Add basic documentation
xoofx Sep 26, 2024
7aafb96
Update logo with colors
xoofx Sep 26, 2024
2d4eb4d
Fix tests
xoofx Sep 26, 2024
b7cef71
Update readme
xoofx Sep 26, 2024
f7cb66d
Fix UpdateLayout
xoofx Sep 27, 2024
0f147b4
Improve PEPrinter
xoofx Sep 27, 2024
a8831a1
Add better support for resource directory
xoofx Sep 28, 2024
819c74c
Improve support for uncommon headers and PE directories layout
xoofx Sep 28, 2024
3d7b8c5
Add PooledSpan
xoofx Sep 29, 2024
dc54965
Extend usage of PooledSpan for PE
xoofx Sep 29, 2024
6f97a43
Renamed PooledSpan to TempSpan
xoofx Sep 29, 2024
ba62b5f
Rename ImageXXXHeader to PEXXXHeader
xoofx Sep 29, 2024
7d18fd9
Improve handling of PEResourceDirectory
xoofx Sep 29, 2024
ad8d599
Improve handling of PEBaseRelocationDirectory
xoofx Sep 29, 2024
6b5147b
Fix PE writer, first version working in unit tests
xoofx Sep 29, 2024
f7d0c27
Add full support for PE writing
xoofx Sep 30, 2024
2ff9b8c
Fix unit tests on CI for non Windows
xoofx Sep 30, 2024
64006dd
Improve tests when comparing buffers
xoofx Sep 30, 2024
f12216e
Add unit test for creating a PE file from scratch
xoofx Sep 30, 2024
d54f1be
Add comments to TestCreatePE
xoofx Sep 30, 2024
3901ecf
Improve support for directories. Add auto discovery from section content
xoofx Oct 1, 2024
105cafe
Update logo
xoofx Oct 1, 2024
1e9bf55
Add PE verification
xoofx Oct 1, 2024
1ee8299
Add PE checksum
xoofx Oct 1, 2024
d44d387
Fix PE create test to run only on Windows x64
xoofx Oct 1, 2024
e6786d6
Add some advanced documentation
xoofx Oct 1, 2024
d29a07c
Update readme
xoofx Oct 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
145 changes: 145 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
# EditorConfig is awesome:http://EditorConfig.org

# top-most EditorConfig file
root = true

# All Files
[*]
charset = utf-8
indent_style = space
indent_size = 4
insert_final_newline = false
trim_trailing_whitespace = true
csharp_using_directive_placement = outside_namespace:silent
csharp_prefer_simple_using_statement = true:suggestion
csharp_prefer_braces = true:silent
csharp_style_namespace_declarations = block_scoped:silent
csharp_style_prefer_method_group_conversion = true:silent
csharp_style_prefer_top_level_statements = true:silent
csharp_style_expression_bodied_methods = false:silent
csharp_style_expression_bodied_constructors = false:silent
csharp_style_expression_bodied_operators = false:silent
csharp_style_expression_bodied_properties = true:silent
csharp_style_expression_bodied_indexers = true:silent
csharp_style_expression_bodied_accessors = true:silent
csharp_style_expression_bodied_lambdas = true:silent
csharp_style_expression_bodied_local_functions = false:silent
csharp_style_throw_expression = true:suggestion
csharp_style_prefer_null_check_over_type_check = true:suggestion
csharp_prefer_simple_default_expression = true:suggestion
csharp_style_prefer_local_over_anonymous_function = true:suggestion
csharp_style_prefer_index_operator = true:suggestion
csharp_style_prefer_range_operator = true:suggestion
csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion
csharp_style_prefer_tuple_swap = true:suggestion
csharp_style_prefer_utf8_string_literals = true:suggestion
csharp_style_inlined_variable_declaration = true:suggestion
csharp_indent_labels = one_less_than_current
csharp_style_deconstructed_variable_declaration = true:suggestion
dotnet_diagnostic.NUnit2006.severity = silent
dotnet_diagnostic.NUnit2005.severity = silent
dotnet_diagnostic.NUnit2004.severity = silent
dotnet_diagnostic.NUnit2003.severity = silent
dotnet_diagnostic.NUnit2002.severity = silent
dotnet_diagnostic.NUnit2001.severity = silent

# Solution Files
[*.sln]
indent_style = tab

# XML Project Files
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}]
indent_size = 2

# Configuration Files
[*.{json,xml,yml,config,props,targets,nuspec,resx,ruleset}]
indent_size = 2

# Txt/Markdown Files
[*.{md,txt}]
trim_trailing_whitespace = false

# Web Files
[*.{htm,html,js,ts,css,scss,less}]
indent_size = 2
insert_final_newline = true

# Bash Files
[*.sh]
end_of_line = lf

[*.{cs,vb}]
#### Naming styles ####

# Naming rules

dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i

dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case

dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case

# Symbol specifications

dotnet_naming_symbols.interface.applicable_kinds = interface
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.interface.required_modifiers =

dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.types.required_modifiers =

dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.non_field_members.required_modifiers =

# Naming styles

dotnet_naming_style.begins_with_i.required_prefix = I
dotnet_naming_style.begins_with_i.required_suffix =
dotnet_naming_style.begins_with_i.word_separator =
dotnet_naming_style.begins_with_i.capitalization = pascal_case

dotnet_naming_style.pascal_case.required_prefix =
dotnet_naming_style.pascal_case.required_suffix =
dotnet_naming_style.pascal_case.word_separator =
dotnet_naming_style.pascal_case.capitalization = pascal_case

dotnet_naming_style.pascal_case.required_prefix =
dotnet_naming_style.pascal_case.required_suffix =
dotnet_naming_style.pascal_case.word_separator =
dotnet_naming_style.pascal_case.capitalization = pascal_case
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
dotnet_style_prefer_auto_properties = true:silent
dotnet_style_object_initializer = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
dotnet_style_prefer_conditional_expression_over_return = true:silent
dotnet_style_explicit_tuple_names = true:suggestion
dotnet_style_prefer_inferred_tuple_names = true:suggestion
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
dotnet_style_prefer_compound_assignment = true:suggestion
dotnet_style_prefer_simplified_interpolation = true:suggestion
dotnet_style_namespace_match_folder = true:suggestion
dotnet_style_operator_placement_when_wrapping = beginning_of_line
tab_width = 4


# Verify settings
[*.{received,verified}.{txt,xml,json}]
charset = "utf-8-bom"
end_of_line = lf
indent_size = unset
indent_style = unset
insert_final_newline = false
tab_width = unset
trim_trailing_whitespace = false
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto
*.sh text eol=lf
*.verified.txt text eol=lf working-tree-encoding=UTF-8
*.verified.xml text eol=lf working-tree-encoding=UTF-8
*.verified.json text eol=lf working-tree-encoding=UTF-8
Binary file added doc/PE.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading