# RtlMoveMemory

RtlMoveMemory는 원하는 데이터를 목적지 메모리에 복사하는 함수입니다.

```cpp
VOID RtlMoveMemory(
  _Out_       VOID UNALIGNED *Destination,
  _In_  const VOID UNALIGNED *Source,
  _In_        SIZE_T         Length
);
```

| 인자          | 설명         |
| ----------- | ---------- |
| Destination | 목적지 메모리 주소 |
| Source      | 데이터        |
| Length      | 데이터 크기     |

## Example

```cpp
#include <windows.h>
#include <iostream>
#include <cstring>   // memcmp

int main() {
    // 1. 소스 데이터
    unsigned char source[] = { 0x41, 0x42, 0x43, 0x44 }; // 'A', 'B', 'C', 'D'
    SIZE_T size = sizeof(source);

    // 2. 목적지 버퍼 (초기화)
    unsigned char destination[sizeof(source)] = { 0 };

    // 3. 메모리 복사
    RtlMoveMemory(destination, source, size);

    // 4. 복사 결과 검증
    if (memcmp(source, destination, size)) std::cout << "[-] Memory copy failed" << std::endl;

    // 5. 실제 값 출력
    std::cout << "Source:      ";
    for (unsigned char c : source)
        printf("%02X ", c);
    std::cout << "\n";

    std::cout << "Destination: ";
    for (unsigned char c : destination)
        printf("%02X ", c);
    std::cout << "\n";

    return 0;
}

```

## References

{% embed url="<https://learn.microsoft.com/ko-kr/windows/win32/devnotes/rtlmovememory>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.pentestwiki.com/defense-evasion/windows-api/rtlmovememory.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
