├── .github
├── FUNDING.yml
└── ISSUE_TEMPLATE
│ └── bug_report.md
├── .gitignore
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── ISSUE_TEMPLATE.md
├── Images
├── Logo-Icon.ico
├── Logo-Nuget.png
├── Logo.docx
├── Logo.png
├── NewLogo.png
├── Sample11-AvalonDock.png
├── Sample11-NOTBL.png
├── Sample12-BarChart.png
├── Sample12-FIXEDTBL-BYTESHIFT.png
├── Sample13-FindDialog.png
├── Sample14-FindReplaceDialog.png
├── Sample15-CustomBackgroundBlock.png
├── Sample15-FindReplaceDialog.png
├── Sample9-TBL.png
├── TBLExplain.docx
└── TBLExplain.png
├── LICENSE
├── README.md
├── SECURITY.md
├── Sources
├── .editorconfig
├── MigrationBackup
│ └── 74a5b0ae
│ │ └── Samples
│ │ └── WpfHexEditor.Sample.CSharp
│ │ ├── WpfHexEditor.Sample.CSharp.csproj
│ │ └── packages.config
├── Samples
│ ├── WPFHexEditor.Sample.CSharp
│ │ ├── App.xaml
│ │ ├── App.xaml.cs
│ │ ├── Configs
│ │ │ ├── NET45
│ │ │ │ └── App.config
│ │ │ └── NET47
│ │ │ │ └── App.config
│ │ ├── MainWindow.xaml
│ │ ├── MainWindow.xaml.cs
│ │ ├── Properties
│ │ │ ├── AssemblyInfo.cs
│ │ │ ├── Resources.Designer.cs
│ │ │ ├── Resources.resx
│ │ │ ├── Settings.Designer.cs
│ │ │ └── Settings.settings
│ │ ├── Resources
│ │ │ └── Icon
│ │ │ │ ├── 0x-Icon.ico
│ │ │ │ ├── Close-Icon.ico
│ │ │ │ ├── Logo-Icon.ico
│ │ │ │ ├── Open-File-Icon.ico
│ │ │ │ └── Save-Icon.ico
│ │ └── WpfHexEditor.Sample.csproj
│ ├── WpfHexEditor.Sample.AvalonDock
│ │ ├── App.config
│ │ ├── App.xaml
│ │ ├── App.xaml.cs
│ │ ├── MainWindow.xaml
│ │ ├── MainWindow.xaml.cs
│ │ ├── Properties
│ │ │ ├── AssemblyInfo.cs
│ │ │ ├── Resources.Designer.cs
│ │ │ ├── Resources.resx
│ │ │ ├── Settings.Designer.cs
│ │ │ └── Settings.settings
│ │ ├── WpfHexEditor.Sample.AvalonDock.csproj
│ │ └── packages.config
│ ├── WpfHexEditor.Sample.BarChart
│ │ ├── App.xaml
│ │ ├── App.xaml.cs
│ │ ├── AssemblyInfo.cs
│ │ ├── MainWindow.xaml
│ │ ├── MainWindow.xaml.cs
│ │ └── WpfHexEditor.Sample.BarChart.csproj
│ ├── WpfHexEditor.Sample.BinaryFilesDifference
│ │ ├── App.xaml
│ │ ├── App.xaml.cs
│ │ ├── AssemblyInfo.cs
│ │ ├── BlockListItem.xaml
│ │ ├── BlockListItem.xaml.cs
│ │ ├── ByteDifferenceListItem.xaml
│ │ ├── ByteDifferenceListItem.xaml.cs
│ │ ├── MainWindow.xaml
│ │ ├── MainWindow.xaml.cs
│ │ └── WpfHexEditor.Sample.BinaryFilesDifference.csproj
│ ├── WpfHexEditor.Sample.InsertByteAnywhere
│ │ ├── App.xaml
│ │ ├── App.xaml.cs
│ │ ├── AssemblyInfo.cs
│ │ ├── MainWindow.xaml
│ │ ├── MainWindow.xaml.cs
│ │ └── WpfHexEditor.Sample.InsertByteAnywhere.csproj
│ ├── WpfHexEditor.Sample.VB
│ │ ├── App.config
│ │ ├── Application.xaml
│ │ ├── Application.xaml.vb
│ │ ├── GlobalSuppressions.vb
│ │ ├── MainWindow.xaml
│ │ ├── MainWindow.xaml.vb
│ │ ├── My Project
│ │ │ ├── AssemblyInfo.vb
│ │ │ ├── MyExtensions
│ │ │ │ └── MyWpfExtension.vb
│ │ │ ├── Resources.Designer.vb
│ │ │ ├── Resources.resx
│ │ │ ├── Settings.Designer.vb
│ │ │ └── Settings.settings
│ │ ├── Resources
│ │ │ └── Icon
│ │ │ │ ├── 0x-Icon.ico
│ │ │ │ ├── Close-Icon.ico
│ │ │ │ ├── Logo-Icon.ico
│ │ │ │ ├── Open-File-Icon.ico
│ │ │ │ └── Save-Icon.ico
│ │ └── WpfHexEditor.Sample.VB.vbproj
│ └── WpfHexEditor.Sample.Winform
│ │ ├── App.config
│ │ ├── MainForm.Designer.cs
│ │ ├── MainForm.cs
│ │ ├── MainForm.resx
│ │ ├── Program.cs
│ │ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ ├── Resources.resx
│ │ ├── Settings.Designer.cs
│ │ └── Settings.settings
│ │ └── WpfHexEditor.Sample.Winform.csproj
├── WPFHexaEditor
│ ├── BaseByte.cs
│ ├── Core
│ │ ├── BookMark.cs
│ │ ├── Bytes
│ │ │ ├── ByteConverters.cs
│ │ │ ├── ByteDifference.cs
│ │ │ ├── ByteModified.cs
│ │ │ ├── ByteProvider.cs
│ │ │ ├── Byte_16bit.cs
│ │ │ ├── Byte_32bit.cs
│ │ │ └── Byte_8bit.cs
│ │ ├── Caret.cs
│ │ ├── CharacterTable
│ │ │ ├── DTE.cs
│ │ │ ├── Enum.cs
│ │ │ └── TBLStream.cs
│ │ ├── ConstantReadOnly.cs
│ │ ├── Converters
│ │ │ ├── BoolInverterConverter.cs
│ │ │ ├── BooleanToVisibilityConverter.cs
│ │ │ ├── ByteToHexStringConverter.cs
│ │ │ ├── HexToLongStringConverter.cs
│ │ │ ├── LongToHexStringConverter.cs
│ │ │ ├── PathToFilenameConverter.cs
│ │ │ └── VisibilityToBooleanConverter.cs
│ │ ├── CustomBackgroundBlock.cs
│ │ ├── Enumeration.cs
│ │ ├── EventArguments
│ │ │ ├── ByteDifferenceEventArgs.cs
│ │ │ ├── ByteEventArgs.cs
│ │ │ └── CustomBackgroundBlockEventArgs.cs
│ │ ├── Interfaces
│ │ │ ├── IByte.cs
│ │ │ ├── IByteControl.cs
│ │ │ └── IByteModified.cs
│ │ ├── KeyValidator.cs
│ │ ├── MethodExtention
│ │ │ ├── ApplicationExtention.cs
│ │ │ ├── ByteArrayExtention.cs
│ │ │ ├── DoubleExtension.cs
│ │ │ ├── StringExtension.cs
│ │ │ ├── TrackExtention.cs
│ │ │ └── WithMethodExtention.cs
│ │ ├── Native
│ │ │ └── NativeMethods.cs
│ │ └── RandomBrushes.cs
│ ├── Dialog
│ │ ├── FindReplaceWindow.xaml
│ │ ├── FindReplaceWindow.xaml.cs
│ │ ├── FindWindow.xaml
│ │ ├── FindWindow.xaml.cs
│ │ ├── GiveByteWindow.xaml
│ │ ├── GiveByteWindow.xaml.cs
│ │ ├── ReplaceByteWindow.xaml
│ │ └── ReplaceByteWindow.xaml.cs
│ ├── FastTextLine.cs
│ ├── GlobalSuppressions.cs
│ ├── HexBox.xaml
│ ├── HexBox.xaml.cs
│ ├── HexByte.cs
│ ├── HexEditor.xaml
│ ├── HexEditor.xaml.cs
│ ├── LICENSE.txt
│ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ ├── Resources.fr-CA.Designer.cs
│ │ ├── Resources.fr-CA.resx
│ │ ├── Resources.pl-PL.Designer.cs
│ │ ├── Resources.pl-PL.resx
│ │ ├── Resources.pt-BR.Designer.cs
│ │ ├── Resources.pt-BR.resx
│ │ ├── Resources.resx
│ │ ├── Resources.ru-RU.Designer.cs
│ │ ├── Resources.ru-RU.resx
│ │ ├── Resources.zh-CN.resx
│ │ ├── Resources.zh-CN1.Designer.cs
│ │ ├── Settings.Designer.cs
│ │ └── Settings.settings
│ ├── Resources
│ │ ├── Dictionary
│ │ │ ├── BrushesDictionary.xaml
│ │ │ ├── MiscelanousDictionary.xaml
│ │ │ └── ToolTipDictionary.xaml
│ │ ├── EBCDIC-NoSpecialChar.tbl
│ │ ├── EBCDIC.tbl
│ │ └── Icon
│ │ │ ├── 0x-Icon.ico
│ │ │ ├── Add-Bookmark-Icon.ico
│ │ │ ├── Clear-Bookmark-Icon.ico
│ │ │ ├── Copy-Icon.ico
│ │ │ ├── Delete-Icon.ico
│ │ │ ├── Find-Icon.ico
│ │ │ ├── Logo-Icon.ico
│ │ │ ├── Logo-Icon.png
│ │ │ ├── Paste-Icon.ico
│ │ │ ├── Remove-Bookmark-Icon.ico
│ │ │ ├── Sans titre.png
│ │ │ ├── Settings-Icon.ico
│ │ │ └── Undo-Icon.ico
│ ├── StringByte.cs
│ └── WpfHexEditorCore.csproj
└── WpfHexEditorControl.sln
├── _config.yml
└── readme-nuget.md
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 |
3 | github: abbaye
4 | patreon: # Replace with a single Patreon username
5 | open_collective: # Replace with a single Open Collective username
6 | ko_fi: # Replace with a single Ko-fi username
7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9 | liberapay: # Replace with a single Liberapay username
10 | issuehunt: # Replace with a single IssueHunt username
11 | otechie: # Replace with a single Otechie username
12 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
13 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Describe the bug**
11 | A clear and concise description of what the bug is.
12 |
13 | **To Reproduce**
14 | Steps to reproduce the behavior:
15 | 1. Go to '...'
16 | 2. Click on '....'
17 | 3. Scroll down to '....'
18 | 4. See error
19 |
20 | **Expected behavior**
21 | A clear and concise description of what you expected to happen.
22 |
23 | **Screenshots**
24 | If applicable, add screenshots to help explain your problem.
25 |
26 | **Desktop (please complete the following information):**
27 | - OS: [e.g. iOS]
28 | - Browser [e.g. chrome, safari]
29 | - Version [e.g. 22]
30 |
31 | **Smartphone (please complete the following information):**
32 | - Device: [e.g. iPhone6]
33 | - OS: [e.g. iOS8.1]
34 | - Browser [e.g. stock browser, safari]
35 | - Version [e.g. 22]
36 |
37 | **Additional context**
38 | Add any other context about the problem here.
39 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 |
4 | # User-specific files
5 | *.suo
6 | *.user
7 | *.userosscache
8 | *.sln.docstates
9 |
10 | # User-specific files (MonoDevelop/Xamarin Studio)
11 | *.userprefs
12 |
13 | # Build results
14 | [Dd]ebug/
15 | [Dd]ebugPublic/
16 | [Rr]elease/
17 | [Rr]eleases/
18 | x64/
19 | x86/
20 | bld/
21 | [Bb]in/
22 | [Oo]bj/
23 |
24 | # Visual Studio 2015 cache/options directory
25 | .vs/
26 | # Uncomment if you have tasks that create the project's static files in wwwroot
27 | #wwwroot/
28 |
29 | # MSTest test Results
30 | [Tt]est[Rr]esult*/
31 | [Bb]uild[Ll]og.*
32 |
33 | # NUNIT
34 | *.VisualState.xml
35 | TestResult.xml
36 |
37 | # Build Results of an ATL Project
38 | [Dd]ebugPS/
39 | [Rr]eleasePS/
40 | dlldata.c
41 |
42 | # DNX
43 | project.lock.json
44 | artifacts/
45 |
46 | *_i.c
47 | *_p.c
48 | *_i.h
49 | *.ilk
50 | *.meta
51 | *.obj
52 | *.pch
53 | *.pdb
54 | *.pgc
55 | *.pgd
56 | *.rsp
57 | *.sbr
58 | *.tlb
59 | *.tli
60 | *.tlh
61 | *.tmp
62 | *.tmp_proj
63 | *.log
64 | *.vspscc
65 | *.vssscc
66 | .builds
67 | *.pidb
68 | *.svclog
69 | *.scc
70 |
71 | # Chutzpah Test files
72 | _Chutzpah*
73 |
74 | # Visual C++ cache files
75 | ipch/
76 | *.aps
77 | *.ncb
78 | *.opendb
79 | *.opensdf
80 | *.sdf
81 | *.cachefile
82 |
83 | # Visual Studio profiler
84 | *.psess
85 | *.vsp
86 | *.vspx
87 | *.sap
88 |
89 | # TFS 2012 Local Workspace
90 | $tf/
91 |
92 | # Guidance Automation Toolkit
93 | *.gpState
94 |
95 | # ReSharper is a .NET coding add-in
96 | _ReSharper*/
97 | *.[Rr]e[Ss]harper
98 | *.DotSettings.user
99 |
100 | # JustCode is a .NET coding add-in
101 | .JustCode
102 |
103 | # TeamCity is a build add-in
104 | _TeamCity*
105 |
106 | # DotCover is a Code Coverage Tool
107 | *.dotCover
108 |
109 | # NCrunch
110 | _NCrunch_*
111 | .*crunch*.local.xml
112 | nCrunchTemp_*
113 |
114 | # MightyMoose
115 | *.mm.*
116 | AutoTest.Net/
117 |
118 | # Web workbench (sass)
119 | .sass-cache/
120 |
121 | # Installshield output folder
122 | [Ee]xpress/
123 |
124 | # DocProject is a documentation generator add-in
125 | DocProject/buildhelp/
126 | DocProject/Help/*.HxT
127 | DocProject/Help/*.HxC
128 | DocProject/Help/*.hhc
129 | DocProject/Help/*.hhk
130 | DocProject/Help/*.hhp
131 | DocProject/Help/Html2
132 | DocProject/Help/html
133 |
134 | # Click-Once directory
135 | publish/
136 |
137 | # Publish Web Output
138 | *.[Pp]ublish.xml
139 | *.azurePubxml
140 | # TODO: Comment the next line if you want to checkin your web deploy settings
141 | # but database connection strings (with potential passwords) will be unencrypted
142 | *.pubxml
143 | *.publishproj
144 |
145 | # NuGet Packages
146 | *.nupkg
147 | # The packages folder can be ignored because of Package Restore
148 | **/packages/*
149 | # except build/, which is used as an MSBuild target.
150 | !**/packages/build/
151 | # Uncomment if necessary however generally it will be regenerated when needed
152 | #!**/packages/repositories.config
153 | # NuGet v3's project.json files produces more ignoreable files
154 | *.nuget.props
155 | *.nuget.targets
156 |
157 | # Microsoft Azure Build Output
158 | csx/
159 | *.build.csdef
160 |
161 | # Microsoft Azure Emulator
162 | ecf/
163 | rcf/
164 |
165 | # Microsoft Azure ApplicationInsights config file
166 | ApplicationInsights.config
167 |
168 | # Windows Store app package directory
169 | AppPackages/
170 | BundleArtifacts/
171 |
172 | # Visual Studio cache files
173 | # files ending in .cache can be ignored
174 | *.[Cc]ache
175 | # but keep track of directories ending in .cache
176 | !*.[Cc]ache/
177 |
178 | # Others
179 | ClientBin/
180 | ~$*
181 | *~
182 | *.dbmdl
183 | *.dbproj.schemaview
184 | *.pfx
185 | *.publishsettings
186 | node_modules/
187 | orleans.codegen.cs
188 |
189 | # RIA/Silverlight projects
190 | Generated_Code/
191 |
192 | # Backup & report files from converting an old project file
193 | # to a newer Visual Studio version. Backup files are not needed,
194 | # because we have git ;-)
195 | _UpgradeReport_Files/
196 | Backup*/
197 | UpgradeLog*.XML
198 | UpgradeLog*.htm
199 |
200 | # SQL Server files
201 | *.mdf
202 | *.ldf
203 |
204 | # Business Intelligence projects
205 | *.rdl.data
206 | *.bim.layout
207 | *.bim_*.settings
208 |
209 | # Microsoft Fakes
210 | FakesAssemblies/
211 |
212 | # GhostDoc plugin setting file
213 | *.GhostDoc.xml
214 |
215 | # Node.js Tools for Visual Studio
216 | .ntvs_analysis.dat
217 |
218 | # Visual Studio 6 build log
219 | *.plg
220 |
221 | # Visual Studio 6 workspace options file
222 | *.opt
223 |
224 | # Visual Studio LightSwitch build output
225 | **/*.HTMLClient/GeneratedArtifacts
226 | **/*.DesktopClient/GeneratedArtifacts
227 | **/*.DesktopClient/ModelManifest.xml
228 | **/*.Server/GeneratedArtifacts
229 | **/*.Server/ModelManifest.xml
230 | _Pvt_Extensions
231 |
232 | # Paket dependency manager
233 | .paket/paket.exe
234 |
235 | # FAKE - F# Make
236 | .fake/
237 | /WPFHexaEditor.Control/Properties
238 | /WPFHexaEditor.Control/Properties
239 | /WPFHexaEditor.Control/Properties/resources1.Designer.cs
240 | /WPFHexaEditor.Control/Properties/Resources.fr-CA.resx
241 | /WPFHexaEditorExample/Window1.xaml
242 |
243 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Contributor Covenant Code of Conduct
2 |
3 | ## Our Pledge
4 |
5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6 |
7 | ## Our Standards
8 |
9 | Examples of behavior that contributes to creating a positive environment include:
10 |
11 | * Using welcoming and inclusive language
12 | * Being respectful of differing viewpoints and experiences
13 | * Gracefully accepting constructive criticism
14 | * Focusing on what is best for the community
15 | * Showing empathy towards other community members
16 |
17 | Examples of unacceptable behavior by participants include:
18 |
19 | * The use of sexualized language or imagery and unwelcome sexual attention or advances
20 | * Trolling, insulting/derogatory comments, and personal or political attacks
21 | * Public or private harassment
22 | * Publishing others' private information, such as a physical or electronic address, without explicit permission
23 | * Other conduct which could reasonably be considered inappropriate in a professional setting
24 |
25 | ## Our Responsibilities
26 |
27 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28 |
29 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
30 |
31 | ## Scope
32 |
33 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
34 |
35 | ## Enforcement
36 |
37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at derektremblay666@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38 |
39 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
40 |
41 | ## Attribution
42 |
43 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
44 |
45 | [homepage]: http://contributor-covenant.org
46 | [version]: http://contributor-covenant.org/version/1/4/
47 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | You are welcome for help in the project :)
2 |
--------------------------------------------------------------------------------
/ISSUE_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | ## Expected Behavior
2 |
3 |
4 | ## Actual Behavior
5 |
6 |
7 | ## Steps to Reproduce the Problem
8 |
9 | 1.
10 | 1.
11 | 1.
12 |
13 |
--------------------------------------------------------------------------------
/Images/Logo-Icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abbaye/WpfHexEditorControl/835347edd04bda516e4e97ae748535e48eb7af69/Images/Logo-Icon.ico
--------------------------------------------------------------------------------
/Images/Logo-Nuget.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abbaye/WpfHexEditorControl/835347edd04bda516e4e97ae748535e48eb7af69/Images/Logo-Nuget.png
--------------------------------------------------------------------------------
/Images/Logo.docx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abbaye/WpfHexEditorControl/835347edd04bda516e4e97ae748535e48eb7af69/Images/Logo.docx
--------------------------------------------------------------------------------
/Images/Logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abbaye/WpfHexEditorControl/835347edd04bda516e4e97ae748535e48eb7af69/Images/Logo.png
--------------------------------------------------------------------------------
/Images/NewLogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abbaye/WpfHexEditorControl/835347edd04bda516e4e97ae748535e48eb7af69/Images/NewLogo.png
--------------------------------------------------------------------------------
/Images/Sample11-AvalonDock.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abbaye/WpfHexEditorControl/835347edd04bda516e4e97ae748535e48eb7af69/Images/Sample11-AvalonDock.png
--------------------------------------------------------------------------------
/Images/Sample11-NOTBL.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abbaye/WpfHexEditorControl/835347edd04bda516e4e97ae748535e48eb7af69/Images/Sample11-NOTBL.png
--------------------------------------------------------------------------------
/Images/Sample12-BarChart.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abbaye/WpfHexEditorControl/835347edd04bda516e4e97ae748535e48eb7af69/Images/Sample12-BarChart.png
--------------------------------------------------------------------------------
/Images/Sample12-FIXEDTBL-BYTESHIFT.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abbaye/WpfHexEditorControl/835347edd04bda516e4e97ae748535e48eb7af69/Images/Sample12-FIXEDTBL-BYTESHIFT.png
--------------------------------------------------------------------------------
/Images/Sample13-FindDialog.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abbaye/WpfHexEditorControl/835347edd04bda516e4e97ae748535e48eb7af69/Images/Sample13-FindDialog.png
--------------------------------------------------------------------------------
/Images/Sample14-FindReplaceDialog.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abbaye/WpfHexEditorControl/835347edd04bda516e4e97ae748535e48eb7af69/Images/Sample14-FindReplaceDialog.png
--------------------------------------------------------------------------------
/Images/Sample15-CustomBackgroundBlock.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abbaye/WpfHexEditorControl/835347edd04bda516e4e97ae748535e48eb7af69/Images/Sample15-CustomBackgroundBlock.png
--------------------------------------------------------------------------------
/Images/Sample15-FindReplaceDialog.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abbaye/WpfHexEditorControl/835347edd04bda516e4e97ae748535e48eb7af69/Images/Sample15-FindReplaceDialog.png
--------------------------------------------------------------------------------
/Images/Sample9-TBL.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abbaye/WpfHexEditorControl/835347edd04bda516e4e97ae748535e48eb7af69/Images/Sample9-TBL.png
--------------------------------------------------------------------------------
/Images/TBLExplain.docx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abbaye/WpfHexEditorControl/835347edd04bda516e4e97ae748535e48eb7af69/Images/TBLExplain.docx
--------------------------------------------------------------------------------
/Images/TBLExplain.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abbaye/WpfHexEditorControl/835347edd04bda516e4e97ae748535e48eb7af69/Images/TBLExplain.png
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | [](https://www.nuget.org/packages/WPFHexaEditor/)
4 | [](https://www.microsoft.com/net/download/windows)
5 | [](https://www.microsoft.com/net/download/windows)
6 | [](https://blogs.msdn.microsoft.com/dotnet/2016/08/24/whats-new-in-csharp-7-0/)
7 | [](https://github.com/abbaye/WpfHexEditorControl/blob/master/LICENSE)
8 |
9 | Wpf Hexeditor is a powerful and fully customisable user control for editing file or stream as hexadecimal, decimal and binary.
10 |
11 | You can use it very easily in Wpf or WinForm application. Download the code and test the Wpf (C#, VB.NET) and WinForm (C#) samples.
12 |
13 | The control are localized in English, French, Russian, Polish, Portuguese and Chinese
14 |
15 | ### ⭐ You want to say thank or just like project ?
16 |
17 | Hexeditor control is totaly free and can be used in all project you want like open source and commercial applications. I make it in my free time and a few colaborators help me when they can... Please hit the ⭐️ button or fork and I will be very happy ;) I accept help contribution...
18 |
19 | ### 🖼 Screenshots
20 |
21 | Sample with standard ASCII character table
22 | 
23 |
24 | Sample with custom character table (TBL) on SNES Final Fantasy II US
25 | 
26 |
27 | Sample use ByteShiftLeft and BytePerLine properties with custom TBL for edit fixed lenght table...
28 | 
29 |
30 | Sample use of find and find/replace dialog...
31 | 
32 |
33 |
34 | ⭐ Sample use of BarChart representation of the data ...
35 | 
36 |
37 | ⭐ Sample use of control in AvalonDock ...
38 |
39 | 
40 |
41 | ⭐ Sample use of CustomBackgroundBlock in the "Find difference bytes sample" ...
42 | 
43 |
44 | ## 🧾 What is TBL (custom character table)
45 | The TBL are small plaintext .tbl files that link every hexadecimal value with a character, which proves most useful when reading and changing text data. Wpf HexEditor support .tbl and you can define your custom character table as you want.
46 |
47 | Unicode TBL are supported. For use put value at the right of equal (=) like this (0401=塞西尔) or (42=Д) in you plaintext .tbl file.
48 |
49 | 
50 |
51 | ### 🛒 Somes features
52 |
53 | ⭐ = New features
54 |
55 | - ⭐ AvalonDock support
56 | - ⭐ Edit in hexadecimal, decimal and binary
57 | - ⭐ Edit in 8bit, 16bit and 32bit
58 | - ⭐ Edit in LoHi or HiLo
59 | - ⭐ View as BarChart (see in screenshot. will evoluate in future)
60 | - Find and Find/Replace dialog
61 | - Append byte at end of file
62 | - Include HexBox, an Hexadecimal TextBox with spinner
63 | - Fill selection (or another array) with byte.
64 | - Support of common key in window like CTRL+C, CTRL+V, CTRL+Z, CTRL+Y, CTRL+A, ESC...
65 | - Copy to clipboard as code like C#, VB.Net, C, Java, F# ...
66 | - Support custom .TBL character table file insted of default ASCII.
67 | - Unlimited Undo / Redo
68 | - Finds methods (FindFirst, FindNext, FindAll, FindLast, FindSelection) and overload for (string, byte[])
69 | - Replace methods (ReplaceFirst, ReplaceNext, ReplaceAll) and overload for (string, byte[])
70 | - Highlight byte with somes find methods
71 | - Bookmark
72 | - Group byte in block of 2,4,6,8 bytes...
73 | - Show data as hexadecimal or decimal
74 | - Possibility to view only a part of file/stream in editor and dont loose anychange when used it (AllowVisualByteAdress...)
75 | - Zoom / UnZoom hexeditor content (50% to 200%)
76 | - Positility to show or not the bytes are deleted.
77 | - Customize the color of bytes, TBL, background, header, and much more ...
78 | - ...
79 |
80 | ### 👏 How to use
81 | Add a reference to `WPFHexaEditor.dll` from your project, then add the following namespace to your XAML:
82 |
83 | ```xaml
84 | xmlns:control="clr-namespace:WpfHexaEditor;assembly=WPFHexaEditor"
85 | ```
86 |
87 | Insert the control like this in your XAML...:
88 |
89 | ```xaml
90 |
91 |
92 |
93 |
94 | ```
95 |
96 | ---
97 | ✨ Wpf HexEditor user control, by Derek Tremblay (derektremblay666@gmail.com) coded for your fun! 😊🤟
98 |
--------------------------------------------------------------------------------
/SECURITY.md:
--------------------------------------------------------------------------------
1 | # Security Policy
2 |
3 | ## Supported Versions
4 |
5 | Use this section to tell people about which versions of your project are
6 | currently being supported with security updates.
7 |
8 | | Version | Supported |
9 | | ------- | ------------------ |
10 | | 5.1.x | :white_check_mark: |
11 | | 5.0.x | :x: |
12 | | 4.0.x | :white_check_mark: |
13 | | < 4.0 | :x: |
14 |
15 | ## Reporting a Vulnerability
16 |
17 | Use this section to tell people how to report a vulnerability.
18 |
19 | Tell them where to go, how often they can expect to get an update on a
20 | reported vulnerability, what to expect if the vulnerability is accepted or
21 | declined, etc.
22 |
--------------------------------------------------------------------------------
/Sources/.editorconfig:
--------------------------------------------------------------------------------
1 | [*.cs]
2 |
3 | # CS8509: L'expression switch ne prend pas en charge toutes les valeurs possibles de son type d'entrée (elle n'est pas exhaustive).
4 | dotnet_diagnostic.CS8509.severity = none
5 |
--------------------------------------------------------------------------------
/Sources/MigrationBackup/74a5b0ae/Samples/WpfHexEditor.Sample.CSharp/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Sources/Samples/WPFHexEditor.Sample.CSharp/App.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/Sources/Samples/WPFHexEditor.Sample.CSharp/App.xaml.cs:
--------------------------------------------------------------------------------
1 | //////////////////////////////////////////////
2 | // Apache 2.0 - 2016-2018
3 | // Author : Derek Tremblay (derektremblay666@gmail.com)
4 | //////////////////////////////////////////////
5 |
6 | using System.Runtime.InteropServices;
7 | using System.Windows.Threading;
8 |
9 | namespace WPFHexaEditorExample
10 | {
11 | ///
12 | /// Interaction logic for App.xaml
13 | ///
14 | public partial class App
15 | {
16 | private void Application_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
17 | {
18 | if (e.Exception is COMException comException && comException.ErrorCode == -2147221040)
19 | e.Handled = true;
20 | }
21 | }
22 | }
--------------------------------------------------------------------------------
/Sources/Samples/WPFHexEditor.Sample.CSharp/Configs/NET45/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | WPF HexEditor control
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Sources/Samples/WPFHexEditor.Sample.CSharp/Configs/NET47/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | WPF HexEditor control
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Sources/Samples/WPFHexEditor.Sample.CSharp/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | //////////////////////////////////////////////
2 | // Apache 2.0 - 2016-2020
3 | // Author : Derek Tremblay (derektremblay666@gmail.com)
4 | //////////////////////////////////////////////
5 |
6 | using System.Runtime.InteropServices;
7 | using System.Windows;
8 |
9 | // Setting ComVisible to false makes the types in this assembly not visible
10 | // to COM components. If you need to access a type in this assembly from
11 | // COM, set the ComVisible attribute to true on that type.
12 | [assembly: ComVisible(false)]
13 |
14 | [assembly: ThemeInfo(
15 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
16 | //(used if a resource is not found in the page,
17 | // or application resource dictionaries)
18 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
19 | //(used if a resource is not found in the page,
20 | // app, or any theme specific resource dictionaries)
21 | )]
22 |
--------------------------------------------------------------------------------
/Sources/Samples/WPFHexEditor.Sample.CSharp/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace WPFHexaEditorExample.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WPFHexaEditorExample.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 |
63 | ///
64 | /// Looks up a localized string similar to test.
65 | ///
66 | internal static string testString {
67 | get {
68 | return ResourceManager.GetString("testString", resourceCulture);
69 | }
70 | }
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/Sources/Samples/WPFHexEditor.Sample.CSharp/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | test
122 |
123 |
--------------------------------------------------------------------------------
/Sources/Samples/WPFHexEditor.Sample.CSharp/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // Ce code a été généré par un outil.
4 | // Version du runtime :4.0.30319.42000
5 | //
6 | // Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si
7 | // le code est régénéré.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace WpfHexEditor.Sample.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.8.1.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 |
26 | [global::System.Configuration.UserScopedSettingAttribute()]
27 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
28 | [global::System.Configuration.DefaultSettingValueAttribute("Wpf HexEditor control c# sample")]
29 | public string ApplicationName {
30 | get {
31 | return ((string)(this["ApplicationName"]));
32 | }
33 | set {
34 | this["ApplicationName"] = value;
35 | }
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/Sources/Samples/WPFHexEditor.Sample.CSharp/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Wpf HexEditor control c# sample
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Sources/Samples/WPFHexEditor.Sample.CSharp/Resources/Icon/0x-Icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abbaye/WpfHexEditorControl/835347edd04bda516e4e97ae748535e48eb7af69/Sources/Samples/WPFHexEditor.Sample.CSharp/Resources/Icon/0x-Icon.ico
--------------------------------------------------------------------------------
/Sources/Samples/WPFHexEditor.Sample.CSharp/Resources/Icon/Close-Icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abbaye/WpfHexEditorControl/835347edd04bda516e4e97ae748535e48eb7af69/Sources/Samples/WPFHexEditor.Sample.CSharp/Resources/Icon/Close-Icon.ico
--------------------------------------------------------------------------------
/Sources/Samples/WPFHexEditor.Sample.CSharp/Resources/Icon/Logo-Icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abbaye/WpfHexEditorControl/835347edd04bda516e4e97ae748535e48eb7af69/Sources/Samples/WPFHexEditor.Sample.CSharp/Resources/Icon/Logo-Icon.ico
--------------------------------------------------------------------------------
/Sources/Samples/WPFHexEditor.Sample.CSharp/Resources/Icon/Open-File-Icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abbaye/WpfHexEditorControl/835347edd04bda516e4e97ae748535e48eb7af69/Sources/Samples/WPFHexEditor.Sample.CSharp/Resources/Icon/Open-File-Icon.ico
--------------------------------------------------------------------------------
/Sources/Samples/WPFHexEditor.Sample.CSharp/Resources/Icon/Save-Icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abbaye/WpfHexEditorControl/835347edd04bda516e4e97ae748535e48eb7af69/Sources/Samples/WPFHexEditor.Sample.CSharp/Resources/Icon/Save-Icon.ico
--------------------------------------------------------------------------------
/Sources/Samples/WPFHexEditor.Sample.CSharp/WpfHexEditor.Sample.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | WinExe
5 | net70-windows
6 | true
7 |
8 |
9 |
10 | TRACE;
11 | NU1605
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 | True
37 | True
38 | Settings.settings
39 |
40 |
41 |
42 |
43 |
44 | SettingsSingleFileGenerator
45 | Settings.Designer.cs
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/Sources/Samples/WpfHexEditor.Sample.AvalonDock/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/Sources/Samples/WpfHexEditor.Sample.AvalonDock/App.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Sources/Samples/WpfHexEditor.Sample.AvalonDock/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | namespace WpfHexEditor.Sample.AvalonDock
4 | {
5 | ///
6 | /// Logique d'interaction pour App.xaml
7 | ///
8 | public partial class App : Application
9 | {
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Sources/Samples/WpfHexEditor.Sample.AvalonDock/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/Sources/Samples/WpfHexEditor.Sample.AvalonDock/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 | using System;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Windows;
6 | using WpfHexaEditor.Core;
7 | using WpfHexaEditor.Core.MethodExtention;
8 | using Xceed.Wpf.AvalonDock.Layout;
9 |
10 | namespace WpfHexEditor.Sample.AvalonDock
11 | {
12 | ///
13 | /// Early implementation of the sample for Avalondock
14 | ///
15 | /// This project will be used to debug the Hexeditor when used in AvalonDock...
16 | ///
17 | public partial class MainWindow : Window
18 | {
19 | public MainWindow() => InitializeComponent();
20 |
21 | private void LoadNewHexEditor(string filename)
22 | {
23 | if (!(dockManager.Layout.Descendents().OfType().FirstOrDefault() is LayoutDocumentPane firstDocumentPane)) return;
24 |
25 | new LayoutDocument().With(d =>
26 | {
27 | if (!File.Exists(filename)) return;
28 |
29 | d.Closed += Doc_Closed;
30 | d.IsSelectedChanged += Doc_IsSelectedChanged;
31 |
32 | d.Title = Path.GetFileName(filename);
33 | d.ToolTip = filename;
34 | d.IsSelected = true;
35 |
36 | new WpfHexaEditor.HexEditor().With(h =>
37 | {
38 | h.PreloadByteInEditorMode = PreloadByteInEditor.MaxVisibleLineExtended;
39 | h.FileName = filename;
40 | d.Content = h;
41 | });
42 |
43 | firstDocumentPane.Children.Add(d);
44 | });
45 | }
46 |
47 | private void Doc_IsSelectedChanged(object sender, EventArgs e)
48 | {
49 | //not implemented...
50 | }
51 |
52 | private void Doc_Closed(object sender, EventArgs e)
53 | {
54 | //not implemented...
55 | }
56 |
57 | private void OpenButton_Click(object sender, RoutedEventArgs e) =>
58 | new OpenFileDialog().With(o =>
59 | {
60 | o.CheckFileExists = true;
61 | o.CheckPathExists = true;
62 | o.Multiselect = false;
63 |
64 | if (o.ShowDialog() ?? false)
65 | LoadNewHexEditor(o.FileName);
66 | });
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/Sources/Samples/WpfHexEditor.Sample.AvalonDock/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 | using System.Windows;
4 |
5 | // Les informations générales relatives à un assembly dépendent de
6 | // l'ensemble d'attributs suivant. Pour modifier les informations
7 | // associées à un assembly.
8 | [assembly: AssemblyTitle("WpfHexEditor.Sample.AvalonDock")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("WpfHexEditor.Sample.AvalonDock")]
13 | [assembly: AssemblyCopyright("Copyright © 2020")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // L'affectation de la valeur false à ComVisible rend les types invisibles dans cet assembly
18 | // aux composants COM. Si vous devez accéder à un type dans cet assembly à partir de
19 | // COM, affectez la valeur True à l'attribut ComVisible sur ce type.
20 | [assembly: ComVisible(false)]
21 |
22 | //Pour commencer à générer des applications localisables, définissez
23 | //CultureUtiliséePourCoder dans votre fichier .csproj
24 | //dans . Par exemple, si vous utilisez le français
25 | //dans vos fichiers sources, définissez à fr-FR. Puis, supprimez les marques de commentaire de
26 | //l'attribut NeutralResourceLanguage ci-dessous. Mettez à jour "fr-FR" dans
27 | //la ligne ci-après pour qu'elle corresponde au paramètre UICulture du fichier projet.
28 |
29 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
30 |
31 |
32 | [assembly: ThemeInfo(
33 | ResourceDictionaryLocation.None, //où se trouvent les dictionnaires de ressources spécifiques à un thème
34 | //(utilisé si une ressource est introuvable dans la page,
35 | // ou dictionnaires de ressources de l'application)
36 | ResourceDictionaryLocation.SourceAssembly //où se trouve le dictionnaire de ressources générique
37 | //(utilisé si une ressource est introuvable dans la page,
38 | // dans l'application ou dans l'un des dictionnaires de ressources spécifiques à un thème)
39 | )]
40 |
41 |
42 | // Les informations de version pour un assembly se composent des quatre valeurs suivantes :
43 | //
44 | // Version principale
45 | // Version secondaire
46 | // Numéro de build
47 | // Révision
48 | //
49 | // Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut
50 | // en utilisant '*', comme indiqué ci-dessous :
51 | // [assembly: AssemblyVersion("1.0.*")]
52 | [assembly: AssemblyVersion("1.0.0.0")]
53 | [assembly: AssemblyFileVersion("1.0.0.0")]
54 |
--------------------------------------------------------------------------------
/Sources/Samples/WpfHexEditor.Sample.AvalonDock/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // Ce code a été généré par un outil.
4 | // Version du runtime :4.0.30319.42000
5 | //
6 | // Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si
7 | // le code est régénéré.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace WpfHexEditor.Sample.AvalonDock.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// Une classe de ressource fortement typée destinée, entre autres, à la consultation des chaînes localisées.
17 | ///
18 | // Cette classe a été générée automatiquement par la classe StronglyTypedResourceBuilder
19 | // à l'aide d'un outil, tel que ResGen ou Visual Studio.
20 | // Pour ajouter ou supprimer un membre, modifiez votre fichier .ResX, puis réexécutez ResGen
21 | // avec l'option /str ou régénérez votre projet VS.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Retourne l'instance ResourceManager mise en cache utilisée par cette classe.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WpfHexEditor.Sample.AvalonDock.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Remplace la propriété CurrentUICulture du thread actuel pour toutes
51 | /// les recherches de ressources à l'aide de cette classe de ressource fortement typée.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/Sources/Samples/WpfHexEditor.Sample.AvalonDock/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/Sources/Samples/WpfHexEditor.Sample.AvalonDock/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // Ce code a été généré par un outil.
4 | // Version du runtime :4.0.30319.42000
5 | //
6 | // Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si
7 | // le code est régénéré.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace WpfHexEditor.Sample.AvalonDock.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.5.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Sources/Samples/WpfHexEditor.Sample.AvalonDock/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/Sources/Samples/WpfHexEditor.Sample.AvalonDock/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Sources/Samples/WpfHexEditor.Sample.BarChart/App.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Sources/Samples/WpfHexEditor.Sample.BarChart/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | namespace WpfHexEditor.Sample.BarChart
4 | {
5 | ///
6 | /// Interaction logic for App.xaml
7 | ///
8 | public partial class App : Application
9 | {
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Sources/Samples/WpfHexEditor.Sample.BarChart/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | [assembly: ThemeInfo(
4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5 | //(used if a resource is not found in the page,
6 | // or application resource dictionaries)
7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8 | //(used if a resource is not found in the page,
9 | // app, or any theme specific resource dictionaries)
10 | )]
11 |
--------------------------------------------------------------------------------
/Sources/Samples/WpfHexEditor.Sample.BarChart/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
28 |
29 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/Sources/Samples/WpfHexEditor.Sample.BarChart/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 | using System.Windows;
3 | using WpfHexaEditor.Core.MethodExtention;
4 |
5 | namespace WpfHexEditor.Sample.BarChart
6 | {
7 | ///
8 | /// Interaction logic for MainWindow.xaml
9 | ///
10 | public partial class MainWindow : Window
11 | {
12 | public MainWindow() => InitializeComponent();
13 |
14 | private void OpenButton_Click(object sender, RoutedEventArgs e) =>
15 | new OpenFileDialog().With(o =>
16 | {
17 | o.CheckFileExists = true;
18 | o.CheckPathExists = true;
19 | o.Multiselect = false;
20 |
21 | if (o.ShowDialog() ?? false)
22 | HexEditor.FileName = o.FileName;
23 | });
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/Sources/Samples/WpfHexEditor.Sample.BarChart/WpfHexEditor.Sample.BarChart.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | WinExe
5 | net70-windows
6 | true
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/Sources/Samples/WpfHexEditor.Sample.BinaryFilesDifference/App.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/Sources/Samples/WpfHexEditor.Sample.BinaryFilesDifference/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | namespace WpfHexEditor.Sample.BinaryFilesDifference
4 | {
5 | ///
6 | /// Interaction logic for App.xaml
7 | ///
8 | public partial class App : Application
9 | {
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Sources/Samples/WpfHexEditor.Sample.BinaryFilesDifference/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | [assembly: ThemeInfo(
4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5 | //(used if a resource is not found in the page,
6 | // or application resource dictionaries)
7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8 | //(used if a resource is not found in the page,
9 | // app, or any theme specific resource dictionaries)
10 | )]
11 |
--------------------------------------------------------------------------------
/Sources/Samples/WpfHexEditor.Sample.BinaryFilesDifference/BlockListItem.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
21 |
22 |
23 |
24 |
41 |
42 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
59 |
60 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/Sources/Samples/WpfHexEditor.Sample.BinaryFilesDifference/BlockListItem.xaml.cs:
--------------------------------------------------------------------------------
1 | //////////////////////////////////////////////
2 | // Apache 2.0 - 2021
3 | // Author : Derek Tremblay (derektremblay666@gmail.com)
4 | //
5 | //
6 | // NOT A TRUE PROJECT! IT'S JUST A SAMPLE FOR TESTING THE HEXEDITOR IN VARIOUS SITUATIONS...
7 | //////////////////////////////////////////////
8 |
9 | using System;
10 | using System.Windows.Controls;
11 | using System.Windows.Media;
12 | using WpfHexaEditor.Core;
13 |
14 | namespace WpfHexEditor.Sample.BinaryFilesDifference
15 | {
16 | public partial class BlockListItem : UserControl
17 | {
18 | private CustomBackgroundBlock _customBackGroundBlock;
19 | public event EventHandler PatchButtonClick;
20 | public event EventHandler Click;
21 |
22 | public BlockListItem() => InitializeComponent();
23 |
24 | public BlockListItem(CustomBackgroundBlock cbb)
25 | {
26 | InitializeComponent();
27 |
28 | CustomBlock = cbb;
29 | }
30 |
31 | public CustomBackgroundBlock CustomBlock
32 | {
33 | get => _customBackGroundBlock;
34 |
35 | set
36 | {
37 | _customBackGroundBlock = value;
38 | DataContext = value;
39 | }
40 | }
41 |
42 | private void PatchBlockButton_Click(object sender, System.Windows.RoutedEventArgs e) =>
43 | PatchButtonClick?.Invoke(this, EventArgs.Empty);
44 |
45 | private void UserControl_MouseEnter(object sender, System.Windows.Input.MouseEventArgs e) =>
46 | Background = Brushes.Orange;
47 |
48 | private void UserControl_MouseLeave(object sender, System.Windows.Input.MouseEventArgs e) =>
49 | Background = Brushes.Transparent;
50 |
51 | private void UserControl_MouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
52 | {
53 | Click?.Invoke(this, EventArgs.Empty);
54 | }
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/Sources/Samples/WpfHexEditor.Sample.BinaryFilesDifference/ByteDifferenceListItem.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
18 |
19 |
20 |
21 |
39 |
40 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
58 |
59 |
60 |
64 |
65 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/Sources/Samples/WpfHexEditor.Sample.BinaryFilesDifference/ByteDifferenceListItem.xaml.cs:
--------------------------------------------------------------------------------
1 | //////////////////////////////////////////////
2 | // Apache 2.0 - 2021
3 | // Author : Derek Tremblay (derektremblay666@gmail.com)
4 | //
5 | //
6 | // NOT A TRUE PROJECT! IT'S JUST A SAMPLE FOR TESTING THE HEXEDITOR IN VARIOUS SITUATIONS...
7 | //////////////////////////////////////////////
8 |
9 | using System.Windows.Controls;
10 | using WpfHexaEditor.Core.Bytes;
11 |
12 | namespace WpfHexEditor.Sample.BinaryFilesDifference
13 | {
14 | public partial class ByteDifferenceListItem : UserControl
15 | {
16 | private ByteDifference _byteDiff;
17 |
18 | public ByteDifference ByteDiff
19 | {
20 | get => _byteDiff;
21 | set
22 | {
23 | _byteDiff = value;
24 | DataContext = value;
25 | }
26 | }
27 |
28 | public ByteDifferenceListItem() => InitializeComponent();
29 |
30 | public ByteDifferenceListItem(ByteDifference byteDiff)
31 | {
32 | InitializeComponent();
33 |
34 | ByteDiff = byteDiff;
35 | }
36 |
37 | private void PatchSecondFile_Click(object sender, System.Windows.RoutedEventArgs e)
38 | {
39 |
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/Sources/Samples/WpfHexEditor.Sample.BinaryFilesDifference/WpfHexEditor.Sample.BinaryFilesDifference.csproj:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 |
11 | WinExe
12 | net70-windows
13 | true
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/Sources/Samples/WpfHexEditor.Sample.InsertByteAnywhere/App.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
14 |
--------------------------------------------------------------------------------
/Sources/Samples/WpfHexEditor.Sample.InsertByteAnywhere/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | namespace WpfHexEditor.Sample.InsertByteAnywhere
4 | {
5 | ///
6 | /// Interaction logic for App.xaml
7 | ///
8 | public partial class App : Application
9 | {
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Sources/Samples/WpfHexEditor.Sample.InsertByteAnywhere/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | [assembly: ThemeInfo(
4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5 | //(used if a resource is not found in the page,
6 | // or application resource dictionaries)
7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8 | //(used if a resource is not found in the page,
9 | // app, or any theme specific resource dictionaries)
10 | )]
11 |
--------------------------------------------------------------------------------
/Sources/Samples/WpfHexEditor.Sample.InsertByteAnywhere/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
20 |
21 |
22 |
29 |
30 |
38 |
39 |
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/Sources/Samples/WpfHexEditor.Sample.InsertByteAnywhere/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | //////////////////////////////////////////////
2 | // Apache 2.0 - 2021
3 | // Author : Derek Tremblay (derektremblay666@gmail.com)
4 | //
5 | // INSERT BYTE ANYWHERE SAMPLE / DEVELOPMENT TEST
6 | //
7 | // THIS SAMPLE IS FOR DEVELOP THE POSSIBILITY TO INSERT BYTE ANYWHERE.
8 | // IT'S WILL BE THE NEXT MAJOR UPDATE OF "WPF HEX EDITOR CONTROL"
9 | //
10 | //////////////////////////////////////////////
11 |
12 | using Microsoft.Win32;
13 | using System.Windows;
14 | using WpfHexaEditor.Core.MethodExtention;
15 |
16 | namespace WpfHexEditor.Sample.InsertByteAnywhere
17 | {
18 | public partial class MainWindow : Window
19 | {
20 | public MainWindow() => InitializeComponent();
21 |
22 | private void OpenButton_Click(object sender, RoutedEventArgs e) =>
23 | new OpenFileDialog().With(o =>
24 | {
25 | o.CheckFileExists = true;
26 | o.CheckPathExists = true;
27 | o.Multiselect = false;
28 |
29 | if (o.ShowDialog() ?? false)
30 | HexEditor.FileName = o.FileName;
31 | });
32 |
33 | ///
34 | /// Test of adding somes byte
35 | ///
36 | /// IN DEVELOPMENT, NOT WORKING PROPRELY :)
37 | ///
38 | private void AddByteButton_Click(object sender, RoutedEventArgs e) =>
39 | HexEditor.With(c =>
40 | {
41 | c.InsertByte(255, 15);
42 | c.InsertByte(255, 16);
43 | c.InsertByte(255, 17);
44 | c.InsertByte(255, 18);
45 | c.InsertByte(255, 19);
46 | c.InsertByte(255, 20);
47 | c.InsertByte(255, 21);
48 |
49 | //Actually the visual not show the result. I'm working on this :)
50 | c.RefreshView();
51 | });
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/Sources/Samples/WpfHexEditor.Sample.InsertByteAnywhere/WpfHexEditor.Sample.InsertByteAnywhere.csproj:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 | WinExe
14 | net70-windows
15 | true
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/Sources/Samples/WpfHexEditor.Sample.VB/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | Wpf HexaEditor Control
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Sources/Samples/WpfHexEditor.Sample.VB/Application.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Sources/Samples/WpfHexEditor.Sample.VB/Application.xaml.vb:
--------------------------------------------------------------------------------
1 | Class Application
2 |
3 | ' Les événements de niveau application, par exemple Startup, Exit et DispatcherUnhandledException
4 | ' peuvent être gérés dans ce fichier.
5 |
6 | End Class
7 |
--------------------------------------------------------------------------------
/Sources/Samples/WpfHexEditor.Sample.VB/GlobalSuppressions.vb:
--------------------------------------------------------------------------------
1 | ' This file is used by Code Analysis to maintain SuppressMessage
2 | ' attributes that are applied to this project.
3 | ' Project-level suppressions either have no target or are given
4 | ' a specific target and scoped to a namespace, type, member, etc.
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Sources/Samples/WpfHexEditor.Sample.VB/My Project/AssemblyInfo.vb:
--------------------------------------------------------------------------------
1 | Imports System
2 | Imports System.Reflection
3 | Imports System.Runtime.InteropServices
4 | Imports System.Globalization
5 | Imports System.Resources
6 | Imports System.Windows
7 |
8 | ' Les informations générales relatives à un assembly dépendent de
9 | ' l'ensemble d'attributs suivant. Changez les valeurs de ces attributs pour modifier les informations
10 | ' associées à un assembly.
11 |
12 | ' Vérifiez les valeurs des attributs de l'assembly
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 | 'Pour commencer à générer des applications localisables, définissez
23 | 'CultureUtiliséePourCoder dans votre fichier .vbproj,
24 | 'dans . Par exemple, si vous utilisez le français
25 | 'dans vos fichiers sources, définissez à "fr-FR". Puis, supprimez les marques de commentaire de
26 | 'l'attribut NeutralResourceLanguage ci-dessous. Mettez à jour "fr-FR" dans
27 | 'la ligne ci-après pour qu'elle corresponde au paramètre UICulture du fichier projet.
28 |
29 | '
30 |
31 |
32 | 'L'attribut ThemeInfo décrit l'emplacement des dictionnaires de ressources spécifiques à un thème et génériques.
33 | 'Premier paramètre : emplacement des dictionnaires de ressources spécifiques à un thème
34 | '(utilisé si une ressource est introuvable dans la page,
35 | ' ou dictionnaires de ressources de l'application)
36 |
37 | '2nd paramètre : emplacement du dictionnaire de ressources générique
38 | '(utilisé si une ressource est introuvable dans la page,
39 | 'l'application et tous les dictionnaires de ressources spécifiques à un thème)
40 |
41 |
42 |
43 |
44 | 'Le GUID suivant est pour l'ID de la typelib si ce projet est exposé à COM
45 |
46 |
47 | ' Les informations de version pour un assembly se composent des quatre valeurs suivantes :
48 | '
49 | ' Version principale
50 | ' Version secondaire
51 | ' Numéro de build
52 | ' Révision
53 | '
54 | ' Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut
55 | ' en utilisant '*', comme indiqué ci-dessous :
56 | '
57 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/Sources/Samples/WpfHexEditor.Sample.VB/My Project/Resources.Designer.vb:
--------------------------------------------------------------------------------
1 | '------------------------------------------------------------------------------
2 | '
3 | ' Ce code a été généré par un outil.
4 | ' Version du runtime :4.0.30319.42000
5 | '
6 | ' Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si
7 | ' le code est régénéré.
8 | '
9 | '------------------------------------------------------------------------------
10 |
11 | Option Strict On
12 | Option Explicit On
13 |
14 | Imports System
15 |
16 | Namespace My.Resources
17 |
18 | 'Cette classe a été générée automatiquement par la classe StronglyTypedResourceBuilder
19 | 'à l'aide d'un outil, tel que ResGen ou Visual Studio.
20 | 'Pour ajouter ou supprimer un membre, modifiez votre fichier .ResX, puis réexécutez ResGen
21 | 'avec l'option /str ou régénérez votre projet VS.
22 | '''
23 | ''' Une classe de ressource fortement typée destinée, entre autres, à la consultation des chaînes localisées.
24 | '''
25 | _
29 | Friend Module Resources
30 |
31 | Private resourceMan As Global.System.Resources.ResourceManager
32 |
33 | Private resourceCulture As Global.System.Globalization.CultureInfo
34 |
35 | '''
36 | ''' Retourne l'instance ResourceManager mise en cache utilisée par cette classe.
37 | '''
38 | _
39 | Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
40 | Get
41 | If Object.ReferenceEquals(resourceMan, Nothing) Then
42 | Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("WpfHexEditor.Sample.VB.Resources", GetType(Resources).Assembly)
43 | resourceMan = temp
44 | End If
45 | Return resourceMan
46 | End Get
47 | End Property
48 |
49 | '''
50 | ''' Remplace la propriété CurrentUICulture du thread actuel pour toutes
51 | ''' les recherches de ressources à l'aide de cette classe de ressource fortement typée.
52 | '''
53 | _
54 | Friend Property Culture() As Global.System.Globalization.CultureInfo
55 | Get
56 | Return resourceCulture
57 | End Get
58 | Set
59 | resourceCulture = value
60 | End Set
61 | End Property
62 | End Module
63 | End Namespace
64 |
--------------------------------------------------------------------------------
/Sources/Samples/WpfHexEditor.Sample.VB/My Project/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/Sources/Samples/WpfHexEditor.Sample.VB/My Project/Settings.Designer.vb:
--------------------------------------------------------------------------------
1 | '------------------------------------------------------------------------------
2 | '
3 | ' Ce code a été généré par un outil.
4 | ' Version du runtime :4.0.30319.42000
5 | '
6 | ' Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si
7 | ' le code est régénéré.
8 | '
9 | '------------------------------------------------------------------------------
10 |
11 | Option Strict On
12 | Option Explicit On
13 |
14 |
15 | Namespace My
16 |
17 | _
20 | Partial Friend NotInheritable Class MySettings
21 | Inherits Global.System.Configuration.ApplicationSettingsBase
22 |
23 | Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings)
24 |
25 | #Region "Fonctionnalité Enregistrement automatique My.Settings"
26 | #If _MyType = "WindowsForms" Then
27 | Private Shared addedHandler As Boolean
28 |
29 | Private Shared addedHandlerLockObject As New Object
30 |
31 | _
32 | Private Shared Sub AutoSaveSettings(sender As Global.System.Object, e As Global.System.EventArgs)
33 | If My.Application.SaveMySettingsOnExit Then
34 | My.Settings.Save()
35 | End If
36 | End Sub
37 | #End If
38 | #End Region
39 |
40 | Public Shared ReadOnly Property [Default]() As MySettings
41 | Get
42 |
43 | #If _MyType = "WindowsForms" Then
44 | If Not addedHandler Then
45 | SyncLock addedHandlerLockObject
46 | If Not addedHandler Then
47 | AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
48 | addedHandler = True
49 | End If
50 | End SyncLock
51 | End If
52 | #End If
53 | Return defaultInstance
54 | End Get
55 | End Property
56 |
57 | _
60 | Public Property ApplicationName() As String
61 | Get
62 | Return CType(Me("ApplicationName"),String)
63 | End Get
64 | Set
65 | Me("ApplicationName") = value
66 | End Set
67 | End Property
68 | End Class
69 | End Namespace
70 |
71 | Namespace My
72 |
73 | _
76 | Friend Module MySettingsProperty
77 |
78 | _
79 | Friend ReadOnly Property Settings() As Global.WpfHexEditor.Sample.VB.My.MySettings
80 | Get
81 | Return Global.WpfHexEditor.Sample.VB.My.MySettings.Default
82 | End Get
83 | End Property
84 | End Module
85 | End Namespace
86 |
--------------------------------------------------------------------------------
/Sources/Samples/WpfHexEditor.Sample.VB/My Project/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Wpf HexaEditor Control
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Sources/Samples/WpfHexEditor.Sample.VB/Resources/Icon/0x-Icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abbaye/WpfHexEditorControl/835347edd04bda516e4e97ae748535e48eb7af69/Sources/Samples/WpfHexEditor.Sample.VB/Resources/Icon/0x-Icon.ico
--------------------------------------------------------------------------------
/Sources/Samples/WpfHexEditor.Sample.VB/Resources/Icon/Close-Icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abbaye/WpfHexEditorControl/835347edd04bda516e4e97ae748535e48eb7af69/Sources/Samples/WpfHexEditor.Sample.VB/Resources/Icon/Close-Icon.ico
--------------------------------------------------------------------------------
/Sources/Samples/WpfHexEditor.Sample.VB/Resources/Icon/Logo-Icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abbaye/WpfHexEditorControl/835347edd04bda516e4e97ae748535e48eb7af69/Sources/Samples/WpfHexEditor.Sample.VB/Resources/Icon/Logo-Icon.ico
--------------------------------------------------------------------------------
/Sources/Samples/WpfHexEditor.Sample.VB/Resources/Icon/Open-File-Icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abbaye/WpfHexEditorControl/835347edd04bda516e4e97ae748535e48eb7af69/Sources/Samples/WpfHexEditor.Sample.VB/Resources/Icon/Open-File-Icon.ico
--------------------------------------------------------------------------------
/Sources/Samples/WpfHexEditor.Sample.VB/Resources/Icon/Save-Icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abbaye/WpfHexEditorControl/835347edd04bda516e4e97ae748535e48eb7af69/Sources/Samples/WpfHexEditor.Sample.VB/Resources/Icon/Save-Icon.ico
--------------------------------------------------------------------------------
/Sources/Samples/WpfHexEditor.Sample.Winform/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/Sources/Samples/WpfHexEditor.Sample.Winform/MainForm.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 | using System.Windows.Forms;
4 | using System.Windows.Media;
5 | using WpfHexaEditor.Core;
6 |
7 | namespace WpfHexEditor.Winform.Sample
8 | {
9 | public partial class MainForm : Form
10 | {
11 | public MainForm()
12 | {
13 | InitializeComponent();
14 |
15 | hexEditor.PreloadByteInEditorMode = PreloadByteInEditor.MaxScreenVisibleLineAtDataLoad;
16 | hexEditor.ForegroundSecondColor = Brushes.Blue;
17 | }
18 |
19 | private void OpenFileButton_Click(object sender, EventArgs e)
20 | {
21 | var fileDialog = new OpenFileDialog();
22 |
23 | if (fileDialog.ShowDialog() == DialogResult.OK && File.Exists(fileDialog.FileName))
24 | hexEditor.FileName = fileDialog.FileName;
25 | }
26 |
27 | private void OpenTBLButton_Click(object sender, EventArgs e)
28 | {
29 | var fileDialog = new OpenFileDialog();
30 |
31 | if (fileDialog.ShowDialog() == DialogResult.OK && File.Exists(fileDialog.FileName))
32 | {
33 | hexEditor.LoadTblFile(fileDialog.FileName);
34 | hexEditor.TypeOfCharacterTable = CharacterTableType.TblFile;
35 | }
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/Sources/Samples/WpfHexEditor.Sample.Winform/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Forms;
3 |
4 | namespace WpfHexEditor.Winform.Sample
5 | {
6 | static class Program
7 | {
8 | ///
9 | /// Point d'entrée principal de l'application.
10 | ///
11 | [STAThread]
12 | static void Main()
13 | {
14 | Application.EnableVisualStyles();
15 | Application.SetCompatibleTextRenderingDefault(false);
16 | Application.Run(new MainForm());
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Sources/Samples/WpfHexEditor.Sample.Winform/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | // Les informations générales relatives à un assembly dépendent de
5 | // l'ensemble d'attributs suivant. Changez les valeurs de ces attributs pour modifier les informations
6 | // associées à un assembly.
7 | [assembly: AssemblyTitle("WpfHexEditor.Winform.Sample")]
8 | [assembly: AssemblyDescription("")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("")]
11 | [assembly: AssemblyProduct("WpfHexEditor.Winform.Sample")]
12 | [assembly: AssemblyCopyright("Copyright © 2017")]
13 | [assembly: AssemblyTrademark("")]
14 | [assembly: AssemblyCulture("")]
15 |
16 | // L'affectation de la valeur false à ComVisible rend les types invisibles dans cet assembly
17 | // aux composants COM. Si vous devez accéder à un type dans cet assembly à partir de
18 | // COM, affectez la valeur true à l'attribut ComVisible sur ce type.
19 | [assembly: ComVisible(false)]
20 |
21 | // Le GUID suivant est pour l'ID de la typelib si ce projet est exposé à COM
22 | [assembly: Guid("326eed14-1180-46cc-8583-e6a249a248b6")]
23 |
24 | // Les informations de version pour un assembly se composent des quatre valeurs suivantes :
25 | //
26 | // Version principale
27 | // Version secondaire
28 | // Numéro de build
29 | // Révision
30 | //
31 | // Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut
32 | // en utilisant '*', comme indiqué ci-dessous :
33 | // [assembly: AssemblyVersion("1.0.*")]
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
36 |
--------------------------------------------------------------------------------
/Sources/Samples/WpfHexEditor.Sample.Winform/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // Ce code a été généré par un outil.
4 | // Version du runtime :4.0.30319.42000
5 | //
6 | // Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si
7 | // le code est régénéré.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace WpfHexEditor.Winform.Sample.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// Une classe de ressource fortement typée destinée, entre autres, à la consultation des chaînes localisées.
17 | ///
18 | // Cette classe a été générée automatiquement par la classe StronglyTypedResourceBuilder
19 | // à l'aide d'un outil, tel que ResGen ou Visual Studio.
20 | // Pour ajouter ou supprimer un membre, modifiez votre fichier .ResX, puis réexécutez ResGen
21 | // avec l'option /str ou régénérez votre projet VS.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Retourne l'instance ResourceManager mise en cache utilisée par cette classe.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WpfHexEditor.Winform.Sample.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Remplace la propriété CurrentUICulture du thread actuel pour toutes
51 | /// les recherches de ressources à l'aide de cette classe de ressource fortement typée.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/Sources/Samples/WpfHexEditor.Sample.Winform/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/Sources/Samples/WpfHexEditor.Sample.Winform/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // Ce code a été généré par un outil.
4 | // Version du runtime :4.0.30319.42000
5 | //
6 | // Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si
7 | // le code est régénéré.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace WpfHexEditor.Winform.Sample.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.8.1.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Sources/Samples/WpfHexEditor.Sample.Winform/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Sources/Samples/WpfHexEditor.Sample.Winform/WpfHexEditor.Sample.Winform.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {326EED14-1180-46CC-8583-E6A249A248B6}
8 | WinExe
9 | WpfHexEditor.Winform.Sample
10 | WpfHexEditor.Winform.Sample
11 | v4.8
12 | 512
13 | true
14 |
15 |
16 |
17 | AnyCPU
18 | true
19 | full
20 | false
21 | bin\Debug\
22 | DEBUG;TRACE
23 | prompt
24 | 4
25 | latest
26 |
27 |
28 | AnyCPU
29 | pdbonly
30 | true
31 | bin\Release\
32 | TRACE
33 | prompt
34 | 4
35 | latest
36 |
37 |
38 | true
39 | bin\net47\
40 | DEBUG;TRACE
41 | full
42 | AnyCPU
43 | latest
44 | prompt
45 | MinimumRecommendedRules.ruleset
46 | true
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 | Form
70 |
71 |
72 | MainForm.cs
73 |
74 |
75 |
76 |
77 | MainForm.cs
78 |
79 |
80 | ResXFileCodeGenerator
81 | Resources.Designer.cs
82 | Designer
83 |
84 |
85 | True
86 | Resources.resx
87 | True
88 |
89 |
90 | SettingsSingleFileGenerator
91 | Settings.Designer.cs
92 |
93 |
94 | True
95 | Settings.settings
96 | True
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 | {a53b3778-ba1d-4c35-9dc8-7a21e8224872}
105 | WpfHexEditorCore
106 |
107 |
108 |
109 |
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/Core/BookMark.cs:
--------------------------------------------------------------------------------
1 | //////////////////////////////////////////////
2 | // Apache 2.0 - 2016-2020
3 | // Author : Derek Tremblay (derektremblay666@gmail.com)
4 | //////////////////////////////////////////////
5 |
6 | using WpfHexaEditor.Core.Bytes;
7 |
8 | namespace WpfHexaEditor.Core
9 | {
10 | ///
11 | /// BookMark used in hexeditor
12 | ///
13 | public sealed class BookMark
14 | {
15 | public ScrollMarker Marker { get; set; } = ScrollMarker.Nothing;
16 | public long BytePositionInStream { get; set; }
17 | public string Description { get; set; } = string.Empty;
18 |
19 | public BookMark() { }
20 |
21 | public BookMark(string description, long position)
22 | {
23 | BytePositionInStream = position;
24 | Description = description;
25 | }
26 |
27 | public BookMark(string description, long position, ScrollMarker marker)
28 | {
29 | BytePositionInStream = position;
30 | Description = description;
31 | Marker = marker;
32 | }
33 |
34 | ///
35 | /// String representation
36 | ///
37 | public override string ToString() => $"({ByteConverters.LongToHex(BytePositionInStream)}h){Description}";
38 | }
39 | }
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/Core/Bytes/ByteDifference.cs:
--------------------------------------------------------------------------------
1 | //////////////////////////////////////////////
2 | // Apache 2.0 - 2021
3 | // Author : Derek Tremblay (derektremblay666@gmail.com)
4 | //////////////////////////////////////////////
5 |
6 | using System;
7 | using System.Windows.Media;
8 |
9 | namespace WpfHexaEditor.Core.Bytes
10 | {
11 | ///
12 | /// Used to track a byte difference in a stream vs another stream
13 | ///
14 | public class ByteDifference : ICloneable
15 | {
16 | public byte Origine { get; set; }
17 | public byte Destination { get; set; }
18 | public long BytePositionInStream { get; set; } = -1;
19 |
20 | public SolidColorBrush Color { get; set; } = Brushes.Transparent;
21 |
22 | public ByteDifference() { }
23 |
24 | public ByteDifference(byte origine, byte destination, long bytePositionInStream)
25 | {
26 | Origine = origine;
27 | Destination = destination;
28 | BytePositionInStream = bytePositionInStream;
29 | }
30 |
31 | public ByteDifference(byte origine, byte destination, long bytePositionInStream, SolidColorBrush color) :
32 | this(origine, destination, bytePositionInStream) => Color = color;
33 |
34 | #region Substitution
35 | public override bool Equals(object obj) =>
36 | obj is ByteDifference difference &&
37 | Origine == difference.Origine &&
38 | Destination == difference.Destination &&
39 | BytePositionInStream == difference.BytePositionInStream;
40 |
41 | public override int GetHashCode() => base.GetHashCode();
42 |
43 | public override string ToString() => base.ToString();
44 | #endregion
45 |
46 | #region Methods
47 | ///
48 | /// Get clone of this CustomBackgroundBlock
49 | ///
50 | public object Clone() => MemberwiseClone();
51 |
52 | ///
53 | /// Set a random brush to this instance
54 | ///
55 | public void SetRandomColor() => Color = RandomBrushes.PickBrush();
56 | #endregion
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/Core/Bytes/ByteModified.cs:
--------------------------------------------------------------------------------
1 | //////////////////////////////////////////////
2 | // Apache 2.0 - 2016-2020
3 | // Author : Derek Tremblay (derektremblay666@gmail.com)
4 | //////////////////////////////////////////////
5 |
6 | using WpfHexaEditor.Core.Interfaces;
7 |
8 | namespace WpfHexaEditor.Core.Bytes
9 | {
10 | public class ByteModified : IByteModified
11 | {
12 | #region Constructor
13 |
14 | ///
15 | /// Default contructor
16 | ///
17 | public ByteModified() { }
18 |
19 | ///
20 | /// complete contructor
21 | ///
22 | public ByteModified(byte? val, ByteAction action, long bytePositionInStream, long undoLength)
23 | {
24 | Byte = val;
25 | Action = action;
26 | BytePositionInStream = bytePositionInStream;
27 | Length = undoLength;
28 | }
29 |
30 | #endregion constructor
31 |
32 | #region properties
33 |
34 | ///
35 | /// Byte mofidied
36 | ///
37 | public byte? Byte { get; set; }
38 |
39 | ///
40 | /// Action have made in this byte
41 | ///
42 | public ByteAction Action { get; set; } = ByteAction.Nothing;
43 |
44 | ///
45 | /// Get of Set te position in file
46 | ///
47 | public long BytePositionInStream { get; set; } = -1;
48 |
49 | ///
50 | /// Number of byte to undo when this byte is reach
51 | ///
52 | public long Length { get; set; } = 1;
53 |
54 | #endregion properties
55 |
56 | #region Methods
57 |
58 | ///
59 | /// Check if the object is valid and data can be used for action
60 | ///
61 | public bool IsValid => BytePositionInStream > -1 && Action != ByteAction.Nothing && Byte is not null;
62 |
63 | ///
64 | /// String representation of byte
65 | ///
66 | public override string ToString() =>
67 | $"ByteModified - Action:{Action} Position:{BytePositionInStream} Byte:{Byte}";
68 |
69 | ///
70 | /// Clear object
71 | ///
72 | public void Clear()
73 | {
74 | Byte = null;
75 | Action = ByteAction.Nothing;
76 | BytePositionInStream = -1;
77 | Length = 1;
78 | }
79 |
80 | ///
81 | /// Copy Current instance to another
82 | ///
83 | public ByteModified GetCopy() => new()
84 | {
85 | Action = Action,
86 | Byte = Byte,
87 | Length = Length,
88 | BytePositionInStream = BytePositionInStream
89 | };
90 |
91 | ///
92 | /// Get if bytemodified is valid
93 | ///
94 | public static bool CheckIsValid(ByteModified byteModified) => byteModified is not null && byteModified.IsValid;
95 |
96 | #endregion Methods
97 | }
98 | }
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/Core/CharacterTable/DTE.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abbaye/WpfHexEditorControl/835347edd04bda516e4e97ae748535e48eb7af69/Sources/WPFHexaEditor/Core/CharacterTable/DTE.cs
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/Core/CharacterTable/Enum.cs:
--------------------------------------------------------------------------------
1 | //////////////////////////////////////////////
2 | // Apache 2.0 - 2003-2019
3 | // Author : Derek Tremblay (derektremblay666@gmail.com)
4 | //////////////////////////////////////////////
5 |
6 | namespace WpfHexaEditor.Core.CharacterTable
7 | {
8 | ///
9 | /// Type of DTE used in TBL
10 | ///
11 | public enum DteType
12 | {
13 | Invalid = -1,
14 | Ascii = 0,
15 | Japonais,
16 | DualTitleEncoding,
17 | MultipleTitleEncoding,
18 | EndLine,
19 | EndBlock
20 | }
21 |
22 | public enum DefaultCharacterTableType
23 | {
24 | Ascii,
25 | EbcdicWithSpecialChar,
26 | EbcdicNoSpecialChar
27 | //MACINTOSH
28 | //DOS/IBM-ASCII
29 | }
30 | }
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/Core/CharacterTable/TBLStream.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abbaye/WpfHexEditorControl/835347edd04bda516e4e97ae748535e48eb7af69/Sources/WPFHexaEditor/Core/CharacterTable/TBLStream.cs
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/Core/ConstantReadOnly.cs:
--------------------------------------------------------------------------------
1 | //////////////////////////////////////////////
2 | // Apache 2.0 - 2016-2021
3 | // Author : Derek Tremblay (derektremblay666@gmail.com)
4 | //////////////////////////////////////////////
5 |
6 | namespace WpfHexaEditor.Core
7 | {
8 | public static class ConstantReadOnly
9 | {
10 | public static readonly string HexLineInfoStringFormat = "x8";
11 | public static readonly string Hex2StringFormat = "x2";
12 | public static readonly string HexStringFormat = "x";
13 | public static readonly string DefaultHex8String = "0x00000000";
14 | public static readonly string DefaultHex2String = "0x00";
15 |
16 | public const long Largefilelength = 52_428_800L; //50 MB
17 | public const int Copyblocksize = 131_072; //128 KB
18 | public const int Findblocksize = 1_048_576; //1 MB
19 | }
20 | }
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/Core/Converters/BoolInverterConverter.cs:
--------------------------------------------------------------------------------
1 | //////////////////////////////////////////////
2 | // Apache 2.0 - 2016-2018
3 | // Author : Derek Tremblay (derektremblay666@gmail.com)
4 | //////////////////////////////////////////////
5 |
6 | using System;
7 | using System.Globalization;
8 | using System.Windows.Data;
9 |
10 | namespace WpfHexaEditor.Core.Converters
11 | {
12 | ///
13 | /// Invert bool
14 | ///
15 | public sealed class BoolInverterConverter : IValueConverter
16 | {
17 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
18 | {
19 | bool? val = null;
20 |
21 | try
22 | {
23 | val = value is not null && (bool)value;
24 | }
25 | catch
26 | {
27 | // ignored
28 | }
29 |
30 | return !val;
31 | }
32 |
33 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) =>
34 | throw new NotImplementedException();
35 | }
36 | }
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/Core/Converters/BooleanToVisibilityConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Globalization;
3 | using System.Windows;
4 | using System.Windows.Data;
5 |
6 | namespace WpfHexaEditor.Core.Converters
7 | {
8 | ///
9 | /// CODE FROM NUGET PACKAGE EXPLORER : https://github.com/NuGetPackageExplorer/NuGetPackageExplorer
10 | ///
11 | /// This BooleanToVisibility converter allows us to override the converted value when
12 | /// the bound value is false.
13 | ///
14 | /// The built-in converter in WPF restricts us to always use Collapsed when the bound
15 | /// value is false.
16 | ///
17 | public sealed class BooleanToVisibilityConverter : IValueConverter
18 | {
19 | public bool Inverted { get; set; }
20 |
21 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
22 | {
23 | var boolValue = (bool)value;
24 |
25 | if (Inverted)
26 | boolValue = !boolValue;
27 |
28 | return (string)parameter == "hidden"
29 | ? (boolValue ? Visibility.Visible : Visibility.Hidden)
30 | : (boolValue ? Visibility.Visible : Visibility.Collapsed);
31 | }
32 |
33 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) =>
34 | throw new NotImplementedException();
35 | }
36 | }
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/Core/Converters/ByteToHexStringConverter.cs:
--------------------------------------------------------------------------------
1 | //////////////////////////////////////////////
2 | // Apache 2.0 - 2021
3 | // Author : Derek Tremblay (derektremblay666@gmail.com)
4 | //////////////////////////////////////////////
5 |
6 | using System;
7 | using System.Globalization;
8 | using System.Windows.Data;
9 |
10 | namespace WpfHexaEditor.Core.Converters
11 | {
12 | ///
13 | /// Used to convert byte value to hexadecimal string like this 0xFF.
14 | ///
15 | public sealed class ByteToHexStringConverter : IValueConverter
16 | {
17 | public bool Show0xTag { get; set; } = true;
18 |
19 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) =>
20 | value is not null
21 | ? (byte.TryParse(value.ToString(), out var byteValue)
22 | ? (byteValue >= 0
23 | ? (Show0xTag ? "0x" : "") + byteValue
24 | .ToString(ConstantReadOnly.Hex2StringFormat, CultureInfo.InvariantCulture)
25 | .ToUpperInvariant()
26 | : ConstantReadOnly.DefaultHex2String)
27 | : ConstantReadOnly.DefaultHex2String)
28 | : ConstantReadOnly.DefaultHex2String;
29 |
30 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) => value;
31 | }
32 | }
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/Core/Converters/HexToLongStringConverter.cs:
--------------------------------------------------------------------------------
1 | //////////////////////////////////////////////
2 | // Apache 2.0 - 2016-2018
3 | // Author : Derek Tremblay (derektremblay666@gmail.com)
4 | //////////////////////////////////////////////
5 |
6 | using System;
7 | using System.Globalization;
8 | using System.Windows.Data;
9 | using WpfHexaEditor.Core.Bytes;
10 |
11 | namespace WpfHexaEditor.Core.Converters
12 | {
13 | ///
14 | /// Used to convert hexadecimal to Long value.
15 | ///
16 | public sealed class HexToLongStringConverter : IValueConverter
17 | {
18 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
19 | {
20 | if (value is null) return string.Empty;
21 |
22 | var (success, val) = ByteConverters.IsHexValue(value.ToString());
23 |
24 | return success
25 | ? (object)val
26 | : string.Empty;
27 | }
28 |
29 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) => value;
30 | }
31 | }
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/Core/Converters/LongToHexStringConverter.cs:
--------------------------------------------------------------------------------
1 | //////////////////////////////////////////////
2 | // Apache 2.0 - 2016-2018
3 | // Author : Derek Tremblay (derektremblay666@gmail.com)
4 | //////////////////////////////////////////////
5 |
6 | using System;
7 | using System.Globalization;
8 | using System.Windows.Data;
9 |
10 | namespace WpfHexaEditor.Core.Converters
11 | {
12 | ///
13 | /// Used to convert long value to hexadecimal string like this 0xFFFFFFFF.
14 | ///
15 | public sealed class LongToHexStringConverter : IValueConverter
16 | {
17 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) =>
18 | value is not null
19 | ? (long.TryParse(value.ToString(), out var longValue)
20 | ? (longValue > -1
21 | ? "0x" + longValue
22 | .ToString(ConstantReadOnly.HexLineInfoStringFormat, CultureInfo.InvariantCulture)
23 | .ToUpperInvariant()
24 | : ConstantReadOnly.DefaultHex8String)
25 | : ConstantReadOnly.DefaultHex8String)
26 | : ConstantReadOnly.DefaultHex8String;
27 |
28 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) => value;
29 | }
30 | }
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/Core/Converters/PathToFilenameConverter.cs:
--------------------------------------------------------------------------------
1 | //////////////////////////////////////////////
2 | // Apache 2.0 - 2019
3 | // Author : Derek Tremblay (derektremblay666@gmail.com)
4 | //////////////////////////////////////////////
5 |
6 | using System;
7 | using System.Globalization;
8 | using System.IO;
9 | using System.Windows.Data;
10 |
11 | namespace WpfHexaEditor.Core.Converters
12 | {
13 | ///
14 | /// Used to get the filename with extention.
15 | ///
16 | public sealed class PathToFilenameConverter : IValueConverter
17 | {
18 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) =>
19 | (value is string filename)
20 | ? Path.GetFileName(filename)
21 | : string.Empty;
22 |
23 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) => value;
24 | }
25 | }
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/Core/Converters/VisibilityToBooleanConverter.cs:
--------------------------------------------------------------------------------
1 | //////////////////////////////////////////////
2 | // Apache 2.0 - 2019
3 | // Author : Derek Tremblay (derektremblay666@gmail.com)
4 | //////////////////////////////////////////////
5 |
6 | using System;
7 | using System.Globalization;
8 | using System.Windows;
9 | using System.Windows.Data;
10 |
11 | namespace WpfHexaEditor.Core.Converters
12 | {
13 | ///
14 | /// This VisibilityToBoolean converter convert Visibility <-> Boolean
15 | ///
16 | public sealed class VisibilityToBooleanConverter : IValueConverter
17 | {
18 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) =>
19 | (Visibility)value == Visibility.Visible;
20 |
21 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) =>
22 | (bool)value == true
23 | ? Visibility.Visible
24 | : Visibility.Collapsed;
25 | }
26 | }
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/Core/CustomBackgroundBlock.cs:
--------------------------------------------------------------------------------
1 | //////////////////////////////////////////////
2 | // Apache 2.0 - 2018-2021
3 | // Author : Derek Tremblay (derektremblay666@gmail.com)
4 | //////////////////////////////////////////////
5 |
6 | using System;
7 | using System.Windows.Media;
8 | using WpfHexaEditor.Core.Bytes;
9 |
10 | namespace WpfHexaEditor.Core
11 | {
12 | ///
13 | /// Used to create block of custom colors background
14 | ///
15 | public class CustomBackgroundBlock : ICloneable
16 | {
17 |
18 | #region Constructors
19 | public CustomBackgroundBlock() { }
20 |
21 | public CustomBackgroundBlock(long start, long length, SolidColorBrush color, string description)
22 | {
23 | StartOffset = start;
24 | Length = length;
25 | Color = color;
26 | Description = description;
27 | }
28 |
29 | public CustomBackgroundBlock(long start, long length, SolidColorBrush color)
30 | {
31 | StartOffset = start;
32 | Length = length;
33 | Color = color;
34 | }
35 |
36 | public CustomBackgroundBlock(long start, long length, bool setRandomBrush = true)
37 | {
38 | StartOffset = start;
39 | Length = length;
40 | if (setRandomBrush) Color = RandomBrushes.PickBrush();
41 | }
42 |
43 | public CustomBackgroundBlock(string start, long length, SolidColorBrush color)
44 | {
45 | var (success, position) = ByteConverters.HexLiteralToLong(start);
46 |
47 | StartOffset = success ? position : throw new Exception(Properties.Resources.ConvertStringToLongErrorString);
48 | Length = length;
49 | Color = color;
50 | }
51 |
52 | public CustomBackgroundBlock(string start, long length, SolidColorBrush color, string description)
53 | {
54 | var (success, position) = ByteConverters.HexLiteralToLong(start);
55 |
56 | StartOffset = success ? position : throw new Exception(Properties.Resources.ConvertStringToLongErrorString);
57 | Length = length;
58 | Color = color;
59 | Description = description;
60 | }
61 | #endregion
62 |
63 | #region Property
64 | ///
65 | /// Get or set the start offset
66 | ///
67 | public long StartOffset { get; set; }
68 |
69 | ///
70 | /// Get the stop offset
71 | ///
72 | public long StopOffset => StartOffset + Length;
73 |
74 | ///
75 | /// Get or set the length of background block
76 | ///
77 | public long Length { get; set; }
78 |
79 | ///
80 | /// Description of background block
81 | ///
82 | public string Description { get; set; }
83 |
84 | ///
85 | /// Get or set the color used in the visual
86 | ///
87 | public SolidColorBrush Color { get; set; } = Brushes.Transparent;
88 |
89 | /////
90 | ///// Get or set the color used in the visual
91 | /////
92 | //public SolidColorBrush ForeGroundColor { get; set; } = Brushes.Transparent;
93 | #endregion
94 |
95 | #region Methods
96 | ///
97 | /// Get clone of this CustomBackgroundBlock
98 | ///
99 | public object Clone() => MemberwiseClone();
100 |
101 | ///
102 | /// Set a random brush to this instance
103 | ///
104 | public void SetRandomColor() => Color = RandomBrushes.PickBrush();
105 | #endregion
106 | }
107 | }
108 |
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/Core/EventArguments/ByteDifferenceEventArgs.cs:
--------------------------------------------------------------------------------
1 | //////////////////////////////////////////////
2 | // Apache 2.0 - 2021
3 | // Modified by : Derek Tremblay (derektremblay666@gmail.com)
4 | //////////////////////////////////////////////
5 |
6 | using System;
7 | using WpfHexaEditor.Core.Bytes;
8 |
9 | namespace WpfHexaEditor.Core.EventArguments
10 | {
11 | ///
12 | /// Custom event arguments used for pass somes informations to delegate
13 | ///
14 | public class ByteDifferenceEventArgs : EventArgs
15 | {
16 | public ByteDifferenceEventArgs() { }
17 |
18 | public ByteDifferenceEventArgs(ByteDifference byteDifference) => ByteDiff = byteDifference;
19 |
20 | ///
21 | /// ByteDifference to pass in arguments
22 | /// ///
23 | public ByteDifference ByteDiff;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/Core/EventArguments/ByteEventArgs.cs:
--------------------------------------------------------------------------------
1 | //////////////////////////////////////////////
2 | // Apache 2.0 - 2020-2021
3 | // Author : ehsan69h
4 | // Modified by : Derek Tremblay (derektremblay666@gmail.com)
5 | //////////////////////////////////////////////
6 |
7 | using System;
8 |
9 | namespace WpfHexaEditor.Core.EventArguments
10 | {
11 | ///
12 | /// Custom event arguments used for pass somes informations to delegate
13 | ///
14 | public class ByteEventArgs : EventArgs
15 | {
16 | #region Constructors
17 | public ByteEventArgs() { }
18 |
19 | public ByteEventArgs(long position) => BytePositionInStream = position;
20 |
21 | public ByteEventArgs(long position, int index)
22 | {
23 | BytePositionInStream = position;
24 | Index = index;
25 | }
26 | #endregion
27 |
28 | #region Properties
29 | ///
30 | /// Pass the position of byte
31 | ///
32 | public long BytePositionInStream { get; set; }
33 |
34 | ///
35 | /// Pass index if byte using with BytePositionInStream in somes situations
36 | ///
37 | public int Index { get; set; }
38 | #endregion
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/Core/EventArguments/CustomBackgroundBlockEventArgs.cs:
--------------------------------------------------------------------------------
1 | //////////////////////////////////////////////
2 | // Apache 2.0 - 2021
3 | // Modified by : Derek Tremblay (derektremblay666@gmail.com)
4 | //////////////////////////////////////////////
5 |
6 | using System;
7 |
8 | namespace WpfHexaEditor.Core.EventArguments
9 | {
10 | ///
11 | /// Custom event arguments used for pass somes informations to delegate
12 | ///
13 | public class CustomBackgroundBlockEventArgs : EventArgs
14 | {
15 | public CustomBackgroundBlockEventArgs() { }
16 |
17 | public CustomBackgroundBlockEventArgs(CustomBackgroundBlock customBlock) => CustomBlock = customBlock;
18 |
19 | ///
20 | /// CustomBackgroundBlock to pass in arguments
21 | /// ///
22 | public CustomBackgroundBlock CustomBlock;
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/Core/Interfaces/IByte.cs:
--------------------------------------------------------------------------------
1 | //////////////////////////////////////////////
2 | // Apache 2.0 - 2020-2021
3 | // Base author : ehsan69h
4 | // Modified by : Abbaye
5 | //////////////////////////////////////////////
6 |
7 | using System.Collections.Generic;
8 | using System.Windows.Input;
9 |
10 | namespace WpfHexaEditor.Core.Interfaces
11 | {
12 | public delegate void D_ByteListProp(List newValue, int index);
13 |
14 | interface IByte
15 | {
16 | public List Byte { get; set; }
17 | public List OriginByte { get; set; }
18 |
19 | public string GetText(DataVisualType type, DataVisualState state, ByteOrderType order);
20 |
21 | public D_ByteListProp del_ByteOnChange { get; set; }
22 |
23 | public bool IsEqual(byte[] bytes);
24 |
25 | public (ByteAction, bool) Update(DataVisualType type, Key _key, ByteOrderType byteOrder, ref KeyDownLabel _keyDownLabel);
26 |
27 | public void ChangeByteValue(byte newValue, long position);
28 |
29 | ///
30 | /// GetText() need to be called before
31 | ///
32 | public string Text { get; }
33 |
34 | ///
35 | /// GetText() need to be called before
36 | ///
37 | public long LongText { get; }
38 |
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/Core/Interfaces/IByteControl.cs:
--------------------------------------------------------------------------------
1 | //////////////////////////////////////////////
2 | // Apache 2.0 - 2017-2021
3 | // Author : Janus Tida
4 | // Contributor : Derek Tremblay
5 | //////////////////////////////////////////////
6 |
7 | using System;
8 | using WpfHexaEditor.Core.EventArguments;
9 |
10 | namespace WpfHexaEditor.Core.Interfaces
11 | {
12 | ///
13 | /// All byte control inherit from this interface.
14 | /// This interface is used to reduce the code when manipulate byte control
15 | ///
16 | internal interface IByteControl
17 | {
18 | //Properties
19 | long BytePositionInStream { get; set; }
20 | ByteAction Action { get; set; }
21 | IByte Byte { get; set; }
22 | bool IsHighLight { get; set; }
23 | bool IsSelected { get; set; }
24 | bool InternalChange { get; set; }
25 | bool IsMouseOverMe { get; }
26 | bool IsEnabled { get; set; }
27 |
28 | //Methods
29 | void UpdateVisual();
30 | void Clear();
31 |
32 | //Events
33 | event EventHandler ByteModified;
34 | event EventHandler MouseSelection;
35 | event EventHandler Click;
36 | event EventHandler DoubleClick;
37 | event EventHandler RightClick;
38 | event EventHandler MoveNext;
39 | event EventHandler MovePrevious;
40 | event EventHandler MoveRight;
41 | event EventHandler MoveLeft;
42 | event EventHandler MoveUp;
43 | event EventHandler MoveDown;
44 | event EventHandler MovePageDown;
45 | event EventHandler MovePageUp;
46 | event EventHandler ByteDeleted;
47 | event EventHandler EscapeKey;
48 | event EventHandler CtrlzKey;
49 | event EventHandler CtrlvKey;
50 | event EventHandler CtrlcKey;
51 | event EventHandler CtrlaKey;
52 | event EventHandler CtrlyKey;
53 | }
54 | }
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/Core/Interfaces/IByteModified.cs:
--------------------------------------------------------------------------------
1 | //////////////////////////////////////////////
2 | // Apache 2.0 - 2017-2019
3 | // Author : Derek Tremblay (derektremblay666@gmail.com)
4 | //////////////////////////////////////////////
5 |
6 | using WpfHexaEditor.Core.Bytes;
7 |
8 | namespace WpfHexaEditor.Core.Interfaces
9 | {
10 | public interface IByteModified
11 | {
12 | //Properties
13 | ByteAction Action { get; set; }
14 |
15 | byte? Byte { get; set; }
16 | long BytePositionInStream { get; set; }
17 | bool IsValid { get; }
18 | long Length { get; set; }
19 |
20 | //Methods
21 | void Clear();
22 |
23 | ByteModified GetCopy();
24 | string ToString();
25 | }
26 | }
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/Core/MethodExtention/ApplicationExtention.cs:
--------------------------------------------------------------------------------
1 | //////////////////////////////////////////////
2 | // Apache 2.0 - 2016-2020
3 | // Author : Derek Tremblay (derektremblay666@gmail.com)
4 | //////////////////////////////////////////////
5 |
6 | using System.Windows;
7 | using System.Windows.Threading;
8 |
9 | namespace WpfHexaEditor.Core.MethodExtention
10 | {
11 | ///
12 | /// DoEvents when control is in long task. Control do not freeze the dispatcher.
13 | ///
14 | public static class ApplicationExtention
15 | {
16 | private static readonly DispatcherOperationCallback ExitFrameCallback = ExitFrame;
17 |
18 | public static void DoEvents(this Application _, DispatcherPriority priority = DispatcherPriority.Background)
19 | {
20 | var nestedFrame = new DispatcherFrame();
21 | var exitOperation = Dispatcher.CurrentDispatcher.BeginInvoke(priority, ExitFrameCallback, nestedFrame);
22 |
23 | try
24 | {
25 | //execute all next message
26 | Dispatcher.PushFrame(nestedFrame);
27 |
28 | //If not completed, will stop it
29 | if (exitOperation.Status != DispatcherOperationStatus.Completed)
30 | exitOperation.Abort();
31 | }
32 | catch
33 | {
34 | exitOperation.Abort();
35 | }
36 | }
37 |
38 | private static object ExitFrame(object f)
39 | {
40 | (f as DispatcherFrame).Continue = false;
41 | return null;
42 | }
43 | }
44 | }
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/Core/MethodExtention/ByteArrayExtention.cs:
--------------------------------------------------------------------------------
1 | //////////////////////////////////////////////
2 | // Apache 2.0 - 2016-2020
3 | // Author : Derek Tremblay (derektremblay666@gmail.com)
4 | //////////////////////////////////////////////
5 |
6 | using System.Collections.Generic;
7 | using System.Linq;
8 |
9 | namespace WpfHexaEditor.Core.MethodExtention
10 | {
11 | ///
12 | /// Extention methodes for find match in byte[]
13 | ///
14 | public static class ByteArrayExtention
15 | {
16 | ///
17 | /// Finds all index of byte find
18 | ///
19 | public static IEnumerable FindIndexOf(this byte[] self, byte[] candidate)
20 | {
21 | if (!IsEmptyLocate(self, candidate))
22 | for (var i = 0; i < self.Length; i++)
23 | {
24 | if (!IsMatch(self, i, candidate))
25 | continue;
26 |
27 | yield return i;
28 | }
29 | }
30 |
31 | ///
32 | /// Check if match is finded
33 | ///
34 | private static bool IsMatch(byte[] array,
35 | long position,
36 | byte[] candidate) =>
37 | candidate.Length <= array.Length - position && !candidate.Where((t, i) => array[position + i] != t).Any();
38 |
39 | ///
40 | /// Check if can find
41 | ///
42 | private static bool IsEmptyLocate(byte[] array, byte[] candidate) => array == null
43 | || candidate == null
44 | || array.Length == 0
45 | || candidate.Length == 0
46 | || candidate.Length > array.Length;
47 | }
48 | }
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/Core/MethodExtention/DoubleExtension.cs:
--------------------------------------------------------------------------------
1 | //////////////////////////////////////////////
2 | // Apache 2.0 - 2016-2020
3 | // Author : Derek Tremblay (derektremblay666@gmail.com)
4 | //////////////////////////////////////////////
5 |
6 | using System;
7 |
8 | namespace WpfHexaEditor.Core.MethodExtention
9 | {
10 | public static class DoubleExtension
11 | {
12 | public static double Round(this double s, int digit = 2) => Math.Round(s, digit);
13 | }
14 | }
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/Core/MethodExtention/StringExtension.cs:
--------------------------------------------------------------------------------
1 | //////////////////////////////////////////////
2 | // 2012 - Code from :
3 | // https://stackoverflow.com/questions/11447019/is-there-any-way-to-find-the-width-of-a-character-in-a-fixed-width-font-given-t
4 | //
5 | // 2018-2020 - Modified/adapted by Derek Tremblay (derektremblay666@gmail.com)
6 | //////////////////////////////////////////////
7 |
8 | using System.Globalization;
9 | using System.Windows;
10 | using System.Windows.Controls;
11 | using System.Windows.Media;
12 |
13 | namespace WpfHexaEditor.Core.MethodExtention
14 | {
15 | public static class StringExtension
16 | {
17 | ///
18 | /// Get the screen size of a string
19 | ///
20 | public static Size GetScreenSize(this string text, FontFamily fontFamily, double fontSize, FontStyle fontStyle,
21 | FontWeight fontWeight, FontStretch fontStretch, Brush foreGround, Visual visual)
22 | {
23 | fontFamily ??= new TextBlock().FontFamily;
24 | fontSize = fontSize > 0 ? fontSize : new TextBlock().FontSize;
25 |
26 | var ft = new FormattedText(text ?? string.Empty,
27 | CultureInfo.InvariantCulture,
28 | FlowDirection.LeftToRight,
29 | new Typeface(fontFamily, fontStyle, fontWeight, fontStretch),
30 | fontSize,
31 | foreGround,
32 | VisualTreeHelper.GetDpi(visual).PixelsPerDip);
33 |
34 | return new Size(ft.Width, ft.Height);
35 | }
36 | }
37 | }
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/Core/MethodExtention/TrackExtention.cs:
--------------------------------------------------------------------------------
1 | //////////////////////////////////////////////
2 | // Apache 2.0 - 2016-2020
3 | // Author : Derek Tremblay (derektremblay666@gmail.com)
4 | //////////////////////////////////////////////
5 |
6 | using System.Windows.Controls;
7 | using System.Windows.Controls.Primitives;
8 |
9 | namespace WpfHexaEditor.Core.MethodExtention
10 | {
11 | public static class TrackExtention
12 | {
13 | ///
14 | /// Get actual top position of track
15 | ///
16 | public static double Top(this Track track)
17 | {
18 | if (track.Parent is Grid parent)
19 | {
20 | var topRepeatButton = parent.Children[1] as RepeatButton;
21 |
22 | return topRepeatButton.ActualHeight + parent.Margin.Top + 1;
23 | }
24 |
25 | return 0;
26 | }
27 |
28 | ///
29 | /// Get actual bottom position of track
30 | ///
31 | public static double Bottom(this Track track)
32 | {
33 | if (track.Parent is Grid parent)
34 | {
35 | var trackControl = parent.Children[2] as Track;
36 |
37 | return trackControl.Top() +
38 | trackControl.ActualHeight +
39 | parent.Margin.Top + 1;
40 | }
41 |
42 | return 0;
43 | }
44 |
45 | ///
46 | /// Get actual bottom position of track
47 | ///
48 | public static double ButtonHeight(this Track track) => track.Top() - 1;
49 |
50 | ///
51 | /// Get actual Tick Height
52 | ///
53 | public static double TickHeight(this Track track) => track.ActualHeight / track.Maximum;
54 |
55 | ///
56 | /// Get actual Tick Height with another maximum value
57 | ///
58 | public static double TickHeight(this Track track, long maximum) => track.ActualHeight / maximum;
59 | }
60 | }
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/Core/MethodExtention/WithMethodExtention.cs:
--------------------------------------------------------------------------------
1 | //////////////////////////////////////////////
2 | // Apache 2.0 - 2020
3 | // Author : Derek Tremblay (derektremblay666@gmail.com)
4 | //////////////////////////////////////////////
5 |
6 | using System;
7 |
8 | namespace WpfHexaEditor.Core.MethodExtention
9 | {
10 | public static class WithMethodExtention
11 | {
12 | ///
13 | /// C# like of the very good VB With statement
14 | ///
15 | public static void With(this T obj, Action act) => act(obj);
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/Core/Native/NativeMethods.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.InteropServices;
2 | using System.Text;
3 |
4 | namespace WpfHexaEditor.Core.Native
5 | {
6 | ///
7 | /// Used for key detection
8 | ///
9 | internal static class NativeMethods
10 | {
11 | internal enum MapType : uint
12 | {
13 | MapvkVkToVsc = 0x0,
14 | MapvkVscToVk = 0x1,
15 | MapvkVkToChar = 0x2,
16 | MapvkVscToVkEx = 0x3,
17 | }
18 |
19 | [DllImport("user32.dll")]
20 | internal static extern int ToUnicode(uint wVirtKey,
21 | uint wScanCode,
22 | byte[] lpKeyState,
23 | [Out, MarshalAs(UnmanagedType.LPWStr, SizeParamIndex = 4)] StringBuilder pwszBuff,
24 | int cchBuff,
25 | uint wFlags);
26 |
27 | [DllImport("user32.dll")]
28 | internal static extern bool GetKeyboardState(byte[] lpKeyState);
29 |
30 | [DllImport("user32.dll")]
31 | internal static extern uint MapVirtualKey(uint uCode, MapType uMapType);
32 | }
33 | }
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/Core/RandomBrushes.cs:
--------------------------------------------------------------------------------
1 | //////////////////////////////////////////////
2 | // Apache 2.0 - 2021
3 | // Author : Derek Tremblay (derektremblay666@gmail.com)
4 | //////////////////////////////////////////////
5 |
6 | using System;
7 | using System.Reflection;
8 | using System.Windows.Media;
9 |
10 | namespace WpfHexaEditor.Core
11 | {
12 | public static class RandomBrushes
13 | {
14 | ///
15 | /// Pick a random bruch
16 | ///
17 | public static SolidColorBrush PickBrush()
18 | {
19 | var properties = typeof(Brushes).GetProperties();
20 |
21 | return (SolidColorBrush)properties
22 | [
23 | new Random().Next(properties.Length)
24 | ].GetValue(null, null);
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/Dialog/FindReplaceWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | //////////////////////////////////////////////
2 | // Apache 2.0 - 2018-2019
3 | // Author : Derek Tremblay (derektremblay666@gmail.com)
4 | //////////////////////////////////////////////
5 |
6 | using System.IO;
7 | using System.Windows;
8 |
9 | namespace WpfHexaEditor.Dialog
10 | {
11 | ///
12 | /// Logique d'interaction pour FindReplaceWindow.xaml
13 | ///
14 | public partial class FindReplaceWindow
15 | {
16 | private readonly HexEditor _parent;
17 |
18 | public FindReplaceWindow(HexEditor parent, byte[] findData = null)
19 | {
20 | InitializeComponent();
21 |
22 | //Parent hexeditor for "binding" search
23 | _parent = parent;
24 |
25 | InitializeMStream(FindHexEdit, findData);
26 | InitializeMStream(ReplaceHexEdit);
27 | }
28 |
29 | #region Events
30 | private void ClearButton_Click(object sender, RoutedEventArgs e) => InitializeMStream(FindHexEdit);
31 | private void ClearReplaceButton_Click(object sender, RoutedEventArgs e) => InitializeMStream(ReplaceHexEdit);
32 | private void CloseButton_Click(object sender, RoutedEventArgs e) => Close();
33 |
34 | private void FindAllButton_Click(object sender, RoutedEventArgs e) =>
35 | _parent?.FindAll(FindHexEdit.GetAllBytes(), HighlightMenuItem.IsChecked);
36 |
37 | private void FindFirstButton_Click(object sender, RoutedEventArgs e) =>
38 | _parent?.FindFirst(FindHexEdit.GetAllBytes(), 0, HighlightMenuItem.IsChecked);
39 |
40 | private void FindNextButton_Click(object sender, RoutedEventArgs e) =>
41 | _parent?.FindNext(FindHexEdit.GetAllBytes(), HighlightMenuItem.IsChecked);
42 |
43 | private void FindLastButton_Click(object sender, RoutedEventArgs e) =>
44 | _parent?.FindLast(FindHexEdit.GetAllBytes(), HighlightMenuItem.IsChecked);
45 |
46 | private void ReplaceButton_Click(object sender, RoutedEventArgs e) =>
47 | _parent?.ReplaceFirst(FindHexEdit.GetAllBytes(), ReplaceHexEdit.GetAllBytes(),
48 | TrimMenuItem.IsChecked, HighlightMenuItem.IsChecked);
49 |
50 | private void ReplaceNextButton_Click(object sender, RoutedEventArgs e) =>
51 | _parent?.ReplaceNext(FindHexEdit.GetAllBytes(), ReplaceHexEdit.GetAllBytes(),
52 | TrimMenuItem.IsChecked, HighlightMenuItem.IsChecked);
53 |
54 | private void ReplaceAllButton_Click(object sender, RoutedEventArgs e) =>
55 | _parent?.ReplaceAll(FindHexEdit.GetAllBytes(), ReplaceHexEdit.GetAllBytes(),
56 | TrimMenuItem.IsChecked, HighlightMenuItem.IsChecked);
57 |
58 | private void ReplaceHexEdit_BytesDeleted(object sender, System.EventArgs e) =>
59 | InitializeMStream(ReplaceHexEdit, ReplaceHexEdit.GetAllBytes());
60 |
61 | private void FindHexEdit_BytesDeleted(object sender, System.EventArgs e) =>
62 | InitializeMStream(FindHexEdit, FindHexEdit.GetAllBytes());
63 |
64 | private void SettingButton_Click(object sender, RoutedEventArgs e) => SettingPopup.IsOpen = true;
65 |
66 | private void SettingMenuItem_Click(object sender, RoutedEventArgs e) => SettingPopup.IsOpen = false;
67 | #endregion
68 |
69 | #region Methods
70 | ///
71 | /// Initialize stream and hexeditor
72 | ///
73 | private void InitializeMStream(HexEditor hexeditor, byte[] findData = null)
74 | {
75 | hexeditor.CloseProvider();
76 |
77 | var ms = new MemoryStream(1);
78 |
79 | if (findData is not null && findData.Length > 0)
80 | foreach (var b in findData)
81 | ms.WriteByte(b);
82 | else
83 | ms.WriteByte(0);
84 |
85 | hexeditor.Stream = ms;
86 | }
87 | #endregion
88 | }
89 | }
90 |
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/Dialog/FindWindow.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
26 |
27 |
28 |
29 |
39 |
40 |
50 |
51 |
68 |
69 |
74 |
75 |
85 |
86 |
96 |
97 |
107 |
108 |
117 |
118 |
119 |
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/Dialog/FindWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | //////////////////////////////////////////////
2 | // Apache 2.0 - 2018-2019
3 | // Author : Derek Tremblay (derektremblay666@gmail.com)
4 | //////////////////////////////////////////////
5 |
6 | using System.IO;
7 | using System.Windows;
8 |
9 | namespace WpfHexaEditor.Dialog
10 | {
11 | ///
12 | /// Logique d'interaction pour FindWindow.xaml
13 | ///
14 | public partial class FindWindow
15 | {
16 | private MemoryStream _findMs = new(1);
17 | private readonly HexEditor _parent;
18 |
19 | public FindWindow(HexEditor parent, byte[] findData = null)
20 | {
21 | InitializeComponent();
22 |
23 | //Parent hexeditor for "binding" search
24 | _parent = parent;
25 |
26 | InitializeMStream(findData);
27 | }
28 |
29 | private void CloseButton_Click(object sender, RoutedEventArgs e) => Close();
30 | private void ClearButton_Click(object sender, RoutedEventArgs e) => InitializeMStream();
31 |
32 | private void FindHexEdit_BytesDeleted(object sender, System.EventArgs e) =>
33 | InitializeMStream(FindHexEdit.GetAllBytes());
34 |
35 | private void FindAllButton_Click(object sender, RoutedEventArgs e) =>
36 | _parent?.FindAll(FindHexEdit.GetAllBytes(), true);
37 |
38 | private void FindFirstButton_Click(object sender, RoutedEventArgs e) =>
39 | _parent?.FindFirst(FindHexEdit.GetAllBytes());
40 |
41 | private void FindNextButton_Click(object sender, RoutedEventArgs e) =>
42 | _parent?.FindNext(FindHexEdit.GetAllBytes());
43 |
44 | private void FindLastButton_Click(object sender, RoutedEventArgs e) =>
45 | _parent?.FindLast(FindHexEdit.GetAllBytes());
46 |
47 | ///
48 | /// Initialize stream and hexeditor
49 | ///
50 | private void InitializeMStream(byte[] findData = null)
51 | {
52 | FindHexEdit.CloseProvider();
53 |
54 | _findMs = new MemoryStream(1);
55 |
56 | if (findData is not null && findData.Length > 0)
57 | foreach (var b in findData)
58 | _findMs.WriteByte(b);
59 | else
60 | _findMs.WriteByte(0);
61 |
62 | FindHexEdit.Stream = _findMs;
63 | }
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/Dialog/GiveByteWindow.xaml:
--------------------------------------------------------------------------------
1 |
19 |
20 |
30 |
31 |
40 |
41 |
46 |
47 |
54 |
55 |
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/Dialog/GiveByteWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | //////////////////////////////////////////////
2 | // Apache 2.0 - 2018-2019
3 | // Author : Derek Tremblay (derektremblay666@gmail.com)
4 | //////////////////////////////////////////////
5 |
6 | using System.Windows;
7 |
8 | namespace WpfHexaEditor.Dialog
9 | {
10 | ///
11 | /// This Window is used to give a hex value for fill the selection with.
12 | ///
13 | internal partial class GiveByteWindow
14 | {
15 | public GiveByteWindow() => InitializeComponent();
16 |
17 | private void OKButton_Click(object sender, RoutedEventArgs e) => DialogResult = true;
18 | }
19 | }
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/Dialog/ReplaceByteWindow.xaml:
--------------------------------------------------------------------------------
1 |
19 |
20 |
30 |
31 |
40 |
41 |
46 |
47 |
54 |
55 |
60 |
61 |
68 |
69 |
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/Dialog/ReplaceByteWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | //////////////////////////////////////////////
2 | // Apache 2.0 - 2019
3 | // Author : Derek Tremblay (derektremblay666@gmail.com)
4 | //////////////////////////////////////////////
5 |
6 | using System.Windows;
7 |
8 | namespace WpfHexaEditor.Dialog
9 | {
10 | ///
11 | /// This Window is used to give tow hex value for deal with.
12 | ///
13 | internal partial class ReplaceByteWindow
14 | {
15 | public ReplaceByteWindow() => InitializeComponent();
16 |
17 | private void OKButton_Click(object sender, RoutedEventArgs e) => DialogResult = true;
18 | }
19 | }
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/FastTextLine.cs:
--------------------------------------------------------------------------------
1 | //////////////////////////////////////////////
2 | // Apache 2.0 - 2016-2020
3 | // Author : Derek Tremblay (derektremblay666@gmail.com)
4 | //////////////////////////////////////////////
5 |
6 | using System;
7 | using System.Globalization;
8 | using System.Windows;
9 | using System.Windows.Documents;
10 | using System.Windows.Media;
11 |
12 | namespace WpfHexaEditor
13 | {
14 | ///
15 | /// Light Label like control
16 | ///
17 | internal class FastTextLine : FrameworkElement
18 | {
19 | private readonly HexEditor _parent;
20 |
21 | #region Constructor
22 |
23 | public FastTextLine(HexEditor parent)
24 | {
25 | //Parent hexeditor
26 | _parent = parent ?? throw new ArgumentNullException(nameof(parent));
27 |
28 | //Default properties
29 | DataContext = this;
30 | }
31 |
32 | #endregion Contructor
33 |
34 | #region Base properties
35 |
36 | ///
37 | /// Definie the foreground
38 | ///
39 | public static readonly DependencyProperty ForegroundProperty =
40 | TextElement.ForegroundProperty.AddOwner(typeof(FastTextLine));
41 |
42 | public Brush Foreground
43 | {
44 | get => (Brush)GetValue(ForegroundProperty);
45 | set => SetValue(ForegroundProperty, value);
46 | }
47 |
48 | public static readonly DependencyProperty BackgroundProperty =
49 | TextElement.BackgroundProperty.AddOwner(typeof(FastTextLine),
50 | new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.AffectsRender));
51 |
52 | ///
53 | /// Defines the background
54 | ///
55 | public Brush Background
56 | {
57 | get => (Brush)GetValue(BackgroundProperty);
58 | set => SetValue(BackgroundProperty, value);
59 | }
60 |
61 | public static readonly DependencyProperty TextProperty =
62 | DependencyProperty.Register(nameof(Text), typeof(string), typeof(FastTextLine),
63 | new FrameworkPropertyMetadata(string.Empty,
64 | FrameworkPropertyMetadataOptions.AffectsRender | FrameworkPropertyMetadataOptions.AffectsMeasure));
65 |
66 | ///
67 | /// Text to be displayed representation of Byte
68 | ///
69 | public string Text
70 | {
71 | get => (string)GetValue(TextProperty);
72 | set => SetValue(TextProperty, value);
73 | }
74 |
75 | public static readonly DependencyProperty FontWeightProperty =
76 | TextElement.FontWeightProperty.AddOwner(typeof(FastTextLine));
77 |
78 | ///
79 | /// The FontWeight property specifies the weight of the font.
80 | ///
81 | public FontWeight FontWeight
82 | {
83 | get => (FontWeight)GetValue(FontWeightProperty);
84 | set => SetValue(FontWeightProperty, value);
85 | }
86 |
87 | #endregion Base properties
88 |
89 | #region Properties
90 |
91 | ///
92 | /// Get or set if the width are auto or fixed
93 | ///
94 | public bool AutoWidth { get; set; } = true;
95 |
96 | ///
97 | /// Get or set the render point
98 | ///
99 | public Point RenderPoint
100 | {
101 | get => (Point)GetValue(RenderPointProperty);
102 | set => SetValue(RenderPointProperty, value);
103 | }
104 |
105 | public static readonly DependencyProperty RenderPointProperty =
106 | DependencyProperty.Register(nameof(RenderPoint), typeof(Point), typeof(FastTextLine),
107 | new FrameworkPropertyMetadata(new Point(0, 0), FrameworkPropertyMetadataOptions.AffectsMeasure));
108 |
109 | #endregion
110 |
111 | ///
112 | /// Render the control
113 | ///
114 | protected override void OnRender(DrawingContext dc)
115 | {
116 | //Draw background
117 | if (Background is not null)
118 | dc.DrawRectangle(Background, null, new Rect(0, 0, RenderSize.Width, RenderSize.Height));
119 |
120 | //Draw text
121 | var formatedText = new FormattedText(Text, CultureInfo.InvariantCulture, FlowDirection.LeftToRight,
122 | new Typeface(_parent.FontFamily, _parent.FontStyle, FontWeight, _parent.FontStretch),
123 | _parent.FontSize, Foreground, VisualTreeHelper.GetDpi(this).PixelsPerDip);
124 |
125 | dc.DrawText(formatedText, new Point(RenderPoint.X, RenderPoint.Y));
126 |
127 | if (AutoWidth)
128 | Width = formatedText.Width + RenderPoint.X;
129 | }
130 | }
131 | }
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/GlobalSuppressions.cs:
--------------------------------------------------------------------------------
1 | // This file is used by Code Analysis to maintain SuppressMessage
2 | // attributes that are applied to this project.
3 | // Project-level suppressions either have no target or are given
4 | // a specific target and scoped to a namespace, type, member, etc.
5 |
6 | using System.Diagnostics.CodeAnalysis;
7 |
8 | [assembly: SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "", Scope = "member", Target = "~M:WpfHexaEditor.Core.Bytes.ByteProvider.OpenFile")]
9 | [assembly: SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "", Scope = "member", Target = "~M:WpfHexaEditor.Core.Bytes.ByteProvider.AddByteModified(System.Nullable{System.Byte},System.Int64,System.Int64)")]
10 | [assembly: SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "", Scope = "member", Target = "~M:WpfHexaEditor.Core.Bytes.ByteProvider.AddByteAdded(System.Nullable{System.Byte},System.Int64,System.Int64)")]
11 | [assembly: SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "", Scope = "member", Target = "~M:WpfHexaEditor.Core.MethodExtention.ApplicationExtention.DoEvents(System.Windows.Application,System.Windows.Threading.DispatcherPriority)")]
12 |
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/HexBox.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
32 |
33 |
37 |
38 |
39 |
40 |
46 |
47 |
51 |
52 |
53 |
54 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
86 |
87 |
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/HexBox.xaml.cs:
--------------------------------------------------------------------------------
1 | //////////////////////////////////////////////
2 | // Apache 2.0 - 2017-2019
3 | // Author : Derek Tremblay (derektremblay666@gmail.com)
4 | //////////////////////////////////////////////
5 |
6 | using System;
7 | using System.Windows;
8 | using System.Windows.Controls;
9 | using System.Windows.Input;
10 | using WpfHexaEditor.Core;
11 | using WpfHexaEditor.Core.Bytes;
12 |
13 | namespace WpfHexaEditor
14 | {
15 | ///
16 | /// Control for enter hex value and deal with.
17 | ///
18 | public partial class HexBox
19 | {
20 | public HexBox() => InitializeComponent();
21 |
22 | #region Events
23 | ///
24 | /// Occurs when value are changed.
25 | ///
26 | public event EventHandler ValueChanged;
27 |
28 | #endregion
29 |
30 | #region Properties
31 |
32 | ///
33 | /// Get hexadecimal value of LongValue
34 | ///
35 | public string HexValue => ByteConverters.LongToHex(LongValue);
36 |
37 | ///
38 | /// Get or set maximum value
39 | ///
40 | public long MaximumValue
41 | {
42 | get => (long)GetValue(MaximumValueProperty);
43 | set => SetValue(MaximumValueProperty, value);
44 | }
45 |
46 | public static readonly DependencyProperty MaximumValueProperty =
47 | DependencyProperty.Register(nameof(MaximumValue), typeof(long), typeof(HexBox),
48 | new FrameworkPropertyMetadata(long.MaxValue, MaximumValue_Changed));
49 |
50 | private static void MaximumValue_Changed(DependencyObject d, DependencyPropertyChangedEventArgs e)
51 | {
52 | if (d is not HexBox ctrl) return;
53 | if (e.NewValue == e.OldValue) return;
54 | if (ctrl.LongValue <= (long)e.NewValue) return;
55 |
56 | ctrl.UpdateValueFrom((long)e.NewValue);
57 | }
58 |
59 | ///
60 | /// Get or set the hex value show in control
61 | ///
62 | public long LongValue
63 | {
64 | get => (long)GetValue(LongValueProperty);
65 | set => SetValue(LongValueProperty, value);
66 | }
67 |
68 | public static readonly DependencyProperty LongValueProperty =
69 | DependencyProperty.Register(nameof(LongValue), typeof(long), typeof(HexBox),
70 | new FrameworkPropertyMetadata(0L, LongValue_Changed, LongValue_CoerceValue));
71 |
72 | private static object LongValue_CoerceValue(DependencyObject d, object baseValue)
73 | {
74 | var ctrl = d as HexBox;
75 |
76 | var newValue = (long)baseValue;
77 |
78 | if (newValue > ctrl.MaximumValue) newValue = ctrl.MaximumValue;
79 | if (newValue < 0) newValue = 0;
80 |
81 | return newValue;
82 | }
83 |
84 | private static void LongValue_Changed(DependencyObject d, DependencyPropertyChangedEventArgs e)
85 | {
86 | if (d is not HexBox ctrl) return;
87 | if (e.NewValue == e.OldValue) return;
88 |
89 | var val = ByteConverters.LongToHex((long)e.NewValue);
90 |
91 | if (val == "00000000")
92 | val = "0";
93 | else if (val.Length >= 3)
94 | val = val.TrimStart('0');
95 |
96 | ctrl.HexTextBox.Text = val.ToUpperInvariant();
97 | ctrl.HexTextBox.CaretIndex = ctrl.HexTextBox.Text.Length;
98 | ctrl.ToolTip = e.NewValue;
99 |
100 | ctrl.ValueChanged?.Invoke(ctrl, EventArgs.Empty);
101 | }
102 |
103 | #endregion Properties
104 |
105 | #region Methods
106 |
107 | ///
108 | /// Substract one to the LongValue
109 | ///
110 | private void SubstractOne() => LongValue--;
111 |
112 | ///
113 | /// Add one to the LongValue
114 | ///
115 | private void AddOne() => LongValue++;
116 |
117 | ///
118 | /// Update value from decimal long
119 | ///
120 | private void UpdateValueFrom(long value) => LongValue = value;
121 |
122 | ///
123 | /// Update value from hex string
124 | ///
125 | private void UpdateValueFrom(string value)
126 | {
127 | var (success, val) = ByteConverters.HexLiteralToLong(value);
128 |
129 | LongValue = success ? val : 0;
130 | }
131 |
132 | #endregion Methods
133 |
134 | #region Controls events
135 |
136 | private void HexTextBox_PreviewKeyDown(object sender, KeyEventArgs e) =>
137 | e.Handled = !KeyValidator.IsHexKey(e.Key) &&
138 | !KeyValidator.IsBackspaceKey(e.Key) &&
139 | !KeyValidator.IsDeleteKey(e.Key) &&
140 | !KeyValidator.IsArrowKey(e.Key) &&
141 | !KeyValidator.IsTabKey(e.Key) &&
142 | !KeyValidator.IsEnterKey(e.Key);
143 |
144 | private void HexTextBox_KeyDown(object sender, KeyEventArgs e)
145 | {
146 | if (e.Key == Key.Up)
147 | AddOne();
148 |
149 | if (e.Key == Key.Down)
150 | SubstractOne();
151 |
152 | HexTextBox.Focus();
153 | }
154 |
155 | private void UpButton_Click(object sender, RoutedEventArgs e) => AddOne();
156 |
157 | private void DownButton_Click(object sender, RoutedEventArgs e) => SubstractOne();
158 |
159 | private void HexTextBox_TextChanged(object sender, TextChangedEventArgs e) =>
160 | UpdateValueFrom(HexTextBox.Text);
161 |
162 | private void CopyHexaMenuItem_Click(object sender, RoutedEventArgs e) =>
163 | Clipboard.SetText($"0x{HexTextBox.Text}");
164 |
165 | private void CopyLongMenuItem_Click(object sender, RoutedEventArgs e) =>
166 | Clipboard.SetText(LongValue.ToString());
167 |
168 | #endregion Controls events
169 | }
170 | }
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | //////////////////////////////////////////////
2 | // Apache 2.0 - 2016-2020
3 | // Author : Derek Tremblay (derektremblay666@gmail.com)
4 | //////////////////////////////////////////////
5 |
6 | using System.Windows;
7 |
8 | [assembly: ThemeInfo(
9 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
10 | //(used if a resource is not found in the page,
11 | // or application resource dictionaries)
12 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
13 | //(used if a resource is not found in the page,
14 | // app, or any theme specific resource dictionaries)
15 | )]
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/Properties/Resources.fr-CA.Designer.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abbaye/WpfHexEditorControl/835347edd04bda516e4e97ae748535e48eb7af69/Sources/WPFHexaEditor/Properties/Resources.fr-CA.Designer.cs
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/Properties/Resources.pl-PL.Designer.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abbaye/WpfHexEditorControl/835347edd04bda516e4e97ae748535e48eb7af69/Sources/WPFHexaEditor/Properties/Resources.pl-PL.Designer.cs
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/Properties/Resources.pt-BR.Designer.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abbaye/WpfHexEditorControl/835347edd04bda516e4e97ae748535e48eb7af69/Sources/WPFHexaEditor/Properties/Resources.pt-BR.Designer.cs
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/Properties/Resources.ru-RU.Designer.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abbaye/WpfHexEditorControl/835347edd04bda516e4e97ae748535e48eb7af69/Sources/WPFHexaEditor/Properties/Resources.ru-RU.Designer.cs
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/Properties/Resources.zh-CN1.Designer.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abbaye/WpfHexEditorControl/835347edd04bda516e4e97ae748535e48eb7af69/Sources/WPFHexaEditor/Properties/Resources.zh-CN1.Designer.cs
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // Ce code a été généré par un outil.
4 | // Version du runtime :4.0.30319.42000
5 | //
6 | // Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si
7 | // le code est régénéré.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace WpfHexaEditor.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.8.1.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/Resources/Dictionary/BrushesDictionary.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/Resources/Dictionary/MiscelanousDictionary.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/Resources/Dictionary/ToolTipDictionary.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
26 |
30 |
31 |
32 |
33 |
34 |
35 |
39 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
53 |
54 |
55 |
56 |
57 |
58 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/Resources/EBCDIC-NoSpecialChar.tbl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abbaye/WpfHexEditorControl/835347edd04bda516e4e97ae748535e48eb7af69/Sources/WPFHexaEditor/Resources/EBCDIC-NoSpecialChar.tbl
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/Resources/EBCDIC.tbl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abbaye/WpfHexEditorControl/835347edd04bda516e4e97ae748535e48eb7af69/Sources/WPFHexaEditor/Resources/EBCDIC.tbl
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/Resources/Icon/0x-Icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abbaye/WpfHexEditorControl/835347edd04bda516e4e97ae748535e48eb7af69/Sources/WPFHexaEditor/Resources/Icon/0x-Icon.ico
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/Resources/Icon/Add-Bookmark-Icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abbaye/WpfHexEditorControl/835347edd04bda516e4e97ae748535e48eb7af69/Sources/WPFHexaEditor/Resources/Icon/Add-Bookmark-Icon.ico
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/Resources/Icon/Clear-Bookmark-Icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abbaye/WpfHexEditorControl/835347edd04bda516e4e97ae748535e48eb7af69/Sources/WPFHexaEditor/Resources/Icon/Clear-Bookmark-Icon.ico
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/Resources/Icon/Copy-Icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abbaye/WpfHexEditorControl/835347edd04bda516e4e97ae748535e48eb7af69/Sources/WPFHexaEditor/Resources/Icon/Copy-Icon.ico
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/Resources/Icon/Delete-Icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abbaye/WpfHexEditorControl/835347edd04bda516e4e97ae748535e48eb7af69/Sources/WPFHexaEditor/Resources/Icon/Delete-Icon.ico
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/Resources/Icon/Find-Icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abbaye/WpfHexEditorControl/835347edd04bda516e4e97ae748535e48eb7af69/Sources/WPFHexaEditor/Resources/Icon/Find-Icon.ico
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/Resources/Icon/Logo-Icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abbaye/WpfHexEditorControl/835347edd04bda516e4e97ae748535e48eb7af69/Sources/WPFHexaEditor/Resources/Icon/Logo-Icon.ico
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/Resources/Icon/Logo-Icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abbaye/WpfHexEditorControl/835347edd04bda516e4e97ae748535e48eb7af69/Sources/WPFHexaEditor/Resources/Icon/Logo-Icon.png
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/Resources/Icon/Paste-Icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abbaye/WpfHexEditorControl/835347edd04bda516e4e97ae748535e48eb7af69/Sources/WPFHexaEditor/Resources/Icon/Paste-Icon.ico
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/Resources/Icon/Remove-Bookmark-Icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abbaye/WpfHexEditorControl/835347edd04bda516e4e97ae748535e48eb7af69/Sources/WPFHexaEditor/Resources/Icon/Remove-Bookmark-Icon.ico
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/Resources/Icon/Sans titre.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abbaye/WpfHexEditorControl/835347edd04bda516e4e97ae748535e48eb7af69/Sources/WPFHexaEditor/Resources/Icon/Sans titre.png
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/Resources/Icon/Settings-Icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abbaye/WpfHexEditorControl/835347edd04bda516e4e97ae748535e48eb7af69/Sources/WPFHexaEditor/Resources/Icon/Settings-Icon.ico
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/Resources/Icon/Undo-Icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abbaye/WpfHexEditorControl/835347edd04bda516e4e97ae748535e48eb7af69/Sources/WPFHexaEditor/Resources/Icon/Undo-Icon.ico
--------------------------------------------------------------------------------
/Sources/WPFHexaEditor/WpfHexEditorCore.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net48;net70-windows
5 | true
6 | WpfHexaEditor
7 | WPFHexaEditor
8 | WpfHexEditor user control
9 | true
10 | Derek Tremblay (derektremblay666@gmail.com)
11 | Derek Tremblay (derektremblay666@gmail.com)
12 |
13 | Wpf Hexeditor is a powerful and fully customisable user control for editing file or stream as hexadecimal, decimal and binary. Can be used in Wpf or WinForm application.
14 | Support .Net 4.7/4.8 and .Net 5.0-windows
15 |
16 | Logo-Icon.png
17 |
18 | WpfHexaEditor
19 | Apache 2.0
20 | 2.1.7.0
21 | 2.1.7
22 | 2.1.7
23 | true
24 | character-table;hexadecimal;binary;editor;hexeditor;tbl;hexedit
25 |
26 | preview
27 | https://github.com/abbaye/WpfHexEditorControl
28 | false
29 |
30 | license.txt
31 | true
32 | false
33 | en-US
34 |
35 |
36 |
37 | TRACE;DEBUG
38 | x64
39 |
40 |
41 |
42 |
43 | True
44 |
45 |
46 |
47 | True
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 | PreserveNewest
70 |
71 |
72 | PreserveNewest
73 |
74 |
75 |
76 |
77 |
78 | Never
79 |
80 |
81 | Never
82 |
83 |
84 | Never
85 |
86 |
87 | Never
88 |
89 |
90 | Never
91 |
92 |
93 | Never
94 |
95 |
96 | Never
97 |
98 |
99 | Never
100 |
101 |
102 | Never
103 |
104 |
105 | Never
106 |
107 |
108 |
109 |
110 |
111 | True
112 | True
113 | Settings.settings
114 |
115 |
116 |
117 |
118 |
119 | SettingsSingleFileGenerator
120 | Settings.Designer.cs
121 |
122 |
123 |
124 |
125 |
126 | True
127 | True
128 | Resources.resx
129 | True
130 |
131 |
132 | Designer
133 | Resources.Designer.cs
134 | PublicResXFileCodeGenerator
135 |
136 |
137 |
138 |
--------------------------------------------------------------------------------
/_config.yml:
--------------------------------------------------------------------------------
1 | theme: jekyll-theme-architect
--------------------------------------------------------------------------------
/readme-nuget.md:
--------------------------------------------------------------------------------
1 | [](https://www.microsoft.com/net/download/windows)
2 | [](https://github.com/abbaye/WpfHexEditorControl/blob/master/LICENSE)
3 |
4 | A fast, fully customisable Wpf user control for editing file or stream as hexadecimal.
5 |
6 | Can be used in WPF or WinForm application.
7 |
8 | Localized in English, French, Russian and Chinese
9 |
10 | ## Somes features
11 | - Append byte at end of file
12 | - Include HexBox, an Hexadecimal TextBox with spinner
13 | - Fill selection (or another array) with byte.
14 | - Support of common key in window like CTRL+C, CTRL+V, CTRL+Z, CTRL+A, ESC...
15 | - Copy to clipboard as code like C#, VB.Net, C, Java, F# ...
16 | - Support custom .TBL character table file insted of default ASCII.
17 | - Undo (no redo for now)
18 | - Finds methods (FindFirst, FindNext, FindAll, FindLast, FindSelection) and overload for (string, byte[])
19 | - Highlight byte with somes find methods
20 | - Bookmark
21 | - Group byte in block
22 | - Show data as hexadecimal or decimal
23 | - ...
24 |
25 | ## How to use
26 | Add a reference to `WPFHexaEditor.dll` from your project, then add the following namespace to your XAML:
27 |
28 | ```xaml
29 | xmlns:control="clr-namespace:WpfHexaEditor;assembly=WPFHexaEditor"
30 | ```
31 |
32 | Insert the control like this:
33 |
34 | ```xaml
35 |
36 |
37 |
38 |
39 | ```
40 |
--------------------------------------------------------------------------------