반응형

Step 7: Code Injection: (PW=013370)

Code injection is a technique where you inject a piece of code into the target process, and then reroute the execution of code to go through your own written code.


In this tutorial you'll have a health value and a button that will decrease your health by 1 each time you click it.

Your task is to use code injection to make the button increase your health by 2 each time it is clicked


Start with finding the address and then find what writes to it.

then when you've found the code that decreases it browse to that address in the disassembler, and open the auto assembler window (ctrl+a)

There click on template and then code injection, and give it the address that decreases health (If it isn't already filled in correctly)

That will generate a basic auto assembler injection framework you can use for your code.


Notice the alloc, that will allocate a block of memory for your code cave, in the past, in the pre windows 2000 systems, people had to find code caves in the memory(regions of memory unused by the game), but that's luckily a thing of the past since windows 2000, and will these days cause errors when trying to be used, due to SP2 of XP and the NX bit of new CPU's


Also notice the line newmem: and originalcode: and the text "Place your code here"

As you guessed it, write your code here that will increase the  health with 2.

An usefull assembler instruction in this case is the "ADD instruction"

here are a few examples:

"ADD [00901234],9" to increase the address at 00901234 with 9

"ADD [ESP+4],9" to increase the address pointed to by ESP+4 with 9

In this case, you'll have to use the same thing between the brackets as the original code has that decreases your health


Notice:

It is recommended to delete the line that decreases your health from the original code section, else you'll have to increase your health with 3 (you increase with 3, the original code decreases with 1, so the end result is increase with 2), which might become confusing. But it's all up to you and your programming.


Notice 2:

In some games the original code can exist out of multiple instructions, and sometimes, not always, it might happen that a code at another place jumps into your jump instruction end will then cause unknown behavior. If that happens, you should usually look near that instruction and see the jumps and fix it, or perhaps even choose to use a different address to do the code injection from. As long as you're able to figure out the address to change from inside your injected code.





파파고 번역


#############################################################################

7단계: 코드 주입: (PW=013370)
코드 주입은 대상 프로세스에 코드 조각을 주입한 다음 코드 실행을 다시 라우팅하여 자신의 서면 코드를 거치는 기술이다.

이 튜토리얼에서는 클릭할 때마다 건강이 1씩 저하되는 상태 값과 버튼이 표시된다.
당신의 임무는 버튼을 클릭할 때마다 당신의 건강을 2씩 증가시키기 위해 코드 주입을 사용하는 것이다.

주소를 찾는 것부터 시작해서 어디에 쓰는지 찾아라.
감소하는 코드를 찾으면 분해기에서 해당 주소로 이동하고 자동 조립기 창(ctrl+a)을 여십시오.
템플릿을 클릭한 다음 코드 주입하고 상태를 줄이는 주소를 지정하십시오(아직 올바르게 입력되지 않은 경우).
그렇게 되면 코드에 사용할 수 있는 기본적인 자동 조립기 주입 프레임워크가 생성된다.

당신의 코드 동굴을 위해 메모리 블록을 할당하는 할당에 주목하라. 과거에는 창 2000 시스템 이전에 사람들은 기억에서 코드 동굴을 찾아야 했다. 그러나 그것은 운 좋게도 2000년 이후로 과거의 것이다. 그리고 최근에는 XP의 SP2와 NX 바이오로 인해 사용하려고 할 때 오류를 일으킬 것이다.새 CPU의 t

newmem: 및 originalcode: 및 "Code를 여기에 배치" 텍스트도 참조하십시오.
짐작한 대로, 2로 건강을 증진시킬 코드를 여기에 써라.
이 경우 전체 조립자 지침은 "ADD 지침"이다.
여기 몇 가지 예가 있다.
"ADD [00901234],9"로 주소 9를 00901234로 증가
"ADD [ESP+4],9"를 사용하여 ESP+4로 가리킨 주소를 9로 늘리십시오.
이 경우 건강을 저하시키는 원래 코드가 가지고 있는 것과 같은 것을 괄호 사이에 사용해야 할 것이다.

주의사항:
원래 코드 섹션에서 건강을 저하시키는 라인을 삭제하는 것이 좋으며, 그렇지 않으면 3으로 건강을 높여야 할 것이다(3으로 증가하면 원래 코드는 1로 감소하므로 2로 증가)하여 결과가 혼동될 수 있다. 하지만 모든 것은 너와 네 프로그래밍에 달려 있다.

알림 2:
어떤 게임에서는 원래 코드가 여러 지시사항으로 존재할 수 있으며, 때로는 항상 있는 것은 아니지만, 다른 플레이스의 코드가 점프 명령어 끝에 뛰어들어 알 수 없는 동작을 일으킬 수 있다. 만약 그렇게 된다면, 당신은 보통 그 지시사항 근처를 보고 점프를 보고 그것을 고쳐야 한다. 혹은 심지어 코드 주입을 하기 위해 다른 주소를 사용하는 것을 선택하기도 한다. 주입된 코드 안에서 바꿀 주소를 알아낼 수만 있다면 말이지




#########################################################################################


역시나 첫단계는 값을 추적하여 주소를 얻는것이다.

주소를 얻고 단축키 F6(Find out what wirtes to this address)로 value값을 바꾸는 코드를 찾아보자.

다시한번 hit me를 클릭하면 하나의 명령어를 볼수있다.

replace로는 바뀌지 않는다. show disassembler를 클릭하여 살펴보자 sub함수를 통해 어떠한 주소에 담긴값을 1씩 줄이는 코드이다 이제 우리는 이코드를 바꿔야한다.

tools->auto assemble를 클릭하거나 위 설명대로 ctrl+a를 통해서도 열수있다.

template->code injection 혹은 ctrl+i를 눌러주면 originalcode 부분에 hp를 감소시키는 코드를 볼수있다.

우리는 이코드를 sub를 더하는 함수인  add로 01대신 02로 바꾸어준다.

execute를 눌러주면 injection이 성공했다는 메시지를 볼수있다.


반응형

'보안 > 치트엔진' 카테고리의 다른 글

Cheat Engine 튜토리얼 9번  (0) 2020.02.16
Cheat Engine 튜토리얼 8번  (0) 2020.02.16
Cheat Engine 튜토리얼 6번  (0) 2020.02.02
Cheat Engine 튜토리얼 5번  (0) 2020.02.02
Cheat Engine 튜토리얼 4번  (0) 2020.02.02
  • 네이버 블러그 공유하기
  • 네이버 밴드에 공유하기
  • 페이스북 공유하기
  • 카카오스토리 공유하기