PE File Format – RVA to RAW

2017. 12. 3. 22:13·Reversing

PE File Format – RVA to RAWPosted on 2017년 8월 24일 by 2u110per
책을 보고 IAT를 공부하다가 IMAGE_IMPORT_DESCRIPTOR 구조체의 Offset을 찾는 과정에서 RVA to RAW 부분이 이해가 잘되지 않아 이 부분을 다시 정리하였다.
  • 실습파일 : 계산기
  • 실습환경 : Window 7 32bit
Data Directory의 구조이다. NT Header의 Optional Header에 포함되어 있으며 크키는 80h이다. – 16개(10h)* 8Byte
DataDirectory[0] : EXPORT Directory
DataDirectory[1] : IMPORT Directory
DataDirectory[2] : RESOUCE Directory
Data Directory[9] : TLS Directory

<Data Directory>

IMPORT Directory 인 DataDirectory[1]의 구조체의 VirtualAddress의 값은 00051AFC (IMAGE_IMPORT_DESCRIPTOR의 시작주소)이다.
RAV(00051AFC)를 이용하여 RAW(File Offset)을 계산하여야한다.
<RAW 계산하기>
  •  RAW = RVA – VirtualAddress + PointerToRawData
RVA : 00051AFC – IMAGE_IMPORT_DESCRIPTOR 구조체 배열의 시작 위치(IMPORT Directory의 RVA)
VA : 1000 – 위의 RVA(IMPORT Directory의 RVA) 값 속해 있는 Section의 시작위치 (.text Section Header RVA)
PointerToRawData : 400 – RVA가 속해있는 Section Header의 PointerToRawData(파일에서 섹션의 시작위치)
  • RAW = 00051AFC – 1000 + 400
  • RAW = 00050EFC
 
IMAGE_IMPORT_DESCRIPTOR 구조체의 Offset
<RAW 위치>
Posted in REVERSING and tagged RAW, RAW 값, RAW 계산식, RAW 비례식, RVA, RVA to RAW.


저작자표시 (새창열림)

'Reversing' 카테고리의 다른 글

WinDbg – Windows XP 2/2 (작업관리자에서 notepad.exe 프로세스 숨기기)  (0) 2017.12.03
WinDbg – Windows XP 1/2 (notepad.exe DLL 확인)  (0) 2017.12.03
PE File Format – IAT(Import Address Table)  (0) 2017.12.03
PE File Fomat – PE Header  (0) 2017.12.03
'Reversing' 카테고리의 다른 글
  • WinDbg – Windows XP 2/2 (작업관리자에서 notepad.exe 프로세스 숨기기)
  • WinDbg – Windows XP 1/2 (notepad.exe DLL 확인)
  • PE File Format – IAT(Import Address Table)
  • PE File Fomat – PE Header
zulloper
zulloper
blog
  • zulloper
    zulloper blog
    zulloper
  • 전체
    오늘
    어제
    • Catagory (47)
      • Web (2)
      • Web Hacking (4)
      • CVE (1)
      • Mobile (1)
      • Pwnable (1)
      • Reversing (5)
      • Redteam (2)
      • Python (0)
      • Wargame | CTF (29)
        • Webhacking.kr (25)
        • Suninatas (4)
        • Python Challenge (0)
        • Hack The Box (0)
      • 기타 (0)
  • 블로그 메뉴

    • Category
    • 홈
  • 링크

  • 공지사항

  • 인기 글

  • 태그

    pwntools
    스머글링
    윈디버거
    mssql server injection
    oracle sql injection
    action message format
    burp 인증서
    BurpSuite
    HTML smuggling
    mssql injection
    web
    ms-sql injection
    oracle db sql injection
    oracle db server sql injection
    RAW 계산식
    oracle injection
    oracle db injection
    http security header
    oracle-sql injection
    ms-sql server
    DLL 확인
    액션 메시지 포맷
    Export Address Table
    hsts
    security header
    RAW 값
    Process 숨기기
    ms injetion
    RAW 비례식
    WinDbg
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.1
zulloper
PE File Format – RVA to RAW
상단으로

티스토리툴바