Click here to Skip to main content
15,886,017 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hey

I am coding a simple packer. I need help

How do i implement Multi-Branches tech? for example

401000:
mov eax,10
jmp 401023

401010:
sub ecx,ecx
JMP 401040

401023:
xor edx,1
add ebx,4
jmp 401010

401040:

etc...


I want to implement this on random order. Is there any documentation on how this can be done?

actually my idea is to fill a section with unique DWORD then search for this if found then it will jump to and write codes then search again and so on. But this is not efficient.

Any other ways?
Posted
Updated 18-Jun-13 4:55am
v5
Comments
Sergey Alexandrovich Kryukov 18-Jun-13 9:52am    
Not clear. Your code will just jump infinitely. If you need help, you should explain the behavior you need precisely. No documentation can help here: all you need you already have.
—SA
NoviceCoder87 18-Jun-13 13:55pm    
What you mean not clear? i meant same tech used by Themida VM and VMProtect. lot's of jumps here and there. I can easily add forward branch but my problem is backward branch which if i choose randomly it can get inside a used code already. So to be more clear i choose random destination to jump to, add jmp then update code pointer to that destination so at that location continue code.
Sergey Alexandrovich Kryukov 18-Jun-13 16:12pm    
Sorry, still not clear. What, don't you know what it means? I don't event understand what do you mean by "random", there are some different meanings of this word.

And sorry, I have no idea who is Themida. ASM jumps are way too simple, there is nothing to read about except the reference book.

—SA
CHill60 22-Jun-13 10:08am    
I suspect that the Themida protection tools don't randomly overwrite existing code that is being executed. Part of the confusion we have is not being able to understand why you would want to do this or exactly what you are trying to achieve. Incidentally the word is "technique" not "tech"
NoviceCoder87 22-Jun-13 12:20pm    
Probably as you think. What i am trying to achieve is multiple unconditional branches. Not directly written in source code. But in the loader that will load the EXE file. It is a part of protection. But i am not sure how to do it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900