이 코드가 있습니다후킹을
.text:0045A020 ; int __thiscall CMapConnection__OnItemOptionCombination(CMapConnection *this, _tagRequestMAP_COMPOSITION_OPTIONITEM *prcreq)
.text:0045A020 [email protected]@@[email protected]@@Z proc near
.text:0045A020
.text:0045A020 000 push ebp
.text:0045A021 004 mov ebp, esp
.text:0045A023 004 sub esp, 440h ; Integer Subtraction
.text:0045A029 444 mov eax, ___security_cookie
.text:0045A02E 444 xor eax, ebp ; Logical Exclusive OR
.text:0045A030 444 mov [ebp+var_2F0], eax
.text:0045A036 444 push esi
.text:0045A037 448 push edi
.text:0045A038 44C mov [ebp+this], ecx
.text:0045A03E 44C mov eax, [ebp+this]
.text:0045A044 44C mov ecx, [eax+534h]
.text:0045A04A 44C mov [ebp+pPlayer], ecx
.text:0045A050 44C cmp [ebp+pPlayer], 0 ; Compare Two Operands
.text:0045A057 44C jnz short loc_45A063 ; Jump if Not Zero (ZF=0)
.text:0045A057
.text:0045A059 44C mov eax, 1
.text:0045A05E 44C jmp loc_45A97B ; Jump
긴 것을 짧게, 나는 folowing 할 필요가 : - 기능 의 시작 부분에 후크 - 몇 가지 검사를 코드 (충당 할 그 수표에 필요합니다) - 검사 결과를 바탕으로, 나는 함수를 정상적인 코스로 계속 진행 시키거나, 에러를 유발하는 섹션으로 이동 시키거나 단순히 진행을 멈추게 할 필요가 있습니다.
나는 이것을 asm에 대한 기본적인 이해와 함께해야만한다.
내가 읽은 내가 후크와 함께,하지만 여기 내 문제가 있다고 할 수에서
: 그것은 몇 가지 숫자를 수집 할 수 있도록 검사 기능은 _tagRequestMAP_COMPOSITION_OPTIONITEM * prcreq 데이터를 읽을 필요가있다..text:0041A464 784C mov ecx, [ebp+pPacket] ; jumptable 00417B7A case 27
.text:0041A467 784C add ecx, 4 ; Add
.text:0041A46A 784C mov [ebp+var_1874], ecx
.text:0041A470 784C mov edx, [ebp+var_1874]
.text:0041A476 784C push edx ; prcreq
.text:0041A477 7850 mov ecx, [ebp+this] ; this
.text:0041A47D 7850 call [email protected]@@[email protected]@@Z ;
원본 기능이 어떻게 호출되는지 알려드립니다.
내 질문 :
- 내가 어떻게 * pcreq C에서 ++ 코드에서 데이터를 읽을 수 있습니까? 가능한가?
- hooked 함수와 동일한 매개 변수를 전달하면서 다른 함수를 my hook에서 호출 할 수 있습니까?
- OnItemCombination 함수의 매개 변수를 전혀 사용하지 않습니다. 내 후크를 종료 할 때 스택을 다시 실행해야합니까?
이 참 좋은 질문입니다! –