Electric Fence 가 어떻일을 하길래 보통으로 잡아내기 힘든 에러들을 잡아 내는건가요?
그리고 Electric Fence에 malloc 와 free 를 재정의 하는 것 같던데 기본 C 라이브러리에 있는 malloc / free 와 충돌하지 않고 link 가 되는건 원래 C linker 의 기본 작동 원리인가요?
c++에서 new , delete 연산자를 재정의 하는것이 가능한데 malloc라구 재정의가 안될리란 생각이 안드네요....
소스 코드에
#define malloc my_malloc #define free my_free void *my_malloc( size ) { .... ret = malloc( size ) .... }
이렇게 되어 있지 않을까요?
별도의 allocation정보를 포함해 디버깅이 가능한 버전의 malloc()/free()를 작성하고, LD_PRELOAD로 라이브러리의 로딩순서를 조정하는 것이 일반적인 메모리 디버거의 구현 방법입니다. 보통 str* 류의 함수도 모두 작성하더군요.
소스코드를 전부 새로 컴파일하도록 구현된 메모리디버거의 경우는 #define을 이용하고 gcc 옵션으로 강제로 include시키는 방법으로 컴파일을 하도록 구현된 놈도 종종 있지만, 역시 LD_PRELOAD가 훨씬 간편한 방법입니다.
MS 계열 시스템에서는 런타임 로더의 구조가 다르니 몇가지의 알려진 후킹 방법론을 이용해 구현하는 것 같습니다만 별로 자신은 없군요.
텍스트 포맷에 대한 자세한 정보
<code>
<blockcode>
<apache>
<applescript>
<autoconf>
<awk>
<bash>
<c>
<cpp>
<css>
<diff>
<drupal5>
<drupal6>
<gdb>
<html>
<html5>
<java>
<javascript>
<ldif>
<lua>
<make>
<mysql>
<perl>
<perl6>
<php>
<pgsql>
<proftpd>
<python>
<reg>
<spec>
<ruby>
<foo>
[foo]
c++에서 new , delete 연산자를 재정의 하는것이 가능한데m
c++에서 new , delete 연산자를 재정의 하는것이 가능한데
malloc라구 재정의가 안될리란 생각이 안드네요....
소스 코드에 [code:1]#define malloc my_mal
소스 코드에
이렇게 되어 있지 않을까요?
별도의 allocation정보를 포함해 디버깅이 가능한 버전의 mallo
별도의 allocation정보를 포함해 디버깅이 가능한 버전의 malloc()/free()를 작성하고, LD_PRELOAD로 라이브러리의 로딩순서를 조정하는 것이 일반적인 메모리 디버거의 구현 방법입니다. 보통 str* 류의 함수도 모두 작성하더군요.
소스코드를 전부 새로 컴파일하도록 구현된 메모리디버거의 경우는 #define을 이용하고 gcc 옵션으로 강제로 include시키는 방법으로 컴파일을 하도록 구현된 놈도 종종 있지만, 역시 LD_PRELOAD가 훨씬 간편한 방법입니다.
MS 계열 시스템에서는 런타임 로더의 구조가 다르니 몇가지의 알려진 후킹 방법론을 이용해 구현하는 것 같습니다만 별로 자신은 없군요.
댓글 달기