开发者

Modify env variable name inside a library with hex editor?

开发者 https://www.devze.com 2023-03-01 23:35 出处:网络
Is i开发者_运维技巧t possible to modify an environmental variable\'s name inside a library with some sort of editor. I\'m thinking maybe a hex editor ?

Is i开发者_运维技巧t possible to modify an environmental variable's name inside a library with some sort of editor. I'm thinking maybe a hex editor ?

I wish to modify the name but without altering its length: envfoobar (9 chars) yellowbar (9 chars)

Obviously, recompilation would be perfect but I do not know what exact flags were used to compile this library.


What's stopping you? You can even use a text editor (as long as it's a decent editor and knows how to handle binary data, like vim does). If the library is referring to the name of the environment variable through a string, and the string is in the library in the data segment (ie. it's not a string built at runtime), then it's trivial to edit a library in this way. Just don't delete or introduce new characters. I've done this under Linux. Some other OSes may digitally sign binaries and prevent this from working. Some OSes use a standard checksum or hash in which case you'll have to recompute it.


If you can find the name with the strings command on the library it might work. You could load the library up in your favorite hex editor change the string and give it a shot.

It's a hacky thing to do but it could work. Let us know.

0

精彩评论

暂无评论...
验证码 换一张
取 消