簡體   English   中英

從內存中讀取數據時發生溢出異常

[英]Overflow exception when reading data from memory

我正在使用進程基址+基址指針+偏移量的組合從內存中讀取數據。 到目前為止,它按預期工作了5個案例中的4個。

我的5:th嘗試引發以下異常。 是因為address參數值嗎?

OverflowExceptption:算術運算導致溢出

public static int ReadInt(long address)
{
    byte[] buffer = new byte[sizeof(int)];
    ReadProcessMemory(PHandle, (UIntPtr)address, buffer, 
                     (UIntPtr)4, IntPtr.Zero);

    //(UIntPtr)address: -1482250587

    return BitConverter.ToInt32(buffer, 0);
}

由於您的address值為負,因此失敗。

哪個進程基址+基址指針+偏移量提供此值?

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM