From d24858fb7248d3d15679855f69fa7be087aec68f Mon Sep 17 00:00:00 2001 From: Nikolay Samokhvalov Date: Wed, 20 Aug 2025 10:38:03 -0700 Subject: [PATCH 1/6] Improve macOS installation instructions - Add Apple Silicon (M1/M2/M3) compatibility notes - Provide Hex Fiend alternative when wxHexEditor fails to build - Fix Python configuration issue for udis86 Addresses compilation issues on ARM64 macOS while maintaining compatibility with existing Intel Mac instructions. --- README.md | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 42d6bf0..792e49c 100644 --- a/README.md +++ b/README.md @@ -166,19 +166,31 @@ git repo, and following the instructions that it provides: ## Initial setup on MacOS -These steps should help you install pg_hexedit on MacOS (tested on Catalina +These steps should help you install pg_hexedit on MacOS (tested on Catalina and Apple Silicon with installed [Homebrew](https://brew.sh/)): 1. `brew install automake autoconf libtool wxmac` -1. Get [wxHexEditor source code](https://github.com/EUA/wxHexEditor) and edit -`Makefile` removing the line mentioning OpenMP (`LIBS += -lgomp`) -1. Build wxHexEditor (`make`) -1. Get pg_hexedit source code, build (`make`) with `$PATH` including path + +**Note for Apple Silicon (M1/M2/M3) Macs:** Building wxHexEditor from source currently fails due to x86 SSE intrinsics compatibility issues. Consider using an alternative hex editor like [Hex Fiend](https://hexfiend.com/) (`brew install --cask hex-fiend`) and configure `hexedit.cfg` accordingly. + +2. Get [wxHexEditor source code](https://github.com/EUA/wxHexEditor) and edit +`Makefile` removing the line mentioning OpenMP (`LIBS += -lgomp`). Also configure with Python: `cd udis86 && ./configure --with-python=/opt/homebrew/bin/python3` +3. Build wxHexEditor (`make`) +4. Get pg_hexedit source code, build (`make`) with `$PATH` including path to PostgreSQL binaries (Postgres installed via Homebrew – `brew install postgresql` – should be enough) -1. In hexedit.cfg, check `export HEXEDITOR`, it needs to point to +5. In hexedit.cfg, check `export HEXEDITOR`, it needs to point to the `wxHexEditor` binary (created above) +### Alternative: Using Hex Fiend (recommended for Apple Silicon) + +If wxHexEditor compilation fails: + +1. Install Hex Fiend: `brew install --cask hex-fiend` +2. Build pg_hexedit only: `make` (in pg_hexedit directory) +3. Edit `hexedit.cfg` to set: `export HEXEDITOR="open -a 'Hex Fiend'"` (or path to your preferred hex editor) +4. Generate tags manually: `./pg_hexedit file > file.tags` then open file in Hex Fiend + Note: The convenience scripts set `$HOME` to the current working directory so that wxHexEditor reads its settings from a convenience-script-generated .wxHexEditor config file rather than the true user-wide/system-wide config From 1838fddcd3fd4d0f0c056d511428ea893f8cb33e Mon Sep 17 00:00:00 2001 From: Nikolay Samokhvalov Date: Wed, 20 Aug 2025 11:05:18 -0700 Subject: [PATCH 2/6] Clarify that Hex Fiend doesn't import wxHexEditor XML tags - Make it clear that Hex Fiend won't display the XML annotations - Explain that tags file is for separate reference - Set proper expectations for the alternative workflow --- README.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 792e49c..d381e97 100644 --- a/README.md +++ b/README.md @@ -182,14 +182,17 @@ to PostgreSQL binaries (Postgres installed via Homebrew – 5. In hexedit.cfg, check `export HEXEDITOR`, it needs to point to the `wxHexEditor` binary (created above) -### Alternative: Using Hex Fiend (recommended for Apple Silicon) +### Alternative: Using Hex Fiend (for Apple Silicon when wxHexEditor fails) -If wxHexEditor compilation fails: +If wxHexEditor compilation fails, you can still use pg_hexedit to analyze PostgreSQL files: 1. Install Hex Fiend: `brew install --cask hex-fiend` 2. Build pg_hexedit only: `make` (in pg_hexedit directory) -3. Edit `hexedit.cfg` to set: `export HEXEDITOR="open -a 'Hex Fiend'"` (or path to your preferred hex editor) -4. Generate tags manually: `./pg_hexedit file > file.tags` then open file in Hex Fiend +3. Generate XML annotations: `./pg_hexedit file > file.tags` +4. Open the file in Hex Fiend for hex viewing +5. Reference the `.tags` file separately for PostgreSQL structure information + +**Note:** Hex Fiend does not automatically import wxHexEditor XML tags, but the generated annotations are still valuable for understanding PostgreSQL page structure. Note: The convenience scripts set `$HOME` to the current working directory so that wxHexEditor reads its settings from a convenience-script-generated From 9c820f3ed67c932722e1670b38754613120892e3 Mon Sep 17 00:00:00 2001 From: Nikolay Samokhvalov Date: Wed, 20 Aug 2025 11:09:07 -0700 Subject: [PATCH 3/6] Replace Hex Fiend recommendation with ImHex ImHex provides better analysis capabilities for PostgreSQL files: - Modern hex editor with pattern matching - Built-in data structure visualization - More suitable for analyzing complex binary formats - Available on macOS ARM64 via Homebrew --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index d381e97..8d4dd4f 100644 --- a/README.md +++ b/README.md @@ -182,17 +182,17 @@ to PostgreSQL binaries (Postgres installed via Homebrew – 5. In hexedit.cfg, check `export HEXEDITOR`, it needs to point to the `wxHexEditor` binary (created above) -### Alternative: Using Hex Fiend (for Apple Silicon when wxHexEditor fails) +### Alternative: Using ImHex (recommended for Apple Silicon when wxHexEditor fails) -If wxHexEditor compilation fails, you can still use pg_hexedit to analyze PostgreSQL files: +If wxHexEditor compilation fails, ImHex provides a modern alternative with pattern matching capabilities: -1. Install Hex Fiend: `brew install --cask hex-fiend` -2. Build pg_hexedit only: `make` (in pg_hexedit directory) -3. Generate XML annotations: `./pg_hexedit file > file.tags` -4. Open the file in Hex Fiend for hex viewing -5. Reference the `.tags` file separately for PostgreSQL structure information +1. Install ImHex: `brew install --cask imhex` +2. Build pg_hexedit only: `make` (in pg_hexedit directory) +3. Open PostgreSQL files directly in ImHex for hex viewing with built-in analysis tools -**Note:** Hex Fiend does not automatically import wxHexEditor XML tags, but the generated annotations are still valuable for understanding PostgreSQL page structure. +ImHex offers advanced pattern matching and data structure visualization that can help analyze PostgreSQL page layouts, though it uses its own pattern language rather than importing wxHexEditor XML tags. + +**Alternative:** You can still generate pg_hexedit XML annotations (`./pg_hexedit file > file.tags`) and reference them alongside any hex editor for detailed PostgreSQL structure information. Note: The convenience scripts set `$HOME` to the current working directory so that wxHexEditor reads its settings from a convenience-script-generated From d13ed697520365f056debd9990147048d5a53dad Mon Sep 17 00:00:00 2001 From: Nikolay Samokhvalov Date: Thu, 21 Aug 2025 11:58:37 -0700 Subject: [PATCH 4/6] Update macOS instructions - wxHexEditor builds successfully on ARM64 The SSE intrinsics compilation issues have been resolved. wxHexEditor builds successfully on Apple Silicon with the Python configuration fix. Updated instructions to reflect this success while keeping ImHex as an alternative option for users who prefer it. --- README.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 8d4dd4f..6212994 100644 --- a/README.md +++ b/README.md @@ -171,7 +171,7 @@ with installed [Homebrew](https://brew.sh/)): 1. `brew install automake autoconf libtool wxmac` -**Note for Apple Silicon (M1/M2/M3) Macs:** Building wxHexEditor from source currently fails due to x86 SSE intrinsics compatibility issues. Consider using an alternative hex editor like [Hex Fiend](https://hexfiend.com/) (`brew install --cask hex-fiend`) and configure `hexedit.cfg` accordingly. +**Note for Apple Silicon (M1/M2/M3) Macs:** Building wxHexEditor from source requires some modifications but is possible. The SSE intrinsics are properly wrapped with conditional compilation, so the build should succeed with the Python configuration fix below. 2. Get [wxHexEditor source code](https://github.com/EUA/wxHexEditor) and edit `Makefile` removing the line mentioning OpenMP (`LIBS += -lgomp`). Also configure with Python: `cd udis86 && ./configure --with-python=/opt/homebrew/bin/python3` @@ -182,17 +182,15 @@ to PostgreSQL binaries (Postgres installed via Homebrew – 5. In hexedit.cfg, check `export HEXEDITOR`, it needs to point to the `wxHexEditor` binary (created above) -### Alternative: Using ImHex (recommended for Apple Silicon when wxHexEditor fails) +### Alternative: Using ImHex (if preferred) -If wxHexEditor compilation fails, ImHex provides a modern alternative with pattern matching capabilities: +If you prefer a modern hex editor with pattern matching capabilities: 1. Install ImHex: `brew install --cask imhex` 2. Build pg_hexedit only: `make` (in pg_hexedit directory) 3. Open PostgreSQL files directly in ImHex for hex viewing with built-in analysis tools -ImHex offers advanced pattern matching and data structure visualization that can help analyze PostgreSQL page layouts, though it uses its own pattern language rather than importing wxHexEditor XML tags. - -**Alternative:** You can still generate pg_hexedit XML annotations (`./pg_hexedit file > file.tags`) and reference them alongside any hex editor for detailed PostgreSQL structure information. +ImHex offers advanced pattern matching and data structure visualization, though it uses its own pattern language rather than importing wxHexEditor XML tags. For full pg_hexedit functionality with XML annotations, wxHexEditor remains the recommended choice. Note: The convenience scripts set `$HOME` to the current working directory so that wxHexEditor reads its settings from a convenience-script-generated From f69ac4a3748940d4b1209078743bf5ae55f07cbb Mon Sep 17 00:00:00 2001 From: Nikolay Samokhvalov Date: Thu, 21 Aug 2025 12:00:34 -0700 Subject: [PATCH 5/6] Streamline macOS Apple Silicon instructions - Remove redundant note, integrate ARM64 fix into step sequence - Make Python configuration step clearly Apple Silicon specific - Cleaner, more actionable instructions for users - Confirmed working with successful wxHexEditor + pg_hexedit integration --- README.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 6212994..e35c59d 100644 --- a/README.md +++ b/README.md @@ -171,15 +171,14 @@ with installed [Homebrew](https://brew.sh/)): 1. `brew install automake autoconf libtool wxmac` -**Note for Apple Silicon (M1/M2/M3) Macs:** Building wxHexEditor from source requires some modifications but is possible. The SSE intrinsics are properly wrapped with conditional compilation, so the build should succeed with the Python configuration fix below. - 2. Get [wxHexEditor source code](https://github.com/EUA/wxHexEditor) and edit -`Makefile` removing the line mentioning OpenMP (`LIBS += -lgomp`). Also configure with Python: `cd udis86 && ./configure --with-python=/opt/homebrew/bin/python3` -3. Build wxHexEditor (`make`) -4. Get pg_hexedit source code, build (`make`) with `$PATH` including path +`Makefile` removing the line mentioning OpenMP (`LIBS += -lgomp`) +3. **For Apple Silicon (M1/M2/M3) Macs:** Configure udis86 with Python: `cd udis86 && ./configure --with-python=/opt/homebrew/bin/python3` +4. Build wxHexEditor (`make`) +5. Get pg_hexedit source code, build (`make`) with `$PATH` including path to PostgreSQL binaries (Postgres installed via Homebrew – `brew install postgresql` – should be enough) -5. In hexedit.cfg, check `export HEXEDITOR`, it needs to point to +6. In hexedit.cfg, check `export HEXEDITOR`, it needs to point to the `wxHexEditor` binary (created above) ### Alternative: Using ImHex (if preferred) From 7d82fd6f1eeb219afdedb830f7eb33de5e2b87d1 Mon Sep 17 00:00:00 2001 From: Nikolay Samokhvalov Date: Thu, 21 Aug 2025 12:15:47 -0700 Subject: [PATCH 6/6] Clean up macOS instructions - remove unnecessary alternatives - Update testing info: Apple Silicon M1 on Sequoia 15.6 - Remove ImHex alternative section - wxHexEditor works perfectly - Focus on the proven solution that provides full functionality --- README.md | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/README.md b/README.md index e35c59d..431baa6 100644 --- a/README.md +++ b/README.md @@ -166,7 +166,7 @@ git repo, and following the instructions that it provides: ## Initial setup on MacOS -These steps should help you install pg_hexedit on MacOS (tested on Catalina and Apple Silicon +These steps should help you install pg_hexedit on MacOS (tested on Catalina and Apple Silicon M1 on Sequoia 15.6 with installed [Homebrew](https://brew.sh/)): 1. `brew install automake autoconf libtool wxmac` @@ -181,15 +181,6 @@ to PostgreSQL binaries (Postgres installed via Homebrew – 6. In hexedit.cfg, check `export HEXEDITOR`, it needs to point to the `wxHexEditor` binary (created above) -### Alternative: Using ImHex (if preferred) - -If you prefer a modern hex editor with pattern matching capabilities: - -1. Install ImHex: `brew install --cask imhex` -2. Build pg_hexedit only: `make` (in pg_hexedit directory) -3. Open PostgreSQL files directly in ImHex for hex viewing with built-in analysis tools - -ImHex offers advanced pattern matching and data structure visualization, though it uses its own pattern language rather than importing wxHexEditor XML tags. For full pg_hexedit functionality with XML annotations, wxHexEditor remains the recommended choice. Note: The convenience scripts set `$HOME` to the current working directory so that wxHexEditor reads its settings from a convenience-script-generated