mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-31 05:15:55 -05:00
Compare commits
59 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
60eb59c605 | ||
|
|
6a7bbb8752 | ||
|
|
e4431749e1 | ||
|
|
c587b357eb | ||
|
|
7357c26d54 | ||
|
|
73ca45ad3d | ||
|
|
bf00503d1f | ||
|
|
44a90f5c7d | ||
|
|
5c3ee9f499 | ||
|
|
03f357efd1 | ||
|
|
5462575f5c | ||
|
|
120e2bc300 | ||
|
|
c3137df83c | ||
|
|
737155a226 | ||
|
|
66d64cf020 | ||
|
|
42f5c0f484 | ||
|
|
75047e26e2 | ||
|
|
9fa6d82775 | ||
|
|
d1468984e7 | ||
|
|
20a2331504 | ||
|
|
5b00c8ee08 | ||
|
|
bda4aadc54 | ||
|
|
9d7e2eccac | ||
|
|
8c219b981c | ||
|
|
7d87c8bb98 | ||
|
|
13afd96806 | ||
|
|
4fb74a1769 | ||
|
|
aa658b7dbc | ||
|
|
7e3601989a | ||
|
|
3a1c0f8d66 | ||
|
|
91160b4311 | ||
|
|
83f4093796 | ||
|
|
f219395b25 | ||
|
|
ae6a7ad8e5 | ||
|
|
d990ee102a | ||
|
|
cfde9939b4 | ||
|
|
a22725bb67 | ||
|
|
7a4040f6ec | ||
|
|
2fbb351314 | ||
|
|
96e85c0685 | ||
|
|
50577c9ea0 | ||
|
|
073323b517 | ||
|
|
37cc8f3aae | ||
|
|
6367152650 | ||
|
|
ffbaef3872 | ||
|
|
a0b2473bf4 | ||
|
|
95a3104a56 | ||
|
|
2d5f77730b | ||
|
|
033a0dfbb9 | ||
|
|
cb682b6e21 | ||
|
|
7312908d4d | ||
|
|
b44f6035b3 | ||
|
|
b6bc8abf83 | ||
|
|
c60c1154b9 | ||
|
|
219afb6244 | ||
|
|
22b6bdb5cf | ||
|
|
d9a47fe815 | ||
|
|
45e987b413 | ||
|
|
a920696d03 |
16
.github/workflows/build.yml
vendored
16
.github/workflows/build.yml
vendored
@@ -321,7 +321,7 @@ jobs:
|
||||
run: |
|
||||
cp -r build/DEBIAN build/DebDir
|
||||
dpkg-deb -Zgzip --build build/DebDir
|
||||
mv build/DebDir.deb imhex-${{env.IMHEX_VERSION}}.deb
|
||||
mv build/DebDir.deb imhex-${{env.IMHEX_VERSION}}-Ubuntu-22.04.deb
|
||||
|
||||
# AppImage cmake build
|
||||
- name: 🛠️ Reconfigure build for AppImage
|
||||
@@ -345,10 +345,8 @@ jobs:
|
||||
- name: 📦 Bundle AppImage
|
||||
run: |
|
||||
cd build-appimage
|
||||
mkdir -p ./AppDir/usr/share/metainfo
|
||||
cp ../dist/imhex.appdata.xml ./AppDir/usr/share/metainfo/imhex.appdata.xml
|
||||
export VERSION=${{env.IMHEX_VERSION}}
|
||||
appimage-builder --recipe ../dist/AppImageBuilder.yml
|
||||
mv ImHex-AppImage-x86_64.AppImage ../imhex-${{env.IMHEX_VERSION}}.AppImage
|
||||
cd ..
|
||||
|
||||
#- name: ⬆️ Upload Flatpak
|
||||
@@ -361,14 +359,20 @@ jobs:
|
||||
- name: ⬆️ Upload DEB
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: Linux DEB (Ubuntu 22.04)
|
||||
name: Ubuntu 22.04 DEB
|
||||
path: '*.deb'
|
||||
|
||||
- name: ⬆️ Upload AppImage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: Linux AppImage
|
||||
path: '*.AppImage'
|
||||
path: 'build-appimage/*.AppImage'
|
||||
|
||||
- name: ⬆️ Upload AppImage zsync
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: Linux AppImage zsync
|
||||
path: 'build-appimage/*.AppImage.zsync'
|
||||
|
||||
# ArchLinux build
|
||||
archlinux-build:
|
||||
|
||||
6
.github/workflows/release.yml
vendored
6
.github/workflows/release.yml
vendored
@@ -116,6 +116,9 @@ jobs:
|
||||
|
||||
- name: ✉️ Update C++ Plugin Template
|
||||
uses: mvasigh/dispatch-action@main
|
||||
env:
|
||||
RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||
if: "${{ env.RELEASE_TOKEN != '' }}"
|
||||
with:
|
||||
token: ${{ secrets.RELEASE_TOKEN }}
|
||||
repo: ImHex-Cpp-Plugin-Template
|
||||
@@ -130,11 +133,12 @@ jobs:
|
||||
- name: ⬇️ Download dependencies
|
||||
shell: pwsh
|
||||
run: |
|
||||
iwr https://github.com/microsoft/winget-create/releases/download/v1.0.4.0/wingetcreate.exe -OutFile wingetcreate.exe
|
||||
iwr https://github.com/microsoft/winget-create/releases/download/v1.1.2.0/wingetcreate.exe -OutFile wingetcreate.exe
|
||||
- name: ⬆️ Update winget manifest
|
||||
shell: pwsh
|
||||
env:
|
||||
WINGET_GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||
if: "${{ env.WINGET_GITHUB_TOKEN != '' }}"
|
||||
run: |
|
||||
$tagname = $env:GITHUB_REF.Replace("refs/tags/", "")
|
||||
$version = $tagname.Replace("v", "")
|
||||
|
||||
1
.idea/vcs.xml
generated
1
.idea/vcs.xml
generated
@@ -8,6 +8,7 @@
|
||||
<mapping directory="$PROJECT_DIR$/lib/external/libromfs" vcs="Git" />
|
||||
<mapping directory="$PROJECT_DIR$/lib/external/nativefiledialog" vcs="Git" />
|
||||
<mapping directory="$PROJECT_DIR$/lib/external/pattern_language" vcs="Git" />
|
||||
<mapping directory="$PROJECT_DIR$/lib/external/pattern_language/external/cli11" vcs="Git" />
|
||||
<mapping directory="$PROJECT_DIR$/lib/external/pattern_language/external/fmt" vcs="Git" />
|
||||
<mapping directory="$PROJECT_DIR$/lib/external/xdgpp" vcs="Git" />
|
||||
<mapping directory="$PROJECT_DIR$/lib/external/yara/yara" vcs="Git" />
|
||||
|
||||
10
README.md
10
README.md
@@ -1,4 +1,4 @@
|
||||
<a href="https://imhex.werwolv.net"><h1 align="center" >:mag: ImHex</h1></a>
|
||||
<a href="https://imhex.werwolv.net"><h1 align="center" ><img height="100px" src="resources/projects/logo_text.svg"></h1></a>
|
||||
|
||||
<p align="center">A Hex Editor for Reverse Engineers, Programmers and people who value their retinas when working at 3 AM.</p>
|
||||
|
||||
@@ -116,7 +116,7 @@ For format patterns, libraries, magic and constant files, check out the [ImHex-P
|
||||
|
||||
To use ImHex, the following minimal system requirements need to be met:
|
||||
|
||||
- **OS**: Windows 7 or higher, macOS 10.15 (Catalina) or higher, "Modern" Linux (Ubuntu 22.04+, Fedora Stable/Rawhide, and Arch Linux are officially supported)
|
||||
- **OS**: Windows 7 or higher, macOS 10.15 (Catalina) or higher, "Modern" Linux (Ubuntu 22.04, Fedora Stable/Rawhide, and Arch Linux have official packages, other distributions can use the AppImage)
|
||||
- **CPU**: x86_64 (64 Bit)
|
||||
- **GPU**: OpenGL 3.0 or higher (preferable a dedicated GPU and not Intel HD Graphics)
|
||||
- **RAM**: 512MB, more may be required for more complicated analysis
|
||||
@@ -129,7 +129,7 @@ To develop plugins for ImHex, use one of the following two templates projects to
|
||||
- [Rust Plugin Template](https://github.com/WerWolv/ImHex-Rust-Plugin-Template)
|
||||
|
||||
## Installing
|
||||
The following OSs have packages available in their respositories making it easy to install ImHex.
|
||||
The following OSs have packages available in their repositories making it easy to install ImHex.
|
||||
### Fedora (36+)
|
||||
```
|
||||
dnf install imhex
|
||||
@@ -139,7 +139,7 @@ dnf install imhex
|
||||
|
||||
### Arch Linux (AUR)
|
||||
```
|
||||
yay install imhex
|
||||
yay -S imhex-bin
|
||||
```
|
||||
|
||||
## Third Party Repositories
|
||||
@@ -158,7 +158,7 @@ Nightlies are available via GitHub Actions [here](https://github.com/WerWolv/ImH
|
||||
- MacOS • __x86_64__
|
||||
- [DMG](https://nightly.link/WerWolv/ImHex/workflows/build/master/macOS%20DMG.zip)
|
||||
- Linux • __x86_64__
|
||||
- [Ubuntu DEB](https://nightly.link/WerWolv/ImHex/workflows/build/master/Linux%20DEB%20%28Ubuntu%2022.04%29.zip)
|
||||
- [Ubuntu 22.04 DEB](https://nightly.link/WerWolv/ImHex/workflows/build/master/Ubuntu%2022.04%20DEB.zip)
|
||||
- [AppImage](https://nightly.link/WerWolv/ImHex/workflows/build/master/Linux%20AppImage.zip)
|
||||
- [Arch Package](https://nightly.link/WerWolv/ImHex/workflows/build/master/ArchLinux%20.pkg.tar.zst.zip)
|
||||
- [Fedora Rawhide RPM](https://nightly.link/WerWolv/ImHex/workflows/build/master/Fedora%20Rawhide%20RPM.zip)
|
||||
|
||||
@@ -265,6 +265,14 @@ macro(createPackage)
|
||||
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/resources/icon.png DESTINATION ${CMAKE_INSTALL_PREFIX}/share/pixmaps RENAME imhex.png)
|
||||
install(FILES "$<TARGET_FILE:libimhex>" DESTINATION "${CMAKE_INSTALL_LIBDIR}" PERMISSIONS ${LIBRARY_PERMISSIONS})
|
||||
downloadImHexPatternsFiles("./share/imhex")
|
||||
|
||||
# install AppStream file
|
||||
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/dist/net.werwolv.imhex.metainfo.xml DESTINATION ${CMAKE_INSTALL_PREFIX}/share/metainfo)
|
||||
|
||||
# install symlink for the old standard name
|
||||
file(CREATE_LINK net.werwolv.imhex.metainfo.xml ${CMAKE_CURRENT_BINARY_DIR}/net.werwolv.imhex.appdata.xml SYMBOLIC)
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/net.werwolv.imhex.appdata.xml DESTINATION ${CMAKE_INSTALL_PREFIX}/share/metainfo)
|
||||
|
||||
endif()
|
||||
|
||||
if (CREATE_BUNDLE)
|
||||
@@ -323,7 +331,9 @@ macro(setDefaultBuiltTypeIfUnset)
|
||||
endmacro()
|
||||
|
||||
function(loadVersion version)
|
||||
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/VERSION" read_version)
|
||||
set(VERSION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/VERSION")
|
||||
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${VERSION_FILE})
|
||||
file(READ "${VERSION_FILE}" read_version)
|
||||
set(${version} ${read_version} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
@@ -382,6 +392,12 @@ function(downloadImHexPatternsFiles dest)
|
||||
|
||||
FetchContent_Populate(imhex_patterns)
|
||||
|
||||
else ()
|
||||
# Maybe patterns are cloned to a subdirectory
|
||||
set(imhex_patterns_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ImHex-Patterns")
|
||||
endif ()
|
||||
|
||||
if (EXISTS ${imhex_patterns_SOURCE_DIR})
|
||||
set(PATTERNS_FOLDERS_TO_INSTALL constants encodings includes patterns magic)
|
||||
foreach (FOLDER ${PATTERNS_FOLDERS_TO_INSTALL})
|
||||
install(DIRECTORY "${imhex_patterns_SOURCE_DIR}/${FOLDER}" DESTINATION ${dest})
|
||||
|
||||
5
dist/AppImageBuilder.yml
vendored
5
dist/AppImageBuilder.yml
vendored
@@ -6,7 +6,7 @@ AppDir:
|
||||
id: imhex
|
||||
name: ImHex
|
||||
icon: imhex
|
||||
version: AppImage
|
||||
version: "{{VERSION}}"
|
||||
exec: usr/bin/imhex
|
||||
exec_args: $@
|
||||
apt:
|
||||
@@ -136,4 +136,5 @@ AppDir:
|
||||
- usr/share/doc/*/TODO.*
|
||||
AppImage:
|
||||
arch: x86_64
|
||||
update-information: guess
|
||||
update-information: gh-releases-zsync|WerWolv|ImHex|latest|imhex-*.AppImage.zsync
|
||||
file_name: imhex-{{VERSION}}.AppImage
|
||||
|
||||
33
dist/Arch/PKGBUILD
vendored
33
dist/Arch/PKGBUILD
vendored
@@ -1,40 +1,29 @@
|
||||
# Maintainer: iTrooz_ <itrooz at protonmail dot com>
|
||||
# Contributor: Morten Linderud <foxboron@archlinux.org>
|
||||
|
||||
pkgname=imhex-bin
|
||||
pkgver=%version%
|
||||
pkgrel=1
|
||||
pkgdesc="A Hex Editor for Reverse Engineers, Programmers and people who value their retinas when working at 3 AM. "
|
||||
arch=("x86_64")
|
||||
url="https://github.com/WerWolv/ImHex"
|
||||
repo=$url
|
||||
license=('GPL 2.0')
|
||||
groups=()
|
||||
license=('GPL2')
|
||||
depends=(glfw mbedtls python freetype2 libglvnd dbus xdg-desktop-portal curl fmt yara nlohmann-json)
|
||||
makedepends=(git)
|
||||
checkdepends=()
|
||||
optdepends=()
|
||||
provides=(imhex)
|
||||
conflicts=(imhex)
|
||||
replaces=()
|
||||
backup=()
|
||||
options=()
|
||||
source=($repo"/releases/download/v$pkgver/imhex-$pkgver-ArchLinux.pkg.tar.zst")
|
||||
noextract=()
|
||||
source=("$url/releases/download/v$pkgver/imhex-$pkgver-ArchLinux.pkg.tar.zst")
|
||||
md5sums=(SKIP)
|
||||
validpgpkeys=()
|
||||
|
||||
package() {
|
||||
tar -xf imhex-$pkgver-ArchLinux.pkg.tar.zst
|
||||
install -Dm755 "$srcdir/usr/bin/imhex" "$pkgdir/usr/bin/imhex"
|
||||
install -Dm644 "$srcdir/usr/lib/libimhex.so.$pkgver" "$pkgdir/usr/lib/libimhex.so.$pkgver"
|
||||
|
||||
install -DT $srcdir/usr/bin/imhex $pkgdir/usr/bin/imhex
|
||||
install -DT $srcdir/usr/lib/libimhex.so.$pkgver $pkgdir/usr/lib/libimhex.so.$pkgver
|
||||
|
||||
for plugin in $srcdir/usr/lib/imhex/plugins/*.hexplug;
|
||||
do
|
||||
install -DT $plugin $pkgdir/usr/lib/imhex/plugins/`basename $plugin`
|
||||
for plugin in "$srcdir/usr/lib/imhex/plugins/"*.hexplug; do
|
||||
install -Dm644 "$plugin" "$pkgdir/usr/lib/imhex/plugins/${plugin##*/}"
|
||||
done
|
||||
|
||||
mkdir -p $pkgdir/usr/share/imhex
|
||||
cp -r $srcdir/usr/share/imhex/{constants,encodings,includes,magic,patterns} $pkgdir/usr/share/imhex
|
||||
cp -r $srcdir/usr/share/{applications,licenses} $pkgdir/usr/share
|
||||
install -d $pkgdir/usr/share
|
||||
install -d "$pkgdir/usr/share/imhex"
|
||||
cp -r "$srcdir/usr/share/imhex/"{constants,encodings,includes,magic,patterns} "$pkgdir/usr/share/imhex"
|
||||
cp -r "$srcdir/usr/share/"{applications,licenses} "$pkgdir/usr/share"
|
||||
}
|
||||
|
||||
22
dist/imhex.appdata.xml
vendored
22
dist/imhex.appdata.xml
vendored
@@ -1,22 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<component type="desktop-application">
|
||||
<id>imhex</id>
|
||||
<metadata_license>GPL-2.0</metadata_license>
|
||||
<project_license>GPL-2.0</project_license>
|
||||
<name>ImHex</name>
|
||||
<summary>A Hex Editor for Reverse Engineers, Programmers and people who value their retinas when working at 3 AM</summary>
|
||||
<description>
|
||||
<p>ImHex is a feature-rich Hex Editor aimed towards Reverse Engineers working with foreign data formats, malware, executables and raw memory.
|
||||
Besides all the features a common Hex Editor has, ImHex also features a custom scripting language used to declare and dissect data structures, support for running YARA rules, a node-based graphical data pre-processor and support for various data sources such as files, raw disks or GDB Servers.</p>
|
||||
</description>
|
||||
<launchable type="desktop-id">imhex.desktop</launchable>
|
||||
<url type="homepage">https://imhex.werwolv.net</url>
|
||||
<screenshots>
|
||||
<screenshot type="default">
|
||||
<image>https://user-images.githubusercontent.com/10835354/139717326-8044769d-527b-4d88-8adf-2d4ecafdca1f.png</image>
|
||||
</screenshot>
|
||||
</screenshots>
|
||||
<provides>
|
||||
<id>imhex.desktop</id>
|
||||
</provides>
|
||||
</component>
|
||||
34
dist/net.werwolv.imhex.metainfo.xml
vendored
Normal file
34
dist/net.werwolv.imhex.metainfo.xml
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<component type="desktop-application">
|
||||
<id>imhex</id>
|
||||
<metadata_license>CC0-1.0</metadata_license>
|
||||
<project_license>GPL-2.0</project_license>
|
||||
<name>ImHex</name>
|
||||
<developer_name>WerWolv</developer_name>
|
||||
<update_contact>hey@werwolv.net</update_contact>
|
||||
<summary>A Hex Editor for Reverse Engineers, Programmers and people who value their retinas when working at 3 AM</summary>
|
||||
<description>
|
||||
<p>ImHex is a feature-rich Hex Editor aimed towards Reverse Engineers working with foreign data formats, malware, executables and raw memory.
|
||||
Besides all the features a common Hex Editor has, ImHex also features a custom scripting language used to declare and dissect data structures, support for running YARA rules, a node-based graphical data pre-processor and support for various data sources such as files, raw disks or GDB Servers.</p>
|
||||
</description>
|
||||
<launchable type="desktop-id">imhex.desktop</launchable>
|
||||
<url type="homepage">https://imhex.werwolv.net</url>
|
||||
<screenshots>
|
||||
<screenshot type="default">
|
||||
<image>https://user-images.githubusercontent.com/10835354/139717326-8044769d-527b-4d88-8adf-2d4ecafdca1f.png</image>
|
||||
</screenshot>
|
||||
<screenshot>
|
||||
<image>https://user-images.githubusercontent.com/10835354/139717323-1f8c9d52-f7eb-4f43-9f11-097ac728ed6c.png</image>
|
||||
</screenshot>
|
||||
</screenshots>
|
||||
|
||||
<provides>
|
||||
<id>imhex.desktop</id>
|
||||
</provides>
|
||||
|
||||
<categories>
|
||||
<category>Development</category>
|
||||
</categories>
|
||||
|
||||
|
||||
</component>
|
||||
2
dist/rpm/imhex.spec
vendored
2
dist/rpm/imhex.spec
vendored
@@ -84,5 +84,7 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/imhex.desktop
|
||||
%{_datadir}/applications/imhex.desktop
|
||||
%{_prefix}/lib64/libimhex.so.%{_version}
|
||||
%{_prefix}/lib64/imhex/plugins/*
|
||||
%{_metainfodir}/net.werwolv.imhex.metainfo.xml
|
||||
%{_metainfodir}/net.werwolv.imhex.appdata.xml
|
||||
|
||||
%changelog
|
||||
|
||||
2
lib/external/imgui/include/imconfig.h
vendored
2
lib/external/imgui/include/imconfig.h
vendored
@@ -99,7 +99,7 @@
|
||||
// Your renderer backend will need to support it (most example renderer backends support both 16/32-bit indices).
|
||||
// Another way to allow large meshes while keeping 16-bit indices is to handle ImDrawCmd::VtxOffset in your renderer.
|
||||
// Read about ImGuiBackendFlags_RendererHasVtxOffset for details.
|
||||
//#define ImDrawIdx unsigned int
|
||||
#define ImDrawIdx unsigned int
|
||||
|
||||
//---- Override ImDrawCallback signature (will need to modify renderer backends accordingly)
|
||||
//struct ImDrawList;
|
||||
|
||||
2
lib/external/pattern_language
vendored
2
lib/external/pattern_language
vendored
Submodule lib/external/pattern_language updated: b4e973c310...143628ab82
@@ -136,7 +136,7 @@ namespace hex {
|
||||
|
||||
}
|
||||
|
||||
std::unique_ptr<pl::PatternLanguage> createDefaultRuntime(prv::Provider *provider);
|
||||
void configureRuntime(pl::PatternLanguage &runtime, prv::Provider *provider);
|
||||
|
||||
void addPragma(const std::string &name, const pl::api::PragmaHandler &handler);
|
||||
|
||||
|
||||
@@ -179,10 +179,10 @@ namespace hex {
|
||||
return result;
|
||||
}
|
||||
|
||||
static constexpr auto CTRL = Key(static_cast<Keys>(0x1000'0000));
|
||||
static constexpr auto ALT = Key(static_cast<Keys>(0x2000'0000));
|
||||
static constexpr auto SHIFT = Key(static_cast<Keys>(0x4000'0000));
|
||||
static constexpr auto SUPER = Key(static_cast<Keys>(0x8000'0000));
|
||||
constexpr static auto CTRL = Key(static_cast<Keys>(0x1000'0000));
|
||||
constexpr static auto ALT = Key(static_cast<Keys>(0x2000'0000));
|
||||
constexpr static auto SHIFT = Key(static_cast<Keys>(0x4000'0000));
|
||||
constexpr static auto SUPER = Key(static_cast<Keys>(0x8000'0000));
|
||||
|
||||
class ShortcutManager {
|
||||
public:
|
||||
|
||||
@@ -40,6 +40,8 @@ namespace hex {
|
||||
|
||||
void interrupt();
|
||||
|
||||
void setInterruptCallback(std::function<void()> callback);
|
||||
|
||||
private:
|
||||
void finish();
|
||||
void interruption();
|
||||
@@ -51,6 +53,7 @@ namespace hex {
|
||||
std::string m_unlocalizedName;
|
||||
u64 m_currValue, m_maxValue;
|
||||
std::thread m_thread;
|
||||
std::function<void()> m_interruptCallback;
|
||||
|
||||
bool m_shouldInterrupt = false;
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace hex {
|
||||
|
||||
class Disassembler {
|
||||
public:
|
||||
static constexpr cs_arch toCapstoneArchitecture(Architecture architecture) {
|
||||
constexpr static cs_arch toCapstoneArchitecture(Architecture architecture) {
|
||||
return static_cast<cs_arch>(architecture);
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace hex {
|
||||
Net();
|
||||
~Net();
|
||||
|
||||
static constexpr u32 DefaultTimeout = 2'000;
|
||||
constexpr static u32 DefaultTimeout = 2'000;
|
||||
|
||||
std::future<Response<std::string>> getString(const std::string &url, u32 timeout = DefaultTimeout);
|
||||
std::future<Response<nlohmann::json>> getJson(const std::string &url, u32 timeout = DefaultTimeout);
|
||||
|
||||
@@ -24,6 +24,9 @@ namespace hex::prv {
|
||||
}
|
||||
|
||||
void setEndAddress(u64 address) {
|
||||
if (address >= this->m_provider->getActualSize())
|
||||
address = this->m_provider->getActualSize() - 1;
|
||||
|
||||
this->m_endAddress = address;
|
||||
}
|
||||
|
||||
@@ -256,7 +259,7 @@ namespace hex::prv {
|
||||
private:
|
||||
void updateBuffer(u64 address, size_t size) {
|
||||
if (!this->m_bufferValid || address < this->m_bufferAddress || address + size > (this->m_bufferAddress + this->m_buffer.size())) {
|
||||
const auto remainingBytes = (this->m_endAddress - address) - 1;
|
||||
const auto remainingBytes = (this->m_endAddress - address) + 1;
|
||||
if (remainingBytes < this->m_maxBufferSize)
|
||||
this->m_buffer.resize(remainingBytes);
|
||||
else
|
||||
|
||||
@@ -14,10 +14,6 @@
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
namespace pl {
|
||||
class PatternLanguage;
|
||||
}
|
||||
|
||||
namespace hex::prv {
|
||||
|
||||
class Provider {
|
||||
@@ -70,8 +66,8 @@ namespace hex::prv {
|
||||
[[nodiscard]] virtual std::string getName() const = 0;
|
||||
[[nodiscard]] virtual std::vector<std::pair<std::string, std::string>> getDataInformation() const = 0;
|
||||
|
||||
[[nodiscard]] virtual bool open();
|
||||
virtual void close();
|
||||
[[nodiscard]] virtual bool open() = 0;
|
||||
virtual void close() = 0;
|
||||
|
||||
void addPatch(u64 offset, const void *buffer, size_t size, bool createUndo = false);
|
||||
void createUndoPoint();
|
||||
|
||||
@@ -241,29 +241,30 @@ namespace hex {
|
||||
return functionName;
|
||||
}
|
||||
|
||||
std::unique_ptr<pl::PatternLanguage> createDefaultRuntime(prv::Provider *provider) {
|
||||
auto runtime = std::make_unique<pl::PatternLanguage>();
|
||||
void configureRuntime(pl::PatternLanguage &runtime, prv::Provider *provider) {
|
||||
runtime.reset();
|
||||
|
||||
if (provider != nullptr) {
|
||||
runtime->setDataSource([provider](u64 offset, u8 *buffer, size_t size) {
|
||||
runtime.setDataSource([provider](u64 offset, u8 *buffer, size_t size) {
|
||||
provider->read(offset, buffer, size);
|
||||
}, provider->getBaseAddress(), provider->getActualSize());
|
||||
}
|
||||
|
||||
runtime->setIncludePaths(fs::getDefaultPaths(fs::ImHexPath::PatternsInclude) | fs::getDefaultPaths(fs::ImHexPath::Patterns));
|
||||
runtime.setIncludePaths(fs::getDefaultPaths(fs::ImHexPath::PatternsInclude) | fs::getDefaultPaths(fs::ImHexPath::Patterns));
|
||||
|
||||
for (const auto &func : getFunctions()) {
|
||||
if (func.dangerous)
|
||||
runtime->addDangerousFunction(func.ns, func.name, func.parameterCount, func.callback);
|
||||
runtime.addDangerousFunction(func.ns, func.name, func.parameterCount, func.callback);
|
||||
else
|
||||
runtime->addFunction(func.ns, func.name, func.parameterCount, func.callback);
|
||||
runtime.addFunction(func.ns, func.name, func.parameterCount, func.callback);
|
||||
}
|
||||
|
||||
for (const auto &[name, callback] : getPragmas()) {
|
||||
runtime->addPragma(name, callback);
|
||||
runtime.addPragma(name, callback);
|
||||
}
|
||||
|
||||
return runtime;
|
||||
runtime.addDefine("__IMHEX__");
|
||||
runtime.addDefine("__IMHEX_VERSION__", IMHEX_VERSION);
|
||||
}
|
||||
|
||||
void addPragma(const std::string &name, const pl::api::PragmaHandler &handler) {
|
||||
|
||||
@@ -208,7 +208,7 @@ namespace hex {
|
||||
|
||||
namespace ImHexApi::Provider {
|
||||
|
||||
static u32 s_currentProvider = std::numeric_limits<u32>::max();
|
||||
static i64 s_currentProvider = -1;
|
||||
static std::vector<prv::Provider *> s_providers;
|
||||
|
||||
namespace impl {
|
||||
@@ -247,7 +247,7 @@ namespace hex {
|
||||
}
|
||||
|
||||
bool isValid() {
|
||||
return !s_providers.empty() && s_currentProvider < s_providers.size();
|
||||
return !s_providers.empty() && s_currentProvider >= 0 && s_currentProvider < i64(s_providers.size());
|
||||
}
|
||||
|
||||
void markDirty() {
|
||||
@@ -308,6 +308,8 @@ namespace hex {
|
||||
setCurrentProvider(0);
|
||||
|
||||
provider->close();
|
||||
EventManager::post<EventProviderClosed>(provider);
|
||||
|
||||
delete provider;
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,9 @@ namespace hex {
|
||||
}
|
||||
|
||||
Task::~Task() {
|
||||
this->interrupt();
|
||||
if (!this->isFinished())
|
||||
this->interrupt();
|
||||
|
||||
this->m_thread.join();
|
||||
}
|
||||
|
||||
@@ -72,6 +74,13 @@ namespace hex {
|
||||
std::scoped_lock lock(this->m_mutex);
|
||||
|
||||
this->m_shouldInterrupt = true;
|
||||
|
||||
if (this->m_interruptCallback)
|
||||
this->m_interruptCallback();
|
||||
}
|
||||
|
||||
void Task::setInterruptCallback(std::function<void()> callback) {
|
||||
this->m_interruptCallback = std::move(callback);
|
||||
}
|
||||
|
||||
bool Task::isFinished() const {
|
||||
|
||||
@@ -190,15 +190,26 @@ namespace hex {
|
||||
curl_mimepart *part = curl_mime_addpart(mime);
|
||||
|
||||
auto fileName = filePath.filename().string();
|
||||
curl_mime_data_cb(
|
||||
part, file.getSize(), [](char *buffer, size_t size, size_t nitems, void *arg) -> size_t {
|
||||
curl_mime_data_cb(part, file.getSize(),
|
||||
[](char *buffer, size_t size, size_t nitems, void *arg) -> size_t {
|
||||
auto file = static_cast<FILE*>(arg);
|
||||
return fread(buffer, size, nitems, file); }, [](void *arg, curl_off_t offset, int origin) -> int {
|
||||
|
||||
return fread(buffer, size, nitems, file);
|
||||
},
|
||||
[](void *arg, curl_off_t offset, int origin) -> int {
|
||||
auto file = static_cast<FILE*>(arg);
|
||||
fseek(file, offset, origin);
|
||||
return CURL_SEEKFUNC_OK; }, [](void *arg) {
|
||||
|
||||
if (fseek(file, offset, origin) != 0)
|
||||
return CURL_SEEKFUNC_CANTSEEK;
|
||||
else
|
||||
return CURL_SEEKFUNC_OK;
|
||||
},
|
||||
[](void *arg) {
|
||||
auto file = static_cast<FILE*>(arg);
|
||||
fclose(file); }, file.getHandle());
|
||||
|
||||
fclose(file);
|
||||
},
|
||||
file.getHandle());
|
||||
curl_mime_filename(part, fileName.c_str());
|
||||
curl_mime_name(part, "file");
|
||||
|
||||
|
||||
@@ -233,7 +233,7 @@ namespace hex {
|
||||
}
|
||||
|
||||
std::string toEngineeringString(double value) {
|
||||
constexpr std::array Suffixes = { "a", "f", "p", "n", "u", "m", "", "k", "M", "G", "T", "P", "E" };
|
||||
constexpr static std::array Suffixes = { "a", "f", "p", "n", "u", "m", "", "k", "M", "G", "T", "P", "E" };
|
||||
|
||||
int8_t suffixIndex = 6;
|
||||
|
||||
@@ -339,7 +339,7 @@ namespace hex {
|
||||
auto c = [&] { return string[offset]; };
|
||||
|
||||
if (c() == '\\') {
|
||||
if ((offset + 2) >= string.length()) return {};
|
||||
if ((offset + 2) > string.length()) return {};
|
||||
|
||||
offset++;
|
||||
|
||||
|
||||
@@ -170,14 +170,6 @@ namespace hex::prv {
|
||||
return page;
|
||||
}
|
||||
|
||||
bool Provider::open() {
|
||||
EventManager::post<EventProviderOpened>(this);
|
||||
return true;
|
||||
}
|
||||
void Provider::close() {
|
||||
EventManager::post<EventProviderClosed>(this);
|
||||
}
|
||||
|
||||
void Provider::addPatch(u64 offset, const void *buffer, size_t size, bool createUndo) {
|
||||
if (this->m_patchTreeOffset > 0) {
|
||||
auto iter = this->m_patches.end();
|
||||
|
||||
@@ -52,11 +52,9 @@ int main(int argc, char **argv, char **envp) {
|
||||
|
||||
if (argc == 1)
|
||||
; // No arguments provided
|
||||
else if (argc == 2)
|
||||
EventManager::post<RequestOpenFile>(argv[1]);
|
||||
else {
|
||||
hex::log::fatal("Usage: {} [<file_name>]", argv[0]);
|
||||
return EXIT_FAILURE;
|
||||
else if (argc >= 2) {
|
||||
for (auto i = 1; i < argc; i++)
|
||||
EventManager::post<RequestOpenFile>(argv[i]);
|
||||
}
|
||||
|
||||
window.loop();
|
||||
|
||||
@@ -32,7 +32,39 @@ namespace hex {
|
||||
static float g_titleBarHeight;
|
||||
static ImGuiMouseCursor g_mouseCursorIcon;
|
||||
|
||||
static LRESULT windowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
|
||||
static LRESULT commonWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
|
||||
switch (uMsg) {
|
||||
case WM_COPYDATA:
|
||||
{
|
||||
auto message = reinterpret_cast<COPYDATASTRUCT *>(lParam);
|
||||
if (message == nullptr) break;
|
||||
|
||||
auto data = reinterpret_cast<const char8_t *>(message->lpData);
|
||||
if (data == nullptr) break;
|
||||
|
||||
std::fs::path path = data;
|
||||
log::info("Opening file in existing instance: {}", path.string());
|
||||
EventManager::post<RequestOpenFile>(path);
|
||||
break;
|
||||
}
|
||||
case WM_SETTINGCHANGE:
|
||||
{
|
||||
if (lParam == 0) break;
|
||||
|
||||
if (LPCTSTR(lParam) == std::string_view("ImmersiveColorSet")) {
|
||||
EventManager::post<EventOSThemeChanged>();
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return CallWindowProc((WNDPROC)g_oldWndProc, hwnd, uMsg, wParam, lParam);
|
||||
}
|
||||
|
||||
static LRESULT borderlessWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
|
||||
switch (uMsg) {
|
||||
case WM_NCACTIVATE:
|
||||
case WM_NCPAINT:
|
||||
@@ -106,11 +138,11 @@ namespace hex {
|
||||
return HTNOWHERE;
|
||||
}
|
||||
|
||||
constexpr auto RegionClient = 0b0000;
|
||||
constexpr auto RegionLeft = 0b0001;
|
||||
constexpr auto RegionRight = 0b0010;
|
||||
constexpr auto RegionTop = 0b0100;
|
||||
constexpr auto RegionBottom = 0b1000;
|
||||
constexpr static auto RegionClient = 0b0000;
|
||||
constexpr static auto RegionLeft = 0b0001;
|
||||
constexpr static auto RegionRight = 0b0010;
|
||||
constexpr static auto RegionTop = 0b0100;
|
||||
constexpr static auto RegionBottom = 0b1000;
|
||||
|
||||
const auto result =
|
||||
RegionLeft * (cursor.x < (window.left + border.x)) |
|
||||
@@ -146,35 +178,11 @@ namespace hex {
|
||||
}
|
||||
break;
|
||||
}
|
||||
case WM_SETTINGCHANGE:
|
||||
{
|
||||
if (lParam == 0) break;
|
||||
|
||||
if (LPCTSTR(lParam) == std::string_view("ImmersiveColorSet")) {
|
||||
EventManager::post<EventOSThemeChanged>();
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case WM_COPYDATA:
|
||||
{
|
||||
auto message = reinterpret_cast<COPYDATASTRUCT *>(lParam);
|
||||
if (message == nullptr) break;
|
||||
|
||||
auto data = reinterpret_cast<const char8_t *>(message->lpData);
|
||||
if (data == nullptr) break;
|
||||
|
||||
std::fs::path path = data;
|
||||
log::info("Opening file in existing instance: {}", path.string());
|
||||
EventManager::post<RequestOpenFile>(path);
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return CallWindowProc((WNDPROC)g_oldWndProc, hwnd, uMsg, wParam, lParam);
|
||||
return commonWindowProc(hwnd, uMsg, wParam, lParam);
|
||||
}
|
||||
|
||||
|
||||
@@ -255,7 +263,7 @@ namespace hex {
|
||||
|
||||
|
||||
if (borderlessWindowMode) {
|
||||
g_oldWndProc = ::SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR)windowProc);
|
||||
g_oldWndProc = ::SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR)borderlessWindowProc);
|
||||
|
||||
MARGINS borderless = { 1, 1, 1, 1 };
|
||||
::DwmExtendFrameIntoClientArea(hwnd, &borderless);
|
||||
@@ -265,6 +273,8 @@ namespace hex {
|
||||
|
||||
::SetWindowPos(hwnd, nullptr, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_FRAMECHANGED | SWP_NOSIZE | SWP_NOMOVE);
|
||||
::SetWindowLong(hwnd, GWL_STYLE, GetWindowLong(hwnd, GWL_STYLE) | WS_OVERLAPPEDWINDOW);
|
||||
} else {
|
||||
g_oldWndProc = ::SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR)commonWindowProc);
|
||||
}
|
||||
|
||||
// Catch heap corruption
|
||||
|
||||
@@ -129,9 +129,9 @@ namespace hex {
|
||||
glfwSetWindowTitle(this->m_window, title.c_str());
|
||||
});
|
||||
|
||||
constexpr auto CrashBackupFileName = "crash_backup.hexproj";
|
||||
constexpr static auto CrashBackupFileName = "crash_backup.hexproj";
|
||||
|
||||
EventManager::subscribe<EventAbnormalTermination>(this, [this, CrashBackupFileName](int) {
|
||||
EventManager::subscribe<EventAbnormalTermination>(this, [this](int) {
|
||||
ImGui::SaveIniSettingsToDisk(this->m_imguiSettingsPath.string().c_str());
|
||||
|
||||
if (!ImHexApi::Provider::isDirty())
|
||||
|
||||
@@ -52,9 +52,8 @@ add_library(${PROJECT_NAME} SHARED
|
||||
source/content/views/view_provider_settings.cpp
|
||||
source/content/views/view_find.cpp
|
||||
|
||||
|
||||
source/math_evaluator.cpp
|
||||
source/pattern_drawer.cpp
|
||||
source/content/helpers/math_evaluator.cpp
|
||||
source/content/helpers/pattern_drawer.cpp
|
||||
|
||||
source/lang/de_DE.cpp
|
||||
source/lang/en_US.cpp
|
||||
|
||||
@@ -98,7 +98,7 @@ namespace hex {
|
||||
};
|
||||
|
||||
static i16 comparePrecedence(const Operator &a, const Operator &b);
|
||||
static bool isLeftAssociative(const Operator op);
|
||||
static bool isLeftAssociative(const Operator &op);
|
||||
static std::pair<Operator, size_t> toOperator(const std::string &input);
|
||||
|
||||
private:
|
||||
@@ -34,12 +34,6 @@ namespace hex {
|
||||
void visit(pl::ptrn::PatternWideString& pattern) override;
|
||||
|
||||
private:
|
||||
void createDefaultEntry(const pl::ptrn::Pattern &pattern, const std::string &value, pl::core::Token::Literal &&literal) const;
|
||||
void createLeafNode(const pl::ptrn::Pattern& pattern) const;
|
||||
bool createTreeNode(const pl::ptrn::Pattern& pattern) const;
|
||||
|
||||
void makeSelectable(const pl::ptrn::Pattern &pattern) const;
|
||||
|
||||
void draw(pl::ptrn::Pattern& pattern);
|
||||
|
||||
template<ArrayPattern T>
|
||||
@@ -53,19 +47,12 @@ namespace hex {
|
||||
});
|
||||
}
|
||||
|
||||
this->drawArrayEnd(pattern, opened);
|
||||
this->drawArrayEnd(pattern, opened, pattern.isInlined());
|
||||
}
|
||||
|
||||
bool drawArrayRoot(pl::ptrn::Pattern& pattern, size_t entryCount, bool isInlined);
|
||||
void drawArrayNode(u64 idx, u64& displayEnd, pl::ptrn::Pattern& pattern);
|
||||
void drawArrayEnd(pl::ptrn::Pattern& pattern, bool opened);
|
||||
|
||||
void drawCommentTooltip(const pl::ptrn::Pattern &pattern) const;
|
||||
void drawTypenameColumn(const pl::ptrn::Pattern& pattern, const std::string& pattern_name) const;
|
||||
void drawNameColumn(const pl::ptrn::Pattern& pattern) const;
|
||||
void drawColorColumn(const pl::ptrn::Pattern& pattern) const;
|
||||
void drawOffsetColumn(const pl::ptrn::Pattern& pattern) const;
|
||||
void drawSizeColumn(const pl::ptrn::Pattern& pattern) const;
|
||||
void drawArrayEnd(pl::ptrn::Pattern& pattern, bool opened, bool inlined);
|
||||
|
||||
u64& getDisplayEnd(const pl::ptrn::Pattern& pattern);
|
||||
|
||||
@@ -15,6 +15,9 @@ namespace hex::plugin::builtin::prv {
|
||||
[[nodiscard]] bool isResizable() const override { return false; }
|
||||
[[nodiscard]] bool isSavable() const override { return false; }
|
||||
|
||||
[[nodiscard]] bool open() override { return true; }
|
||||
void close() override { }
|
||||
|
||||
void readRaw(u64 offset, void *buffer, size_t size) override { hex::unused(offset, buffer, size); }
|
||||
void writeRaw(u64 offset, const void *buffer, size_t size) override { hex::unused(offset, buffer, size); }
|
||||
[[nodiscard]] size_t getActualSize() const override { return 0x00; }
|
||||
|
||||
@@ -61,6 +61,7 @@ namespace hex::plugin::builtin {
|
||||
|
||||
struct Regex {
|
||||
std::string pattern;
|
||||
bool fullMatch = true;
|
||||
} regex;
|
||||
|
||||
struct BinaryPattern {
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include "pattern_drawer.hpp"
|
||||
|
||||
#include <hex.hpp>
|
||||
|
||||
#include <imgui.h>
|
||||
#include <hex/ui/view.hpp>
|
||||
|
||||
#include <content/helpers/pattern_drawer.hpp>
|
||||
|
||||
#include <vector>
|
||||
#include <tuple>
|
||||
#include <cstdio>
|
||||
|
||||
namespace hex::plugin::builtin {
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include <hex/helpers/utils.hpp>
|
||||
#include <hex/helpers/fmt.hpp>
|
||||
|
||||
#include "math_evaluator.hpp"
|
||||
#include <content/helpers/math_evaluator.hpp>
|
||||
|
||||
namespace hex::plugin::builtin {
|
||||
|
||||
|
||||
@@ -1,34 +1,42 @@
|
||||
#include <hex/api/content_registry.hpp>
|
||||
|
||||
#include <hex/providers/provider.hpp>
|
||||
#include <hex/providers/buffered_reader.hpp>
|
||||
#include <hex/helpers/fmt.hpp>
|
||||
#include <hex/helpers/crypto.hpp>
|
||||
|
||||
namespace hex::plugin::builtin {
|
||||
|
||||
static std::string formatLanguageArray(prv::Provider *provider, u64 offset, size_t size, const std::string &start, const std::string &byteFormat, const std::string &end) {
|
||||
constexpr auto NewLineIndent = "\n ";
|
||||
constexpr static auto NewLineIndent = "\n ";
|
||||
constexpr static auto LineLength = 16;
|
||||
|
||||
std::string result = start;
|
||||
std::string result;
|
||||
result.reserve(start.size() + hex::format(byteFormat, 0x00).size() * size + + std::string(NewLineIndent).size() / LineLength + end.size());
|
||||
|
||||
std::vector<u8> buffer(0x1'0000, 0x00);
|
||||
for (u64 i = 0; i < size; i += buffer.size()) {
|
||||
size_t readSize = std::min<u64>(buffer.size(), size - i);
|
||||
provider->read(offset, buffer.data(), readSize);
|
||||
result += start;
|
||||
|
||||
for (u32 j = 0; j < readSize; j++) {
|
||||
if (j % 0x10 == 0)
|
||||
result += NewLineIndent;
|
||||
auto reader = prv::BufferedReader(provider);
|
||||
reader.seek(offset);
|
||||
reader.setEndAddress(offset + size - 1);
|
||||
|
||||
result += hex::format(byteFormat, buffer[j]);
|
||||
}
|
||||
u64 index = 0x00;
|
||||
for (u8 byte : reader) {
|
||||
if ((index % LineLength) == 0x00)
|
||||
result += NewLineIndent;
|
||||
|
||||
// Remove trailing comma
|
||||
result += hex::format(byteFormat, byte);
|
||||
|
||||
index++;
|
||||
}
|
||||
|
||||
// Remove trailing comma
|
||||
if (provider->getActualSize() > 0) {
|
||||
result.pop_back();
|
||||
result.pop_back();
|
||||
}
|
||||
|
||||
result += "\n";
|
||||
result += end;
|
||||
result += "\n" + end;
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -63,45 +71,78 @@ namespace hex::plugin::builtin {
|
||||
return formatLanguageArray(provider, offset, size, "const data = new Uint8Array([", "0x{0:02X}, ", "]);");
|
||||
});
|
||||
|
||||
ContentRegistry::DataFormatter::add("hex.builtin.view.hex_editor.copy.lua", [](prv::Provider *provider, u64 offset, size_t size) {
|
||||
return formatLanguageArray(provider, offset, size, "data = {", "0x{0:02X}, ", "}");
|
||||
});
|
||||
|
||||
ContentRegistry::DataFormatter::add("hex.builtin.view.hex_editor.copy.go", [](prv::Provider *provider, u64 offset, size_t size) {
|
||||
return formatLanguageArray(provider, offset, size, "data := [...]byte {", "0x{0:02X}, ", "}");
|
||||
});
|
||||
|
||||
ContentRegistry::DataFormatter::add("hex.builtin.view.hex_editor.copy.crystal", [](prv::Provider *provider, u64 offset, size_t size) {
|
||||
return formatLanguageArray(provider, offset, size, "data = [", "0x{0:02X}, ", "] of UInt8");
|
||||
});
|
||||
|
||||
ContentRegistry::DataFormatter::add("hex.builtin.view.hex_editor.copy.swift", [](prv::Provider *provider, u64 offset, size_t size) {
|
||||
return formatLanguageArray(provider, offset, size, "let data: [Uint8] = [", "0x{0:02X}, ", "]");
|
||||
});
|
||||
|
||||
ContentRegistry::DataFormatter::add("hex.builtin.view.hex_editor.copy.pascal", [](prv::Provider *provider, u64 offset, size_t size) {
|
||||
return formatLanguageArray(provider, offset, size, hex::format("data: array[0..{0}] of Byte = (", size - 1), "${0:02X}, ", ")");
|
||||
});
|
||||
|
||||
ContentRegistry::DataFormatter::add("hex.builtin.view.hex_editor.copy.base64", [](prv::Provider *provider, u64 offset, size_t size) {
|
||||
std::vector<u8> data(size, 0x00);
|
||||
provider->read(offset, data.data(), size);
|
||||
|
||||
auto result = crypt::encode64(data);
|
||||
|
||||
return std::string(result.begin(), result.end());
|
||||
});
|
||||
|
||||
ContentRegistry::DataFormatter::add("hex.builtin.view.hex_editor.copy.ascii", [](prv::Provider *provider, u64 offset, size_t size) {
|
||||
std::string result = "Hex View 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F\n\n";
|
||||
constexpr static auto HeaderLine = "Hex View 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F\n";
|
||||
std::string result;
|
||||
result.reserve(std::string(HeaderLine).size() * size / 0x10);
|
||||
|
||||
std::vector<u8> buffer(0x1'0000, 0x00);
|
||||
for (u64 byte = 0; byte < size; byte += buffer.size()) {
|
||||
size_t readSize = std::min<u64>(buffer.size(), size - byte);
|
||||
provider->read(offset, buffer.data(), readSize);
|
||||
result += HeaderLine;
|
||||
|
||||
const auto end = (offset + readSize) - 1;
|
||||
auto reader = prv::BufferedReader(provider);
|
||||
reader.seek(offset);
|
||||
reader.setEndAddress((offset + size) - 1);
|
||||
|
||||
for (u32 col = offset >> 4; col <= (end >> 4); col++) {
|
||||
result += hex::format("{0:08X} ", col << 4);
|
||||
for (u64 i = 0; i < 16; i++) {
|
||||
u64 address = offset & ~u64(0x0F);
|
||||
std::string asciiRow;
|
||||
for (u8 byte : reader) {
|
||||
if ((address % 0x10) == 0) {
|
||||
result += hex::format(" {}", asciiRow);
|
||||
result += hex::format("\n{0:08X} ", address);
|
||||
|
||||
if ((col == (offset >> 4) && i < (offset & 0xF)) || (col == (end >> 4) && i > (end & 0xF)))
|
||||
asciiRow.clear();
|
||||
|
||||
if (address == (offset & ~u64(0x0F))) {
|
||||
for (u64 i = 0; i < (offset - address); i++) {
|
||||
result += " ";
|
||||
else
|
||||
result += hex::format("{0:02X} ", buffer[((col << 4) - offset) + i]);
|
||||
|
||||
if ((i & 0xF) == 0x7)
|
||||
result += " ";
|
||||
asciiRow += " ";
|
||||
}
|
||||
address = offset;
|
||||
}
|
||||
}
|
||||
|
||||
result += hex::format("{0:02X} ", byte);
|
||||
asciiRow += std::isprint(byte) ? char(byte) : '.';
|
||||
if ((address % 0x10) == 0x07)
|
||||
result += " ";
|
||||
|
||||
for (u64 i = 0; i < 16; i++) {
|
||||
|
||||
if ((col == (offset >> 4) && i < (offset & 0xF)) || (col == (end >> 4) && i > (end & 0xF)))
|
||||
result += " ";
|
||||
else {
|
||||
u8 c = buffer[((col << 4) - offset) + i];
|
||||
char displayChar = (c < 32 || c >= 128) ? '.' : c;
|
||||
result += hex::format("{0}", displayChar);
|
||||
}
|
||||
}
|
||||
|
||||
result += "\n";
|
||||
}
|
||||
address++;
|
||||
}
|
||||
|
||||
if ((address % 0x10) != 0x00)
|
||||
for (u32 i = 0; i < (0x10 - (address % 0x10)); i++)
|
||||
result += " ";
|
||||
|
||||
result += hex::format(" {}", asciiRow);
|
||||
|
||||
return result;
|
||||
});
|
||||
|
||||
@@ -115,48 +156,46 @@ namespace hex::plugin::builtin {
|
||||
" .textcolumn { color:#000000 }\n"
|
||||
" </style>\n\n"
|
||||
" <code>\n"
|
||||
" <span class=\"offsetheader\">Hex View  00 01 02 03 04 05 06 07  08 09 0A 0B 0C 0D 0E 0F</span><br>\n";
|
||||
" <span class=\"offsetheader\">Hex View  00 01 02 03 04 05 06 07  08 09 0A 0B 0C 0D 0E 0F</span>";
|
||||
|
||||
auto reader = prv::BufferedReader(provider);
|
||||
reader.seek(offset);
|
||||
reader.setEndAddress((offset + size) - 1);
|
||||
|
||||
std::vector<u8> buffer(0x1'0000, 0x00);
|
||||
for (u64 byte = 0; byte < size; byte += buffer.size()) {
|
||||
size_t readSize = std::min<u64>(buffer.size(), size - byte);
|
||||
provider->read(offset, buffer.data(), readSize);
|
||||
u64 address = offset & ~u64(0x0F);
|
||||
std::string asciiRow;
|
||||
for (u8 byte : reader) {
|
||||
if ((address % 0x10) == 0) {
|
||||
result += hex::format(" {}", asciiRow);
|
||||
result += hex::format("<br>\n <span class=\"offsetcolumn\">{0:08X}</span>  <span class=\"hexcolumn\">", address);
|
||||
|
||||
const auto end = (offset + readSize) - 1;
|
||||
asciiRow.clear();
|
||||
|
||||
for (u32 col = offset >> 4; col <= (end >> 4); col++) {
|
||||
result += hex::format(" <span class=\"offsetcolumn\">{0:08X}</span>  <span class=\"hexcolumn\">", col << 4);
|
||||
for (u64 i = 0; i < 16; i++) {
|
||||
|
||||
if ((col == (offset >> 4) && i < (offset & 0xF)) || (col == (end >> 4) && i > (end & 0xF)))
|
||||
result += "   ";
|
||||
else
|
||||
result += hex::format("{0:02X} ", buffer[((col << 4) - offset) + i]);
|
||||
|
||||
if ((i & 0xF) == 0x7)
|
||||
result += " ";
|
||||
}
|
||||
|
||||
result += "</span>  <span class=\"textcolumn\">";
|
||||
|
||||
for (u64 i = 0; i < 16; i++) {
|
||||
|
||||
if ((col == (offset >> 4) && i < (offset & 0xF)) || (col == (end >> 4) && i > (end & 0xF)))
|
||||
result += " ";
|
||||
else {
|
||||
u8 c = buffer[((col << 4) - offset) + i];
|
||||
char displayChar = (c < 32 || c >= 128) ? '.' : c;
|
||||
result += hex::format("{0}", displayChar);
|
||||
if (address == (offset & ~u64(0x0F))) {
|
||||
for (u64 i = 0; i < (offset - address); i++) {
|
||||
result += "   ";
|
||||
asciiRow += " ";
|
||||
}
|
||||
address = offset;
|
||||
}
|
||||
|
||||
result += "</span><br>\n";
|
||||
result += "</span>";
|
||||
}
|
||||
|
||||
result += hex::format("{0:02X} ", byte);
|
||||
asciiRow += std::isprint(byte) ? char(byte) : '.';
|
||||
if ((address % 0x10) == 0x07)
|
||||
result += " ";
|
||||
|
||||
address++;
|
||||
}
|
||||
|
||||
for (u32 i = 0; i < (0x10 - (address % 0x10)); i++)
|
||||
result += "   ";
|
||||
result += asciiRow;
|
||||
|
||||
result +=
|
||||
" </code>\n"
|
||||
"\n </code>\n"
|
||||
"</div>\n";
|
||||
|
||||
return result;
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace hex::plugin::builtin {
|
||||
NodeBuffer() : Node("hex.builtin.nodes.constants.buffer.header", { dp::Attribute(dp::Attribute::IOType::Out, dp::Attribute::Type::Buffer, "") }) { }
|
||||
|
||||
void drawNode() override {
|
||||
constexpr int StepSize = 1, FastStepSize = 10;
|
||||
constexpr static int StepSize = 1, FastStepSize = 10;
|
||||
|
||||
ImGui::PushItemWidth(100);
|
||||
ImGui::InputScalar("hex.builtin.nodes.constants.buffer.size"_lang, ImGuiDataType_U32, &this->m_size, &StepSize, &FastStepSize);
|
||||
|
||||
@@ -21,7 +21,8 @@ namespace hex::plugin::builtin {
|
||||
auto provider = ImHexApi::Provider::createProvider("hex.builtin.provider.file", true);
|
||||
if (auto *fileProvider = dynamic_cast<prv::FileProvider*>(provider); fileProvider != nullptr) {
|
||||
fileProvider->setPath(path);
|
||||
(void)fileProvider->open();
|
||||
if (fileProvider->open())
|
||||
EventManager::post<EventProviderOpened>(fileProvider);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,6 +101,8 @@ namespace hex::plugin::builtin {
|
||||
TaskManager::doLater([provider] { ImHexApi::Provider::remove(provider); });
|
||||
return;
|
||||
}
|
||||
|
||||
EventManager::post<EventProviderOpened>(provider);
|
||||
}
|
||||
else if (provider->hasLoadInterface())
|
||||
EventManager::post<RequestOpenPopup>(View::toWindowName("hex.builtin.view.provider_settings.load_popup"));
|
||||
@@ -107,7 +110,10 @@ namespace hex::plugin::builtin {
|
||||
if (!provider->open() || !provider->isAvailable()) {
|
||||
View::showErrorPopup("hex.builtin.popup.error.open"_lang);
|
||||
TaskManager::doLater([provider] { ImHexApi::Provider::remove(provider); });
|
||||
return;
|
||||
}
|
||||
|
||||
EventManager::post<EventProviderOpened>(provider);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "math_evaluator.hpp"
|
||||
#include <content/helpers/math_evaluator.hpp>
|
||||
|
||||
#include <hex/helpers/utils.hpp>
|
||||
#include <hex/helpers/concepts.hpp>
|
||||
@@ -6,7 +6,6 @@
|
||||
#include <string>
|
||||
#include <queue>
|
||||
#include <stack>
|
||||
#include <stdexcept>
|
||||
#include <cmath>
|
||||
#include <cstdint>
|
||||
#include <optional>
|
||||
@@ -19,7 +18,7 @@ namespace hex {
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
bool MathEvaluator<T>::isLeftAssociative(const Operator op) {
|
||||
bool MathEvaluator<T>::isLeftAssociative(const Operator &op) {
|
||||
return (static_cast<u32>(op) & 0xF00) == 0;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pattern_drawer.hpp"
|
||||
#include <content/helpers/pattern_drawer.hpp>
|
||||
|
||||
#include <pl/patterns/pattern_array_dynamic.hpp>
|
||||
#include <pl/patterns/pattern_array_static.hpp>
|
||||
@@ -25,15 +25,100 @@
|
||||
#include <imgui.h>
|
||||
#include <hex/ui/imgui_imhex_extensions.h>
|
||||
|
||||
namespace {
|
||||
constexpr static auto DisplayEndDefault = 50u;
|
||||
constexpr static auto DisplayEndStep = 50u;
|
||||
|
||||
using namespace ::std::literals::string_literals;
|
||||
};
|
||||
|
||||
namespace hex {
|
||||
|
||||
namespace {
|
||||
|
||||
constexpr auto DisplayEndDefault = 50U;
|
||||
constexpr auto DisplayEndStep = 50U;
|
||||
|
||||
using namespace ::std::literals::string_literals;
|
||||
|
||||
void createLeafNode(const pl::ptrn::Pattern& pattern) {
|
||||
ImGui::TreeNodeEx(pattern.getDisplayName().c_str(), ImGuiTreeNodeFlags_Leaf |
|
||||
ImGuiTreeNodeFlags_NoTreePushOnOpen |
|
||||
ImGuiTreeNodeFlags_SpanFullWidth |
|
||||
ImGuiTreeNodeFlags_AllowItemOverlap);
|
||||
}
|
||||
|
||||
bool createTreeNode(const pl::ptrn::Pattern& pattern) {
|
||||
if (pattern.isSealed()) {
|
||||
ImGui::Indent();
|
||||
ImGui::TextUnformatted(pattern.getDisplayName().c_str());
|
||||
ImGui::Unindent();
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return ImGui::TreeNodeEx(pattern.getDisplayName().c_str(), ImGuiTreeNodeFlags_SpanFullWidth);
|
||||
}
|
||||
|
||||
void drawTypenameColumn(const pl::ptrn::Pattern& pattern, const std::string& pattern_name) {
|
||||
ImGui::TextFormattedColored(ImColor(0xFFD69C56), pattern_name);
|
||||
ImGui::SameLine();
|
||||
ImGui::TextUnformatted(pattern.getTypeName().c_str());
|
||||
ImGui::TableNextColumn();
|
||||
}
|
||||
|
||||
void drawNameColumn(const pl::ptrn::Pattern& pattern) {
|
||||
ImGui::TextUnformatted(pattern.getDisplayName().c_str());
|
||||
ImGui::TableNextColumn();
|
||||
}
|
||||
|
||||
void drawColorColumn(const pl::ptrn::Pattern& pattern) {
|
||||
ImGui::ColorButton("color", ImColor(pattern.getColor()), ImGuiColorEditFlags_NoTooltip, ImVec2(ImGui::GetColumnWidth(), ImGui::GetTextLineHeight()));
|
||||
ImGui::TableNextColumn();
|
||||
}
|
||||
|
||||
void drawOffsetColumn(const pl::ptrn::Pattern& pattern) {
|
||||
ImGui::TextFormatted("0x{0:08X} : 0x{1:08X}", pattern.getOffset(), pattern.getOffset() + pattern.getSize() - (pattern.getSize() == 0 ? 0 : 1));
|
||||
ImGui::TableNextColumn();
|
||||
}
|
||||
|
||||
void drawSizeColumn(const pl::ptrn::Pattern& pattern) {
|
||||
ImGui::TextFormatted("0x{0:04X}", pattern.getSize());
|
||||
ImGui::TableNextColumn();
|
||||
}
|
||||
|
||||
void drawCommentTooltip(const pl::ptrn::Pattern &pattern) {
|
||||
if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByActiveItem) && pattern.getComment() != nullptr) {
|
||||
ImGui::BeginTooltip();
|
||||
ImGui::TextUnformatted(pattern.getComment()->c_str());
|
||||
ImGui::EndTooltip();
|
||||
}
|
||||
}
|
||||
|
||||
void makeSelectable(const pl::ptrn::Pattern &pattern) {
|
||||
ImGui::PushID(static_cast<int>(pattern.getOffset()));
|
||||
ImGui::PushID(pattern.getVariableName().c_str());
|
||||
|
||||
if (ImGui::Selectable("##PatternLine", false, ImGuiSelectableFlags_SpanAllColumns | ImGuiSelectableFlags_AllowItemOverlap)) {
|
||||
ImHexApi::HexEditor::setSelection(pattern.getOffset(), pattern.getSize());
|
||||
}
|
||||
|
||||
ImGui::SameLine(0, 0);
|
||||
|
||||
ImGui::PopID();
|
||||
ImGui::PopID();
|
||||
}
|
||||
|
||||
void createDefaultEntry(pl::ptrn::Pattern &pattern) {
|
||||
ImGui::TableNextRow();
|
||||
createLeafNode(pattern);
|
||||
ImGui::TableNextColumn();
|
||||
makeSelectable(pattern);
|
||||
drawCommentTooltip(pattern);
|
||||
ImGui::SameLine();
|
||||
drawNameColumn(pattern);
|
||||
drawColorColumn(pattern);
|
||||
drawOffsetColumn(pattern);
|
||||
drawSizeColumn(pattern);
|
||||
ImGui::TextFormattedColored(ImColor(0xFF9BC64D), "{}", pattern.getFormattedName().empty() ? pattern.getTypeName() : pattern.getFormattedName());
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::TextFormatted("{}", pattern.getFormattedValue());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void PatternDrawer::visit(pl::ptrn::PatternArrayDynamic& pattern) {
|
||||
this->drawArray(pattern);
|
||||
}
|
||||
@@ -81,15 +166,12 @@ namespace hex {
|
||||
ImGui::TableNextColumn();
|
||||
makeSelectable(pattern);
|
||||
drawCommentTooltip(pattern);
|
||||
ImGui::TableNextColumn();
|
||||
drawColorColumn(pattern);
|
||||
drawOffsetColumn(pattern);
|
||||
drawSizeColumn(pattern);
|
||||
drawTypenameColumn(pattern, "bitfield");
|
||||
|
||||
ImGui::TextFormatted("{}", pattern.getFormattedValue());
|
||||
} else {
|
||||
ImGui::SameLine();
|
||||
ImGui::TreeNodeEx("", ImGuiTreeNodeFlags_SpanFullWidth | ImGuiTreeNodeFlags_Leaf);
|
||||
}
|
||||
|
||||
if (open) {
|
||||
@@ -97,16 +179,17 @@ namespace hex {
|
||||
this->draw(field);
|
||||
});
|
||||
|
||||
ImGui::TreePop();
|
||||
if (!pattern.isInlined())
|
||||
ImGui::TreePop();
|
||||
}
|
||||
}
|
||||
|
||||
void PatternDrawer::visit(pl::ptrn::PatternBoolean& pattern) {
|
||||
this->createDefaultEntry(pattern, pattern.getFormattedValue(), bool(hex::get_or<u128>(pattern.getValue(), 0x00)));
|
||||
createDefaultEntry(pattern);
|
||||
}
|
||||
|
||||
void PatternDrawer::visit(pl::ptrn::PatternCharacter& pattern) {
|
||||
this->createDefaultEntry(pattern, pattern.getFormattedValue(), pattern.getValue());
|
||||
createDefaultEntry(pattern);
|
||||
}
|
||||
|
||||
void PatternDrawer::visit(pl::ptrn::PatternEnum& pattern) {
|
||||
@@ -125,11 +208,7 @@ namespace hex {
|
||||
}
|
||||
|
||||
void PatternDrawer::visit(pl::ptrn::PatternFloat& pattern) {
|
||||
if (pattern.getSize() == 4) {
|
||||
this->createDefaultEntry(pattern, pattern.getFormattedValue(), pattern.getValue());
|
||||
} else if (pattern.getSize() == 8) {
|
||||
this->createDefaultEntry(pattern, pattern.getFormattedValue(), pattern.getValue());
|
||||
}
|
||||
createDefaultEntry(pattern);
|
||||
}
|
||||
|
||||
void PatternDrawer::visit(pl::ptrn::PatternPadding& pattern) {
|
||||
@@ -147,32 +226,29 @@ namespace hex {
|
||||
ImGui::TableNextColumn();
|
||||
makeSelectable(pattern);
|
||||
drawCommentTooltip(pattern);
|
||||
ImGui::SameLine(0, 0);
|
||||
drawColorColumn(pattern);
|
||||
drawOffsetColumn(pattern);
|
||||
drawSizeColumn(pattern);
|
||||
ImGui::TextFormattedColored(ImColor(0xFF9BC64D), "{}", pattern.getFormattedName());
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::TextFormatted("{}", pattern.getFormattedValue());
|
||||
} else {
|
||||
ImGui::SameLine();
|
||||
ImGui::TreeNodeEx("", ImGuiTreeNodeFlags_SpanFullWidth | ImGuiTreeNodeFlags_Leaf);
|
||||
}
|
||||
|
||||
if (open) {
|
||||
pattern.getPointedAtPattern()->accept(*this);
|
||||
|
||||
ImGui::TreePop();
|
||||
if (!pattern.isInlined())
|
||||
ImGui::TreePop();
|
||||
}
|
||||
}
|
||||
|
||||
void PatternDrawer::visit(pl::ptrn::PatternSigned& pattern) {
|
||||
this->createDefaultEntry(pattern, pattern.getFormattedValue(), pattern.getValue());
|
||||
createDefaultEntry(pattern);
|
||||
}
|
||||
|
||||
void PatternDrawer::visit(pl::ptrn::PatternString& pattern) {
|
||||
if (pattern.getSize() > 0)
|
||||
this->createDefaultEntry(pattern, pattern.getFormattedValue(), pattern.getValue());
|
||||
createDefaultEntry(pattern);
|
||||
}
|
||||
|
||||
void PatternDrawer::visit(pl::ptrn::PatternStruct& pattern) {
|
||||
@@ -185,14 +261,14 @@ namespace hex {
|
||||
ImGui::TableNextColumn();
|
||||
makeSelectable(pattern);
|
||||
drawCommentTooltip(pattern);
|
||||
ImGui::TableNextColumn();
|
||||
if (pattern.isSealed())
|
||||
drawColorColumn(pattern);
|
||||
else
|
||||
ImGui::TableNextColumn();
|
||||
drawOffsetColumn(pattern);
|
||||
drawSizeColumn(pattern);
|
||||
drawTypenameColumn(pattern, "struct");
|
||||
ImGui::TextFormatted("{}", pattern.getFormattedValue());
|
||||
} else {
|
||||
ImGui::SameLine();
|
||||
ImGui::TreeNodeEx("", ImGuiTreeNodeFlags_SpanFullWidth | ImGuiTreeNodeFlags_Leaf);
|
||||
}
|
||||
|
||||
if (open) {
|
||||
@@ -200,7 +276,8 @@ namespace hex {
|
||||
this->draw(member);
|
||||
});
|
||||
|
||||
ImGui::TreePop();
|
||||
if (!pattern.isInlined())
|
||||
ImGui::TreePop();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -214,14 +291,14 @@ namespace hex {
|
||||
ImGui::TableNextColumn();
|
||||
makeSelectable(pattern);
|
||||
drawCommentTooltip(pattern);
|
||||
ImGui::TableNextColumn();
|
||||
if (pattern.isSealed())
|
||||
drawColorColumn(pattern);
|
||||
else
|
||||
ImGui::TableNextColumn();
|
||||
drawOffsetColumn(pattern);
|
||||
drawSizeColumn(pattern);
|
||||
drawTypenameColumn(pattern, "union");
|
||||
ImGui::TextFormatted("{}", pattern.getFormattedValue());
|
||||
} else {
|
||||
ImGui::SameLine();
|
||||
ImGui::TreeNodeEx("", ImGuiTreeNodeFlags_SpanFullWidth | ImGuiTreeNodeFlags_Leaf);
|
||||
}
|
||||
|
||||
if (open) {
|
||||
@@ -229,59 +306,22 @@ namespace hex {
|
||||
this->draw(member);
|
||||
});
|
||||
|
||||
ImGui::TreePop();
|
||||
if (!pattern.isInlined())
|
||||
ImGui::TreePop();
|
||||
}
|
||||
}
|
||||
|
||||
void PatternDrawer::visit(pl::ptrn::PatternUnsigned& pattern) {
|
||||
this->createDefaultEntry(pattern, pattern.getFormattedValue(), pattern.getValue());
|
||||
createDefaultEntry(pattern);
|
||||
}
|
||||
|
||||
void PatternDrawer::visit(pl::ptrn::PatternWideCharacter& pattern) {
|
||||
this->createDefaultEntry(pattern, pattern.getFormattedValue(), pattern.getValue());
|
||||
createDefaultEntry(pattern);
|
||||
}
|
||||
|
||||
void PatternDrawer::visit(pl::ptrn::PatternWideString& pattern) {
|
||||
if (pattern.getSize() > 0)
|
||||
this->createDefaultEntry(pattern, pattern.getFormattedValue(), pattern.getValue());
|
||||
}
|
||||
|
||||
void PatternDrawer::createDefaultEntry(const pl::ptrn::Pattern &pattern, const std::string &value, pl::core::Token::Literal &&literal) const {
|
||||
ImGui::TableNextRow();
|
||||
createLeafNode(pattern);
|
||||
ImGui::TableNextColumn();
|
||||
|
||||
makeSelectable(pattern);
|
||||
|
||||
drawCommentTooltip(pattern);
|
||||
ImGui::SameLine();
|
||||
drawNameColumn(pattern);
|
||||
drawColorColumn(pattern);
|
||||
drawOffsetColumn(pattern);
|
||||
drawSizeColumn(pattern);
|
||||
ImGui::TextFormattedColored(ImColor(0xFF9BC64D), "{}", pattern.getFormattedName().empty() ? pattern.getTypeName() : pattern.getFormattedName());
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::TextFormatted("{}", pattern.formatDisplayValue(value, literal));
|
||||
}
|
||||
|
||||
void PatternDrawer::makeSelectable(const pl::ptrn::Pattern &pattern) const {
|
||||
ImGui::PushID(static_cast<int>(pattern.getOffset()));
|
||||
ImGui::PushID(pattern.getVariableName().c_str());
|
||||
if (ImGui::Selectable("##PatternLine", false, ImGuiSelectableFlags_SpanAllColumns | ImGuiSelectableFlags_AllowItemOverlap)) {
|
||||
ImHexApi::HexEditor::setSelection(pattern.getOffset(), pattern.getSize());
|
||||
}
|
||||
ImGui::SameLine();
|
||||
ImGui::PopID();
|
||||
ImGui::PopID();
|
||||
}
|
||||
|
||||
|
||||
void PatternDrawer::drawCommentTooltip(const pl::ptrn::Pattern &pattern) const {
|
||||
if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByActiveItem) && pattern.getComment() != nullptr) {
|
||||
ImGui::BeginTooltip();
|
||||
ImGui::TextUnformatted(pattern.getComment()->c_str());
|
||||
ImGui::EndTooltip();
|
||||
}
|
||||
createDefaultEntry(pattern);
|
||||
}
|
||||
|
||||
void PatternDrawer::draw(pl::ptrn::Pattern& pattern) {
|
||||
@@ -303,7 +343,10 @@ namespace hex {
|
||||
ImGui::TableNextColumn();
|
||||
makeSelectable(pattern);
|
||||
drawCommentTooltip(pattern);
|
||||
ImGui::TableNextColumn();
|
||||
if (pattern.isSealed())
|
||||
drawColorColumn(pattern);
|
||||
else
|
||||
ImGui::TableNextColumn();
|
||||
drawOffsetColumn(pattern);
|
||||
drawSizeColumn(pattern);
|
||||
ImGui::TextFormattedColored(ImColor(0xFF9BC64D), "{0}", pattern.getTypeName());
|
||||
@@ -317,9 +360,6 @@ namespace hex {
|
||||
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::TextFormatted("{}", pattern.getFormattedValue());
|
||||
} else {
|
||||
ImGui::SameLine();
|
||||
ImGui::TreeNodeEx("", ImGuiTreeNodeFlags_SpanFullWidth | ImGuiTreeNodeFlags_Leaf);
|
||||
}
|
||||
|
||||
return open;
|
||||
@@ -328,7 +368,7 @@ namespace hex {
|
||||
void PatternDrawer::drawArrayNode(u64 idx, u64& displayEnd, pl::ptrn::Pattern& pattern) {
|
||||
u64 lastVisible = displayEnd - 1;
|
||||
|
||||
ImGui::PushID(pattern.getOffset());
|
||||
ImGui::PushID(reinterpret_cast<void*>(pattern.getOffset()));
|
||||
|
||||
if (idx < lastVisible) {
|
||||
this->draw(pattern);
|
||||
@@ -344,65 +384,23 @@ namespace hex {
|
||||
ImGui::PopID();
|
||||
}
|
||||
|
||||
void PatternDrawer::drawArrayEnd(pl::ptrn::Pattern& pattern, bool opened) {
|
||||
void PatternDrawer::drawArrayEnd(pl::ptrn::Pattern& pattern, bool opened, bool inlined) {
|
||||
if (opened) {
|
||||
ImGui::TreePop();
|
||||
if (!inlined)
|
||||
ImGui::TreePop();
|
||||
} else {
|
||||
auto& displayEnd = this->getDisplayEnd(pattern);
|
||||
displayEnd = DisplayEndDefault;
|
||||
}
|
||||
}
|
||||
|
||||
void PatternDrawer::createLeafNode(const pl::ptrn::Pattern& pattern) const {
|
||||
ImGui::TreeNodeEx(pattern.getDisplayName().c_str(), ImGuiTreeNodeFlags_Leaf |
|
||||
ImGuiTreeNodeFlags_NoTreePushOnOpen |
|
||||
ImGuiTreeNodeFlags_SpanFullWidth |
|
||||
ImGuiTreeNodeFlags_AllowItemOverlap);
|
||||
}
|
||||
|
||||
bool PatternDrawer::createTreeNode(const pl::ptrn::Pattern& pattern) const {
|
||||
if (pattern.isSealed()) {
|
||||
ImGui::Selectable(pattern.getDisplayName().c_str(), false, ImGuiSelectableFlags_SpanAllColumns | ImGuiSelectableFlags_AllowItemOverlap);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return ImGui::TreeNodeEx(pattern.getDisplayName().c_str(), ImGuiTreeNodeFlags_SpanFullWidth);
|
||||
}
|
||||
|
||||
void PatternDrawer::drawTypenameColumn(const pl::ptrn::Pattern& pattern, const std::string& pattern_name) const {
|
||||
ImGui::TextFormattedColored(ImColor(0xFFD69C56), pattern_name);
|
||||
ImGui::SameLine();
|
||||
ImGui::TextUnformatted(pattern.getTypeName().c_str());
|
||||
ImGui::TableNextColumn();
|
||||
}
|
||||
|
||||
void PatternDrawer::drawNameColumn(const pl::ptrn::Pattern& pattern) const {
|
||||
ImGui::TextUnformatted(pattern.getDisplayName().c_str());
|
||||
ImGui::TableNextColumn();
|
||||
}
|
||||
|
||||
void PatternDrawer::drawColorColumn(const pl::ptrn::Pattern& pattern) const {
|
||||
ImGui::ColorButton("color", ImColor(pattern.getColor()), ImGuiColorEditFlags_NoTooltip, ImVec2(ImGui::GetColumnWidth(), ImGui::GetTextLineHeight()));
|
||||
ImGui::TableNextColumn();
|
||||
}
|
||||
|
||||
void PatternDrawer::drawOffsetColumn(const pl::ptrn::Pattern& pattern) const {
|
||||
ImGui::TextFormatted("0x{0:08X} : 0x{1:08X}", pattern.getOffset(), pattern.getOffset() + pattern.getSize() - (pattern.getSize() == 0 ? 0 : 1));
|
||||
ImGui::TableNextColumn();
|
||||
}
|
||||
|
||||
void PatternDrawer::drawSizeColumn(const pl::ptrn::Pattern& pattern) const {
|
||||
ImGui::TextFormatted("0x{0:04X}", pattern.getSize());
|
||||
ImGui::TableNextColumn();
|
||||
}
|
||||
|
||||
u64& PatternDrawer::getDisplayEnd(const pl::ptrn::Pattern& pattern) {
|
||||
auto it = m_displayEnd.find(&pattern);
|
||||
if (it != m_displayEnd.end()) {
|
||||
auto it = this->m_displayEnd.find(&pattern);
|
||||
if (it != this->m_displayEnd.end()) {
|
||||
return it->second;
|
||||
}
|
||||
|
||||
auto [inserted, success] = m_displayEnd.emplace(&pattern, DisplayEndDefault);
|
||||
return inserted->second;
|
||||
auto [value, success] = this->m_displayEnd.emplace(&pattern, DisplayEndDefault);
|
||||
return value->second;
|
||||
}
|
||||
};
|
||||
@@ -13,10 +13,23 @@ namespace hex::plugin::builtin {
|
||||
using namespace pl::core;
|
||||
using FunctionParameterCount = pl::api::FunctionParameterCount;
|
||||
|
||||
pl::api::Namespace nsStdHttp = { "builtin", "std", "http" };
|
||||
pl::api::Namespace nsHexCore = { "builtin", "hex", "core" };
|
||||
{
|
||||
/* get_selection() */
|
||||
ContentRegistry::PatternLanguage::addDangerousFunction(nsHexCore, "get_selection", FunctionParameterCount::none(), [](Evaluator *, auto) -> std::optional<Token::Literal> {
|
||||
if (!ImHexApi::HexEditor::isSelectionValid())
|
||||
return std::numeric_limits<u128>::max();
|
||||
|
||||
auto selection = ImHexApi::HexEditor::getSelection();
|
||||
|
||||
return u128(u128(selection->getStartAddress()) << 64 | u128(selection->getSize()));
|
||||
});
|
||||
}
|
||||
|
||||
pl::api::Namespace nsHexHttp = { "builtin", "hex", "http" };
|
||||
{
|
||||
/* get(url) */
|
||||
ContentRegistry::PatternLanguage::addDangerousFunction(nsStdHttp, "get", FunctionParameterCount::exactly(1), [](Evaluator *, auto params) -> std::optional<Token::Literal> {
|
||||
ContentRegistry::PatternLanguage::addDangerousFunction(nsHexHttp, "get", FunctionParameterCount::exactly(1), [](Evaluator *, auto params) -> std::optional<Token::Literal> {
|
||||
const auto url = Token::literalToString(params[0], false);
|
||||
|
||||
hex::Net net;
|
||||
|
||||
@@ -41,6 +41,8 @@ namespace hex::plugin::builtin {
|
||||
provider->loadSettings(providerSettings["settings"]);
|
||||
if (!provider->open())
|
||||
success = false;
|
||||
else
|
||||
EventManager::post<EventProviderOpened>(provider);
|
||||
}
|
||||
|
||||
return success;
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
namespace hex::plugin::builtin::prv {
|
||||
|
||||
DiskProvider::DiskProvider() : Provider() {
|
||||
this->reloadDrives();
|
||||
|
||||
}
|
||||
|
||||
bool DiskProvider::isAvailable() const {
|
||||
@@ -137,7 +137,7 @@ namespace hex::plugin::builtin::prv {
|
||||
|
||||
#endif
|
||||
|
||||
return Provider::open();
|
||||
return true;
|
||||
}
|
||||
|
||||
void DiskProvider::close() {
|
||||
@@ -156,8 +156,6 @@ namespace hex::plugin::builtin::prv {
|
||||
this->m_diskHandle = -1;
|
||||
|
||||
#endif
|
||||
|
||||
Provider::close();
|
||||
}
|
||||
|
||||
void DiskProvider::readRaw(u64 offset, void *buffer, size_t size) {
|
||||
@@ -320,6 +318,9 @@ namespace hex::plugin::builtin::prv {
|
||||
void DiskProvider::drawLoadInterface() {
|
||||
#if defined(OS_WINDOWS)
|
||||
|
||||
if (this->m_availableDrives.empty())
|
||||
this->reloadDrives();
|
||||
|
||||
if (ImGui::BeginListBox("hex.builtin.provider.disk.selected_disk"_lang)) {
|
||||
|
||||
for (const auto &drive : this->m_availableDrives) {
|
||||
|
||||
@@ -300,7 +300,7 @@ namespace hex::plugin::builtin::prv {
|
||||
|
||||
#endif
|
||||
|
||||
return Provider::open();
|
||||
return true;
|
||||
}
|
||||
|
||||
void FileProvider::close() {
|
||||
@@ -319,8 +319,6 @@ namespace hex::plugin::builtin::prv {
|
||||
::close(this->m_file);
|
||||
|
||||
#endif
|
||||
|
||||
Provider::close();
|
||||
}
|
||||
|
||||
void FileProvider::loadSettings(const nlohmann::json &settings) {
|
||||
|
||||
@@ -273,7 +273,7 @@ namespace hex::plugin::builtin::prv {
|
||||
}
|
||||
});
|
||||
|
||||
return Provider::open();
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
@@ -285,8 +285,6 @@ namespace hex::plugin::builtin::prv {
|
||||
if (this->m_cacheUpdateThread.joinable()) {
|
||||
this->m_cacheUpdateThread.join();
|
||||
}
|
||||
|
||||
Provider::close();
|
||||
}
|
||||
|
||||
bool GDBProvider::isConnected() const {
|
||||
|
||||
@@ -210,12 +210,11 @@ namespace hex::plugin::builtin::prv {
|
||||
this->m_dataSize = maxAddress + 1;
|
||||
this->m_dataValid = true;
|
||||
|
||||
return Provider::open();
|
||||
return true;
|
||||
}
|
||||
|
||||
void IntelHexProvider::close() {
|
||||
|
||||
Provider::close();
|
||||
}
|
||||
|
||||
[[nodiscard]] std::string IntelHexProvider::getName() const {
|
||||
|
||||
@@ -190,11 +190,11 @@ namespace hex::plugin::builtin::prv {
|
||||
this->m_dataSize = maxAddress + 1;
|
||||
this->m_dataValid = true;
|
||||
|
||||
return Provider::open();
|
||||
return true;
|
||||
}
|
||||
|
||||
void MotorolaSRECProvider::close() {
|
||||
Provider::close();
|
||||
|
||||
}
|
||||
|
||||
[[nodiscard]] std::string MotorolaSRECProvider::getName() const {
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#include <limits>
|
||||
|
||||
#include <llvm/Demangle/Demangle.h>
|
||||
#include "math_evaluator.hpp"
|
||||
#include <content/helpers/math_evaluator.hpp>
|
||||
|
||||
#include <imgui.h>
|
||||
#define IMGUI_DEFINE_MATH_OPERATORS
|
||||
@@ -974,7 +974,7 @@ namespace hex::plugin::builtin {
|
||||
return;
|
||||
}
|
||||
|
||||
constexpr auto BufferSize = 0xFF'FFFF;
|
||||
constexpr static auto BufferSize = 0xFF'FFFF;
|
||||
for (u64 partOffset = 0; partOffset < splitSize; partOffset += BufferSize) {
|
||||
partFile.write(file.readBytes(std::min<u64>(BufferSize, splitSize - partOffset)));
|
||||
partFile.flush();
|
||||
@@ -1103,7 +1103,7 @@ namespace hex::plugin::builtin {
|
||||
return;
|
||||
}
|
||||
|
||||
constexpr auto BufferSize = 0xFF'FFFF;
|
||||
constexpr static auto BufferSize = 0xFF'FFFF;
|
||||
auto inputSize = input.getSize();
|
||||
for (u64 inputOffset = 0; inputOffset < inputSize; inputOffset += BufferSize) {
|
||||
output.write(input.readBytes(std::min<u64>(BufferSize, inputSize - inputOffset)));
|
||||
|
||||
@@ -212,14 +212,16 @@ namespace hex::plugin::builtin {
|
||||
});
|
||||
}
|
||||
|
||||
ContentRegistry::Interface::addFooterItem([] {
|
||||
static float framerate = 0;
|
||||
if (ImGui::HasSecondPassed()) {
|
||||
framerate = 1.0F / ImGui::GetIO().DeltaTime;
|
||||
}
|
||||
#if defined(DEBUG)
|
||||
ContentRegistry::Interface::addFooterItem([] {
|
||||
static float framerate = 0;
|
||||
if (ImGui::HasSecondPassed()) {
|
||||
framerate = 1.0F / ImGui::GetIO().DeltaTime;
|
||||
}
|
||||
|
||||
ImGui::TextFormatted("FPS {0:2}.{1:02}", u32(framerate), u32(framerate * 100) % 100);
|
||||
});
|
||||
ImGui::TextFormatted("FPS {0:2}.{1:02}", u32(framerate), u32(framerate * 100) % 100);
|
||||
});
|
||||
#endif
|
||||
|
||||
ContentRegistry::Interface::addFooterItem([] {
|
||||
auto taskCount = TaskManager::getRunningTaskCount();
|
||||
|
||||
@@ -147,7 +147,7 @@ namespace hex::plugin::builtin {
|
||||
ImGui::TableSetupColumn("Type");
|
||||
ImGui::TableSetupColumn("Paths");
|
||||
|
||||
constexpr std::array<std::pair<const char *, fs::ImHexPath>, 8> PathTypes = {
|
||||
constexpr static std::array<std::pair<const char *, fs::ImHexPath>, 8> PathTypes = {
|
||||
{{ "Resources", fs::ImHexPath::Resources },
|
||||
{ "Config", fs::ImHexPath::Config },
|
||||
{ "Magic", fs::ImHexPath::Magic },
|
||||
|
||||
@@ -75,7 +75,7 @@ namespace hex::plugin::builtin {
|
||||
}
|
||||
|
||||
std::vector<ViewCommandPalette::CommandResult> ViewCommandPalette::getCommandResults(const std::string &input) {
|
||||
constexpr auto MatchCommand = [](const std::string &currCommand, const std::string &commandToMatch) -> std::pair<MatchType, std::string_view> {
|
||||
constexpr static auto MatchCommand = [](const std::string &currCommand, const std::string &commandToMatch) -> std::pair<MatchType, std::string_view> {
|
||||
if (currCommand.empty()) {
|
||||
return { MatchType::InfoMatch, "" };
|
||||
} else if (currCommand.size() <= commandToMatch.size()) {
|
||||
|
||||
@@ -234,6 +234,9 @@ namespace hex::plugin::builtin {
|
||||
reader.setEndAddress(searchRegion.getEndAddress());
|
||||
|
||||
auto sequence = hex::decodeByteString(settings.sequence);
|
||||
if (sequence.empty())
|
||||
return { };
|
||||
|
||||
auto occurrence = reader.begin();
|
||||
while (true) {
|
||||
occurrence = std::search(reader.begin(), reader.end(), std::boyer_moore_horspool_searcher(sequence.begin(), sequence.end()));
|
||||
@@ -268,8 +271,13 @@ namespace hex::plugin::builtin {
|
||||
std::string string(occurrence.region.getSize(), '\x00');
|
||||
provider->read(occurrence.region.getStartAddress(), string.data(), occurrence.region.getSize());
|
||||
|
||||
if (std::regex_match(string, regex))
|
||||
result.push_back(occurrence);
|
||||
if (settings.fullMatch) {
|
||||
if (std::regex_match(string, regex))
|
||||
result.push_back(occurrence);
|
||||
} else {
|
||||
if (std::regex_search(string, regex))
|
||||
result.push_back(occurrence);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -461,7 +469,7 @@ namespace hex::plugin::builtin {
|
||||
|
||||
ImGui::InputText("hex.builtin.common.value"_lang, settings.sequence);
|
||||
|
||||
this->m_settingsValid = !settings.sequence.empty();
|
||||
this->m_settingsValid = !settings.sequence.empty() && !hex::decodeByteString(settings.sequence).empty();
|
||||
|
||||
ImGui::EndTabItem();
|
||||
}
|
||||
@@ -470,7 +478,7 @@ namespace hex::plugin::builtin {
|
||||
|
||||
mode = SearchSettings::Mode::Regex;
|
||||
|
||||
ImGui::InputText("hex.builtin.view.find.regex"_lang, settings.pattern);
|
||||
ImGui::InputText("hex.builtin.view.find.regex.pattern"_lang, settings.pattern);
|
||||
|
||||
try {
|
||||
std::regex regex(settings.pattern);
|
||||
@@ -482,6 +490,8 @@ namespace hex::plugin::builtin {
|
||||
if (settings.pattern.empty())
|
||||
this->m_settingsValid = false;
|
||||
|
||||
ImGui::Checkbox("hex.builtin.view.find.regex.full_match"_lang, &settings.fullMatch);
|
||||
|
||||
ImGui::EndTabItem();
|
||||
}
|
||||
if (ImGui::BeginTabItem("hex.builtin.view.find.binary_pattern"_lang)) {
|
||||
@@ -514,6 +524,16 @@ namespace hex::plugin::builtin {
|
||||
|
||||
ImGui::SameLine();
|
||||
ImGui::TextFormatted("hex.builtin.view.find.search.entries"_lang, this->m_foundOccurrences[provider].size());
|
||||
|
||||
ImGui::BeginDisabled(this->m_foundOccurrences[provider].empty());
|
||||
{
|
||||
if (ImGui::Button("hex.builtin.view.find.search.reset"_lang)) {
|
||||
this->m_foundOccurrences[provider].clear();
|
||||
this->m_sortedOccurrences[provider].clear();
|
||||
this->m_occurrenceTree[provider].clear();
|
||||
}
|
||||
}
|
||||
ImGui::EndDisabled();
|
||||
}
|
||||
ImGui::EndDisabled();
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include <hex/providers/buffered_reader.hpp>
|
||||
#include <hex/helpers/crypto.hpp>
|
||||
|
||||
#include "math_evaluator.hpp"
|
||||
#include <content/helpers/math_evaluator.hpp>
|
||||
|
||||
#include <imgui_internal.h>
|
||||
#include <nlohmann/json.hpp>
|
||||
@@ -1002,14 +1002,14 @@ namespace hex::plugin::builtin {
|
||||
if ((ImGui::IsMouseDown(ImGuiMouseButton_Left) && this->m_selectionStart != this->m_selectionEnd)) {
|
||||
auto fractionPerLine = 1.0 / (this->m_visibleRowCount + 1);
|
||||
|
||||
if (y == u64(clipper.DisplayStart + 2)) {
|
||||
if (i128(this->m_selectionEnd - provider->getBaseAddress() - provider->getCurrentPageAddress()) <= (i64(clipper.DisplayStart + 2) * this->m_bytesPerRow)) {
|
||||
if (y == u64(clipper.DisplayStart + 3)) {
|
||||
if (i128(this->m_selectionEnd - provider->getBaseAddress() - provider->getCurrentPageAddress()) <= (i64(clipper.DisplayStart + 3) * this->m_bytesPerRow)) {
|
||||
this->m_shouldScrollToSelection = false;
|
||||
ImGui::SetScrollHereY(fractionPerLine * 4);
|
||||
ImGui::SetScrollHereY(fractionPerLine * 5);
|
||||
|
||||
}
|
||||
} else if (y == u64(clipper.DisplayEnd - 2)) {
|
||||
if (i128(this->m_selectionEnd - provider->getBaseAddress() - provider->getCurrentPageAddress()) >= (i64(clipper.DisplayEnd - 2) * this->m_bytesPerRow)) {
|
||||
} else if (y == u64(clipper.DisplayEnd - 3)) {
|
||||
if (i128(this->m_selectionEnd - provider->getBaseAddress() - provider->getCurrentPageAddress()) >= (i64(clipper.DisplayEnd - 3) * this->m_bytesPerRow)) {
|
||||
this->m_shouldScrollToSelection = false;
|
||||
ImGui::SetScrollHereY(fractionPerLine * (this->m_visibleRowCount - 1));
|
||||
}
|
||||
@@ -1152,7 +1152,7 @@ namespace hex::plugin::builtin {
|
||||
void ViewHexEditor::drawContent() {
|
||||
|
||||
if (ImGui::Begin(View::toWindowName(this->getUnlocalizedName()).c_str(), &this->getWindowOpenState(), ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoNavInputs | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoScrollWithMouse)) {
|
||||
const auto FooterSize = ImVec2(ImGui::GetContentRegionAvail().x, ImGui::GetTextLineHeightWithSpacing() * 3);
|
||||
const auto FooterSize = ImVec2(ImGui::GetContentRegionAvail().x, ImGui::GetTextLineHeightWithSpacing() * 2.3);
|
||||
const auto TableSize = ImGui::GetContentRegionAvail() - ImVec2(0, FooterSize.y);
|
||||
|
||||
this->drawPopup();
|
||||
@@ -1175,17 +1175,22 @@ namespace hex::plugin::builtin {
|
||||
}
|
||||
|
||||
static void copyBytes(const Region &selection) {
|
||||
constexpr static auto Format = "{0:02X} ";
|
||||
|
||||
auto provider = ImHexApi::Provider::get();
|
||||
|
||||
std::vector<u8> buffer(selection.size, 0x00);
|
||||
provider->read(selection.getStartAddress() + provider->getBaseAddress() + provider->getCurrentPageAddress(), buffer.data(), buffer.size());
|
||||
auto reader = prv::BufferedReader(provider);
|
||||
reader.seek(selection.getStartAddress() + provider->getBaseAddress() + provider->getCurrentPageAddress());
|
||||
reader.setEndAddress(selection.getEndAddress() + provider->getBaseAddress() + provider->getCurrentPageAddress());
|
||||
|
||||
std::string str;
|
||||
for (const auto &byte : buffer)
|
||||
str += hex::format("{0:02X} ", byte);
|
||||
str.pop_back();
|
||||
std::string result;
|
||||
result.reserve(fmt::format(Format, 0x00).size() * selection.getSize());
|
||||
|
||||
ImGui::SetClipboardText(str.c_str());
|
||||
for (const auto &byte : reader)
|
||||
result += fmt::format(Format, byte);
|
||||
result.pop_back();
|
||||
|
||||
ImGui::SetClipboardText(result.c_str());
|
||||
}
|
||||
|
||||
static void pasteBytes(const Region &selection) {
|
||||
@@ -1526,6 +1531,8 @@ namespace hex::plugin::builtin {
|
||||
if (ImGui::BeginMenu("hex.builtin.view.hex_editor.menu.edit.copy_as"_lang, selection.has_value() && providerValid)) {
|
||||
if (ImGui::MenuItem("hex.builtin.view.hex_editor.copy.hex"_lang, "CTRL + SHIFT + C"))
|
||||
copyString(*selection);
|
||||
if (ImGui::MenuItem("hex.builtin.view.hex_editor.copy.address"_lang))
|
||||
ImGui::SetClipboardText(hex::format("0x{:08X}", selection->getStartAddress()).c_str());
|
||||
|
||||
ImGui::Separator();
|
||||
|
||||
@@ -1569,7 +1576,8 @@ namespace hex::plugin::builtin {
|
||||
}
|
||||
|
||||
if (ImGui::MenuItem("hex.builtin.view.hex_editor.menu.edit.remove"_lang, nullptr, false, providerValid && provider->isResizable())) {
|
||||
this->openPopup<PopupRemove>(this->getSelection().getStartAddress(), 0x00);
|
||||
auto selection = this->getSelection();
|
||||
this->openPopup<PopupRemove>(selection.getStartAddress(), selection.getSize());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
#include <hex/providers/provider.hpp>
|
||||
|
||||
#include <pl/pattern_language.hpp>
|
||||
#include <pl/patterns/pattern.hpp>
|
||||
|
||||
#include <provider_extra_data.hpp>
|
||||
|
||||
@@ -26,13 +26,13 @@ namespace hex::plugin::builtin {
|
||||
static bool initialized = false;
|
||||
static TextEditor::LanguageDefinition langDef;
|
||||
if (!initialized) {
|
||||
static constexpr std::array keywords = {
|
||||
"using", "struct", "union", "enum", "bitfield", "be", "le", "if", "else", "false", "true", "this", "parent", "addressof", "sizeof", "$", "while", "for", "fn", "return", "break", "continue", "namespace", "in", "out"
|
||||
constexpr static std::array keywords = {
|
||||
"using", "struct", "union", "enum", "bitfield", "be", "le", "if", "else", "false", "true", "this", "parent", "addressof", "sizeof", "$", "while", "for", "fn", "return", "break", "continue", "namespace", "in", "out", "ref"
|
||||
};
|
||||
for (auto &k : keywords)
|
||||
langDef.mKeywords.insert(k);
|
||||
|
||||
static constexpr std::array builtInTypes = {
|
||||
constexpr static std::array builtInTypes = {
|
||||
"u8", "u16", "u24", "u32", "u48", "u64", "u96", "u128", "s8", "s16", "s24", "s32", "s48", "s64", "s96", "s128", "float", "double", "char", "char16", "bool", "padding", "str", "auto"
|
||||
};
|
||||
for (const auto name : builtInTypes) {
|
||||
@@ -80,7 +80,8 @@ namespace hex::plugin::builtin {
|
||||
|
||||
|
||||
ViewPatternEditor::ViewPatternEditor() : View("hex.builtin.view.pattern_editor.name") {
|
||||
this->m_parserRuntime = ContentRegistry::PatternLanguage::createDefaultRuntime(nullptr);
|
||||
this->m_parserRuntime = std::make_unique<pl::PatternLanguage>();
|
||||
ContentRegistry::PatternLanguage::configureRuntime(*this->m_parserRuntime, nullptr);
|
||||
|
||||
this->m_textEditor.SetLanguageDefinition(PatternLanguage());
|
||||
this->m_textEditor.SetShowWhitespaces(false);
|
||||
@@ -110,7 +111,8 @@ namespace hex::plugin::builtin {
|
||||
|
||||
EventManager::subscribe<EventProviderOpened>(this, [this](prv::Provider *provider) {
|
||||
auto &patternLanguageData = ProviderExtraData::get(provider).patternLanguage;
|
||||
patternLanguageData.runtime = ContentRegistry::PatternLanguage::createDefaultRuntime(provider);
|
||||
patternLanguageData.runtime = std::make_unique<pl::PatternLanguage>();
|
||||
ContentRegistry::PatternLanguage::configureRuntime(*patternLanguageData.runtime, provider);
|
||||
|
||||
if (!this->m_autoLoadPatterns)
|
||||
return;
|
||||
@@ -418,6 +420,7 @@ namespace hex::plugin::builtin {
|
||||
|
||||
if (this->m_dangerousFunctionCalled && !ImGui::IsPopupOpen(View::toWindowName("hex.builtin.view.pattern_editor.dangerous_function.name").c_str())) {
|
||||
ImGui::OpenPopup(View::toWindowName("hex.builtin.view.pattern_editor.dangerous_function.name").c_str());
|
||||
this->m_dangerousFunctionCalled = false;
|
||||
}
|
||||
|
||||
if (ImGui::BeginPopupModal(View::toWindowName("hex.builtin.view.pattern_editor.dangerous_function.name").c_str(), nullptr, ImGuiWindowFlags_AlwaysAutoResize)) {
|
||||
@@ -524,7 +527,7 @@ namespace hex::plugin::builtin {
|
||||
ON_SCOPE_EXIT { ImGui::PopID(); };
|
||||
|
||||
ImGui::PushItemWidth(ImGui::GetContentRegionAvail().x);
|
||||
constexpr const char *Types[] = { "I", "F", "S", "B" };
|
||||
constexpr static const char *Types[] = { "I", "F", "S", "B" };
|
||||
if (ImGui::BeginCombo("", Types[static_cast<int>(type)])) {
|
||||
for (auto i = 0; i < IM_ARRAYSIZE(Types); i++) {
|
||||
if (ImGui::Selectable(Types[i]))
|
||||
@@ -704,51 +707,51 @@ namespace hex::plugin::builtin {
|
||||
{
|
||||
ImGui::ColorButton(pattern->getVariableName().c_str(), ImColor(pattern->getColor()));
|
||||
ImGui::SameLine(0, 10);
|
||||
ImGui::TextFormattedColored(ImColor(0xFF9BC64D), "{}", pattern->getFormattedName());
|
||||
ImGui::TextFormattedColored(ImColor(0xFF9BC64D), "{} ", pattern->getFormattedName());
|
||||
ImGui::SameLine(0, 5);
|
||||
ImGui::TextFormatted("{}", pattern->getDisplayName());
|
||||
ImGui::SameLine();
|
||||
ImGui::SeparatorEx(ImGuiSeparatorFlags_Vertical);
|
||||
ImGui::SameLine();
|
||||
ImGui::TextFormatted("{}", pattern->getFormattedValue());
|
||||
ImGui::TextFormatted("{} ", pattern->getFormattedValue());
|
||||
|
||||
if (ImGui::GetIO().KeyShift) {
|
||||
ImGui::Indent();
|
||||
if (ImGui::BeginTable("##extra_info", 2, ImGuiTableFlags_RowBg | ImGuiTableFlags_NoClip)) {
|
||||
if (ImGui::BeginTable("##extra_info", 2, ImGuiTableFlags_RowBg | ImGuiTableFlags_BordersInnerV | ImGuiTableFlags_NoClip)) {
|
||||
|
||||
ImGui::TableNextRow();
|
||||
ImGui::TableNextColumn();
|
||||
|
||||
ImGui::TableNextRow();
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::TextFormatted("{}: ", "hex.builtin.common.type"_lang);
|
||||
ImGui::TextFormatted("{} ", "hex.builtin.common.type"_lang);
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::TextFormatted("{}", pattern->getTypeName());
|
||||
ImGui::TextFormatted(" {}", pattern->getTypeName());
|
||||
|
||||
ImGui::TableNextRow();
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::TextFormatted("{}: ", "hex.builtin.common.address"_lang);
|
||||
ImGui::TextFormatted("{} ", "hex.builtin.common.address"_lang);
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::TextFormatted("0x{:08X}", pattern->getOffset());
|
||||
ImGui::TextFormatted(" 0x{:08X}", pattern->getOffset());
|
||||
|
||||
ImGui::TableNextRow();
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::TextFormatted("{}: ", "hex.builtin.common.size"_lang);
|
||||
ImGui::TextFormatted("{} ", "hex.builtin.common.size"_lang);
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::TextFormatted("{}", hex::toByteString(pattern->getSize()));
|
||||
ImGui::TextFormatted(" {}", hex::toByteString(pattern->getSize()));
|
||||
|
||||
ImGui::TableNextRow();
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::TextFormatted("{}: ", "hex.builtin.common.endian"_lang);
|
||||
ImGui::TextFormatted("{} ", "hex.builtin.common.endian"_lang);
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::TextFormatted("{}", pattern->getEndian() == std::endian::little ? "hex.builtin.common.little"_lang : "hex.builtin.common.big"_lang);
|
||||
ImGui::TextFormatted(" {}", pattern->getEndian() == std::endian::little ? "hex.builtin.common.little"_lang : "hex.builtin.common.big"_lang);
|
||||
|
||||
if (const auto &comment = pattern->getComment(); comment != nullptr) {
|
||||
ImGui::TableNextRow();
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::TextFormatted("{}: ", "hex.builtin.common.comment"_lang);
|
||||
ImGui::TextFormatted("{} ", "hex.builtin.common.comment"_lang);
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::TextWrapped("\"%s\"", comment->c_str());
|
||||
ImGui::TextWrapped(" \"%s\"", comment->c_str());
|
||||
}
|
||||
|
||||
ImGui::EndTable();
|
||||
@@ -775,6 +778,7 @@ namespace hex::plugin::builtin {
|
||||
void ViewPatternEditor::parsePattern(const std::string &code) {
|
||||
this->m_runningParsers++;
|
||||
|
||||
ContentRegistry::PatternLanguage::configureRuntime(*this->m_parserRuntime, nullptr);
|
||||
auto ast = this->m_parserRuntime->parseString(code);
|
||||
|
||||
this->m_patternVariables.clear();
|
||||
@@ -815,14 +819,13 @@ namespace hex::plugin::builtin {
|
||||
auto provider = ImHexApi::Provider::get();
|
||||
auto &runtime = ProviderExtraData::get(provider).patternLanguage.runtime;
|
||||
|
||||
runtime->reset();
|
||||
runtime->setIncludePaths(fs::getDefaultPaths(fs::ImHexPath::PatternsInclude) | fs::getDefaultPaths(fs::ImHexPath::Patterns));
|
||||
runtime->setDataBaseAddress(provider->getBaseAddress());
|
||||
runtime->setDataSize(provider->getActualSize());
|
||||
ContentRegistry::PatternLanguage::configureRuntime(*runtime, provider);
|
||||
|
||||
EventManager::post<EventHighlightingChanged>();
|
||||
|
||||
TaskManager::createTask("hex.builtin.view.pattern_editor.evaluating", TaskManager::NoProgress, [this, &runtime, code](auto &) {
|
||||
TaskManager::createTask("hex.builtin.view.pattern_editor.evaluating", TaskManager::NoProgress, [this, &runtime, code](auto &task) {
|
||||
task.setInterruptCallback([&runtime] { runtime->abort(); });
|
||||
|
||||
std::map<std::string, pl::core::Token::Literal> envVars;
|
||||
for (const auto &[id, name, value, type] : this->m_envVarEntries)
|
||||
envVars.insert({ name, value });
|
||||
|
||||
@@ -36,6 +36,7 @@ namespace hex::plugin::builtin {
|
||||
|
||||
if (ImGui::Button("hex.builtin.common.open"_lang)) {
|
||||
if (provider->open()) {
|
||||
EventManager::post<EventProviderOpened>(provider);
|
||||
ImGui::CloseCurrentPopup();
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -11,8 +11,10 @@ namespace hex::plugin::builtin {
|
||||
ViewSettings::ViewSettings() : View("hex.builtin.view.settings.name") {
|
||||
EventManager::subscribe<RequestOpenWindow>(this, [this](const std::string &name) {
|
||||
if (name == "Settings") {
|
||||
TaskManager::doLater([] { ImGui::OpenPopup(View::toWindowName("hex.builtin.view.settings.name").c_str()); });
|
||||
this->getWindowOpenState() = true;
|
||||
TaskManager::doLater([this] {
|
||||
ImGui::OpenPopup(View::toWindowName("hex.builtin.view.settings.name").c_str());
|
||||
this->getWindowOpenState() = true;
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -99,6 +99,8 @@ namespace hex::plugin::builtin {
|
||||
return;
|
||||
}
|
||||
|
||||
EventManager::post<EventProviderOpened>(provider);
|
||||
|
||||
updateRecentProviders();
|
||||
}
|
||||
}
|
||||
@@ -340,7 +342,8 @@ namespace hex::plugin::builtin {
|
||||
if (ImGui::Hyperlink("X")) {
|
||||
auto provider = ImHexApi::Provider::createProvider("hex.builtin.provider.null");
|
||||
if (provider != nullptr)
|
||||
(void)provider->open();
|
||||
if (provider->open())
|
||||
EventManager::post<EventProviderOpened>(provider);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -366,8 +369,6 @@ namespace hex::plugin::builtin {
|
||||
}
|
||||
|
||||
static void drawNoViewsBackground() {
|
||||
if (isAnyViewOpen() && ImHexApi::Provider::isValid()) return;
|
||||
|
||||
if (ImGui::Begin("ImHexDockSpace")) {
|
||||
static char title[256];
|
||||
ImFormatString(title, IM_ARRAYSIZE(title), "%s/DockSpace_%08X", ImGui::GetCurrentWindow()->Name, ImGui::GetID("ImHexMainDock"));
|
||||
@@ -392,7 +393,10 @@ namespace hex::plugin::builtin {
|
||||
updateRecentProviders();
|
||||
|
||||
(void)EventManager::subscribe<EventFrameBegin>(drawWelcomeScreen);
|
||||
(void)EventManager::subscribe<EventFrameBegin>(drawNoViewsBackground);
|
||||
(void)EventManager::subscribe<EventFrameBegin>([]{
|
||||
if (ImHexApi::Provider::isValid() && !isAnyViewOpen())
|
||||
drawNoViewsBackground();
|
||||
});
|
||||
|
||||
(void)EventManager::subscribe<EventSettingsChanged>([]() {
|
||||
{
|
||||
@@ -524,7 +528,7 @@ namespace hex::plugin::builtin {
|
||||
});
|
||||
|
||||
|
||||
constexpr auto CrashBackupFileName = "crash_backup.hexproj";
|
||||
constexpr static auto CrashBackupFileName = "crash_backup.hexproj";
|
||||
for (const auto &path : fs::getDefaultPaths(fs::ImHexPath::Config)) {
|
||||
if (auto filePath = std::fs::path(path) / CrashBackupFileName; fs::exists(filePath)) {
|
||||
s_safetyBackupPath = filePath;
|
||||
|
||||
@@ -133,7 +133,6 @@ namespace hex::plugin::builtin {
|
||||
|
||||
{ "hex.builtin.menu.view", "Ansicht" },
|
||||
{ "hex.builtin.menu.layout", "Layout" },
|
||||
{ "hex.builtin.menu.view.fps", "FPS anzeigen" },
|
||||
{ "hex.builtin.menu.view.demo", "ImGui Demo anzeigen" },
|
||||
{ "hex.builtin.menu.help", "Hilfe" },
|
||||
|
||||
@@ -285,7 +284,8 @@ namespace hex::plugin::builtin {
|
||||
{ "hex.builtin.view.hex_editor.file.save_as", "Speichern unter..." },
|
||||
{ "hex.builtin.view.hex_editor.menu.edit.copy", "Kopieren" },
|
||||
{ "hex.builtin.view.hex_editor.menu.edit.copy_as", "Kopieren als..." },
|
||||
{ "hex.builtin.view.hex_editor.copy.hex", "String" },
|
||||
{ "hex.builtin.view.hex_editor.copy.hex", "Hex String" },
|
||||
{ "hex.builtin.view.hex_editor.copy.address", "Adresse" },
|
||||
{ "hex.builtin.view.hex_editor.copy.c", "C Array" },
|
||||
{ "hex.builtin.view.hex_editor.copy.cpp", "C++ Array" },
|
||||
{ "hex.builtin.view.hex_editor.copy.csharp", "C# Array" },
|
||||
@@ -293,7 +293,13 @@ namespace hex::plugin::builtin {
|
||||
{ "hex.builtin.view.hex_editor.copy.python", "Python Array" },
|
||||
{ "hex.builtin.view.hex_editor.copy.java", "Java Array" },
|
||||
{ "hex.builtin.view.hex_editor.copy.js", "JavaScript Array" },
|
||||
{ "hex.builtin.view.hex_editor.copy.ascii", "ASCII Art" },
|
||||
{ "hex.builtin.view.hex_editor.copy.lua", "Lua Array" },
|
||||
{ "hex.builtin.view.hex_editor.copy.go", "Go Array" },
|
||||
{ "hex.builtin.view.hex_editor.copy.crystal", "Crystal Array" },
|
||||
{ "hex.builtin.view.hex_editor.copy.swift", "Swift Array" },
|
||||
{ "hex.builtin.view.hex_editor.copy.pascal", "Pascal Array" },
|
||||
{ "hex.builtin.view.hex_editor.copy.base64", "Base64" },
|
||||
{ "hex.builtin.view.hex_editor.copy.ascii", "Text Area" },
|
||||
{ "hex.builtin.view.hex_editor.copy.html", "HTML" },
|
||||
{ "hex.builtin.view.hex_editor.menu.edit.paste", "Einfügen" },
|
||||
{ "hex.builtin.view.hex_editor.menu.edit.select_all", "Alles auswählen" },
|
||||
@@ -414,11 +420,14 @@ namespace hex::plugin::builtin {
|
||||
{ "hex.builtin.view.find.strings.line_feeds", "Line Feeds" },
|
||||
{ "hex.builtin.view.find.sequences", "Sequenzen" },
|
||||
{ "hex.builtin.view.find.regex", "Regex" },
|
||||
{ "hex.builtin.view.find.regex.pattern", "Pattern" },
|
||||
{ "hex.builtin.view.find.regex.full_match", "Benötige volle übereinstimmung" },
|
||||
{ "hex.builtin.view.find.binary_pattern", "Binärpattern" },
|
||||
{ "hex.builtin.view.find.search", "Suchen" },
|
||||
{ "hex.builtin.view.find.context.copy", "Wert Kopieren" },
|
||||
{ "hex.builtin.view.find.context.copy_demangle", "Demangled Wert Kopieren" },
|
||||
{ "hex.builtin.view.find.search.entries", "{} Einträge gefunden" },
|
||||
{ "hex.builtin.view.find.search.reset", "Zurücksetzen" },
|
||||
|
||||
{ "hex.builtin.command.calc.desc", "Rechner" },
|
||||
{ "hex.builtin.command.cmd.desc", "Command" },
|
||||
|
||||
@@ -288,7 +288,8 @@ namespace hex::plugin::builtin {
|
||||
{ "hex.builtin.view.hex_editor.menu.file.save_as", "Save As..." },
|
||||
{ "hex.builtin.view.hex_editor.menu.edit.copy", "Copy" },
|
||||
{ "hex.builtin.view.hex_editor.menu.edit.copy_as", "Copy as..." },
|
||||
{ "hex.builtin.view.hex_editor.copy.hex", "String" },
|
||||
{ "hex.builtin.view.hex_editor.copy.hex", "Hex String" },
|
||||
{ "hex.builtin.view.hex_editor.copy.address", "Address" },
|
||||
{ "hex.builtin.view.hex_editor.copy.c", "C Array" },
|
||||
{ "hex.builtin.view.hex_editor.copy.cpp", "C++ Array" },
|
||||
{ "hex.builtin.view.hex_editor.copy.csharp", "C# Array" },
|
||||
@@ -296,7 +297,13 @@ namespace hex::plugin::builtin {
|
||||
{ "hex.builtin.view.hex_editor.copy.python", "Python Array" },
|
||||
{ "hex.builtin.view.hex_editor.copy.java", "Java Array" },
|
||||
{ "hex.builtin.view.hex_editor.copy.js", "JavaScript Array" },
|
||||
{ "hex.builtin.view.hex_editor.copy.ascii", "ASCII Art" },
|
||||
{ "hex.builtin.view.hex_editor.copy.lua", "Lua Array" },
|
||||
{ "hex.builtin.view.hex_editor.copy.go", "Go Array" },
|
||||
{ "hex.builtin.view.hex_editor.copy.crystal", "Crystal Array" },
|
||||
{ "hex.builtin.view.hex_editor.copy.swift", "Swift Array" },
|
||||
{ "hex.builtin.view.hex_editor.copy.pascal", "Pascal Array" },
|
||||
{ "hex.builtin.view.hex_editor.copy.base64", "Base64" },
|
||||
{ "hex.builtin.view.hex_editor.copy.ascii", "Text Area" },
|
||||
{ "hex.builtin.view.hex_editor.copy.html", "HTML" },
|
||||
{ "hex.builtin.view.hex_editor.menu.edit.paste", "Paste" },
|
||||
{ "hex.builtin.view.hex_editor.menu.edit.select_all", "Select all" },
|
||||
@@ -419,11 +426,14 @@ namespace hex::plugin::builtin {
|
||||
{ "hex.builtin.view.find.strings.line_feeds", "Line Feeds" },
|
||||
{ "hex.builtin.view.find.sequences", "Sequences" },
|
||||
{ "hex.builtin.view.find.regex", "Regex" },
|
||||
{ "hex.builtin.view.find.regex.pattern", "Pattern" },
|
||||
{ "hex.builtin.view.find.regex.full_match", "Require full match" },
|
||||
{ "hex.builtin.view.find.binary_pattern", "Binary Pattern" },
|
||||
{ "hex.builtin.view.find.search", "Search" },
|
||||
{ "hex.builtin.view.find.context.copy", "Copy Value" },
|
||||
{ "hex.builtin.view.find.context.copy_demangle", "Copy Demangled Value" },
|
||||
{ "hex.builtin.view.find.search.entries", "{} entries found" },
|
||||
{ "hex.builtin.view.find.search.reset", "Reset" },
|
||||
|
||||
|
||||
{ "hex.builtin.command.calc.desc", "Calculator" },
|
||||
|
||||
@@ -289,7 +289,8 @@ namespace hex::plugin::builtin {
|
||||
{ "hex.builtin.view.hex_editor.menu.file.save_as", "Salva come..." },
|
||||
{ "hex.builtin.view.hex_editor.menu.edit.copy", "Copia" },
|
||||
{ "hex.builtin.view.hex_editor.menu.edit.copy_as", "Copia come..." },
|
||||
{ "hex.builtin.view.hex_editor.copy.hex", "Stringa" },
|
||||
{ "hex.builtin.view.hex_editor.copy.hex", "Hex Stringa" },
|
||||
//{ "hex.builtin.view.hex_editor.copy.address", "Address" },
|
||||
{ "hex.builtin.view.hex_editor.copy.c", "C Array" },
|
||||
{ "hex.builtin.view.hex_editor.copy.cpp", "C++ Array" },
|
||||
{ "hex.builtin.view.hex_editor.copy.csharp", "C# Array" },
|
||||
@@ -297,7 +298,13 @@ namespace hex::plugin::builtin {
|
||||
{ "hex.builtin.view.hex_editor.copy.python", "Python Array" },
|
||||
{ "hex.builtin.view.hex_editor.copy.java", "Java Array" },
|
||||
{ "hex.builtin.view.hex_editor.copy.js", "JavaScript Array" },
|
||||
{ "hex.builtin.view.hex_editor.copy.ascii", "ASCII Art" },
|
||||
{ "hex.builtin.view.hex_editor.copy.lua", "Lua Array" },
|
||||
{ "hex.builtin.view.hex_editor.copy.go", "Go Array" },
|
||||
{ "hex.builtin.view.hex_editor.copy.crystal", "Crystal Array" },
|
||||
{ "hex.builtin.view.hex_editor.copy.swift", "Swift Array" },
|
||||
{ "hex.builtin.view.hex_editor.copy.pascal", "Pascal Array" },
|
||||
{ "hex.builtin.view.hex_editor.copy.base64", "Base64" },
|
||||
//{ "hex.builtin.view.hex_editor.copy.ascii", "Text Area" },
|
||||
{ "hex.builtin.view.hex_editor.copy.html", "HTML" },
|
||||
{ "hex.builtin.view.hex_editor.menu.edit.paste", "Incolla" },
|
||||
{ "hex.builtin.view.hex_editor.menu.edit.select_all", "Seleziona tutti" },
|
||||
@@ -418,11 +425,14 @@ namespace hex::plugin::builtin {
|
||||
// { "hex.builtin.view.find.strings.line_feeds", "Line Feeds" },
|
||||
// { "hex.builtin.view.find.sequences", "Sequences" },
|
||||
// { "hex.builtin.view.find.regex", "Regex" },
|
||||
//{ "hex.builtin.view.find.regex.pattern", "Pattern" },
|
||||
//{ "hex.builtin.view.find.regex.full_match", "Require full match" },
|
||||
// { "hex.builtin.view.find.binary_pattern", "Binary Pattern" },
|
||||
// { "hex.builtin.view.find.search", "Search" },
|
||||
// { "hex.builtin.view.find.context.copy", "Copy Value" },
|
||||
// { "hex.builtin.view.find.context.copy_demangle", "Copy Demangled Value" },
|
||||
// { "hex.builtin.view.find.search.entries", "{} entries found" },
|
||||
// { "hex.builtin.view.find.search.reset", "Reset" },
|
||||
|
||||
{ "hex.builtin.command.calc.desc", "Calcolatrice" },
|
||||
{ "hex.builtin.command.cmd.desc", "Comando" },
|
||||
|
||||
@@ -289,6 +289,7 @@ namespace hex::plugin::builtin {
|
||||
{ "hex.builtin.view.hex_editor.menu.edit.copy", "コピー" },
|
||||
{ "hex.builtin.view.hex_editor.menu.edit.copy_as", "〜としてコピー…" },
|
||||
{ "hex.builtin.view.hex_editor.copy.hex", "文字列" },
|
||||
//{ "hex.builtin.view.hex_editor.copy.address", "Address" },
|
||||
{ "hex.builtin.view.hex_editor.copy.c", "C 配列" },
|
||||
{ "hex.builtin.view.hex_editor.copy.cpp", "C++ 配列" },
|
||||
{ "hex.builtin.view.hex_editor.copy.csharp", "C# 配列" },
|
||||
@@ -296,7 +297,13 @@ namespace hex::plugin::builtin {
|
||||
{ "hex.builtin.view.hex_editor.copy.python", "Python 配列" },
|
||||
{ "hex.builtin.view.hex_editor.copy.java", "Java 配列" },
|
||||
{ "hex.builtin.view.hex_editor.copy.js", "JavaScript 配列" },
|
||||
{ "hex.builtin.view.hex_editor.copy.ascii", "アスキーアート" },
|
||||
{ "hex.builtin.view.hex_editor.copy.lua", "Lua 配列" },
|
||||
{ "hex.builtin.view.hex_editor.copy.go", "Go 配列" },
|
||||
{ "hex.builtin.view.hex_editor.copy.crystal", "Crystal 配列" },
|
||||
{ "hex.builtin.view.hex_editor.copy.swift", "Swift 配列" },
|
||||
{ "hex.builtin.view.hex_editor.copy.pascal", "Pascal 配列" },
|
||||
{ "hex.builtin.view.hex_editor.copy.base64", "Base64" },
|
||||
//{ "hex.builtin.view.hex_editor.copy.ascii", "Text Area" },
|
||||
{ "hex.builtin.view.hex_editor.copy.html", "HTML" },
|
||||
{ "hex.builtin.view.hex_editor.menu.edit.paste", "貼り付け" },
|
||||
{ "hex.builtin.view.hex_editor.menu.edit.select_all", "すべて選択" },
|
||||
@@ -421,11 +428,14 @@ namespace hex::plugin::builtin {
|
||||
{ "hex.builtin.view.find.strings.line_feeds", "ラインフィード" },
|
||||
{ "hex.builtin.view.find.sequences", "通常検索" },
|
||||
{ "hex.builtin.view.find.regex", "正規表現" },
|
||||
// { "hex.builtin.view.find.regex.pattern", "Pattern" },
|
||||
// { "hex.builtin.view.find.regex.full_match", "Require full match" },
|
||||
{ "hex.builtin.view.find.binary_pattern", "16進数" },
|
||||
{ "hex.builtin.view.find.search", "検索を実行" },
|
||||
{ "hex.builtin.view.find.context.copy", "値をコピー" },
|
||||
// { "hex.builtin.view.find.context.copy_demangle", "Copy Demangled Value" },
|
||||
{ "hex.builtin.view.find.search.entries", "一致件数: {}" },
|
||||
// { "hex.builtin.view.find.search.reset", "Reset" },
|
||||
|
||||
{ "hex.builtin.command.calc.desc", "電卓" },
|
||||
{ "hex.builtin.command.cmd.desc", "コマンド" },
|
||||
|
||||
@@ -136,7 +136,6 @@ namespace hex::plugin::builtin {
|
||||
|
||||
{ "hex.builtin.menu.view", "뷰" },
|
||||
{ "hex.builtin.menu.layout", "레이아웃" },
|
||||
{ "hex.builtin.menu.view.fps", "FPS 표시하기" },
|
||||
{ "hex.builtin.menu.view.demo", "ImGui Demo 표시하기" },
|
||||
{ "hex.builtin.menu.help", "도움말" },
|
||||
|
||||
@@ -289,6 +288,7 @@ namespace hex::plugin::builtin {
|
||||
{ "hex.builtin.view.hex_editor.menu.edit.copy", "복사" },
|
||||
{ "hex.builtin.view.hex_editor.menu.edit.copy_as", "다른 방법으로 복사..." },
|
||||
{ "hex.builtin.view.hex_editor.copy.hex", "문자열" },
|
||||
//{ "hex.builtin.view.hex_editor.copy.address", "Address" },
|
||||
{ "hex.builtin.view.hex_editor.copy.c", "C 배열" },
|
||||
{ "hex.builtin.view.hex_editor.copy.cpp", "C++ 배열" },
|
||||
{ "hex.builtin.view.hex_editor.copy.csharp", "C# 배열" },
|
||||
@@ -296,7 +296,13 @@ namespace hex::plugin::builtin {
|
||||
{ "hex.builtin.view.hex_editor.copy.python", "Python 배열" },
|
||||
{ "hex.builtin.view.hex_editor.copy.java", "Java 배열" },
|
||||
{ "hex.builtin.view.hex_editor.copy.js", "JavaScript 배열" },
|
||||
{ "hex.builtin.view.hex_editor.copy.ascii", "ASCII 아트" },
|
||||
{ "hex.builtin.view.hex_editor.copy.lua", "Lua 배열" },
|
||||
{ "hex.builtin.view.hex_editor.copy.go", "Go 배열" },
|
||||
{ "hex.builtin.view.hex_editor.copy.crystal", "Crystal 배열" },
|
||||
{ "hex.builtin.view.hex_editor.copy.swift", "Swift 배열" },
|
||||
{ "hex.builtin.view.hex_editor.copy.pascal", "Pascal 배열" },
|
||||
{ "hex.builtin.view.hex_editor.copy.base64", "Base64" },
|
||||
//{ "hex.builtin.view.hex_editor.copy.ascii", "Text Area" },
|
||||
{ "hex.builtin.view.hex_editor.copy.html", "HTML" },
|
||||
{ "hex.builtin.view.hex_editor.menu.edit.paste", "붙여넣기" },
|
||||
{ "hex.builtin.view.hex_editor.menu.edit.select_all", "모두 선택하기" },
|
||||
@@ -419,11 +425,14 @@ namespace hex::plugin::builtin {
|
||||
{ "hex.builtin.view.find.strings.line_feeds", "라인 피드" },
|
||||
{ "hex.builtin.view.find.sequences", "텍스트 시퀸스" },
|
||||
{ "hex.builtin.view.find.regex", "정규식" },
|
||||
// { "hex.builtin.view.find.regex.pattern", "Pattern" },
|
||||
// { "hex.builtin.view.find.regex.full_match", "Require full match" },
|
||||
{ "hex.builtin.view.find.binary_pattern", "바이너리 패턴" },
|
||||
{ "hex.builtin.view.find.search", "검색" },
|
||||
{ "hex.builtin.view.find.context.copy", "값 복사" },
|
||||
{ "hex.builtin.view.find.context.copy_demangle", "Copy Demangled Value" },
|
||||
{ "hex.builtin.view.find.search.entries", "{} 개 검색됨" },
|
||||
// { "hex.builtin.view.find.search.reset", "Reset" },
|
||||
|
||||
|
||||
{ "hex.builtin.command.calc.desc", "계산기" },
|
||||
|
||||
@@ -287,6 +287,7 @@ namespace hex::plugin::builtin {
|
||||
{ "hex.builtin.view.hex_editor.menu.edit.copy", "Copiar" },
|
||||
{ "hex.builtin.view.hex_editor.menu.edit.copy_as", "Copiar como..." },
|
||||
{ "hex.builtin.view.hex_editor.copy.hex", "String" },
|
||||
//{ "hex.builtin.view.hex_editor.copy.address", "Address" },
|
||||
{ "hex.builtin.view.hex_editor.copy.c", "C Array" },
|
||||
{ "hex.builtin.view.hex_editor.copy.cpp", "C++ Array" },
|
||||
{ "hex.builtin.view.hex_editor.copy.csharp", "C# Array" },
|
||||
@@ -294,7 +295,13 @@ namespace hex::plugin::builtin {
|
||||
{ "hex.builtin.view.hex_editor.copy.python", "Python Array" },
|
||||
{ "hex.builtin.view.hex_editor.copy.java", "Java Array" },
|
||||
{ "hex.builtin.view.hex_editor.copy.js", "JavaScript Array" },
|
||||
{ "hex.builtin.view.hex_editor.copy.ascii", "ASCII Art" },
|
||||
{ "hex.builtin.view.hex_editor.copy.lua", "Lua Array" },
|
||||
{ "hex.builtin.view.hex_editor.copy.go", "Go Array" },
|
||||
{ "hex.builtin.view.hex_editor.copy.crystal", "Crystal Array" },
|
||||
{ "hex.builtin.view.hex_editor.copy.swift", "Swift Array" },
|
||||
{ "hex.builtin.view.hex_editor.copy.pascal", "Pascal Array" },
|
||||
{ "hex.builtin.view.hex_editor.copy.base64", "Base64" },
|
||||
//{ "hex.builtin.view.hex_editor.copy.ascii", "Text Area" },
|
||||
{ "hex.builtin.view.hex_editor.copy.html", "HTML" },
|
||||
{ "hex.builtin.view.hex_editor.menu.edit.paste", "Colar" },
|
||||
{ "hex.builtin.view.hex_editor.menu.edit.select_all", "Selecionar tudo" },
|
||||
@@ -416,11 +423,14 @@ namespace hex::plugin::builtin {
|
||||
// { "hex.builtin.view.find.strings.line_feeds", "Line Feeds" },
|
||||
// { "hex.builtin.view.find.sequences", "Sequences" },
|
||||
// { "hex.builtin.view.find.regex", "Regex" },
|
||||
// { "hex.builtin.view.find.regex.pattern", "Pattern" },
|
||||
// { "hex.builtin.view.find.regex.full_match", "Require full match" },
|
||||
// { "hex.builtin.view.find.binary_pattern", "Binary Pattern" },
|
||||
// { "hex.builtin.view.find.search", "Search" },
|
||||
// { "hex.builtin.view.find.context.copy", "Copy Value" },
|
||||
// { "hex.builtin.view.find.context.copy_demangle", "Copy Demangled Value" },
|
||||
// { "hex.builtin.view.find.search.entries", "{} entries found" },
|
||||
// { "hex.builtin.view.find.search.reset", "Reset" },
|
||||
|
||||
{ "hex.builtin.command.calc.desc", "Calculadora" },
|
||||
{ "hex.builtin.command.cmd.desc", "Comando" },
|
||||
|
||||
@@ -81,13 +81,13 @@ namespace hex::plugin::builtin {
|
||||
{ "hex.builtin.common.browse", "浏览..." },
|
||||
{ "hex.builtin.common.choose_file", "选择文件" },
|
||||
{ "hex.builtin.common.processing", "处理" },
|
||||
//{ "hex.builtin.common.filter", "Filter" },
|
||||
//{ "hex.builtin.common.value", "Value" },
|
||||
{ "hex.builtin.common.filter", "过滤器" },
|
||||
{ "hex.builtin.common.value", "值" },
|
||||
{ "hex.builtin.common.offset", "偏移" },
|
||||
//{ "hex.builtin.common.range", "Range" },
|
||||
//{ "hex.builtin.common.range.entire_data", "Entire Data" },
|
||||
//{ "hex.builtin.common.range.selection", "Selection" },
|
||||
//{ "hex.builtin.common.comment", "Comment" },
|
||||
{ "hex.builtin.common.range", "范围" },
|
||||
{ "hex.builtin.common.range.entire_data", "所有数据" },
|
||||
{ "hex.builtin.common.range.selection", "选区" },
|
||||
{ "hex.builtin.common.comment", "注释" },
|
||||
|
||||
{ "hex.builtin.common.encoding.ascii", "ASCII" },
|
||||
{ "hex.builtin.common.encoding.utf16le", "UTF-16LE" },
|
||||
@@ -96,15 +96,15 @@ namespace hex::plugin::builtin {
|
||||
|
||||
{ "hex.builtin.popup.exit_application.title", "退出?" },
|
||||
{ "hex.builtin.popup.exit_application.desc", "工程还有未保存的更改。\n确定要退出吗?" },
|
||||
//{ "hex.builtin.popup.close_provider.title", "Close Provider?" },
|
||||
//{ "hex.builtin.popup.close_provider.desc", "You have unsaved changes made to this Provider.\nAre you sure you want to close it?" },
|
||||
{ "hex.builtin.popup.close_provider.title", "关闭提供器?" },
|
||||
{ "hex.builtin.popup.close_provider.desc", "有对此提供器做出的未保存的更改。\n你确定要关闭吗?" },
|
||||
{ "hex.builtin.popup.error.read_only", "无法获得写权限,文件以只读方式打开。" },
|
||||
{ "hex.builtin.popup.error.open", "打开文件失败!" },
|
||||
{ "hex.builtin.popup.error.create", "创建新文件失败!" },
|
||||
//{ "hex.builtin.popup.error.task_exception", "Exception thrown in Task '{}':\n\n{}" },
|
||||
{ "hex.builtin.popup.error.task_exception", "任务 '{}' 异常:\n\n{}" },
|
||||
|
||||
{ "hex.builtin.menu.file", "文件" },
|
||||
//{ "hex.builtin.menu.file.create_file", "New File..." },
|
||||
{ "hex.builtin.menu.file.create_file", "新建文件..." },
|
||||
{ "hex.builtin.menu.file.open_file", "打开文件..." },
|
||||
{ "hex.builtin.menu.file.open_recent", "最近打开" },
|
||||
{ "hex.builtin.menu.file.clear_recent", "清除" },
|
||||
@@ -125,8 +125,8 @@ namespace hex::plugin::builtin {
|
||||
{ "hex.builtin.menu.file.export.ips32", "IPS32 补丁" },
|
||||
{ "hex.builtin.menu.file.export.base64.popup.export_error", "文件不是有效的 Base64 格式!" },
|
||||
{ "hex.builtin.menu.file.export.popup.create", "无法导出文件。文件创建失败!" },
|
||||
//{ "hex.builtin.menu.file.bookmark.import", "Import bookmarks" },
|
||||
//{ "hex.builtin.menu.file.bookmark.export", "Export bookmarks" },
|
||||
{ "hex.builtin.menu.file.bookmark.import", "导入书签" },
|
||||
{ "hex.builtin.menu.file.bookmark.export", "导出书签" },
|
||||
|
||||
{ "hex.builtin.menu.edit", "编辑" },
|
||||
{ "hex.builtin.menu.edit.undo", "撤销" },
|
||||
@@ -279,17 +279,18 @@ namespace hex::plugin::builtin {
|
||||
{ "hex.builtin.view.hex_editor.goto.offset.relative", "相对" },
|
||||
{ "hex.builtin.view.hex_editor.goto.offset.begin", "起始" },
|
||||
{ "hex.builtin.view.hex_editor.goto.offset.end", "末尾" },
|
||||
//{ "hex.builtin.view.hex_editor.menu.file.select", "Select" },
|
||||
// { "hex.builtin.view.hex_editor.select.offset.region", "Region" },
|
||||
// { "hex.builtin.view.hex_editor.select.offset.begin", "Begin" },
|
||||
// { "hex.builtin.view.hex_editor.select.offset.end", "End" },
|
||||
// { "hex.builtin.view.hex_editor.select.offset.size", "Size" },
|
||||
// { "hex.builtin.view.hex_editor.select.select", "Select" },
|
||||
{ "hex.builtin.view.hex_editor.menu.file.select", "选择" },
|
||||
{ "hex.builtin.view.hex_editor.select.offset.region", "区域" },
|
||||
{ "hex.builtin.view.hex_editor.select.offset.begin", "起始" },
|
||||
{ "hex.builtin.view.hex_editor.select.offset.end", "结束" },
|
||||
{ "hex.builtin.view.hex_editor.select.offset.size", "大小" },
|
||||
{ "hex.builtin.view.hex_editor.select.select", "选择" },
|
||||
{ "hex.builtin.view.hex_editor.menu.file.save", "保存" },
|
||||
{ "hex.builtin.view.hex_editor.menu.file.save_as", "另存为..." },
|
||||
{ "hex.builtin.view.hex_editor.menu.edit.copy", "复制" },
|
||||
{ "hex.builtin.view.hex_editor.menu.edit.copy_as", "复制为..." },
|
||||
{ "hex.builtin.view.hex_editor.copy.hex", "字符串" },
|
||||
{ "hex.builtin.view.hex_editor.copy.address", "地址" },
|
||||
{ "hex.builtin.view.hex_editor.copy.c", "C 数组" },
|
||||
{ "hex.builtin.view.hex_editor.copy.cpp", "C++ 数组" },
|
||||
{ "hex.builtin.view.hex_editor.copy.csharp", "C# 数组" },
|
||||
@@ -297,7 +298,13 @@ namespace hex::plugin::builtin {
|
||||
{ "hex.builtin.view.hex_editor.copy.python", "Python 数组" },
|
||||
{ "hex.builtin.view.hex_editor.copy.java", "Java 数组" },
|
||||
{ "hex.builtin.view.hex_editor.copy.js", "JavaScript 数组" },
|
||||
{ "hex.builtin.view.hex_editor.copy.ascii", "Hex Dump(ASCII 艺术)" },
|
||||
{ "hex.builtin.view.hex_editor.copy.lua", "Lua 数组" },
|
||||
{ "hex.builtin.view.hex_editor.copy.go", "Go 数组" },
|
||||
{ "hex.builtin.view.hex_editor.copy.crystal", "Crystal 数组" },
|
||||
{ "hex.builtin.view.hex_editor.copy.swift", "Swift 数组" },
|
||||
{ "hex.builtin.view.hex_editor.copy.pascal", "Pascal 数组" },
|
||||
{ "hex.builtin.view.hex_editor.copy.base64", "Base64" },
|
||||
//{ "hex.builtin.view.hex_editor.copy.ascii", "Text Area" },
|
||||
{ "hex.builtin.view.hex_editor.copy.html", "HTML" },
|
||||
{ "hex.builtin.view.hex_editor.menu.edit.paste", "粘贴" },
|
||||
{ "hex.builtin.view.hex_editor.menu.edit.select_all", "全选" },
|
||||
@@ -400,30 +407,33 @@ namespace hex::plugin::builtin {
|
||||
|
||||
{ "hex.builtin.view.provider_settings.name", "提供器设置" },
|
||||
{ "hex.builtin.view.provider_settings.load_popup", "打开提供器" },
|
||||
// { "hex.builtin.view.provider_settings.load_error", "An error occurred while trying to open this provider!"},
|
||||
{ "hex.builtin.view.provider_settings.load_error", "尝试打开此提供器时出现错误"},
|
||||
|
||||
//{ "hex.builtin.view.find.name", "Find" },
|
||||
// { "hex.builtin.view.find.searching", "Searching..." },
|
||||
// { "hex.builtin.view.find.demangled", "Demangled" },
|
||||
// { "hex.builtin.view.find.strings", "Strings" },
|
||||
// { "hex.builtin.view.find.strings.min_length", "Minimum length" },
|
||||
// { "hex.builtin.view.find.strings.match_settings", "Match Settings" },
|
||||
// { "hex.builtin.view.find.strings.null_term", "Require Null Termination" },
|
||||
// { "hex.builtin.view.find.strings.chars", "Characters" },
|
||||
// { "hex.builtin.view.find.strings.lower_case", "Lower case letters" },
|
||||
// { "hex.builtin.view.find.strings.upper_case", "Upper case letters" },
|
||||
// { "hex.builtin.view.find.strings.numbers", "Numbers" },
|
||||
// { "hex.builtin.view.find.strings.underscores", "Underscores" },
|
||||
// { "hex.builtin.view.find.strings.symbols", "Symbols" },
|
||||
// { "hex.builtin.view.find.strings.spaces", "Spaces" },
|
||||
// { "hex.builtin.view.find.strings.line_feeds", "Line Feeds" },
|
||||
// { "hex.builtin.view.find.sequences", "Sequences" },
|
||||
// { "hex.builtin.view.find.regex", "Regex" },
|
||||
// { "hex.builtin.view.find.binary_pattern", "Binary Pattern" },
|
||||
// { "hex.builtin.view.find.search", "Search" },
|
||||
// { "hex.builtin.view.find.context.copy", "Copy Value" },
|
||||
// { "hex.builtin.view.find.context.copy_demangle", "Copy Demangled Value" },
|
||||
// { "hex.builtin.view.find.search.entries", "{} entries found" },
|
||||
{ "hex.builtin.view.find.name", "查找" },
|
||||
{ "hex.builtin.view.find.searching", "搜索中..." },
|
||||
{ "hex.builtin.view.find.demangled", "还原名" },
|
||||
{ "hex.builtin.view.find.strings", "字符串" },
|
||||
{ "hex.builtin.view.find.strings.min_length", "最短长度" },
|
||||
{ "hex.builtin.view.find.strings.match_settings", "配置设置" },
|
||||
{ "hex.builtin.view.find.strings.null_term", "需要NULL终止" },
|
||||
{ "hex.builtin.view.find.strings.chars", "字符" },
|
||||
{ "hex.builtin.view.find.strings.lower_case", "小写字母" },
|
||||
{ "hex.builtin.view.find.strings.upper_case", "大写字母" },
|
||||
{ "hex.builtin.view.find.strings.numbers", "数字" },
|
||||
{ "hex.builtin.view.find.strings.underscores", "下划线" },
|
||||
{ "hex.builtin.view.find.strings.symbols", "符号" },
|
||||
{ "hex.builtin.view.find.strings.spaces", "空格" },
|
||||
{ "hex.builtin.view.find.strings.line_feeds", "换行" },
|
||||
{ "hex.builtin.view.find.sequences", "序列" },
|
||||
{ "hex.builtin.view.find.regex", "正则表达式" },
|
||||
// { "hex.builtin.view.find.regex.pattern", "Pattern" },
|
||||
// { "hex.builtin.view.find.regex.full_match", "Require full match" },
|
||||
{ "hex.builtin.view.find.binary_pattern", "二进制模式" },
|
||||
{ "hex.builtin.view.find.search", "搜索" },
|
||||
{ "hex.builtin.view.find.context.copy", "复制值" },
|
||||
{ "hex.builtin.view.find.context.copy_demangle", "复制值的还原名" },
|
||||
{ "hex.builtin.view.find.search.entries", "{} 个结果" },
|
||||
// { "hex.builtin.view.find.search.reset", "Reset" },
|
||||
|
||||
{ "hex.builtin.command.calc.desc", "计算器" },
|
||||
{ "hex.builtin.command.cmd.desc", "指令" },
|
||||
@@ -431,8 +441,7 @@ namespace hex::plugin::builtin {
|
||||
{ "hex.builtin.command.web.desc", "网站解析" },
|
||||
{ "hex.builtin.command.web.result", "导航到 '{0}'" },
|
||||
|
||||
// Use half width symbols for inspector names because displayable space
|
||||
{ "hex.builtin.inspector.binary", "二进制(8位)" },
|
||||
{ "hex.builtin.inspector.binary", "二进制(8 位)" },
|
||||
{ "hex.builtin.inspector.u8", "uint8_t" },
|
||||
{ "hex.builtin.inspector.i8", "int8_t" },
|
||||
{ "hex.builtin.inspector.u16", "uint16_t" },
|
||||
@@ -445,12 +454,12 @@ namespace hex::plugin::builtin {
|
||||
{ "hex.builtin.inspector.i48", "int48_t" },
|
||||
{ "hex.builtin.inspector.u64", "uint64_t" },
|
||||
{ "hex.builtin.inspector.i64", "int64_t" },
|
||||
{ "hex.builtin.inspector.float16", "半精度浮点(16位)" },
|
||||
{ "hex.builtin.inspector.float", "float(32位单精度)" },
|
||||
{ "hex.builtin.inspector.double", "double(64位双精度)" },
|
||||
{ "hex.builtin.inspector.long_double", "long double(128位四精度)" },
|
||||
//{ "hex.builtin.inspector.sleb128", "Signed LEB128" },
|
||||
//{ "hex.builtin.inspector.uleb128", "Unsigned LEB128" },
|
||||
{ "hex.builtin.inspector.float16", "half float(16 位)" },
|
||||
{ "hex.builtin.inspector.float", "float(32 位)" },
|
||||
{ "hex.builtin.inspector.double", "double(64 位)" },
|
||||
{ "hex.builtin.inspector.long_double", "long double(128 位)" },
|
||||
{ "hex.builtin.inspector.sleb128", "有符号LEB128" },
|
||||
{ "hex.builtin.inspector.uleb128", "无符号LEB128" },
|
||||
{ "hex.builtin.inspector.bool", "bool" },
|
||||
{ "hex.builtin.inspector.ascii", "ASCII 字符" },
|
||||
{ "hex.builtin.inspector.wide", "宽字符" },
|
||||
@@ -709,7 +718,7 @@ namespace hex::plugin::builtin {
|
||||
{ "hex.builtin.setting.general", "通用" },
|
||||
{ "hex.builtin.setting.general.show_tips", "在启动时显示每日提示" },
|
||||
{ "hex.builtin.setting.general.auto_load_patterns", "自动加载支持的模式" },
|
||||
// { "hex.builtin.setting.general.sync_pattern_source", "Sync pattern source code between providers" },
|
||||
{ "hex.builtin.setting.general.sync_pattern_source", "在提供器间同步模式源码" },
|
||||
{ "hex.builtin.setting.interface", "界面" },
|
||||
{ "hex.builtin.setting.interface.color", "颜色主题" },
|
||||
{ "hex.builtin.setting.interface.color.system", "跟随系统" },
|
||||
@@ -765,10 +774,10 @@ namespace hex::plugin::builtin {
|
||||
{ "hex.builtin.provider.disk.disk_size", "磁盘大小" },
|
||||
{ "hex.builtin.provider.disk.sector_size", "扇区大小" },
|
||||
{ "hex.builtin.provider.disk.reload", "刷新" },
|
||||
//{ "hex.builtin.provider.intel_hex", "Intel Hex Provider" },
|
||||
// { "hex.builtin.provider.intel_hex.name", "Intel Hex {0}" },
|
||||
//{ "hex.builtin.provider.motorola_srec", "Motorola SREC Provider" },
|
||||
// { "hex.builtin.provider.motorola_srec.name", "Motorola SREC {0}" },
|
||||
{ "hex.builtin.provider.intel_hex", "Intel Hex" },
|
||||
{ "hex.builtin.provider.intel_hex.name", "Intel Hex {0}" },
|
||||
{ "hex.builtin.provider.motorola_srec", "Motorola SREC" },
|
||||
{ "hex.builtin.provider.motorola_srec.name", "Motorola SREC {0}" },
|
||||
|
||||
{ "hex.builtin.layouts.default", "默认" },
|
||||
|
||||
|
||||
@@ -287,6 +287,7 @@ namespace hex::plugin::builtin {
|
||||
{ "hex.builtin.view.hex_editor.menu.edit.copy", "複製" },
|
||||
{ "hex.builtin.view.hex_editor.menu.edit.copy_as", "複製為..." },
|
||||
{ "hex.builtin.view.hex_editor.copy.hex", "字串" },
|
||||
//{ "hex.builtin.view.hex_editor.copy.address", "Address" },
|
||||
{ "hex.builtin.view.hex_editor.copy.c", "C 陣列" },
|
||||
{ "hex.builtin.view.hex_editor.copy.cpp", "C++ 陣列" },
|
||||
{ "hex.builtin.view.hex_editor.copy.csharp", "C# 陣列" },
|
||||
@@ -294,7 +295,13 @@ namespace hex::plugin::builtin {
|
||||
{ "hex.builtin.view.hex_editor.copy.python", "Python 陣列" },
|
||||
{ "hex.builtin.view.hex_editor.copy.java", "Java 陣列" },
|
||||
{ "hex.builtin.view.hex_editor.copy.js", "JavaScript 陣列" },
|
||||
{ "hex.builtin.view.hex_editor.copy.ascii", "ASCII 畫" },
|
||||
{ "hex.builtin.view.hex_editor.copy.lua", "Lua 陣列" },
|
||||
{ "hex.builtin.view.hex_editor.copy.go", "Go 陣列" },
|
||||
{ "hex.builtin.view.hex_editor.copy.crystal", "Crystal 陣列" },
|
||||
{ "hex.builtin.view.hex_editor.copy.swift", "Swift 陣列" },
|
||||
{ "hex.builtin.view.hex_editor.copy.pascal", "Pascal 陣列" },
|
||||
{ "hex.builtin.view.hex_editor.copy.base64", "Base64" },
|
||||
// { "hex.builtin.view.hex_editor.copy.ascii", "Text Area" },
|
||||
{ "hex.builtin.view.hex_editor.copy.html", "HTML" },
|
||||
{ "hex.builtin.view.hex_editor.menu.edit.paste", "貼上" },
|
||||
{ "hex.builtin.view.hex_editor.menu.edit.select_all", "全選" },
|
||||
@@ -417,11 +424,14 @@ namespace hex::plugin::builtin {
|
||||
// { "hex.builtin.view.find.strings.line_feeds", "Line Feeds" },
|
||||
// { "hex.builtin.view.find.sequences", "Sequences" },
|
||||
// { "hex.builtin.view.find.regex", "Regex" },
|
||||
// { "hex.builtin.view.find.regex.pattern", "Pattern" },
|
||||
// { "hex.builtin.view.find.regex.full_match", "Require full match" },
|
||||
// { "hex.builtin.view.find.binary_pattern", "Binary Pattern" },
|
||||
// { "hex.builtin.view.find.search", "Search" },
|
||||
// { "hex.builtin.view.find.context.copy", "Copy Value" },
|
||||
// { "hex.builtin.view.find.context.copy_demangle", "Copy Demangled Value" },
|
||||
// { "hex.builtin.view.find.search.entries", "{} entries found" },
|
||||
// { "hex.builtin.view.find.search.reset", "Reset" },
|
||||
|
||||
{ "hex.builtin.command.calc.desc", "計算機" },
|
||||
{ "hex.builtin.command.cmd.desc", "命令" },
|
||||
|
||||
97
resources/projects/logo_text.svg
Normal file
97
resources/projects/logo_text.svg
Normal file
@@ -0,0 +1,97 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
width="138.42885mm"
|
||||
height="42.6539mm"
|
||||
viewBox="0 0 138.42885 42.6539"
|
||||
version="1.1"
|
||||
id="svg1"
|
||||
inkscape:export-filename="bitmap.png"
|
||||
inkscape:export-xdpi="93.949997"
|
||||
inkscape:export-ydpi="93.949997"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg">
|
||||
|
||||
<style>
|
||||
#text2 { fill:#d8dbe1; }
|
||||
|
||||
@media (prefers-color-scheme: light) {
|
||||
#text2 { fill:#121419; }
|
||||
}
|
||||
</style>
|
||||
|
||||
<sodipodi:namedview
|
||||
id="namedview1"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#000000"
|
||||
borderopacity="0.25"
|
||||
inkscape:showpageshadow="2"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pagecheckerboard="0"
|
||||
inkscape:deskcolor="#d1d1d1"
|
||||
inkscape:document-units="mm"
|
||||
showgrid="false"
|
||||
inkscape:export-bgcolor="#babec900" />
|
||||
<defs
|
||||
id="defs1">
|
||||
<filter
|
||||
style="color-interpolation-filters:sRGB"
|
||||
inkscape:label="Drop Shadow"
|
||||
id="filter30"
|
||||
x="-0.037258737"
|
||||
y="-0.14521736"
|
||||
width="1.0745175"
|
||||
height="1.2904347">
|
||||
<feFlood
|
||||
result="flood"
|
||||
in="SourceGraphic"
|
||||
flood-opacity="0.564706"
|
||||
flood-color="rgb(0,0,0)"
|
||||
id="feFlood29" />
|
||||
<feGaussianBlur
|
||||
result="blur"
|
||||
in="SourceGraphic"
|
||||
stdDeviation="2.000000"
|
||||
id="feGaussianBlur29" />
|
||||
<feOffset
|
||||
result="offset"
|
||||
in="blur"
|
||||
dx="0.000000"
|
||||
dy="0.000000"
|
||||
id="feOffset29" />
|
||||
<feComposite
|
||||
result="comp1"
|
||||
operator="in"
|
||||
in="flood"
|
||||
in2="offset"
|
||||
id="feComposite29" />
|
||||
<feComposite
|
||||
result="comp2"
|
||||
operator="over"
|
||||
in="SourceGraphic"
|
||||
in2="comp1"
|
||||
id="feComposite30" />
|
||||
</filter>
|
||||
</defs>
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(-44.395001,-12.770095)">
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-size:45.1556px;line-height:0;fill-opacity:1;stroke-width:0.264583;filter:url(#filter30)"
|
||||
x="45.943798"
|
||||
y="49.901505"
|
||||
id="text2"
|
||||
inkscape:label="text2"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan2"
|
||||
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:45.1556px;font-family:'Product Sans';-inkscape-font-specification:'Product Sans Bold';fill-opacity:1;stroke-width:0.264583"
|
||||
x="45.943798"
|
||||
y="49.901505">ImHex</tspan></text>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.7 KiB |
BIN
resources/projects/ms_banner.xcf
Normal file
BIN
resources/projects/ms_banner.xcf
Normal file
Binary file not shown.
Reference in New Issue
Block a user