|
-
Dec 28th, 2001, 07:35 AM
#1
Thread Starter
Addicted Member
a 'small' problem with source code
A friend has asked me if it's possible to write a (.exe, compiled) program that has the ability to display its own source code (without putting it into a seperate file or into a variable that contains everything).
I thought about it but i think if i would try it i'd still be storing everything into a variable or something...
So is there a way to solve this ?
The main VB routine in Windows XP (The don't admit it, they wrote it in VB)
[vbcode]
Public Sub Windows_Load()
a = 1
b = 2
if not a + b = 2 then
goto crash
end if
goto crash
End Sub
[/vbcode]
-
Dec 28th, 2001, 07:40 AM
#2
Hyperactive Member
As you say the only way is to output every line to a file, basically duplicating your program size.
The programs once compiled have no idea what source code created them, and does not contain the source code in any way, as the compiler rewrites them in assembler
-
Dec 28th, 2001, 07:46 AM
#3
Lively Member
Well...
This is possible only in scripting languages (the love letter virus does it) such as vbscript, javascript, etc.
In compiled programs it is not possible, I think.
Saran.
-
Dec 28th, 2001, 07:57 AM
#4
Thread Starter
Addicted Member
So then i need to make a vbscript file that displays it's source code because vbscript cannot be compiled ?
But that is not what i was asked ...
So do u think it's not possible ?
The main VB routine in Windows XP (The don't admit it, they wrote it in VB)
[vbcode]
Public Sub Windows_Load()
a = 1
b = 2
if not a + b = 2 then
goto crash
end if
goto crash
End Sub
[/vbcode]
-
Dec 28th, 2001, 08:11 AM
#5
Not possible
I'm sorry to disappoint you, but what you are asking cannot be done!! (well - correct me if i'm wrong anyone)
Compiled source code is ...well.... compiled and cannot be decompiled just like that.
Some programs may partially translate the compiled code to VB code, but if this even can be done without loosing data and valuable routine data (which I doubt) it will never ever be the same as the source code you wrote yourself! All the goofy variable names and the set-up with loops etc. will be completely different and not recognisable by any means. It is also very doubtful that the functions etc. will be separated like before, if seperated at all.
If you find out something please let me know, but I really(!!!!) doubt it!!
-
Dec 28th, 2001, 08:17 AM
#6
Thread Starter
Addicted Member
Ok...
anyways... thanks for this information...
Let's ask microsoft this :-)
I would bet they don't know how to do it eighter ;-)
The main VB routine in Windows XP (The don't admit it, they wrote it in VB)
[vbcode]
Public Sub Windows_Load()
a = 1
b = 2
if not a + b = 2 then
goto crash
end if
goto crash
End Sub
[/vbcode]
-
Dec 28th, 2001, 10:23 AM
#7
no need to ask MS. It is not possible.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|