Slashdot Log In
Assembler Compiler In Bash
Posted by
michael
on Thu Feb 15, 2001 05:05 AM
from the bass-ackwards dept.
from the bass-ackwards dept.
sTeF writes "This guy is crazy, he wrote an assembler totally in Bash. After all those awk/sed/ps httpservers this is the next crazy step. what's next? a virtual machine in Bash? anyhow here's the url to the source."
This discussion has been archived.
No new comments can be posted.
Assembler Compiler in bash
|
Log In/Create an Account
| Top
| 126 comments
(Spill at 50!) | Index Only
| Search Discussion
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
(1)
|
2
(1)
|
2
hee, hee, hee (Score:3)
A standard mirror... (Score:3)
HTTP: http://www.bluecherry.net/~rain/shasm.tgz [bluecherry.net]
FTP: ftp://ftp.bluecherry.net/pub/misc/shasm.tgz [bluecherry.net]
Our FTP server has a limit of 15 anonymous users, so I'd highly recommend using the HTTP mirror unless some BOFH [everything2.com] firewalled port 80 outbound. (I've seen it happen!).
--
Ben Winslow..........rain@bluecherry.net
bluecherry internet..http://www.bluecherry.net/
Interactive assembler (Score:3)
shasm (Score:3)
The idea is to try to make a porttable ( to an extent ) assembler so asm written on one Arch can port easily to another.
The cool thing about this is it only needs Bash. no other external utils.
Tre Geek Cool
At the moment not all the instructions are support and it doesnt do Elf and A.out - Only flat listings
Re:'Assembler Compiler?' (Score:3)
For the newbies who can't understand what we're talking about:
'Assembler' used to mean both the mnemonic 'language' that coincided with machine code (the actual ones and zeros that hardware understands -- sort of) and the program that turns that language into a form that the linker needs to produce the executable.
'Compiler' is a program used to 1) scan the source code looking for keywords and other constructs in the language in question, substituting 'tokens' and making entries into a symbol table. 2) produce meaningful error messages concerning syntax. 3) parse the result determining the meaning of the program, sending this information to a 3) code generator and optionally to a 4) code optimizer. That's a very simplistic definition and one that's not necessarily 100 percent correct for all programs calling themselves 'compilers'.
The current trend of calling assemblers 'assembler compilers' grates against my sensibilities too.
Re:Next step (Score:3)
Let me guess... (Score:3)
Assembler vs. compiler (Score:4)
Now, if you were to try and write a 3rd generation language compiler (such as Pascal) in bash, you might get into trouble fast. This would require some very extensive control and data structures that bash doesn't support as well as, say, C. I'm not sure bash has multidimensional arrays or pointers, and these make constructing things like symbol tables a lot easier.
Still, I would say this guy knows a lot more about bash than I do, and there is probably something I am missing (since I can't read the source right now).
'Assembler Compiler?' (Score:5)
--
Next step (Score:5)
the next crazy step
bash in assembler.
By the way, that would make bash self booting ...
---
recursion, n: see recursion.
Strange, stupid things to do with common tools (Score:5)
I turned in a solution in ksh. He asked me "Why Ksh??", and I said "It doesn't fork to run functions like the bourne shell." Hee hee! I love given right-wrong answers to profs.
A few weeks later I wrote a normal-math to RPN-math parser in Bourne shell using the Shunting Yard algorithm.
You can do all kinds of things in shell -- for those of you among us who extoll p*rl as the be-all and end-all of programming languages, I say, "Try Shell! If you can't do it in shell, you should be writing it in C, anyhow".
--
Bullshit (Score:5)
Anything which can generate binary from your telnet connection will do -- I've transfered binaries from one system to another by cutting and pasting them in base64, or escaped octal before. Hell, there are even special t00lz designed for transfering binaries which are often available on the target system.. Lets see... I think they are called "ftp", "rsh", "ssh", and other funny nam3z like that.
Yeesh. You people are idiots. Sysadmins beware? Puh-lease.
No 5cr1pt k1dd13 is going to be writing custom one-offs in assembler on a target box.. after all, the 5cr1pt k1dd1e collective IQ is somewhat near the value the ax register holds after xor ax,ax.
No skilled cracker is going to need this tool to do the deed, although it might be handy to have around.
Next time, think before you speak -- alarmism is not useful. If you weren't posting as an AC, I'd think that you were almost certainly trying to a frist psot karma-whore trick.
--
LOL (Score:5)