讀取內存地址中的數據


import ctypes
from ctypes import string_at
from sys import getsizeof
from binascii import hexlify
value="我和你"#'hello world' #定義一個字符串變量
address=id(value) #獲取value的地址,賦給address
get_value=ctypes.cast(address, ctypes.py_object).value #讀取地址中的變量
print(get_value)
value1=hexlify(string_at(address,getsizeof(value)))
print(value1)


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM