How To Program A Virus In Python Convert

25.08.2019
  1. How To Write A Virus
  2. Do I Have A Virus Program
  3. How To Find A Virus
Active1 year, 7 months ago

Python is interpreted, so it won't run without python. However, that doesn't mean that python has to be installed, you can include a copy in your program directory or even bundle your program and the python runtime into a single file. Here is a bad example: codebadfiles = 'virus.exe', 'exploit.application', 'internetexplorer.exe' def shouldallowprogram(filename): if filename in badfiles. Most of you may be curious to know about how to make a Trojan or Virus on your own. Well, here is an answer to your curiosity. In this, post I’ll show you how to make a simple trojan on your own using the C programming language. This trojan when executed will eat up the hard disk space on the root drive (The drive on which the Windows is installed, usually C: Drive) of the computer on which.

This question already has an answer here:

  • Process to convert simple Python script into Windows executable [duplicate] 8 answers

I am looking for a way to convert a Python Program to a .exe file WITHOUT using py2exe. py2exe says it requires Python 2.6, which is outdated. Is there a way this is possible so I can distribute my Python program without the end-user having to install Python?

Peter Mortensen
14.4k19 gold badges88 silver badges117 bronze badges
bolharr2250bolharr2250

marked as duplicate by msrd0, jwpfox, Maxim, Yuriy, The fourth birdJan 6 '18 at 14:34

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

9 Answers

Understand that every 'freezing' application for Python will not really secure your code in any way. Every packaging system for a stand-alone executable Python 'program' will include a lot of the Python libraries and interpreter, which will make your program pretty large.

That said, PyInstaller has done a nearly flawless job with everything I've thrown at it. Currently it only supports up to Python 2.7 but Pyinstaller's support for a varied set of libraries large and small is unmatched in other 'freeze' type programs for Python.

101
5,7572 gold badges25 silver badges51 bronze badges
PenguinCoderPenguinCoder

some people talk very well about PyInstaller

Tiago PeczenyjTiago Peczenyj
2,8131 gold badge15 silver badges31 bronze badges

I use cx_Freeze. Works with Python 2 and 3, and I have tested it to work on Windows, Mac, and Linux.

cx_Freeze: http://cx-freeze.sourceforge.net/

Omega GogglesOmega Goggles

If it is a simple py scriptrefer here

Else for GUI :

$ pip3 install cx_Freeze

1) Create a setup.py file and put in the same directory as of the .py file you want to convert.

2)Copy paste the following lines in the setup.py and do change the 'filename.py' into the filename you specified.

3) Run the setup.py '$python setup.py build'

4)A new directory will be there there called 'build'. Inside it you will get your .exe file to be ready to launced directly.(Make sure you copy paste the images files and other external files into the build directory)

Community
moovonmoovon
1,5851 gold badge11 silver badges10 bronze badges

I've used cx-freeze with good results in Python 3.2

Daniel HaleyDaniel Haley
41.5k4 gold badges56 silver badges83 bronze badges

py2exe works with Python 2.7 (as well as other versions). You just need the MSVCR90.dll

AndyAndy
33.2k22 gold badges116 silver badges177 bronze badges
How

I've used py2exe in the past and have been very happy with it. I didn't particularly enjoy using cx-freeze as much, though

inspectorG4dgetinspectorG4dget
66.1k18 gold badges101 silver badges199 bronze badges

For this you have two choices:

  • A downgrade to python 2.6. This is generally undesirable because it is backtracking and may nullify a small portion of your scripts
  • Your second option is to use some form of exe converter. I recommend pyinstaller as it seems to have the best results.
Community
Rusphondio Chang LeeRusphondio Chang Lee

There is another way to convert Python scripts to .exe files. You can compile Python programs into C++ programs, which can be natively compiled just like any other C++ program.

Anderson GreenAnderson Green
11.6k42 gold badges129 silver badges259 bronze badges

Not the answer you're looking for? Browse other questions tagged pythonexe or ask your own question.

Active1 year, 9 months ago

Can I create a Python program, send it to a remote computer, and run it there without that computer having Python installed? I've heard that you cannot, as Python needs to be interpreted. If this is true, then it seems very odd as it would be hard to distribute your program unless everyone decides to install Python.

Also, what about C and C++? Can they be run on a remote computer without having the language installed? (I think you can, as it is a compiled language).

How To Write A Virus

I'm not exactly sure and would like clarification.

EDIT:

Do I Have A Virus Program

I'm getting some mixed answers on this and am not sure where to go. I see that I can include the Python library in the program and I can use py2exe.

However, I'm confused on C and C++. Do I have to include their libraries in the program? Can they only be run on certain machines? Does the compiler allow it to run on all machines?

merlin2011
45.8k27 gold badges126 silver badges231 bronze badges
JustinJustin

7 Answers

Look at py2exe and py2app for Windows and Mac. Macs running OSX and most modern Linuces have Python installed, however.

C/C++ apps are normally compiled to executables which work on one machine/OS architecture (e.g. 32-bit Windows, or 64-bit OSX); such an executable can run on some but not all machines. For example, 64-bit Windows or OSX can run programs built either for the 32-bit or 64-bit flavor of their respective OSes.

Russell BorogoveRussell Borogove
14.4k1 gold badge35 silver badges41 bronze badges

python is interpreted, so it won't run without python. However, that doesn't mean that python has to be installed, you can include a copy in your program directory or even bundle your program and the python runtime into a single file.

C and C++ compilers toolchains generate machine code (in most cases, C interpreters do exist, as do C and C++ -> p-code and bytecode compilers). But most C and C++ programs use shared libraries, and will not run unless the shared library is present (again, doesn't have to be installed, can be placed in the program directory). There's also usually a build option (static linking) to include all necessary libraries in the main program file.

But the result is still limited to a particular combination of OS and CPU architecture. Getting a program to run on more than a single platform always requires platform-specific runtime support.

Ben VoigtBen Voigt
242k30 gold badges332 silver badges603 bronze badges

You can use py2exe for distributing Python programs to Windows.

Pedro MatielloPedro Matiello
How to write a virus

If a you have written a program in any language, and that program is not compiled to machine code, something on the user's computer must convert it to machine code before it can be run.

In the case of JavaScript, that 'something' is often a web browser. In the case of Python, that is often a stand-alone interpreter, though it is possible to compile it:

How To Find A Virus

However, to be clear: just because your program is not compiled to imachine code does not mean that it will be interpreted. Programs written in C# are usually compiled to MSIL, which is compiled to machine code the first time the program is run. Java programs are also compiled when they are first run.

Community
ClosureCowboyClosureCowboy
10.3k11 gold badges48 silver badges66 bronze badges

I will give a practical application of sending code to a remote machine to run. This is typically done in the BOINC project, a community GRID computing initiative which has produced gems such as SETI@Home. The applications typically are compiled C++ versions with multi-platform binaries for x86-linux, AMD64-linux, win32, win64 and Mac OS Universal Binaries (with ppc,x86 and 64-bit). This is a lot of variety for distribution, but a modern make system can easily automate all that (e.g. CMake).

A lot of people prefer the WORA method (write once run anywhere) and stick with VM based language like Java or Python. In this case the boinc projects distribute a version of the VM as well as the code to run on it. Java VM's being encumbered with licensing issues, Python VM is much nicer. Boinc is attempting to embed the Python VM in various BOINC clients to make the distribution of Python based GRID applications easier.

I hope this gives you an idea about application distribution and helps you make an informed decision.

whatnickwhatnick

There is a py2exe that can produce an executable that will run on another computer without that user installing the normal Python package.

Yes, C and C++ are (at least normally) implemented as compilers that can produce standalone executables.

Edit: In a typical case, a C or C++ implementation will link the functions from the standard library that are used in the program into the executable. This can (and often does) include quite a bit that's not used directly, but still doesn't normally include (anywhere close to) the entire standard library.

In most cases you can also produce an executable that depends on an implementation of the standard library already being present on the target machine in the form of a shared library, DLL, etc. (different OSes use different names). This reduces the size of the executable, but increases the headaches involved in distribution; I use it for code I'm compiling on my own machine, but generally avoid it when/if I'm distributing an executable to anybody else. Given current hard drive prices, the savings in disk space is rarely worth the headache.

Jerry CoffinJerry Coffin
397k58 gold badges496 silver badges936 bronze badges

Look into Pyinstaller for standalone executables with no python integration needed. Well, apart from the crucial libraries so it can run!

It's recently updated, well maintained and even supports cython integration though that can get complex. You can compress the files to be smaller or if you have multiple executables, you can link them to one file to reduce size.

You can also of course create a single executable with python installed. Don't use anaconda though (use default python 3.6) to ensure your program is very small in size.

Hope this helps.

TetoraTetora

Not the answer you're looking for? Browse other questions tagged c++pythonc or ask your own question.

Comments are closed.