리틀엔디안
-
Dreamhack - littlevsbigwargame/Dreamhack 2023. 11. 25. 02:45
[Beginner - littlevsbig - misc] 사용자한테서 문자열을 입력받아 메모리에 저장하는 프로그램이다. 저장된 값이 특정 값과 일치하면 플래그를 출력한다고 한다. 문제 파일 다운로드 받으면 위와 같은 chall.c를 볼 수 있다. 내가 문자열 입력하면 arr라는 배열에 넣고 각 문자를 16진수로 나타내서 출력한다. 조건식과 일치해야 flag 획득할 수 있는 것 같다. (이때 arr에서 4바이트씩 끊어 읽어서 정수로 해석하기 때문에 내가 8바이트 입력하면 int_arr[0]은 첫 4바이트, int_arr[1]은 다음 4바이트) 테스트 삼아 abcdefg 입력해보면 예상대로 문자 하나씩 16진수값 나온다. 그런데 아랫줄에 출력된 int_arr[0]과 int_arr[1]를 보면 x86 아키텍처..