hi.
i have a linux elf with a self define setion (__attribute__((section(".sigdata"), used)) unsigned char g_sig[256];)to be proteced. i wanna use vmp in this way: compile origin executable elf file,and protect it with vmp,then cal signature data of protected elf file ,at the end objcopy --update-section to overwrite the user defined section. without vmprotect shelling , objcopy --update-section work fine.but after vmprotect shelling objcopy --update-section report the input file has no sections.i test several option possible related (Details->Segments->Exclued from protection or option->File->pack the output file..),no one work.
is it a bug ? or i use in a wrong way?or something cant be handled technologically?
by the way i use the V3.9.6.2385 windows version to proction linux elf file.
linux elf segment option excluded from protection failed
-
- Posts: 8
- Joined: Fri Mar 14, 2025 3:31 am
Re: linux elf segment option excluded from protection failed
Please notice that a "segment" and a "section" are different things. Try to use the following script:
Code: Select all
function OnBeforeSaveFile()
local file = vmprotect.core():outputArchitecture()
local section = file:sections():itemByName('.sigdata')
if section then
section:setExcludedFromStrip(true)
end
end
-
- Posts: 8
- Joined: Fri Mar 14, 2025 3:31 am
Re: linux elf segment option excluded from protection failed
thx for your reply. yeah your script worked , after compiling with the scirpt code,the output can be handled with "objcopy --update-section " (no error msg report ),but when run the "objcopy" handled file it crushed and report "cannot execute binary file: Exec format error" ,it seems the file had been demaged by the command.
and the scirpt code report script error when i use it in windows conditon(windows version vmprotect to protect windwos exe)。it report,"attempt to call a nill value(method 'itemByName')"。Forgive me for not familiar with the lua language.
best wishes.
and the scirpt code report script error when i use it in windows conditon(windows version vmprotect to protect windwos exe)。it report,"attempt to call a nill value(method 'itemByName')"。Forgive me for not familiar with the lua language.
best wishes.
Re: linux elf segment option excluded from protection failed
I don't recommend to modify a protected application because it may work incorrectly.
P.S. The PE format contains only "segments" unlike ELF and Mach-O where "segments" and "sections" are available.
P.S. The PE format contains only "segments" unlike ELF and Mach-O where "segments" and "sections" are available.
-
- Posts: 8
- Joined: Fri Mar 14, 2025 3:31 am
Re: linux elf segment option excluded from protection failed
yeah.thx for your help.i'll use it in another nornal way.