flat assembler
Message board for the users of flat assembler.
Index
> Main > Cgi without C or Perl in ASM |
Author |
|
Jaques 21 Jun 2004, 01:26
Is it possible to acomplish CGI sucessfully in Asemmbly
_________________ - My ignorance is now your problem. |
|||
21 Jun 2004, 01:26 |
|
roticv 21 Jun 2004, 02:25
Yes. Take a look at http://board.win32asmcommunity.net/showthread.php?s=&threadid=6745
|
|||
21 Jun 2004, 02:25 |
|
pelaillo 21 Jun 2004, 16:45
This is also interesting: http://www.whizkidtech.redprince.net/cgi-bin/tutorial
Look it also an intersting way to fight spammers using cgi, proposed by the author. |
|||
21 Jun 2004, 16:45 |
|
decard 21 Jun 2004, 19:44
interesting... can anybody present an example of CGI script in ELF format?
|
|||
21 Jun 2004, 19:44 |
|
pelaillo 23 Jun 2004, 03:07
This is probably the simplest one:
Code: format ELF executable entry start section readable writeable html: db 'Content-type: text/html',0Ah,0Ah db '<html><head><title>Fasm Worldwide</title></head>',0Ah db '<center><body bgcolor=Black text=Green>',0Ah db '<font face="sans-serif" size="10">',0Ah db '<a href="http://flatassembler.net">fasm is everywhere</a>',0Ah db '</center></font></body></html>' .size = $ - html - 1 section readable executable start: mov eax,4 mov ebx,1 mov ecx,html mov edx,html.size int 0x80 mov eax,1 xor ebx,ebx int 0x80 |
|||
23 Jun 2004, 03:07 |
|
comrade 23 Jun 2004, 04:32
Isn't it CRLF as opposed to single LF?
|
|||
23 Jun 2004, 04:32 |
|
pelaillo 23 Jun 2004, 04:42
Unix style. All my hand-edited html files have LF only and works with any browser.
Is there a W3C instruction regarding CRLF? |
|||
23 Jun 2004, 04:42 |
|
JohnFound 23 Jun 2004, 05:46
|
|||
23 Jun 2004, 05:46 |
|
decard 23 Jun 2004, 06:57
hmmm, and I can't make it work on my server... maybe I'm missing something? does it have to be in cgi-bin directory? Is it enough to rename it to "index.cgi"? I have newer been using CGI so I don't understand everything.... :/
[edit]it is working now... it was just the matter of setting permisions what a fool... hehe http://www.decard.net/cgi-bin/fasm/index.cgi[/edit] |
|||
23 Jun 2004, 06:57 |
|
Madis731 04 Nov 2004, 21:14
Sorry, to bring this up again, but I haven't found ANY way to tell the server/browser to EXECUTE the exe, not download.
There was just ONE 16-bit Hello.exe, that didn't download, but outputted junk and I was glad -at least something... "All you have to do is put an exe in cgi-bin and write the address in your IE" hmm... doesn't work that way I tried Java and there you would have to make a File.cgi where you put something like this: Code: #!/bin/sh # Kunstlik hingamine CLASSPATH=`dirname $0` export CLASSPATH #echo "Content-type: text/plain" #echo exec java -DREQUEST_METHOD="$REQUEST_METHOD" \ -DQUERY_STRING="$QUERY_STRING" \ Vorm Anyone? what did I miss |
|||
04 Nov 2004, 21:14 |
|
pelaillo 05 Nov 2004, 12:46
Madis731,
1. is your cgi-bin directory in a linux server? (as you are using a bash shell script) 2. is your client a windows system? (as you are talking about IE) |
|||
05 Nov 2004, 12:46 |
|
Madis731 05 Nov 2004, 16:09
Well, I don't know what server we have at school Sun? maybe...
it does not matter because I can run Java in any directory - there is no such *special* directory, that has cgi-bin as a name and CGI as an ONLY runnable interface in it. I even made a Java guestbook in cgi, but I just can't do the same with exe. Another interesting option I have found is that the file does not have to be *.exe so files like "c" are perfectly legal - but mystery remains - how does server know? header checking or what? Yes, I have a Win2k machine and yes I have some rudiments of IE on that but I HATE it. Unfortunately Mozilla got beaten with that *one* 16-bit exe. Otherwise they act the same. And after I did some tricks in server (I can't remember what) over SSH, it ran on both: IE & Moz ...wierd... |
|||
05 Nov 2004, 16:09 |
|
mike.dld 05 Nov 2004, 19:14
try to rename *.exe to *.cgi
also, i've failed to run MZ's & PE's on unix (free) hosting |
|||
05 Nov 2004, 19:14 |
|
Matrix 05 Nov 2004, 21:29
You can run an EXE on a web server ?
this is new for me, could someone explain? |
|||
05 Nov 2004, 21:29 |
|
mike.dld 05 Nov 2004, 22:08
CGI app is just an ordinary program (MZ, PE, ELF, etc.) which output is redirected to the user' browser. Nothing special for me. Look to pelaillo's post above with ELF example - you just need to compile it, rename to some_name.cgi and place to the *nix-based server. Then type its address in your browser and see something like this: http://mikedld.50free.org/_cgi/index3.cgi.
MZ & PE executables may be run on Windows-based server of course. |
|||
05 Nov 2004, 22:08 |
|
pelaillo 06 Nov 2004, 15:26
cgi programs run on server so the native file must be able to run in the server system.
To run a PE exe in a *nix server, you need to instruct the server to run it through wine. If you don't have access to the server, there's nothing to do about. If you want to test it locally, you need to have a server running on your computer and access it from browser as http://localhost/your_cgi_script and then it runs instead of download. |
|||
06 Nov 2004, 15:26 |
|
Matrix 06 Nov 2004, 16:39
Thank you
its cool |
|||
06 Nov 2004, 16:39 |
|
Madis731 07 Nov 2004, 13:14
Oh, my bad, exe is a windows filetype and of course linux won't understand it by default:P I read from above that ELF is the way to go in these cases
|
|||
07 Nov 2004, 13:14 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.