The code works fine until it the value read at the address reaches 255.


.data
ValueFormat       db '%8lu',0

.data?
LVValue db 8 dup (?)
CnvrtedLVValue     db      8     dup (?)

.code

LoadValue proc uses esi
LOCAL lvi:LV_ITEM
invoke GetDlgItem,hWnd,1001
mov hList2,eax
invoke SendMessage,hList2,LVM_GETITEMCOUNT,0,0
mov esi,eax

.while esi != 0
dec esi
mov    lvi.imask,LVIF_TEXT
mov lvi.pszText,offset itemcount
mov lvi.iItem,esi
mov lvi.iSubItem,1
invoke SendMessage,hList2,LVM_GETITEMTEXT,esi,addr lvi
invoke htodw,addr itemcount
mov itemcount,eax
invoke ReadProcessMemory,editprocess,itemcount,addr LVValue,4,NULL
invoke wsprintf,addr CnvrtedLVValue,addr ValueFormat,LVValue
mov    lvi.imask, LVIF_TEXT
mov    lvi.pszText,offset CnvrtedLVValue
mov lvi.iSubItem, 2
invoke SendMessage, hList2, LVM_SETITEM, 0, ADDR lvi
.endw
ret
LoadValue endp


What the code is supposed to do is get the address placed in a certain part of a listview, convert the address from text to hex format, read 4 bytes from that address, then display the result under a new column in the listview. Everything works perfect except when the value reaches 255. After that the value displayed in the listview returns to 0 and starts again. Any ideas?
Posted on 2005-03-24 02:46:27 by resistance_is_futile
any ideas anyone?

Edit:
No one has any idea on this what-so-ever?
Posted on 2005-03-24 13:04:13 by resistance_is_futile
well I fixed the problem.. Just changed the LVValue buffer from db 8 dup (?) to dd 0. Worked like a charm..
Posted on 2005-03-25 03:15:39 by resistance_is_futile