VB 讀取《武林外傳》角色名的原始碼

2021-08-31 06:27:11 字數 2555 閱讀 9275

private declare function

getwindowthreadprocessid

lib

"user32"

(byval

hwnd

as long

, lpdwprocessid

as long

) as long

private declare function

findwindow

lib

"user32"

alias

"findwindowa"

(byval

lpclassname

as string

, byval

lpwindowname

as string

) as long

private declare function

openprocess

lib

"kernel32"

(byval

dwdesiredaccess

as long

, byval

binherithandle

as long

, byval

dwprocessid

as long

) as long

private declare function

readprocessmemory

lib

"kernel32"

(byval

hprocess

as long

, lpbaseaddress

as any, lpbuffer

as any,

byval

nsize

as long

, lpnumberofbyteswritten

as long

) as long

private declare function

closehandle

lib

"kernel32"

(byval

hobject

as long

) as long

const

standard_rights_required =

&hf0000

const

synchronize =

&h100000

const

process_all_access = (standard_rights_required

or synchronize

or &hfff

)private sub

form_load()

dim

hwnd

as long

dim

pid

as long

dim

hprocess

as long

dim

h as long

dim

addr

as long

dim

buffer(

31)

as byte

hwnd = findwindow(vbnullstring,

"element client"

)if

hwnd

then

getwindowthreadprocessid hwnd, pid

hprocess = openprocess(process_all_access,

false

, pid)

if hprocess

then

addr =

&h12f82c

readprocessmemory hprocess,

byval

addr, h, 4,

0&readprocessmemory hprocess,

byval

(h +

&h24

), h, 4,

0&readprocessmemory hprocess,

byval

(h +

&h390

), h, 4,

0&readprocessmemory hprocess,

byval

h, buffer(

0),

32, 0&

closehandle hprocess

end if

text1.text = buffer

end if

end sub

結束

讀角色名時並沒有先讀取長度,因為本身就是0結尾u串,沒必要。

結果也證明是對的。

如果有朋友老是出現無法讀值的問題,一般來說是你搞錯了傳值傳址的問題。

VB讀取武林外傳記憶體位址

一 模組 複製內容到剪貼簿 option explicit public declare function findwindow lib user32 alias findwindowa byval lpclassname as string,byval lpwindowname as string...

應要求,放出讀取XML檔案相關的原始碼

地形類的原始碼裡面關聯了其他類的一些東西,其實就是xml讀取的幫助類而已 tlbbfilebuffer這個類就是乙個記憶體緩衝而已,簡單說就是乙個uchar的陣列.用來把2進製檔案一次性讀取到記憶體中而已.我的 裡面只把xml型別的檔案讀取到記憶體裡面,其他檔案比如heightmap等,並沒有用這個...

VB原始碼之友公升級了(系統核心的公升級最近也要推出)

2005年08月20日 21 24 00 以前有些懶,雖然用原始碼之友過程中出現了幾次 vb ide宕機 害的要關閉vb ide,如果沒儲存就慘了 不過一般免費使用者遇不到,那是在專業版中提供的僅對函式內整理的功能。目前已經修改完畢。此外,對不是使用標準系統主題的使用者 或win98 的使用者,在v...