Raised This Month: $51 Target: $400
 12% 

Solved I think my source code got corrupted... Any help, please?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
LordHotPocketHomicide
Member
Join Date: Aug 2016
Location: This Realm of Existence
Old 06-27-2021 , 21:05   I think my source code got corrupted... Any help, please?
Reply With Quote #1

Right, so I've got this major project I'm working on - I'm around 3k-4k lines of code in, only another 1k-2k and it'll be done. Then, all I'll have to do is test for bugs, then I can publish it. I decide to save the SP, just in case something goes wrong. Then, out of nowhere, my computer's fans all go silent as the computer stops responding to my inputs and clicks. Out of panic, I hold the power button and do a hard reboot. As soon as my PC is back on, I immediately go back to my project, and I'm greeted with a single very long line of blank spaces.

The SP itself gives me 26 error 075s (input line too long after substitutions) when I try to compile it. For some reason though, the SP is still the same file size (107KB) as it was before it was corrupted, which leads me to believe that this can still be saved, so I'm reaching out to all of you geniuses on here. Has anyone else run into this issue? Is it even possible to salvage the source code at this point, or am I doomed?

Things I've tried so far:
  • I've tried opening the SP in several different programs, all of which had the same result, except for Notepad++, which gives me a bunch of [NULL] instead of a blank space.
  • Decompiling the latest successful compile with this decompiler. Unsuccessful; it just spits out a jumbled mess of my global variables (all of which were new instead of float, int, etc), some of my custom stocks, and some default SourceMod functions. The entire thing is also old syntax. Here's the output file, if you want to see it.

Lastly, here's a download to the SP in question for anyone who might want to see it.
__________________
Professional retard. I might borrow some code, but I always try to give credit when I do! If you've noticed I've borrowed some of your code, and you have a problem with that, please add me on Steam and let me know so I can correct the problem as soon as possible!

Last edited by LordHotPocketHomicide; 06-27-2021 at 22:36.
LordHotPocketHomicide is offline
nosoop
Veteran Member
Join Date: Aug 2014
Old 06-27-2021 , 21:53   Re: I think my source code got corrupted... Any help, please?
Reply With Quote #2

It looks like your source file is completely hosed; can't recover anything meaningful from a long sequence of null bytes. The most you can do is use the disassembled / decompiled source as a reference and write the whole plugin again, or if you're lucky, Notepad++ may have a backup containing unsaved changes somewhere on the filesystem if you were using it as your primary editor; Everything may be able to find one of it exists (search for the filename).

Be sure to have source control (git stores a copy of every file commit so you can recover from damage in the working tree) and off-device backups (in the case of full hardware failure) for the future. You may also want to check the health of your drive(s) and consider replacements if it's not in good condition.
__________________
I do TF2, TF2 servers, and TF2 plugins.
I don't do DMs over Discord -- PM me on the forums regarding inquiries.
AlliedModders Releases / Github / TF2 Server / Donate (BTC / BCH / coffee)

Last edited by nosoop; 06-27-2021 at 22:00.
nosoop is offline
LordHotPocketHomicide
Member
Join Date: Aug 2016
Location: This Realm of Existence
Old 06-27-2021 , 22:36   Re: I think my source code got corrupted... Any help, please?
Reply With Quote #3

Quote:
Originally Posted by nosoop View Post
It looks like your source file is completely hosed; can't recover anything meaningful from a long sequence of null bytes. The most you can do is use the disassembled / decompiled source as a reference and write the whole plugin again, or if you're lucky, Notepad++ may have a backup containing unsaved changes somewhere on the filesystem if you were using it as your primary editor; Everything may be able to find one of it exists (search for the filename).

Be sure to have source control (git stores a copy of every file commit so you can recover from damage in the working tree) and off-device backups (in the case of full hardware failure) for the future. You may also want to check the health of your drive(s) and consider replacements if it's not in good condition.
Ah, that's tragic to hear. Still, I appreciate the response; looks like I'll be rebuilding it. I'll keep these tips in mind for future reference!
__________________
Professional retard. I might borrow some code, but I always try to give credit when I do! If you've noticed I've borrowed some of your code, and you have a problem with that, please add me on Steam and let me know so I can correct the problem as soon as possible!
LordHotPocketHomicide is offline
MAGNAT2645
Senior Member
Join Date: Nov 2015
Location: AlliedMods.net
Old 06-28-2021 , 07:20   Re: I think my source code got corrupted... Any help, please?
Reply With Quote #4

I had kinda similar problem but in my case i just lost every source file due to dying HDD.
Thanks to Lysis Decompiler and SourcePawn Disassembler i managed to restore (and got an opportunity to rewrite/improve logic of some plugins) almost all sources (still wip).

1) I use Decompiler as a base (to get most of the code)
2) Then I remove from restored code external stuff like stocks from libraries (i can use #include later), headers (structs like SharedPlugin, Extension, PlVers).
3) Disassembler helps me to restore constants (strings, enumerations etc.) and fix broken logic (for example, if Decompiler can't restore conditional branching properly). However, here you need to know and understand the assembler code. I use this Russian guide as a reference (Perhaps there is a similar one in English somewhere, I haven't seen it.)
__________________
MAGNAT2645 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:27.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode