如何编写C程序,将其自身复制到硬盘上,同时运行? [英] how to write C program that copy's it's self onto the hard drive, while its running?

查看:66
本文介绍了如何编写C程序,将其自身复制到硬盘上,同时运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是初学C程序员,这实际上是我的第一个编程

语言,除了html,cgi和javascript。我正在寻找一种方法来生成.exe文件,或者我自己文件的副本。我试过写一个

文件,编译它,并在记事本中读取它,然后编写一个程序

再次写它,但我没有运气。我向你保证,我不是在尝试创建下一个大病毒或蠕虫病毒,而只是试图扩展我对将要采用的编程语言的知识。 C是我的优点

的味道,虽然我可能会进入java如果这个没有用完。


有抱负的程序员

Jon

15

I am a beginner C programmer, this is actually my first programming
lanugage, besides html, cgi, and javascript. I am looking for a way to
make an .exe file, or a copy of my own file. I have tried writing a
file, compling it, and reading it in a notepad, then writing a program
to write it again, but i have had no luck. I assure you i''m not trying
to create the next big virus, or worm, but only trying to expaned my
knowledge on what programming language i will take. C is my perferred
taste, though i may go into java if this dosen''t work out.

aspiring programmer
Jon
15

推荐答案

jon写道:
jon wrote:

我是初学者C程序员,这实际上是我的第一个编程

语言,除了html,cgi和javascript。我正在寻找一种方法来生成.exe文件,或者我自己文件的副本。我试过写一个

文件,编译它,并在记事本中读取它,然后编写一个程序

再次写它,但我没有运气。我向你保证,我不是在尝试创建下一个大病毒或蠕虫病毒,而只是试图扩展我对将要采用的编程语言的知识。 C是我的优点

的味道,虽然我可能会进入java如果这个没有用完。


有抱负的程序员

Jon

15
I am a beginner C programmer, this is actually my first programming
lanugage, besides html, cgi, and javascript. I am looking for a way to
make an .exe file, or a copy of my own file. I have tried writing a
file, compling it, and reading it in a notepad, then writing a program
to write it again, but i have had no luck. I assure you i''m not trying
to create the next big virus, or worm, but only trying to expaned my
knowledge on what programming language i will take. C is my perferred
taste, though i may go into java if this dosen''t work out.

aspiring programmer
Jon
15



嗯,这是一个复制自己的程序???


如果是这样的话不是病毒......请告诉我你想要达到的目标。


你知道吗


复制myexe.exe my- NEW-exe.exe


将在命令行提示符下工作。


这很容易。但是不,你想要它在运行时复制

...为什么?


无论如何它都很难,因为当你的程序

正在运行,它被锁定并且fopen将失败...因为你已经看到了



试试Java。我相信你会找到一个简单的方法来复制正在运行的JAVA程序,这不是吗?


:-)


jacob

Mmmm a program that copies itself???

If that isn''t a virus... please tell me what you want to achieve.

You know that

copy myexe.exe my-NEW-exe.exe

will work at the command line prompt.

This is quite easy. But no, you want it to copy
it when it is running... Why?

In any case it will be difficult, since when your program
is running, it is locked and fopen will fail... as you
have seen.

Try Java. I am sure there you will find an
easy way to copy a running JAVA program isn''t it?

:-)

jacob




jacob navia写道:

jacob navia wrote:

jon写道:
jon wrote:

我是初学C程序员,这实际上是我的第一个编程

语言,除了html,cgi和javascript 。我正在寻找一种方法来生成.exe文件,或者我自己文件的副本。我试过写一个

文件,编译它,并在记事本中读取它,然后编写一个程序

再次写它,但我没有运气。我向你保证,我不是在尝试创建下一个大病毒或蠕虫病毒,而只是试图扩展我对将要采用的编程语言的知识。 C是我的优点

的味道,虽然我可能会进入java如果这个没有用完。


有抱负的程序员

Jon

15
I am a beginner C programmer, this is actually my first programming
lanugage, besides html, cgi, and javascript. I am looking for a way to
make an .exe file, or a copy of my own file. I have tried writing a
file, compling it, and reading it in a notepad, then writing a program
to write it again, but i have had no luck. I assure you i''m not trying
to create the next big virus, or worm, but only trying to expaned my
knowledge on what programming language i will take. C is my perferred
taste, though i may go into java if this dosen''t work out.

aspiring programmer
Jon
15



嗯,这是一个复制自己的程序???


如果是这样的话不是病毒......请告诉我你想要达到的目标。


你知道吗


复制myexe.exe my- NEW-exe.exe


将在命令行提示符下工作。


这很容易。但是不,你想要它在运行时复制

...为什么?


无论如何它都很难,因为当你的程序

正在运行,它被锁定并且fopen将失败...因为你已经看到了



试试Java。我相信你会找到一个简单的方法来复制正在运行的JAVA程序,这不是吗?


:-)


jacob


Mmmm a program that copies itself???

If that isn''t a virus... please tell me what you want to achieve.

You know that

copy myexe.exe my-NEW-exe.exe

will work at the command line prompt.

This is quite easy. But no, you want it to copy
it when it is running... Why?

In any case it will be difficult, since when your program
is running, it is locked and fopen will fail... as you
have seen.

Try Java. I am sure there you will find an
easy way to copy a running JAVA program isn''t it?

:-)

jacob



嗯,该程序写网页,当用户想要启动另一个

一个,新的将复制。


Well, The program writes webpages, and when user wants to start another
one, the new copy will be made.


Fork?

" jon" < jm ****** @ hotmail.comwrote in message

news:11 ********************** @ m73g2000cwd .googlegr oups.com ...
Fork?

"jon" <jm******@hotmail.comwrote in message
news:11**********************@m73g2000cwd.googlegr oups.com...

>

jacob navia写道:
>
jacob navia wrote:

> jon写道:
>jon wrote:

我是初学者C程序员,这实际上是我的第一个编程

lanugage,除了html ,cgi和javascript。我正在寻找一种方法来生成.exe文件,或者我自己文件的副本。我试过写一个

文件,编译它,并在记事本中读取它,然后编写一个程序

再次写它,但我没有运气。我向你保证,我不是在尝试创建下一个大病毒或蠕虫病毒,而只是试图扩展我对将要采用的编程语言的知识。 C是我的优点

的味道,虽然我可能会进入java如果这个没有用完。


有抱负的程序员

Jon

15
I am a beginner C programmer, this is actually my first programming
lanugage, besides html, cgi, and javascript. I am looking for a way to
make an .exe file, or a copy of my own file. I have tried writing a
file, compling it, and reading it in a notepad, then writing a program
to write it again, but i have had no luck. I assure you i''m not trying
to create the next big virus, or worm, but only trying to expaned my
knowledge on what programming language i will take. C is my perferred
taste, though i may go into java if this dosen''t work out.

aspiring programmer
Jon
15


Mmmm是一个自我复制的程序???

如果那不是病毒...请告诉我你想要达到的目标。

你知道

复制myexe.exe my-NEW-exe.exe

将在命令行提示符。

这很容易。但不,你希望它在运行时复制它......为什么?

无论如何它都很难,因为当你的程序运行时,它就会运行它已经锁定,fopen会失败......正如你所看到的那样。

尝试Java。我相信你会找到一个简单的方法来复制正在运行的JAVA程序不是吗?

:-)

jacob


Mmmm a program that copies itself???

If that isn''t a virus... please tell me what you want to achieve.

You know that

copy myexe.exe my-NEW-exe.exe

will work at the command line prompt.

This is quite easy. But no, you want it to copy
it when it is running... Why?

In any case it will be difficult, since when your program
is running, it is locked and fopen will fail... as you
have seen.

Try Java. I am sure there you will find an
easy way to copy a running JAVA program isn''t it?

:-)

jacob




好​​吧,该程序会编写网页,当用户想要启动另一个

时,将会制作新的副本。



Well, The program writes webpages, and when user wants to start another
one, the new copy will be made.



这篇关于如何编写C程序,将其自身复制到硬盘上,同时运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆