SeeWhyAnEyeSee

Ocra to exe! v2

Nov 20th, 2014
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.68 KB | None | 0 0
  1. #Actual relevance github.com/cyniclimbu/rootShell/issues/1
  2.  
  3. exit if defined?(Ocra)
  4.  
  5. self_name = File.basename $0,".rb" #STRIP OUT EXTENSION OF FILENAME
  6.                    #LOCATED ON TEMP DIR
  7. puts exe_file = self_name + ".exe"
  8. puts rb_file = self_name + ".rb"   
  9.  
  10. if File.exists?(rb_file) and File.exists?(exe_file)
  11. puts "A file with the same name has been detected, please move the file to somewhere else."
  12.  
  13. elsif File.exists?(rb_file)
  14. puts "File is rb"
  15.  
  16. elsif File.exists?(exe_file)
  17. puts "File is exe"
  18. else
  19. puts "I'M ERROR, RAWR!"
  20. end
  21.  
  22.  
  23. =begin
  24. The title may be misleading so let me explain right quick.
  25. The code you see above checks if the self-running script is .rb or .exe
  26. =end
Advertisement
Add Comment
Please, Sign In to add comment