Показать сообщение отдельно
Непрочитано 28.03.2013, 17:06   #43
Аватар для Ashe
Олдфаг

По умолчанию Re: ASM или как сделать хук l2.exe

Цитата:
Сообщение от ALF. Посмотреть сообщение
Ребят. Всякие PE Tools-ы и т д это уже старый век.
Мой вариант такой:
Переписать DSETUP.DLL
в ней - объявление функций DirectX (НЕ реализация!!!)
т.е. что надо сделать:
Создаем все экспортируемые функции dsetup.dll у себя на проекте и ВСЁ
в DllEntryPoint - уже делаем все что душа пожелает. Толь хуки, толь хуки в потоках. Без разницы.

Вот пример на FASM
Код:
format PE GUI 4.0 DLL
entry DllEntryPoint
include 'win32a.inc'
include 'MACRO/IF.INC'
;-------------------------------------------------------------------------------------
section '.data' data readable writeable
	; ЭТО СЕКЦИЯ ДАННЫХ. ОБЪЯВЛЯЕМ В НЕЙ КОНСТАНТЫ, ПЕРЕМЕННЫЕ И  Т Д 

;-------------------------------------------------------------------------------------
section '.text' code readable executable
proc DllEntryPoint hinstDLL,fdwReason,lpvReserved
	mov eax, [fdwReason]
	.if eax = DLL_PROCESS_ATTACH
		call LoadBaseHook ; ЭТО ВЫЗОВ ФУНКЦИИ ХУКОВ И Т Д
		invoke DisableThreadLibraryCalls, [hinstDLL]
	.endif
	mov	eax,TRUE
	ret
endp
;-------------------------------------------------------------------------------------
proc LoadBaseHook
	pushad
	;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
	; ТУТ ВЫЗЫВАЕМ ВСЕ НУЖНЫЕ ХУКИ И Т Д !
	;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
	popad
	ret
endp
;-------------------------------------------------------------------------------------
proc DirectXDeviceDriverSetupA 
	xor eax, eax
	ret
endp
proc DirectXDeviceDriverSetupW 
	xor eax, eax
	ret
endp
proc DirectXRegisterApplicationA 
	xor eax, eax
	ret
endp
proc DirectXRegisterApplicationW 
	xor eax, eax
	ret
endp
proc DirectXSetupA 
	xor eax, eax
	ret
endp
proc DirectXSetupIsJapan 
	xor eax, eax
	ret
endp
proc DirectXSetupIsJapanNec 
	xor eax, eax
	ret
endp
proc DirectXSetupW 
	xor eax, eax
	ret
endp
proc DirectXUnRegisterApplication 
	xor eax, eax
	ret
endp
proc DirectXSetupSetCallback 
	xor eax, eax
	ret
endp
proc DirectXSetupGetVersion 
	xor eax, eax
	ret
endp
proc DirectXSetupCallback 
	xor eax, eax
	ret
endp
proc DirectXSetupGetFileVersion 
	xor eax, eax
	ret
endp
proc DirectXLoadString 
	xor eax, eax
	ret
endp
proc DirectXSetupIsEng 
	xor eax, eax
	ret
endp
proc DirectXSetupShowEULA 
	xor eax, eax
	ret
endp
proc DirectXSetupGetEULAA 
	xor eax, eax
	ret
endp
proc DirectXSetupGetEULAW 
	xor eax, eax
	ret
endp
;-------------------------------------------------------------------------------------
section '.idata' import data readable writeable
	library kernel,'KERNEL32.DLL'
	import kernel,\
		DisableThreadLibraryCalls, 'DisableThreadLibraryCalls',\
		GetModuleHandleA, 'GetModuleHandleA',\
		GetProcAddress, 'GetProcAddress'
;-------------------------------------------------------------------------------------
section '.edata' export data readable
	export 'DSETUP.DLL',\
		DllEntryPoint, 'DllEntryPoint',\
		DirectXDeviceDriverSetupA,'DirectXDeviceDriverSetupA',\
		DirectXDeviceDriverSetupW,'DirectXDeviceDriverSetupW',\
		DirectXRegisterApplicationA,'DirectXRegisterApplicationA',\
		DirectXRegisterApplicationW,'DirectXRegisterApplicationW',\
		DirectXSetupA,'DirectXSetupA',\
		DirectXSetupIsJapan,'DirectXSetupIsJapan',\
		DirectXSetupIsJapanNec,'DirectXSetupIsJapanNec',\
		DirectXSetupW,'DirectXSetupW',\
		DirectXUnRegisterApplication,'DirectXUnRegisterApplication',\
		DirectXSetupSetCallback,'DirectXSetupSetCallback',\
		DirectXSetupGetVersion,'DirectXSetupGetVersion',\
		DirectXSetupCallback,'DirectXSetupCallback',\
		DirectXSetupGetFileVersion,'DirectXSetupGetFileVersion',\
		DirectXLoadString,'DirectXLoadString',\
		DirectXSetupIsEng,'DirectXSetupIsEng',\
		DirectXSetupShowEULA,'DirectXSetupShowEULA',\
		DirectXSetupGetEULAA,'DirectXSetupGetEULAA',\
		DirectXSetupGetEULAW,'DirectXSetupGetEULAW'
;-------------------------------------------------------------------------------------
section '.reloc' fixups data discardable
Компилим, и просто бросаем в папку system клиента. ВСЁ
Так всё-таки проканает такой способ

P.S. В третьем сообщении писал о нём
__________________
Fortuna - non penis, in manus non recipe.
Ashe вне форума Ответить с цитированием