본문 바로가기

전체 글143

[LOB_FC4] dark_stone -> cruel cruel.c의 소스는 아래와 같다. /* The Lord of the BOF : The Fellowship of the BOF - cruel - Local BOF on Fedora Core 4 - hint : no more fake ebp, RET sleding on random library */ #include #include #include int main(int argc, char *argv[]) { char buffer[256]; if(argc < 2){ printf("argv error\n"); exit(0); } strcpy(buffer, argv[1]); printf("%s\n", buffer); } Fedoa Core4 환경에서의 간단한 stack overflow이다. FC3에서 달라진.. 2012. 8. 20.
[LOB_FC3] evil_wizard->dark_stone dark_stone.c의 소스는 아래와 같다. /* The Lord of the BOF : The Fellowship of the BOF - dark_stone - Remote BOF on Fedora Core 3 - hint : GOT overwriting again - port : TCP 8888 */ #include // magic potion for you void pop_pop_ret(void) { asm("pop %eax"); asm("pop %eax"); asm("ret"); } int main() { char buffer[256]; char saved_sfp[4]; int length; char temp[1024]; printf("dark_stone : how fresh meat you a.. 2012. 8. 18.
자료형 LPSTR, LPWSTR, LPTSTR, TCHAR - ascii 코드 - LPSTR : char * LPCSTR : const char * - unicode - LPWSTR : w_char * LPCWSTR : const w_char * - ascii & unicode - LPTSTR : TCHAR * LPCTSTR : const TCHAR * - TCHAR - #ifdef UNICODE typedef wchar_t TCHAR; #else typedef char TCHAR; #endif 2012. 8. 18.
윈도우즈 API - 윈도우 창 윈도우 클래스의 종류 1) 시스템 전역 클래스 : 운영체제에 미리 등록되어 있는 윈도우 클래스이다. (컨트롤, 메뉴, 대화상자 등..) 2) 응용 프로그램 전역 클래스 : 주로 DLL에 의해 등록되며 여러 프로그램에서 공유할 커스텀 컨트롤을 만드는데 사용. 3) 응용 프로그램 로컬 클래스 : 응용 프로그램 자신의 메인 윈도우, 차일드 윈도우, 커스텀 컨트롤을 만드는데 사용. 윈도우즈 API프로그래밍에서 윈도우를 만드는 순서를 살펴보면 다음과 같다. 1. 윈도우 클래스를 만든다. (WNDCLASS) WNDCLASS는 총 10개의 멤버로 구성되며 중요한 멤버 3가지를 살펴보자. - lpszClassName : 등록하고자 하는 윈도우 클래스의 이름 - lpfnWndProc : 메시지 처리 함수 지정. - hI.. 2012. 8. 15.