亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

什么是戈朗等價物。網絡的元帥復制方法?

什么是戈朗等價物。網絡的元帥復制方法?

Go
莫回無 2022-10-04 19:40:06
我試圖修補戈朗的一大塊內存。我已關閉虛擬保護功能,并且內存塊正在更改為 RW,但我找不到用于復制到內存的 Golang 功能。我想從強勢外殼腳本中模擬這一點:[System.Runtime.InteropServices.Marshal]::Copy($patch, 0, $targetedAddress, 3)我目前擁有的戈朗代碼如下:var patch = []byte {    0x31, 0xC0, // xor rax, rax    0xC3,        // ret}var oldfperms uint32virtualProt(unsafe.Pointer(&patchAddr), unsafe.Sizeof(uintptr(2)), uint32(0x40), unsafe.Pointer(&oldfperms)) // Modify region for ReadWritevar r uintptrfor _, b := range patch {    r = (r << 8) | uintptr(b)}patch := unsafe.Pointer(uintptr(r)) // Attempting to copy into memory here and I'm stumpedfmt.Println(patch)var a uint32virtualProt(unsafe.Pointer(&patchAddr), unsafe.Sizeof(uintptr(2)), oldfperms, unsafe.Pointer(&a)) // Change region back to normal
查看完整描述

1 回答

?
青春有我

TA貢獻1784條經驗 獲得超8個贊

沒關系。找到對 Win32 寫入過程內存函數的引用并使用該函數。


https://pkg.go.dev/github.com/0xrawsec/golang-win32/win32/kernel32#WriteProcessMemory


func WriteProcMem(currProccess uintptr, patchAddr uintptr, patch uintptr) bool {


    kern32WriteMem := syscall.NewLazyDLL("kernel32.dll").NewProc("WriteProcessMemory")

    _, _, _ = kern32WriteMem.Call(

    currProccess,

    patchAddr,

    patch)

    fmt.Println("[+] Patched Memory!")

    return true


}


查看完整回答
反對 回復 2022-10-04
  • 1 回答
  • 0 關注
  • 100 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號