Ok, figured I would write a tool to make my life easier. Idea is to copy some text from a table in a html doc and paste it to a text box, then parse the text and grab what I need instead of copy and paste each line in column 1... So I was just playing with some other parse code I have and cannot get this to work, am I out of the loop that long that I am missing the obvious? When I PrintStringByAddr edi I get nothing
LOCAL Len:DWORD
push NULL
push NULL
push WM_GETTEXTLENGTH
push hText
call SendMessage
add eax, 1
mov Len, eax
invoke HeapAlloc, hHeap, HEAP_ZERO_MEMORY, Len
mov esi, eax
push esi
push Len
push WM_GETTEXT
push hText
call SendMessage
mov eax, 2
mul Len
mov Len, eax
invoke HeapAlloc, hHeap, HEAP_ZERO_MEMORY, Len
mov edi, eax
@@:
mov al, byte ptr[esi]
test al, al
jz @F
mov byte ptr[edi], al
inc edi
;dec edi ;<-- kinda works, string is backwards
inc esi
jmp @B
@@:
PrintStringByAddr edi ;<-----------Nothing!
push edi
push 0
push hHeap
call HeapFree
push esi
push 0
push hHeap
call HeapFree
ret
What am I missing?
simplify the loop a little bit - notice how it writes the null terminator for you
and save/restore edi
push edi
@@: mov al,[esi]
mov [edi],al
inc esi
inc edi
test al,al
jnz @B
pop edi
Thank you soooo much! :dance: :U
OT: Gunner, you are on rank 6 for googling PrintStringByAddr. Congrats :cheekygreen:
Quote from: jj2007 on November 29, 2009, 12:54:25 AM
OT: Gunner, you are on rank 6 for googling PrintStringByAddr. Congrats :cheekygreen:
That is too funny :bg