Compressing the to inject dll

c++ / delphi package - dll injection and api hooking
Post Reply
Davita
Posts: 163
Joined: Tue Sep 13, 2005 7:31 pm

Compressing the to inject dll

Post by Davita »

Hello

anyone knows what would happen if I compress the to inject dll with tools like UPX or Aspack?
madshi
Site Admin
Posts: 10766
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

It might result in problems. I'd strongly recommend to not do that. See hooking rule 2:

http://help.madshi.net/HookingRules.htm
2. Only do what is absolutely necessary.
When UPXing the hook dll, it will have to be uncompressed again and again in every single running process on the OS. That can't be good for performance. Also doing unUPXing in memory in system processes doesn't seem like a good idea to me.

Hook dlls should try to be as invisible as possible. So they should avoid to do any unnecessary work like uncompressing themselves.
linden
Posts: 36
Joined: Tue Mar 08, 2005 9:17 am
Location: Japan

Post by linden »

Well, I have a software (it's a program by a Korean AV maker)in my PC that uses madCodeHook; its hooker dll is compressed, and it also has some anti-dissasembly tricks in it....and it hooks system wide! Pretty nasty, but it is working. So, I believe there won't be much problem compressing the hooking dll...
madshi
Site Admin
Posts: 10766
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

Ok, well, probably it will work, if the uncompression routine doesn't do any nasty stuff like using GUI functions, but still I don't really recommend it. But if you want to use it and it works fine for you, that's ok for me. Good luck!

:D
Sirmabus
Posts: 89
Joined: Fri May 28, 2004 6:20 pm

Post by Sirmabus »

I've used some compressors and some cause problems for sure.
You'll probably have to experiment, as different compressors do different low level things, and depending on what anti-debugger, anti-dumping features you have turned on.
Experiment and do a good amount of statability testing..
uall
Posts: 254
Joined: Sun Feb 20, 2005 1:24 pm

Post by uall »

@linden: link to the Korean AV maker?
linden
Posts: 36
Joined: Tue Mar 08, 2005 9:17 am
Location: Japan

Post by linden »

uall wrote:@linden: link to the Korean AV maker?
I think I should avoid pointing it out explicitly, because Madshi might get upset. But if you are interested, search for "HackShield", and you will get there soon. This product uses madCodeHook. It also uses many kinds of nasty rootkit techniques such as service table hooking, page fault handler hooking, and memory cloaking stuff; it does a complete take over of the user PC in order to achieve its goal... Really barbaric!!
madshi
Site Admin
Posts: 10766
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

I dot not mind at all if you find out yourself which product is using madCodeHook. The only thing is that I can't tell it, because I don't know whether my customers would like that. But if you find it out yourself, that's just fine for me.
linden
Posts: 36
Joined: Tue Mar 08, 2005 9:17 am
Location: Japan

Post by linden »

Post Reply