Baconinvader
Baconinvader

Reputation: 15

How to get recovered c# class in working order

I was browsing YouTube a few days ago, and my computer suddenly crashed with a PAGE_FAULT_IN_NONPAGED_AREA error. This has happened a few times, and I assume it's just a bug in Windows 10, and it never really affected me too much, as when the computer restarted all the tabs and files I had open re-opened. However, this time when my computer restarted, the error seemed to have corrupted a class I was working on using visual studio at the time (The other classes were untouched thankfully :D). The corrupted class had also created 202 errors, most of them being:

Severity Code Description Project File Line Error CS1056 Unexpected character ' (the ' looked like [] in the actually error, if that helps)

I went to the class location and opened it with notepad to see what had happened to it, but the whole thing was blank (even though you could still make text selections of the blank space).

I looked online to see if anyone else had encountered this problem and someone had this. I tried all the solutions but none gave me any results except solution four (which was to download a program called recurva and run a scan on the directory that had the class in it). The recovered file had this in it:

"LinkFilterHashList"
{
	"List_3"
	{
		"UpdateTime"		"1440597537"
		"version"		"8E1298389020E47C82385F70CD2D2CBFCBF16415"
		"ListHashes"
		{
			"127"		"a10b2cb9"
			"126"		"9b4b0158"
			"125"		"d51486ac"
			"124"		"90d4be26"
			"123"		"5f0339e8"
			"122"		"44bad6fd"
			"121"		"17ea1c80"
			"120"		"b7c14d80"
			"119"		"82e02475"
			"118"		"45dbfd52"
			"117"		"5112a614"
			"116"		"623c6132"
			"115"		"f15d5b67"
			"114"		"450f9de3"
			"113"		"c72f6261"
			"112"		"76db13e1"
			"111"		"d5d74942"
			"110"		"4c31aea4"
			"109"		"39be93f6"
			"108"		"f7a03d6a"
			"107"		"67ca16d3"
			"106"		"450d18ff"
			"105"		"d3ebc87f"
			"104"		"bd46a91b"
			"103"		"0afee1a3"
			"102"		"ccd92718"
			"101"		"a0244293"
			"100"		"2426f23b"
			"99"		"defe4f66"
			"98"		"55bb2e0e"
			"97"		"1560bc34"
			"96"		"d4e454db"
			"95"		"c002249a"
			"94"		"3904e93e"
			"93"		"c8d6d91e"
			"92"		"716b327f"
			"91"		"763dc014"
			"90"		"cb1a4644"
			"89"		"b4d31bce"
			"88"		"9c86f47b"
			"87"		"f6337120"
			"86"		"f0fa14d1"
			"85"		"dd1405fb"
			"84"		"4be7fd6d"
			"83"		"f0eb2085"
			"82"		"d3bf95ea"
			"81"		"e1b9b9c9"
			"80"		"a052f026"
			"79"		"ff120db1"
			"78"		"f6f73860"
			"77"		"a6f25f79"
			"76"		"5fe133bf"
			"75"		"1e9f5241"
			"74"		"2352753a"
			"73"		"932b1389"
			"72"		"7d4c0b1c"
			"71"		"ce171620"
			"70"		"a248bfee"
			"69"		"3ed688bd"
			"68"		"a2001d91"
			"67"		"6eed69b1"
			"66"		"50340073"
			"65"		"4d164331"
			"64"		"83dbdf21"
			"63"		"41c27890"
			"62"		"1918e6c7"
			"61"		"72601636"
			"60"		"5d6e0537"
			"59"		"1e5dca25"
			"58"		"bf6d9a00"
			"57"		"7a9dca5d"
			"56"		"cb094fd0"
			"55"		"9c44b858"
			"54"		"4db97899"
			"53"		"d3ffef5a"
			"52"		"1084ac47"
			"51"		"80e2567a"
			"50"		"90ae19fa"
			"49"		"3a1e0ffe"
			"48"		"74c8a2e0"
			"47"		"d142e8a9"
			"46"		"75e3b51c"
			"45"		"cbd1da13"
			"44"		"2820efab"
			"43"		"0f280c48"
			"42"		"75624871"
			"41"		"7597abfd"
			"40"		"bd0fb8a6"
			"39"		"79a7f00a"
			"38"		"5a780f42"
			"37"		"abb58601"
			"36"		"c70319d1"
			"35"		"aa387037"
			"34"		"c58bd0fc"
			"33"		"271ab389"
			"32"		"382fc066"
			"31"		"cd9e1de8"
			"30"		"87d9e083"
			"29"		"26796404"
			"28"		"f466b44e"
			"27"		"06c7b1d7"
			"26"		"cfe635e0"
			"25"		"7bf78afd"
			"24"		"57a55b2a"
			"23"		"13284911"
			"22"		"c14cc073"
			"21"		"6323fc24"
			"20"		"9f533812"
			"19"		"7c8ead73"
			"18"		"f6389d4c"
			"17"		"24ee8dd0"
			"16"		"93517ede"
			"15"		"a716c85c"
			"14"		"1f316383"
			"13"		"bcf5833f"
			"12"		"cf89c5b5"
			"11"		"46230cf9"
			"10"		"35970855"
			"9"		"397ad2e1"
			"8"		"57e6e7bc"
			"7"		"5b1f58cb"
			"6"		"c2734de0"
			"5"		"ece2b91b"
			"4"		"67e1603d"
			"3"		"ba8e5ae7"
			"2"		"4d3846f1"
			"1"		"f6064fb3"
			"0"		"8f4887b3"
		}
	}
	"List_6"
	{
		"UpdateTime"		"1440597538"
		"version"		"2551A1522AEA2CF617641A9D53264DE41C06D773"
		"ListHashes"
		{
			"85"		"60872dd8"
			"84"		"62bf4267"
			"83"		"44e0f55a"
			"82"		"71cf1e3d"
			"81"		"d368c87c"
			"80"		"635d0396"
			"79"		"9eec3af5"
			"78"		"29f7defc"
			"77"		"4a99fe0b"
			"

I also saw that text in the header of the file in recurva, along with this:

22 4C 69 6E 
6B 46 69 6C 
74 65 72 48 
61 73 68 4C 
69 73 74 22 
0A 7B 0A 09 
22 4C 69 73 
74 5F 33 22 
0A 09 7B 0A 
09 09 22 55 
70 64 61 74 
65 54 69 6D 
65 22 09 09 
22 31 34 34 
30 35 39 37 
35 33 37 22 
0A 09 09 22 
76 65 72 73 
69 6F 6E 22 
09 09 22 38 
45 31 32 39 
38 33 38 39 
30 32 30 45 
34 37 43 38 
32 33 38 35 
46 37 30 43 
44 32 44 32 
43 42 46 43 
42 46 31 36 
34 31 35 22 
0A 09 09 22 
4C 69 73 74 
48 61 73 68 
65 73 22 0A 
09 09 7B 0A 
09 09 09 22 
31 32 37 22 
09 09 22 61 
31 30 62 32 
63 62 39 22 
0A 09 09 09 
22 31 32 36 
22 09 09 22 
39 62 34 62 
30 31 35 38 
22 0A 09 09 
09 22 31 32 
35 22 09 09 
22 64 35 31 
34 38 36 61 
63 22 0A 09 
09 09 22 31 
32 34 22 09 
09 22 39 30 
64 34 62 65 
32 36 22 0A 
09 09 09 22 
31 32 33 22 
09 09 22 35 
66 30 33 33 
39 65 38 22 
0A 09 09 09 
22 31 32 32 
22 09 09 22 
(I know that isn't technically code but it in a snippet for easier reading).

I assume that it is possible to turn these bits of text back into c# but I'm not sure how. Any assistance would be greatly appreciated. (Btw, I know about the visual studio backups but it doesn't seem to have created a backup of any of my files).

EDIT: I would provide a screenshot of recurva but It doesn't seem to work after I tried using chkdsk /f to fix the issue.

Upvotes: 1

Views: 296

Answers (1)

Thomas Weller
Thomas Weller

Reputation: 59218

Recovering files

Crashes like that can happen at any time due to many reasons. The NTFS file system does not guarantee the recoverability of files. If it is possible, then that's just luck.

With the file contents you mentioned in your question, it's not possible to get the C# code back. As you can see, the first data is just text (looks like JSON) and the second is exactly the same, just displayed as hexadecimal values.

The real solution

You should really look into a version control system like SVN and a Windows Explorer integration like TortoiseSVN and a Visual Studio integration like VisualSVN.

Any other version control is fine as well (Git, TFS, Mercury, CVS, Bazaar), just choose one which fits your needs.

Those will not only help in case of crashes, they will also help if you changed your code, saved it intentionally and you find out the code just doesn't work.

Upvotes: 1

Related Questions