짜증나는 그룹웨어 Messager를 어쩔 수 없이 사용하고 있는 만큼 나름 열심히 사용하는 편이다. ( 사실 파일 전송도 안되고 툭하면 Exception 빵빵 뜬다. 조만간 Exception만 나와라 하고 있다 . ) 아무튼 테스트를 위해서 Windbg를 Attach하고 Loding된 Module들을 받는데 왠걸 이상한 dll 이 하나 버티고 있다 . 헐 이건머지 ??
0:001> lmtn
start end module name
00400000 0048d000 Project1 Project1.exe Fri Apr 25 15:40:50 2008 (48117CF2)
00d80000 00d8f000 DocAPI DocAPI.dll Thu Oct 11 10:40:47 2007 (470D7F1F)
01010000 01181000 nview nview.dll Thu Apr 19 14:06:50 2007 (4626F8EA)
01450000 01465000 nvwddi nvwddi.dll Fri Apr 20 06:25:01 2007 (4627DE2D)
01490000 01498000 dormant dormant.dll Tue Sep 12 14:46:39 2006 (450649BF)
10000000 10034000 nssshhook nssshhook.dll Sun Jul 22 18:46:49 2007 (46A32789)
4b540000 4b55a000 imekr61 imekr61.ime Wed Oct 19 02:58:00 2005 (435537A8)
5a480000 5a4b8000 uxtheme uxtheme.dll Wed Aug 04 16:52:52 2004 (411095D4)
5c820000 5c8ba000 COMCTL32 COMCTL32.DLL Sat Aug 26 00:49:50 2006 (44EF1C1E)
61300000 6130d000 MFC42LOC MFC42LOC.DLL Tue Aug 28 07:41:39 2001 (3B8ACCA3)
62340000 62349000 LPK LPK.DLL Wed Aug 04 16:51:48 2004 (41109594)
71b40000 71b53000 SAMLIB SAMLIB.dll Wed Aug 04 16:52:12 2004 (411095AC)
73d10000 73e0e000 MFC42 MFC42.DLL Wed Aug 04 16:51:43 2004 (4110958F)01490000 01498000 dormant
Loaded symbol image file: C:\Program Files\WorkMessenger\dormant.dll
Image path: C:\Program Files\WorkMessenger\dormant.dll
Image name: dormant.dll
Timestamp: Tue Sep 12 14:46:39 2006 (450649BF)
CheckSum: 00000000
ImageSize: 00008000
File version: 1.0.0.1
Product version: 1.0.0.1
File flags: 0 (Mask 3F)
File OS: 4 Unknown Win32
File type: 2.0 Dll
File date: 00000000.00000000
Translations: 0412.04b0
CompanyName: (C) NVIDIA Corporation. All rights reserved.
ProductName: dormant 동적 연결 라이브러리
InternalName: dormant
OriginalFilename: dormant.DLL
ProductVersion: 1, 0, 0, 1
FileVersion: 1, 0, 0, 1
FileDescription: dormant DLL
LegalCopyright: Copyright (C) 2001
LegalTrademarks: Copyright (C) 2001
일단 NVIDIA ?? 이상하다 -_- windbg가 나에게 잘못된 정보를 주고 있는것으로 추정된다. ( DLL 이 PE에 표시된 위치가 아닌 다른 Memory에 로딩되니까 그곳에 있던 String이 우연히 찍힌거 같다 . ) 그건 그렇고 이 놈은 도대체 모하는 놈 ?? ( dorment라는 이름에서 알 수 있듯 자리비움기능을 위한 거겠지만..)
0:001> X dormant!*
01491190 dormant!Initiate (<no parameter info>)
01491230 dormant!EndUp (<no parameter info>)
01491260 dormant!GetDormantTime (<no parameter info>)
3개의 함수가 들어 있군 …
0:001> uf dormant!Initiate
dormant!Initiate:
01491190 51 push ecx
01491191 8d442400 lea eax,[esp]
01491195 56 push esi
01491196 50 push eax
01491197 c7050850490100000000 mov dword ptr [dormant!GetDormantTime+0x3da8 (01495008)],0
014911a1 c7050c50490100000000 mov dword ptr [dormant!GetDormantTime+0x3dac (0149500c)],0
014911ab e8da010000 call dormant!GetDormantTime+0×12a (0149138a) // MFC42!CTime::GetTickCount
014911b0 8b08 mov ecx,dword ptr [eax]
014911b2 a11c314901 mov eax,dword ptr [dormant!GetDormantTime+0x1ebc (0149311c)]
014911b7 8b3524214901 mov esi,dword ptr [dormant!GetDormantTime+0xec4 (01492124)]
014911bd 6a00 push 0
014911bf 50 push eax
014911c0 68d0104901 push offset dormant+0×10d0 (014910d0)
014911c5 6a02 push 2
014911c7 890d00504901 mov dword ptr [dormant!GetDormantTime+0x3da0 (01495000)],ecx
014911cd a304504901 mov dword ptr [dormant!GetDormantTime+0x3da4 (01495004)],eax
014911d2 ffd6 call esi // USER32!SetWindowsHookExA:
014911d4 8b1504504901 mov edx,dword ptr [dormant!GetDormantTime+0x3da4 (01495004)]
014911da 6a00 push 0
014911dc 52 push edx
014911dd 6820114901 push offset dormant+0×1120 (01491120)
014911e2 6a07 push 7
014911e4 a308504901 mov dword ptr [dormant!GetDormantTime+0x3da8 (01495008)],eax
014911e9 ffd6 call esi // User32!SetWindowsHookExA
014911eb 8b3520214901 mov esi,dword ptr [dormant!GetDormantTime+0xec0 (01492120)]
014911f1 8b0d08504901 mov ecx,dword ptr [dormant!GetDormantTime+0x3da8 (01495008)]
014911f7 85c0 test eax,eax
014911f9 a30c504901 mov dword ptr [dormant!GetDormantTime+0x3dac (0149500c)],eax
014911fe 740c je dormant!Initiate+0×7c (0149120c)
… 중략
SetWindowsHookExA를 사용하는걸 보니 Windows Message Proc를 Hook 하고 있다. Parameter인 2와 7을 보면 Keyboard 와 Mouse 쪽 Message를 Hook 하는 거라고 추정할 수 있다. 실제 Hooking 함수를 보면
0:001> uf 014910d0
dormant+0x10d0:
014910d0 56 push esi
014910d1 8b742408 mov esi,dword ptr [esp+8]
014910d5 85f6 test esi,esi
014910d7 7405 je dormant+0×10de (014910de)dormant+0×10d9:
014910d9 83fe03 cmp esi,3
014910dc 7512 jne dormant+0×10f0 (014910f0)dormant+0×10de:
014910de 8d442408 lea eax,[esp+8]
014910e2 50 push eax
014910e3 e8a2020000 call dormant!GetDormantTime+0×12a (0149138a) // MFC42!CTime::GetTickCount
014910e8 8b08 mov ecx,dword ptr [eax]
014910ea 890d00504901 mov dword ptr [dormant!GetDormantTime+0x3da0 (01495000)],ecx
dormant+0×10f0:
014910f0 8b44240c mov eax,dword ptr [esp+0Ch]
014910f4 8b542410 mov edx,dword ptr [esp+10h]
014910f8 8b0d08504901 mov ecx,dword ptr [dormant!GetDormantTime+0x3da8 (01495008)]
014910fe 25ffff0000 and eax,0FFFFh
01491103 52 push edx
01491104 50 push eax
01491105 56 push esi
01491106 51 push ecx
01491107 ff1528214901 call dword ptr [dormant!GetDormantTime+0xec8 (01492128)] // USER32!CallNextHookEx
0149110d 5e pop esi
0149110e c20c00 ret 0Ch
0149120a 59 pop ecx
0149120b c3 ret
time을 구하고 다음 Hook Handler로 Path 하는걸 볼 수 있다. 별거 하는거 없군 -_- ;; 근데 자리비움 기능을 위해서 구지훅을 할 필요가 있을까 ?? 그리고 NVIDIA의 정체는 과연 무엇이었을까 ?? -_-
최근 답글