간단하게 MD5 Hash 값을 만들어 주는 소스

MD5 이외에도 CRC32, GOSTHASH, MD2, MD4, SHA1, SHA2 를 지원한다.

URL : http://www.codeproject.com/cpp/chash.asp

예제코드


주의점 :
예전에 만들어진 소스여서 그런지, CRC32 지원코드가 최근 컴파일러와는 호환되지 않는다.
(테스트에 사용된 컴파일러는 VS2003이다.)
아래의 부분을 수정해서 CRC32 지원을 끄고 사용해야 한다.

filename : CHash.h

원래 코드

수정 후
반응형

'저장고 > C++' 카테고리의 다른 글

FormView 에 Dialog 붙이기  (2) 2007.10.09
원격 디버깅  (7) 2006.08.07
Memory Leak 을 쉽게 찾아보자!!  (2) 2006.06.01
원문 : http://www.devpia.com/forum/BoardView.aspx?forumname=vc_lec&page=1&no=7405&code=

  1. 디버그 모드로 컴파일된 실행모듈을 디버그 추적이 필요한 시스템에 복사 또는 설치합니다.
  2. 다음의 파일들을 디버그 추적이 필요한 시스템에서 임의의 폴더를 하나 만들어 그 폴더로 복사합니다. 모두 같은 폴더에 있어야 합니다
    C:\Program Files\Microsoft Visual Studio .Net 2003\Common7\Packages\Debugger\
    • msvcmon.exe
    • natdbgtlnet.dll
    • natdbgdm.dll
    C:\Windows\System32
    • msvcr71.dll
    • psapi.dll
    • dbghelp.dll
  3. 복사된 폴더에서 msvcmon.exe -tcpip -anyuser 를 실행합니다.
  4. 디버깅 대상 실행모듈을 실행합니다.
  5. Visual Studio .Net 2003이 설치된 시스템으로 돌아와 메뉴에서 Debug -> Processes 를 선택합니다.
  6. 아래 대화상자에서 Transport를 TCP/IP로 설정하고 Name 에 디버그 추적할 시스템의 주소를 넣고 엔터키를 칩니다. 그러면 해당 시스템의 프로세스 목록이 나타납니다. 이때 디버깅할 프로세스를 더블클릭하면 디버깅이 시작됩니다. ActiveX Control을 디버깅 할 경우 iexplorer.exe를 더블클릭하면 됩니다.


반응형

'저장고 > C++' 카테고리의 다른 글

MD5 Hash 생성 소스  (0) 2007.08.23
Memory Leak 을 쉽게 찾아보자!!  (2) 2006.06.01
VC++에서 delete안된 동적 메모리 체크하기  (0) 2005.12.02
프로그래밍을 하다보면 흔히 만나는 Memory Leak 메세지...

하지만 알 수 없는 메모리 주소만 좌라라락 뿌려주다보니 어딘지 찾기란 쉽지 않습니다. -_-

그 위치를 찾기 쉽게해주는 방법이 여럿 있기는 한데..

최근 데브피아에서 우연히 발견한

Visual Leak Detector!!!

사용법도 lib 연결과 header 파일만 include 해주면 Memory Leak 발생시

해당 부분 call stack을 같이 뿌려줍니다.

게다가 뭐니뭐니해도 무료 lib라는게 가장 중요!!

한번들 써보세요. :)

링크 : http://www.codeproject.com/tools/visualleakdetector.asp
반응형

'저장고 > C++' 카테고리의 다른 글

원격 디버깅  (7) 2006.08.07
VC++에서 delete안된 동적 메모리 체크하기  (0) 2005.12.02
.net에서 내가 쓰는 색상표  (2) 2005.08.22
예제:

VC++ 출력창을 살펴보면
c:...main.cpp(25) : {46} client block at 0x00373BB8, subtype 0, 256 bytes long.
Data: 73 74 72 69 6E 67 32 00 CD CD CD CD CD CD CD CD

파일명, 라인, 그리고 해제안된 메모리 크기등을 보여준다.


출처 : http://php.chol.com/~insugo/tt/index.php?pl=35


xozu comment :
메모리관리는 참으로 어려운 것 같습니다...
메모리 해제 다 해준다고 해준듯 한데도 자주 메모리 릭이 발생하더라구요 -_ㅠ
반응형
.net에서 내가 쓰고 있는 코드 색상표.
이거 쓰다가 기본 색상은 눈아퍼서 못쓰겠어요... :)

그나저나 이 설정값 따로 저장해서 불러들일 수 있게좀 만들어주지.. -ㅅ-;;
빌게츠형님 다음버젼에는 좀 꼭 넣어줘요 :)

반응형
socket 생성 갯수 제한을 풀어주는 레지 수정법
다른 부분은 볼 거 없고...
밑에 박스처리 해놓은 곳만 보고 따라하면 된다.
물론 수정 전에 레지 백업은 필수!!!

http://support.microsoft.com/default.aspx?scid=kb;en-us;196271

Unable to Connect from TCP Ports Above 5000
View products that this article applies to.
Article ID : 196271
Last Review : April 19, 2004
Revision : 4.0
This article was previously published under Q196271
IMPORTANT: This article contains information about modifying the registry. Before you modify the registry, make sure to back it up and make sure that you understand how to restore the registry if a problem occurs. For information about how to back up, restore, and edit the registry, click the following article number to view the article in the Microsoft Knowledge Base:
256986 (http://support.microsoft.com/kb/256986/EN-US/) Description of the Microsoft Windows Registry
SYMPTOMS
When you attempt to set up TCP connections from ports above 5000, the local computer responds with a WSAENOBUFS (10055) error, which means:


An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full.
RESOLUTION
WARNING: If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk.

The default maximum number of ephemeral TCP ports for Microsoft Windows NT is 5000. A new parameter has been added to Windows NT 3.51 Service Pack 5 and to Windows NT 4.0 or higher. To increase the maximum number of ephemeral ports you must set the following registry parameter:

여기만 보면 된다 :)
1. Start Registry Editor (Regedt32.exe).
2. Locate the following key in the registry:
HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesTcpipParameters
3. On the Edit menu, click Add Value, and then add the following registry value:
Value Name: MaxUserPort Data Type: REG_DWORD Value: 65534 Valid Range: 5000-65534 (decimal) Default: 0x1388 (5000 decimal)
Description: This parameter controls the maximum port number used when an application requests any available user port from the system. Normally, ephemeral (that is, short-lived) ports are allocated between the values of 1024 and 5000 inclusive.
4. Quit Registry Editor.
NOTE: An additional registry parameter TCPTimedWaitDelay will determine how long a closed port will wait until being reused. For additional information, please see the following article in the Microsoft Knowledge Base:



149532 (http://support.microsoft.com/kb/149532/EN-US/) Windows NT Clients Run Out of Ports
MORE INFORMATION
For additional information, please see the following white paper available on the Microsoft anonymous File Transfer Protocol (FTP) server:
ftp://ftp.microsoft.com/bussys/winnt/winnt-docs/papers/tcpimp2.exe (ftp://ftp.microsoft.com/bussys/winnt/winnt-docs/papers/tcpimp2.exe)
반응형

'저장고 > C++' 카테고리의 다른 글

Memory Leak 을 쉽게 찾아보자!!  (2) 2006.06.01
VC++에서 delete안된 동적 메모리 체크하기  (0) 2005.12.02
.net에서 내가 쓰는 색상표  (2) 2005.08.22

+ Recent posts