![]() |
|
[C#] Run any extention file like an exe - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [C#] Run any extention file like an exe (/showthread.php?tid=5721937) |
Run any extention file like an exe - knowers - Sep 21, 2017 Hello, It is possible (on Visual studio) to say "Run this app (test.klo) like an .exe" test.klo is an exe but he has just a different extension and I wanna say to Visual if it's possible to run "test.klo" like an executable and keeping the same extension. * - I ɴ ᴄ ʀ ᴇ ᴅ ɪ ʙ ʟ E - Sep 21, 2017 (Sep 21, 2017 04:07 AM)knowers Wrote: Hello, I'm sure only the wide-known extension such as .scr, .msi, and .exe are the only ones you can use to launch/run programmes under windows environment. but well, that's just my understanding. good luck getting replies from experts. * - knowers - Sep 21, 2017 No, I give you an example: String executable = "C:\users\test\desktop\test.txt" // the test.txt actually a .exe, I just modify the extension to ".txt" Process.start(executable + ".exe") Something like that, For run the test.txt like an exe keeping the same extension (.txt) * - Gt403cyl - Sep 21, 2017 Basically only executable file types can be, well executed. .scr .msi .exe .bat .com .bin There are a few others but these are the most common. * - knowers - Sep 21, 2017 (Sep 21, 2017 04:21 AM)Gt403cyl Wrote: Basically only executable file types can be, well executed. I know, the "test.txt" is already an .exe, but i just modify extension, I just wanna say at my source code to run "test.exe" keeping the same extension "test.txt" * - Gt403cyl - Sep 21, 2017 (Sep 21, 2017 04:37 AM)knowers Wrote: I know, the "test.txt" is already an .exe, but i just modify extension, I just wanna say at my source code to run "test.exe" keeping the same extension "test.txt" You really can't, best I can say is you can spoof it but it would look like "texe.txt". * - I ɴ ᴄ ʀ ᴇ ᴅ ɪ ʙ ʟ E - Sep 21, 2017 (Sep 21, 2017 05:08 AM)Gt403cyl Wrote: You really can't, best I can say is you can spoof it but it would look like "texe.txt". That's exactly I was implying. :) * - Dianab0lical. - Sep 21, 2017 - Might be worth it to look into the Windows shell setting for "Hide extensions for known file types": ![]() - Programmatically turn this setting on, then a file named Test.txt.exe would appear in the explorer shell as Test.txt, and just utilize a txt file icon as the icon for your app ![]() This is a horrendous and hideous method to accomplish your ends, and I'm sure there's a better method, but that's just what I came up with on the spot with zero Googling. * - n0$f3ratu$ - Sep 21, 2017 (Sep 21, 2017 04:07 AM)knowers Wrote: Hello, [-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.your extension] More info here: https://www.youtube.com/watch?v=V3gbpCFCs04 Read the comments. * - Vuln - Sep 21, 2017 If you don't mind a cmd dependency then this should work too. Code using (Process p = new Process())* - 0xDEAD10CC - Sep 21, 2017 Anyone who says it isn't possible is clueless. File extensions are just registered to have default programs associated with them in the registry, aside from that, binary data doesn't change... You can load the PE in memory if you had to also. * - Zens - Sep 22, 2017 I believe you can do it, in theory the inside is still an exe not a txt or something... But you can spoof the extension too ;) |