LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   How to de-com a dos com file (https://www.linuxquestions.org/questions/programming-9/how-to-de-com-a-dos-com-file-622426/)

khaos83 02-20-2008 02:38 AM

How to de-com a dos com file
 
I have a com file for DOS.

Is there a way to de-com it?

khaos83 02-20-2008 02:48 AM

Pls offer your brain juice for the above qns.

*off-topic*

I am trying to find out because I have a dos machine. It will run a program. If some how it exits, a com file will run to reboot and with a countdown timer for user intervention. The thing is, if the countdown .com file is run before the program, the countdown time will run/countdown. But if the program is run first, then the countdown time will NOT run/countdown.

I have absolutely no idea why, so I am trying to find out how the .com does the countdown, then from there find out what is wrong.

khaos83 02-20-2008 02:56 AM

*off topic*

or why wait commond is unable to countdown

ronlau9 02-20-2008 04:20 AM

ho de-com a dos com file
 
What do you mean by de-com
The most normal files in dos are 1) sys.com = system file without this dos don,t boot
2) Autoexec.bat = auto startup
3) Config.sys = system config
4) exe files =
5) devices drivers


So what is decom


good luck

cicorino 02-20-2008 04:50 AM

it's very hard...com files run in real mode, live inside a single segment and have no relocation.
If you use 'ndisasm' (found as tool inside the 'nasm' assembler distribution) you can
de-assemble the small amount of code of your file and try to read/rewrite it.

rupertwh 02-20-2008 04:56 AM

What you are looking for is a disassembler. Which basically means any debugger.

ronlau9: .com are dos (small) executables. Only tiny memory model, iirc. None of that new fangled .exe stuff... ;)

AnanthaP 02-20-2008 06:14 AM

I can think that the calling program is not really calling your countdown program when it exits. So one way is to bundle them in a batch file like so.
Calling.exe
Countdon.com

This wil tell you clearly what is the problem.
End

ronlau9 02-20-2008 12:57 PM

how to de-com a dos com file
 
O I know what a com file is I was one the old people who did programming under dos in fortran, Pascal, C in basic After that we get more power full
machines we use Cobol But that were the old days


best wishes

sundialsvcs 02-20-2008 08:56 PM

Believe it or not, COBOL still does most of the "heavy lifting" in the business world... and FORTRAN is still the language of choice in the scientific community. :)

Dan04 02-21-2008 07:53 PM

Yeah, the company I work for still does a lot of COBOL. I'm fortunate enough to be in another department, though.


All times are GMT -5. The time now is 12:07 PM.