I lost the Source Code

This is a discussion on I lost the Source Code within the Tech Board forums, part of the Community Boards category; I had a C progam that was designed for us by a consultant. We had a source code and an ...

  1. #1
    Registered User
    Join Date
    Aug 2010
    Posts
    3

    Question I lost the Source Code

    I had a C progam that was designed for us by a consultant. We had a source code and an executable. The source code was temporarily placed in temp fodler (/tmp) of a Unix box. The source code was lost when the Unix box was restarted. I was told that there is not way it can be recovered. I have some changes that i want to do but because I only have the executable, It is a problem. The consultant who did the code is late.... no one has the source code. Is there a way I can convert the executable to a source code?? Or any help I can get??

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,341
    > The source code was temporarily placed in temp fodler (/tmp) of a Unix box
    So where did it come from? It didn't spontaneously appear there, it must have been copied from somewhere else.

    Eg.
    From: Consultant
    To: you
    Subject: code
    Find attached a TAR file with the source code.

    So check your email archives.

    Or maybe even a CD, or a thumb drive, or an FTP site or your mail hosting ISP or ....

    > Is there a way I can convert the executable to a source code?
    It's usually quicker to rewrite it from scratch, unless you're also interested in legacy preserving bugs in the old version.
    Whilst you can decompile code, the result isn't anything you would want to maintain. It CERTAINLY won't look like the original code.


    > I was told that there is not way it can be recovered.
    Well that depends on how much time has elapsed since the reboot, and the amount of use of the machine. If you've only just done this, there is a reasonable chance that the data is still on the disk (data sectors will only be overwritten when next allocated for storage).
    Reboot, mount the disk read-only and make a clone copy of the disk.
    But the longer you leave this option, the less likely you will find your files with a disk sector search.


    Linux Ext2fs Undeletion mini-HOWTO
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,586
    Um...some type of SCM that you back up each night might be in order. If you have it I cannot believe you did not submit the project the instant you downloaded it. But as Salem has suggested I'm sure the consultant has some type of SCM and if you paid for the code then just ask them to re-send it.

  4. #4
    Registered User
    Join Date
    Aug 2010
    Posts
    3

    Question I lost the Source Code

    Thanks gys,

    The consultant came and retrieved if from his gmail account. We did not have it saved on any media. He was an individual consultant, no partners/co-workers. Like I said, he passed away last year and there is no how we can find his files.

    This unix box is used as a test box. We only edit the script, compile and ftp the compiled file to production. Unfortunately, we do not back-up any data/info contained in this box.

    I will very much want to try the last option given by Salem. I am not much familiar with Unix OS. How best can I do this Reboot and cloning??

    Once again, thanks for your help.

  5. #5
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,586
    We did not have it saved on any media.
    Then I guess this is one painful lesson you won't soon forget.

  6. #6
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    20,976
    Quote Originally Posted by onalethata
    I will very much want to try the last option given by Salem. I am not much familiar with Unix OS. How best can I do this Reboot and cloning??
    Salem also provided a link.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  7. #7
    Registered User
    Join Date
    Aug 2010
    Posts
    3
    Sorry, I found the link after posting the reply. Will go through the doceument.

    Thank All,

  8. #8
    Registered User
    Join Date
    Oct 2008
    Posts
    1,262
    Quote Originally Posted by Salem View Post
    > I was told that there is not way it can be recovered.
    Well that depends on how much time has elapsed since the reboot, and the amount of use of the machine. If you've only just done this, there is a reasonable chance that the data is still on the disk (data sectors will only be overwritten when next allocated for storage).
    Reboot, mount the disk read-only and make a clone copy of the disk.
    But the longer you leave this option, the less likely you will find your files with a disk sector search.


    Linux Ext2fs Undeletion mini-HOWTO
    Hmmm it depends also on how /tmp is mounted. I believe that usually or at least sometimes it's stored in memory rather than disk. Not always though. If it was stored in memory, it's completely gone.
    Try "mount" on the server and copy the line that has /tmp, if any. If none, then you might be able to recover it.

  9. #9
    Registered User
    Join Date
    Nov 2010
    Posts
    1
    I can try to help you to reverse engineer what you have.
    CONUS.INFO

  10. #10
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,586
    Closed.

    Please don't bump old threads.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How do you call another source code file?
    By nifear4 in forum C Programming
    Replies: 2
    Last Post: 10-28-2008, 12:16 PM
  2. 'Type' Error on Build of Officially Released Source Code
    By Jedi_Mediator in forum C++ Programming
    Replies: 5
    Last Post: 07-07-2008, 05:28 PM
  3. starting linux's source code and kernel
    By sawer in forum Linux Programming
    Replies: 9
    Last Post: 08-01-2006, 07:46 AM
  4. DxEngine source code
    By Sang-drax in forum Game Programming
    Replies: 5
    Last Post: 06-26-2003, 05:50 PM
  5. Lines from Unix's source code have been copied into the heart of Linux????
    By zahid in forum A Brief History of Cprogramming.com
    Replies: 13
    Last Post: 05-19-2003, 03:50 PM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21