Recent

Author Topic: Modify Manifest Res?  (Read 2322 times)

codeman

  • Jr. Member
  • **
  • Posts: 78
Modify Manifest Res?
« on: January 13, 2022, 04:15:31 pm »
Hello,
Maybe its a dump question but is it possible to modify manifest res of my app on runtime (programmatically) somehow? 

Lazarus v2.02 Win10

Thaddy

  • Hero Member
  • *****
  • Posts: 14205
  • Probably until I exterminate Putin.
Re: Modify Manifest Res?
« Reply #1 on: January 13, 2022, 05:01:49 pm »
That depends. Is your applicatin 32 bit or 64 bit and signed?
If an Windows application is codesigned it is impossible, that is why it is codesigned.
If an Windows application is NOT codesigned you can use the techniques from e.g. https://www.delphibasics.info/home/delphibasicsprojects/xnresourceeditor-fullyfeaturedresourceeditorwithdelphisourcecode. That sourcecode contains everything you need, but note that the program itself should not be running. I am not talking about that program ( the editor) but about the techniques you can copy from its sources.
 You can not change a resource from a running program.
But WHY do you want to change a resource - any resource including manifests - at runtime? It is a huge security risk.
« Last Edit: January 13, 2022, 05:06:25 pm by Thaddy »
Specialize a type, not a var.

codeman

  • Jr. Member
  • **
  • Posts: 78
Re: Modify Manifest Res?
« Reply #2 on: January 14, 2022, 01:49:10 am »
@Thaddy  is a 32bit app and its not a designed jointly app. Mainly i use Reshacker editor but thanks. All i wanted to do is to remove admin privileges and set asInvoker after a procedure is done. (for faster execution if that make sense).

*You can not change a resource from a running program.*   
im taking that as your anwser because thats what i wanted to do.
Thanks tho.
« Last Edit: January 14, 2022, 01:51:39 am by codeman »
Lazarus v2.02 Win10

Remy Lebeau

  • Hero Member
  • *****
  • Posts: 1312
    • Lebeau Software
Re: Modify Manifest Res?
« Reply #3 on: January 15, 2022, 02:55:27 am »
is it possible to modify manifest res of my app on runtime (programmatically) somehow?

No, it is not.  However, it is possible to create separate Activation Contexts at runtime from different manifest datas, and then switch between them as needed.

All i wanted to do is to remove admin privileges and set asInvoker after a procedure is done. (for faster execution if that make sense).

Modifying manifests and ACs is not the correct way to accomplish that.  Use impersonation instead.
Remy Lebeau
Lebeau Software - Owner, Developer
Internet Direct (Indy) - Admin, Developer (Support forum)

 

TinyPortal © 2005-2018