0

OK so I tried to convert bat to exe using many programs but at the end all of them just put the bat files in temp folder so I wonder if there is another way to protect the code

I thought is there a way to delete that bat from the temp folder after executing the exe file ?

I even thought is there a way to make the exe to put the temp bat in memory ? I heard that its possible but I don't how to do this

any Idea

I want this because I gave a sample exe(that di half the work) file to a client to test it and then pay for a program that I put a lot of hours on it , but after 2 days he answerd me that he isn't interested so I think that he did get he source code

Leo92
  • 724
  • 4
  • 16
  • 29
  • 2
    Source is source, executable is executable. I doubt that he reversed engineered your file. Maybe he wasn't interested after all... – Eitan T Jun 26 '12 at 12:21
  • he didn't reversed anything , it so simple when he excute the file.exe he went to %temp% and get the bat file its so simple – Leo92 Jun 26 '12 at 13:01
  • You should rewrite it in C++ or C#, if you post your batch file code we can help you write it in a much more secure executable. – Bali C Jun 26 '12 at 13:50
  • thaks, so I can deduce that there is no way to protect a batch source , anyway lucky me I did study C language 4 years ago in university , so maybe i should go and recall it – Leo92 Jun 26 '12 at 13:55
  • Not anyway I know of, it's just plain text after all that doesn't need compiling so it would be difficult if it's even possible. C would be a good choice, good luck! :) – Bali C Jun 26 '12 at 14:03

2 Answers2

1

After a bit of searching I found this which is a batch script that uses 7-Zip to compile the batch into an exe. It will still dump it out into %temp% but it does say that it removes all the temporary files once it has finished, which you said you would like.

You other option would be to re-write the code in a proper programming language like C or C++. Although it might not be impossible to decompile the code I don't think anyone would bother trying!

Bali C
  • 30,582
  • 35
  • 123
  • 152
  • yeah but if you close the window clicking the x, it wont delete the temp file ,beside if you keep the program on , you can just take the bat file from temp, I already taking a look , infact i noticed that it will be suffiecnt to put for example system("@echo off"); so i may be i can put all comands between system – Leo92 Jun 26 '12 at 14:33
  • I haven't tested it but I will take your word for it. Yeah, from what I remember you can do `system(command)` in C++ so I guess it will be the same in C. It didn't always work well though as you could only use single commands, you couldn't, for example set vars and use them elsewhere, but that entirely depends on what you want to do. – Bali C Jun 26 '12 at 15:07
  • yeah there are problems with variables and with special characters , but I am afraid that I have to do this if I want to protect soucre code – Leo92 Jun 26 '12 at 15:14
  • Yeah your right, but tbh I can't think of a better way unless you re-write it in that language. – Bali C Jun 26 '12 at 15:17
1

You can also make it delete itself after it is done.

See this answer to How to make .BAT file delete it self after completion?

Community
  • 1
  • 1