Very dangerous code...

This is a discussion on Very dangerous code... within the C++ Programming forums, part of the General Programming Boards category; DON'T SCREW WITH ASM unless you are brave or brilliant. I was brave until last week. thank god i was ...

DON'T SCREW WITH ASM unless you are brave or brilliant. I was brave until last week. thank god i was playing on kiddos box.
M.R.

Assembly language is not dangerous, nor is there some well kept secret on how to use it. You don't have to be brilliant to understand it either. All you need is a good understanding of machine architecture and your CPU. The safest form of assembler is inline assembler since your compiler will catch most of your errors. You can crash the system with assembler, but you can also crash it with C/C++ too. Besides, what did you do that messed up the system so bad? Every problem can be fixed

C can be dangerous if you do not know how to use it, and if you are careless. For that matter, I guess DOS interrupts could be dangerous. FDISK can be dangerous. Anything can be dangerous if you are trying to accomplish creating dangerous code. Personally, I feel that more could beneift from good, solid, stable code than viruses, destructive code, and just plain foolish code - all of which fit into the stupid category.

howdy bubba,
i imagine you are probably right. my terrible experience was the result of blind ignorance and the debug "g" command.
writing directly from a register to a disk location (any how i think thats what happened) did however create an unrecoverable disk error at the expense of tonka joes construction equipment, ask a 5 year old how important his tonka tractor is. devastating!!

Hey people, I got an idea! Remember WinChi virus? If, no I can tell you that it's real name is Chernobil and it makes PHYSICAL demage to your computer. How? Simple, by reprogramming(well I lied - "erasing") Flash BIOS. Very deadly trust me. In fy father's institute 60 computers went down permanently!!!
Think about it.

Yea. Just change the file back. GUI means Graphical User Interface. All you are doing is telling windows to boot into dos mode. From there type WIN and your back into windows. Its just funny because not too many people remember how to manipulate dos.

Yes there are viruses that can erase FLASH, mess hard drives up, etc. But they do not deserve the attention that everyone gives them. It is code designed to destroy. It is foolish, against the law, and counter-productive.

Also, the "g" command in DEBUG does not write anything. It tells debug to move to the start of your program and execute it from there. In fact, if you DEBUG one of your C executables and then type in g, it will execute the code just as if you pressed ALT F9 from within the IDE.

For instance: DEBUG myprog.exe

DEBUG will place your code at an available memory location. To dump the memory from the top you would dimply type in "d." To unassemble you would type "u." This will display the actual instructions, whereas "d" only displays the opcodes and at the right of the screen if the character is printable, it will display the character, if not, it displays "."

To write code, you use the "w" command. This command can wipe out your OS if you are dumb enough to write to absolute disk sectors. However, it is extremely useful if you patch a section of code.

The original Starflight game uses a mode that most newer cards do not support. To patch the game you need to use DEBUG. After you patch the correct section with the correct opcodes using the "e" command, then you write the corrections to disk using "w" by itself. This will write the corrections to disk, in the correct location. It is best not to specify anything else with the "w" command unless you know what you are doing, which most of you do not, so don't try it.

DEBUG has a use (or did) and it works great if you use it for what it was designed for. But in modern day there are many more user-friendly - Windows based debuggers to be used.

Before all of you post about assembly, you really should check out some docs so that you know what you are talking about. Look up Randall Hydes Art of Assembly Language Programming on www.excite.com. It will be the 3rd or 4th listing.

If you want to learn assembly then fine, if you want to misuse it, you get what you deserve.

hey bubba, take a red man,
i may not not everything about everthing but some of us do use these boxes as tools and not just toy's. i still have the note pasted on my monitor that says "make sure disk is inserted and the latch is closed".
my ASM experience was not created by stupidity it was a function of trying to be as cool as you folks.
i'll learn ASM but at this point i guess i'd better go to the link you suggested.
enjoy the experience, unravel your mind, be cool.

Did not say that your problem was the result of stupidity. I said that people who write viruses and pay homage to them like they are some kind of all powerful being are wasting their time. But, if you try to destroy your own drive too see if you can - yes, that is stupidity.

If you were just tinkering around, cool. That is how I learned and also through that link. I'm not cool and I'm not all knowing when it comes to assembly, C++, C or anything else in life. Try those commands in DEBUG, and use a debugger to debug your code. You will get a good idea of what really takes place when the computer runs your program.

If I implied you were stupid, I am sorry and that was uncalled for.
If you have any questions about asm, feel free to PM me or ask on this board. That Randall Hyde book (he uses it for his classes) is one of, if not, the best concerning asm. Don't look at the HLA link or protected mode asm until you fully understand 16-bit asm. Download the 16-bit asm pdf files only. HLA will only serve to confuse you starting out. Welcome to the world of assembly.