flat assembler
Message board for the users of flat assembler.
Index
> Windows > http get |
Author |
|
sina 17 Apr 2004, 22:14
does any one have an example code of http downloader ?
for example i want the file somefile.htm from http://www.somename.com/somefile.htm then i will get the values from that file and print some out to screen |
|||
17 Apr 2004, 22:14 |
|
coconut 18 Apr 2004, 00:32
i believe mad wizard goes over that in his winsock tutorial, the link is around here somewhere
|
|||
18 Apr 2004, 00:32 |
|
roticv 18 Apr 2004, 02:50
HTTP File Transfer v1.0 found @ http://www.madwizard.org/view.php?page=downloads
|
|||
18 Apr 2004, 02:50 |
|
sina 18 Apr 2004, 14:03
thanks ppl
|
|||
18 Apr 2004, 14:03 |
|
sina 21 Apr 2004, 15:11
hmm victor the madwizards program is http send i need something simpler anyone finds something pls send info
thanks anyway |
|||
21 Apr 2004, 15:11 |
|
Dr.X 21 Apr 2004, 17:35
VeSCeRa,
Get the tutorial about sockets from this page. http://www.madwizard.org/view.php?page=tutorials.contents In that tutorial there is an example of retrieving a file from a website. hth Dr.X PS: or copy and paste this into a DOS window: Code: telnet google.com 80 GET /index.html HTTP/1.1 Host: www.google.com User-agent: TelnetBrowser Connection: close REM the two lines above are actually the enter key. |
|||
21 Apr 2004, 17:35 |
|
sina 25 Apr 2004, 12:40
hmm golden replies thanks
|
|||
25 Apr 2004, 12:40 |
|
sina 26 Apr 2004, 17:21
hmm then what do u suggest for searching for a string in that filebuffer?
for example if the buffer is "some text in the buffer" and i want to get the "text" |
|||
26 Apr 2004, 17:21 |
|
Madis731 26 Apr 2004, 22:02
The robust way is to search all buffer for "t" and if found, try if the next character is "e" and so on. If not, you'll fall through and continue searching for "t" until you find a "text" string or reach the end of your buffer. You can even spare time by stopping n charachters (n=len(string)) from the end when there is no way you can find any instances.
Xmpl. "Some kind of string" There is no possibility you can come to a "text" when you have reached to "r" char in "stRing". Hope you get the point |
|||
26 Apr 2004, 22:02 |
|
sina 27 Apr 2004, 01:30
so how to do this
The robust way is to search all buffer for "t" and if found, try if the next character is "e" and so on |
|||
27 Apr 2004, 01:30 |
|
Madis731 27 Apr 2004, 08:49
When buf is your buffer and len is length:
Code: mov eax,buf mov ebx,len Loop: cmp [eax],"t" jne Next add eax,1 cmp [eax],"e" jne Next add eax,1 cmp [eax],"x" jne Next add eax,1 cmp [eax],"t" je FoundIt Next: add eax,1 sub ebx,1 jnz Loop jmp DidntFindIt ;obviously when we reach the end, we don't have our string FoundIt: ;Decide what are you going to do with it ... |
|||
27 Apr 2004, 08:49 |
|
roticv 27 Apr 2004, 11:55
Not coded for speed and no error handlign, may crash if text not found
Code: mov eax, buf dec eax @@: inc eax cmp [eax], "test" jnz @B |
|||
27 Apr 2004, 11:55 |
|
sina 27 Apr 2004, 13:03
ok what if i have some buffer like
"some text and 19/10" the numbers 19 and 10 will be changing and i want to get them so i will search for "/" in the buffer and get the chars around it with +2 and -2 into strings any suggestions? |
|||
27 Apr 2004, 13:03 |
|
decard 27 Apr 2004, 13:41
what about this? It searches string at [edi] for the first occurrence of the pattern at [esi].
Code: StrPos: stdcall StrLen, edi mov ebx,eax ; now ebx holds lenght of the string to search stdcall StrLen, esi mov edx,eax ; now edx holds length of the pattern string lodsb ; load first character of the pattern mov ecx,ebx ; mov ebx,edx ; put str_len(pattern)-1 in ebx dec ebx ; .search: repne scasb jne .not_found cmp ecx,ebx jb .not_found push edi esi ecx or ebx,ebx ; ebx==0 means that we were searching for one jz .got_it ; character. We found it, so we stop. mov ecx,ebx repe cmpsb jne .not_match .got_it: pop ecx esi edi dec edi mov eax,edi .ret: pop edi esi edx ecx ebx ret 8 .not_match: pop ecx esi edi jmp .search .not_found: xor eax,eax jmp .ret |
|||
27 Apr 2004, 13:41 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.