Visual C++
-
Visual Studio 2010 static library를 이용한 project 여러개 생성시 주의점Computer/Programming 2012. 3. 6. 15:15
프로그램이 너무 복잡해져서 솔루션 안에 프로젝트를 여러 개로 분리하였다. 메인 프로젝트를 제외하고 나머지를 static library로 작성하였다. 1. header 참조 메인 프로젝트 속성에서 Configuration Properties - C/C++ - General - Additional Include Directories 에서 각 프로젝트 디렉토리로 설정하고. 메인 프로젝트에서 다른 프로젝트의 header 파일을 Add Existing Item 을 이용해 추가한다. 2. library 포함 메인 프로젝트 속성에서 Configuration Properties - Linker - General - Additional Library Directories 에서 해당 lib 디렉토리 추가 (솔루션 밑에 R..
-
printing __int64 (DWORD64) in hex (Visual C++)Computer/Programming 2011. 12. 27. 10:53
DWORD64 n64 = 0x123456789ABCDEF; _tprintf(TEXT("%016I64X %s\n"), n64) 그냥 printf 하면 문제가 생기므로 X 앞에 I64를 붙여 주어야 한다. DWORD64 n64 = 0x123456789ABCDEF; _tprintf(TEXT("%I64d %s\n"), n64) 10진수로 할 때도 마찬가지로 d 앞에 IA64를 붙인다.
-
Debugger Detection via Hardware BreakpointsComputer/Security 2011. 12. 6. 18:11
Assembly로 하는 코드들은 다른 데 나와 있어서 Visual C++로 해 보았다. LPEXCEPTION_POINTERS except_ptr; __try{ RaiseException(1, 0, 0, NULL); } __except (except_ptr = GetExceptionInformation(), EXCEPTION_EXECUTE_HANDLER) { CONTEXT *ctx = except_ptr->ContextRecord; if (ctx->Dr0 != 0 || ctx->Dr1 != 0 || ctx->Dr2 != 0 || ctx->Dr3 != 0 || ctx->Dr6 != 0 || ctx->Dr7 != 0) { printf("Debugger Present - Hardware Breakpoints\n..
-
Visual C++ 실행파일 실행 후 종료시까지 기다리기Computer/Programming 2011. 7. 11. 14:11
Project 두 개를 합치고 싶기는 하지만, 이름이 충돌해서 합치는 것이 곤란하다. 그래서 분리된 실행 파일로 놓고 한 실행 파일에서 다른 실행 파일을 호출하고 끝날 때까지 기다리도록 했다. STARTUPINFO si; PROCESS_INFORMATION pi; ZeroMemory( &si, sizeof(si) ); si.cb = sizeof(si); ZeroMemory( &pi, sizeof(pi) ); if( !CreateProcess( NULL, // No module name (use command line) "c:\\Temp\\Optimizer.exe", // Command line NULL, // Process handle not inheritable NULL, // Thread handle..
-
Visual C++ Compiler Generated FunctionsComputer/Programming 2008. 10. 7. 21:51
Visual C++ Compiler generates the following functions. Decorated Name Undecorated Name Meaning ?0 constructor ?1 destructor ?2 operator new ?3 operator delete ?4 operator = ?5 operator >> ?6 operator * ?K operator / ?L operator % ?M operator = ?Q operator , ?R operator () ?S operator ~ ?T operator ^ ?U operator | ?V operator && ?W operator || ?X operator *= ?Y operator += ?Z operator -= ?_0 oper..