본문 바로가기

분류 전체보기

pwnable.kr softmmu [666] 보호되어 있는 글입니다. 더보기
kernel - ranchar 보호되어 있는 글입니다. 더보기
C++에서 소수점 자리수 맞추기 12345678910111213#include int main(void){ double a = 0, b = 0; std::cin >> a >> b; std::cout.precision(16); std::cout 더보기
C++에서 문자열 EOF까지 입력받고 출력하기 123456789101112#include #include #include int main(void){ std::istreambuf_iterator begin(std::cin), end; std::string s(begin, end); std::cout 더보기
Linux kernel debugging with qemu x86-64 리눅스 커널을 디버깅 하는 방법입니다.커널을 디버깅하기 위해 host-machine, target-machine이 필요한데 host-machine은 우분투 x86-64라고 가정하고 target-machine은 커널을 qemu에 올려서 vm으로 진행하겠습니다.먼저 디버깅할 버전의 커널을 컴파일 해야합니다.커널을 다운로드 받고 (http://kernel.org) 압축을 풀어서 커널 디렉토리로 이동한 후make defconfig make kvmconfig make menuconfig를 순서대로 실행해줍니다.make menuconfig를 하면 옵션을 선택할 수 있는 창들이 뜰 텐데 여기서 Kernel Hacking compile-time checks and compiler options compil.. 더보기
커널 컴파일 시 code model kernel does not support PIC mode 해결법 낮은 버전의 커널을 최신 혹은 높은 버전의 gcc로 컴파일 할 때 cc1: error: code model kernel does not support PIC mode 라는 에러를 볼 수 있다. gcc특정 버전 이상에서는 pie적용이 기본으로 설정되어있어서 나는 오류이다.1234567891011121314151617diff --git a/Makefile b/Makefileindex dda982c..f96b174 100644--- a/Makefile+++ b/Makefile@@ -608,6 +608,12 @@ endif # $(dot-config) # Defaults to vmlinux, but the arch makefile usually adds further targets all: vmlinux +# .. 더보기
커널 옛날 버전 컴파일 하다가 ____ilog2_nan 에러날 때 가끔씩 옛날 버전 컴파일 하다가 ____ilog2_nan 이거 없다고 에러날 때가 있다.12345678910111213141516171819202122232425262728293031323334353637diff --git a/include/linux/log2.h b/include/linux/log2.hindex ef3d4f67118c..07ef24eedf83 100644--- a/include/linux/log2.h+++ b/include/linux/log2.h@@ -16,12 +16,6 @@ #include /*- * deal with unrepresentable constant logarithms- */-extern __attribute__((const, noreturn))-int ____ilog2.. 더보기
리눅스 가상 시리얼 포트 열기 sudo socat PTY,link=/dev/ttyS10 PTY,link=/dev/ttyS08 하면 /dev/ttyS08 이 열림minicom -D /dev/ttyS08 해서 시리얼 열고 1234567891011121314151617181920212223242526272829303132333435363738394041424344#include #include #include #include #include #include #include int main( void){ int fd; struct termios newtio; fd = open( "/dev/ttyS8", O_RDWR | O_NOCTTY | O_NONBLOCK ); if (fd == -1) { puts("open error"); return 0.. 더보기
2017년 12월 26일 화요일 다시 오랜만에 쓰는 일기~요즘 리눅스 커널에 관심이 좀 있다. 이론 공부도 할만한거 같고 커널 익스 해보는거도 재밌다.워게임 문제로는 w3challs knoob 풀어봤는데 처음 제대로 풀어보는 커널 문제라 아리송 하면서도 재밌었다.지금은 pwnable.kr softmmu를 풀고 있는데 취약점 찾고 대충 익스 시나리오도 구상이 되지만 이게 내맘대로 잘 안돼서 어렵다.꽤 오래 붙잡고 있는거 같은데 음 어렵다.빗소리 (http://rainymood.com) 들으면서 공부하면 집중 되게 잘된다. 한여름 장마철에 공부하는 기분이라서 기분이 상쾌해진다. 더보기
kernel - knoob 보호되어 있는 글입니다. 더보기