deroko
October 18th, 2007, 10:16
Мислим се стварно како људима више не досади да врте ону тему око "поседовања" неке шуљаве заштите. Али што ћете, свету се немодзе угодити. (тастатура ми нема ДЗ слово
)
Но мимо тога, хтедох нешто корисно да постујем, а то је налазење оепа код тхемида (илити дмида
. Трик је веома прост и хајде да га показем набрзака. Фора је у процеисрању грешака, наиме дмида поставља свој сех хандлер како би контролисала извршавање ту и тамо грешака које сама себи баца. Међутим, пре него што скочи на оеп она ће вратит назад сех хандлер који је постојао тј. постављен приликом извршавања трида:
Code:
малко праћења где дмида поставлља свој сех хандлер:
Code:
и на крају пре оепа:
Code:
Кад таргет има вм оеп онда је по мојем истразивању други еип ретурн из вм-а, али све у свему да се лако лоцирати.
То је то, укратко о брзом налазењу оепа код дмида... горе је био употрбљен оутпут из мог трејсера, али битно је да се види логика
English ver
Title: The world can not be pleased
I'm really impressed that people do not get boread talking about "owning" some average protection, but world can not be pleased.
Anyway, I planed to show something interesting, this is the trick of locating themida oep very very fast
Each thread will setup it's own seh in kernel32.dll prior to it's executin (apc -> LdrInitializeThunk -> k32!BaseThreadStart). Oki, while I was writing my tracer for themida I used int 3h to break at the oep, i3here on in sice worked fine and softice would popup, no matter where int 3h occured. On other hand, when I wanted to break with olly using same trick, by simulating exception, themida would simply throw me back MessageBox with some internal exception (yes, themida seh picked up this int3), but this wasn't the case if I simulated exception at the oep. So new idea was born to trace themida till the oep:
1. log where seh handler is changed
2. wait when it is restored
Code:
seh installed to protected app from exceptions:
Code:
and then prior to the oep:
Code:
Of course, all this eip returns are hooked themida vm interpreter as themida will jmp from vm to the oep. It can be vm oep, or normal oep, depending on protection options

Но мимо тога, хтедох нешто корисно да постујем, а то је налазење оепа код тхемида (илити дмида

Code:
Code:
Starting target process again
FS : 0x7FFDF000
sehhandle ptr : 0x0012FFE0
малко праћења где дмида поставлља свој сех хандлер:
Code:
Code:
seh : 0x0012FFE0 EIP return : 0x7C809B67
seh : 0x0012FFE0 EIP return : 0x00601A0B
seh : 0x0012FFE0 EIP return : 0x0060A538
seh : 0x0012FF9C EIP return : 0x0060B2E6
seh : 0x0012FF9C EIP return : 0x00601A0B
и на крају пре оепа:
Code:
Code:
seh : 0x0012FF9C EIP return : 0x00680D7C
seh : 0x0012FF9C EIP return : 0x00681BD8
seh : 0x0012FFE0 EIP return : 0x00401000 <----- бинго
[X] Target terminated...
Кад таргет има вм оеп онда је по мојем истразивању други еип ретурн из вм-а, али све у свему да се лако лоцирати.
То је то, укратко о брзом налазењу оепа код дмида... горе је био употрбљен оутпут из мог трејсера, али битно је да се види логика

English ver
Title: The world can not be pleased
I'm really impressed that people do not get boread talking about "owning" some average protection, but world can not be pleased.
Anyway, I planed to show something interesting, this is the trick of locating themida oep very very fast

Each thread will setup it's own seh in kernel32.dll prior to it's executin (apc -> LdrInitializeThunk -> k32!BaseThreadStart). Oki, while I was writing my tracer for themida I used int 3h to break at the oep, i3here on in sice worked fine and softice would popup, no matter where int 3h occured. On other hand, when I wanted to break with olly using same trick, by simulating exception, themida would simply throw me back MessageBox with some internal exception (yes, themida seh picked up this int3), but this wasn't the case if I simulated exception at the oep. So new idea was born to trace themida till the oep:
1. log where seh handler is changed
2. wait when it is restored
Code:
Code:
Starting target process again
FS : 0x7FFDF000
sehhandle ptr : 0x0012FFE0
seh installed to protected app from exceptions:
Code:
Code:
seh : 0x0012FFE0 EIP return : 0x7C809B67
seh : 0x0012FFE0 EIP return : 0x00601A0B
seh : 0x0012FFE0 EIP return : 0x0060A538
seh : 0x0012FF9C EIP return : 0x0060B2E6
seh : 0x0012FF9C EIP return : 0x00601A0B
and then prior to the oep:
Code:
Code:
seh : 0x0012FF9C EIP return : 0x00680D7C
seh : 0x0012FF9C EIP return : 0x00681BD8
seh : 0x0012FFE0 EIP return : 0x00401000 <----- bingo
[X] Target terminated...
Of course, all this eip returns are hooked themida vm interpreter as themida will jmp from vm to the oep. It can be vm oep, or normal oep, depending on protection options
