Answers.Body: <p>According to Wikipedia's Lego Mindstorms NXT page Next Bytes Code (<a href="http://bricxcc.sourceforge.net/nbc/" rel="nofollow noreferrer">http://bricxcc.sourceforge.net/nbc/</a>) can be used to decompile the bytecode program on the brick.
  I have however no experience with this, nor have I heard of people being successful with this.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-17T17:09:01.327Z
Answers.Text: Currently, I am having trouble finding how you get to a place to download it. If you could provide a link that directs me to that, it would help.
Answers.UserDisplayName: Banana999
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-17T19:26:44.967Z
Answers.Text: @MindRobotics The download link is [right there on that page](http://bricxcc.sourceforge.net/nbc/). You should understand, however, that IF the NBC decompilation is compatible with programs written using the EV3 software, the source code will decompile to NBC language. You'll have to edit it using BricxCC and NBC, not the standard Lego software.
Answers.UserDisplayName: MindS1
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-17T12:09:14.517Z
Answers.LastActivityDate: 2018-08-17T12:09:14.517Z
Answers.UserDisplayName: Michael Verschaeve
Answers.Body: <p>NXT programs are compiled into a program the brick can run. It <em>might</em> be possible to pull the compiled code off the brick, but I'm not aware of any disassemblers or decompilers for the compiled programs.</p>
  
  <p>I think your best chance at recovering the program would be to try to recover the deleted file on your PC with a deleted file recovery program.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-16T19:10:02.857Z
Answers.LastActivityDate: 2018-08-16T19:10:02.857Z
Answers.UserDisplayName: Alexander O'Mara
Answers.Body: <p>You can upload a program from the NXT back to the PC, but unless you can interpret the assembly byte code, it won't be of any use to you. A better option might be to try to <em>recover the deleted file from your PC</em> (what?? I can do that??).  </p>
  
  <p><strong>This is URGENT. You have to act quickly if you want to recover a deleted file.</strong><br>
  Usually deleted files go to the recycle bin. Assuming it's been deleted from there as well, a deleted file's data is actually <em>not immediately lost</em>. That storage space is now liable to be overwritten by other files (hence, <em>recycle</em> bin). As long as it hasn't been overwritten yet, the data can be recovered.  </p>
  
  <ol>
  <li>Close out of all programs on your computer.</li>
  <li>Grab a flash drive or some other external memory device.</li>
  <li>Download portable Recuva software <a href="https://www.ccleaner.com/recuva/download/portable" rel="nofollow noreferrer">from here</a>, <em>directly to your flash drive</em>. Change your browser's download settings if necessary.</li>
  <li>Extract the zip file, again, <em>directly to your flash drive</em>.</li>
  <li>Right click recuva.exe, click "Run as Administrator".</li>
  <li>A wizard will start that will help you recover deleted files on your hard drive.  </li>
  </ol>
  
  <p>Again, the goal here is to use your computer as little as possible in the meantime to minimize the risk that your deleted data will be overwritten.  </p>
  
  <p>Good luck!</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-16T22:42:40.103Z
Answers.Text: Well, the computer I use is not MINE - I am only using this computer for my project - so I cannot use this method. If there is a program to recover the file from the NXT, I can get the program on my personal computer and extract the file (as this IS my personal NXT)
Answers.UserDisplayName: Banana999
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-16T22:59:34.967Z
Answers.Text: @MindRobotics With the NXT-G software you can see what files are on your NXT. IIRC you can click a file and choose "Upload" to save the file to your computer. The purpose of this is to then re-download the program to an NXT later on. But it can't be edited ever again.  Nice username BTW. Looks like we had the same idea there :)
Answers.UserDisplayName: MindS1
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-17T17:14:56.393Z
Answers.Text: I do already know that method, but I am looking for a program that can somehow decompile the uploaded NXT file and be able to edit my program again
Answers.UserDisplayName: Banana999
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-16T22:05:25.113Z
Answers.LastActivityDate: 2018-08-16T22:05:25.113Z
Answers.UserDisplayName: MindS1
Body: <p>I have been programming a complex file for my Lego Mindstorms NXT. I accidentally deleted my file from the PC, but it is still available on my NXT brick. Is there any way that I can retrieve the file from my NXT and continue programming it? The file is complex, and it will be difficult for me to recreate it. Also, if this helps (or places restrictions), I made the program with the EV3 software (as is backward compatible - and I do have the NXT software also). I haven't tried any methods (I don't know any to try) so I can't tell you what doesn't already work for me.</p>
  
  <p>Also, the PC I used is not mine, so I do not have a way to recover the file from that PC. If I could recover it from my NXT I can get the program on my personal computer.
  Thanks!</p>
  
Tags: <nxt><programming>
Title: How to retrieve a deleted program file from the lego NXT
UserDisplayName: Banana999
ThreadText: # How to retrieve a deleted program file from the lego NXT
  
  (Asked by: username_0 on 2018-08-16)
  
  I have been programming a complex file for my Lego Mindstorms NXT. I accidentally deleted my file from the PC, but it is still available on my NXT brick. Is there any way that I can retrieve the file from my NXT and continue programming it? The file is complex, and it will be difficult for me to recreate it. Also, if this helps (or places restrictions), I made the program with the EV3 software (as is backward compatible - and I do have the NXT software also). I haven't tried any methods (I don't know any to try) so I can't tell you what doesn't already work for me.
  
  Also, the PC I used is not mine, so I do not have a way to recover the file from that PC. If I could recover it from my NXT I can get the program on my personal computer.
  Thanks!
  
  **Tags:** nxt, programming
  
  ---
  
  ## 3 answers
  
  ### Answer by username_1 on 2018-08-17. Score: 1 | Accepted answer
  
  According to Wikipedia's Lego Mindstorms NXT page Next Bytes Code (<http://bricxcc.sourceforge.net/nbc/>) can be used to decompile the bytecode program on the brick.
  I have however no experience with this, nor have I heard of people being successful with this.
  
  > **Comments:**
  > **username_0**: Currently, I am having trouble finding how you get to a place to download it. If you could provide a link that directs me to that, it would help.  
  > **username_2**: @MindRobotics The download link is [right there on that page](http://bricxcc.sourceforge.net/nbc/). You should understand, however, that IF the NBC decompilation is compatible with programs written using the EV3 software, the source code will decompile to NBC language. You'll have to edit it using BricxCC and NBC, not the standard Lego software.  
  
  ---
  
  ### Answer by username_3 on 2018-08-16. Score: 1
  
  NXT programs are compiled into a program the brick can run. It *might* be possible to pull the compiled code off the brick, but I'm not aware of any disassemblers or decompilers for the compiled programs.
  
  I think your best chance at recovering the program would be to try to recover the deleted file on your PC with a deleted file recovery program.
  
  
  ---
  
  ### Answer by username_2 on 2018-08-16. Score: 0
  
  You can upload a program from the NXT back to the PC, but unless you can interpret the assembly byte code, it won't be of any use to you. A better option might be to try to *recover the deleted file from your PC* (what?? I can do that??).
  
  **This is URGENT. You have to act quickly if you want to recover a deleted file.**  
  Usually deleted files go to the recycle bin. Assuming it's been deleted from there as well, a deleted file's data is actually *not immediately lost*. That storage space is now liable to be overwritten by other files (hence, *recycle* bin). As long as it hasn't been overwritten yet, the data can be recovered.
  
  1. Close out of all programs on your computer.
  2. Grab a flash drive or some other external memory device.
  3. Download portable Recuva software [from here](https://www.ccleaner.com/recuva/download/portable), *directly to your flash drive*. Change your browser's download settings if necessary.
  4. Extract the zip file, again, *directly to your flash drive*.
  5. Right click recuva.exe, click "Run as Administrator".
  6. A wizard will start that will help you recover deleted files on your hard drive.
  
  Again, the goal here is to use your computer as little as possible in the meantime to minimize the risk that your deleted data will be overwritten.
  
  Good luck!
  
  > **Comments:**
  > **username_0**: Well, the computer I use is not MINE - I am only using this computer for my project - so I cannot use this method. If there is a program to recover the file from the NXT, I can get the program on my personal computer and extract the file (as this IS my personal NXT)  
  > **username_2**: @MindRobotics With the NXT-G software you can see what files are on your NXT. IIRC you can click a file and choose "Upload" to save the file to your computer. The purpose of this is to then re-download the program to an NXT later on. But it can't be edited ever again.  Nice username BTW. Looks like we had the same idea there :)  
  > **username_0**: I do already know that method, but I am looking for a program that can somehow decompile the uploaded NXT file and be able to edit my program again  
  
  ---
  
  