arm64 support very broken

Issues related to VMProtect
Locked
NavilleZhang
Posts: 19
Joined: Fri May 27, 2022 6:23 am

arm64 support very broken

Post by NavilleZhang »

Literally trying to protect any fat macho on my computer results in ``Runtime Error at OpenResource``

Trying to protect a thin arm64 macho results in ``Not enough space for the new segment in the file header``
Last edited by NavilleZhang on Fri Sep 19, 2025 8:04 am, edited 1 time in total.
NavilleZhang
Posts: 19
Joined: Fri May 27, 2022 6:23 am

Re: arm64 support very broken for MachO

Post by NavilleZhang »

on AArch64 Linux ELF so, vmp just crashes right at "saving startup code"
Admin
Site Admin
Posts: 2809
Joined: Mon Aug 21, 2006 8:19 pm
Location: Russia, E-burg
Contact:

Re: arm64 support very broken

Post by Admin »

Send us examples (original binaries + VMP files) that show your problems.
NavilleZhang
Posts: 19
Joined: Fri May 27, 2022 6:23 am

Re: arm64 support very broken

Post by NavilleZhang »

emailed samples to info@vmpsoft.com
Admin
Site Admin
Posts: 2809
Joined: Mon Aug 21, 2006 8:19 pm
Location: Russia, E-burg
Contact:

Re: arm64 support very broken for MachO

Post by Admin »

NavilleZhang wrote: Fri Sep 19, 2025 8:04 am on AArch64 Linux ELF so, vmp just crashes right at "saving startup code"
It seems you tried to protect library for Android that isn't supported by VMProtect.
NavilleZhang wrote: Fri Sep 19, 2025 8:00 am Trying to protect a thin arm64 macho results in ``Not enough space for the new segment in the file header``
Try to use "-headerpad 0x500" for ld to increase the header size.
NavilleZhang wrote: Fri Sep 19, 2025 8:00 am Literally trying to protect any fat macho on my computer results in ``Runtime Error at OpenResource``
Fixed in the 2426 build.
NavilleZhang
Posts: 19
Joined: Fri May 27, 2022 6:23 am

Re: arm64 support very broken

Post by NavilleZhang »

Thank you!
Is there any plan to:
- Support Android Dynamic Library
- Emit that ``headerpad`` fix suggestion along with the error message so I dont have to remember it?

FYI I havn't received 2426 yet
NavilleZhang
Posts: 19
Joined: Fri May 27, 2022 6:23 am

Re: arm64 support very broken

Post by NavilleZhang »

Also, compiling with:

-Wl,-headerpad_max_install_names -Xlinker -headerpad -Xlinker 0x500

seems to yield the exact same error
Admin
Site Admin
Posts: 2809
Joined: Mon Aug 21, 2006 8:19 pm
Location: Russia, E-burg
Contact:

Re: arm64 support very broken

Post by Admin »

Do you see any difference (the file size was changed, etc.) in your binary after usage of "-headerpad"?

P.S. The answer from Google's AI:
The -headerpad flag in Xcode is a linker flag used to add padding to the header of a Mach-O executable or dynamic library. This padding is primarily used to reserve space for future modifications to the dylib ID or loaded dylib paths without requiring a full re-linking of the binary.
How to use -headerpad in Xcode:
Select your Project or Target: In the Xcode Project Navigator, select your project or the specific target you want to apply the flag to.
Navigate to Build Settings: In the main editor area, select the "Build Settings" tab.
Find "Other Linker Flags": Search for "Other Linker Flags" (or OTHER_LDFLAGS) within the Build Settings.
Add the Flag:
Double-click the value area next to "Other Linker Flags."
Click the "+" button to add a new flag.
Enter -headerpad into the new entry.
You can also specify a value for the padding, for example, -headerpad 0x1000 to add 4KB of padding. If no value is specified, the linker will use a default padding size.
NavilleZhang
Posts: 19
Joined: Fri May 27, 2022 6:23 am

Re: arm64 support very broken

Post by NavilleZhang »

My project uses CMake, that implicitly injects ``-headerpad_max_***`` (see https://github.com/Kitware/CMake/blob/c ... .cmake#L10 ) and ld64 ignore my -headerpad 0x500 .

I had to manually remove that CMake command, and raise the custom headpad to 0x4096 for this to work.


The problem is, modifying CMake itself is non-trivial and complicate the process by **A LOT**
NavilleZhang
Posts: 19
Joined: Fri May 27, 2022 6:23 am

Re: arm64 support very broken

Post by NavilleZhang »

I believe Clang allows you to inject custom sections using source level annotations? Can we support using that feature to reserve the load command that VMP needs so we don't need all this trouble?
Admin
Site Admin
Posts: 2809
Joined: Mon Aug 21, 2006 8:19 pm
Location: Russia, E-burg
Contact:

Re: arm64 support very broken

Post by Admin »

NavilleZhang wrote: Mon Sep 22, 2025 6:30 am ld64 ignore my -headerpad 0x500 .
Here is an example:
clang++ ... -Wl,-headerpad,0x1000

I have no idea how to pass these parameters from sources.

P.S. The topic is closed.
Locked