# [SOLVED] How can i view the code for any program¿?



## rhinonsense

*[SOLVED] How can i view the code for any program¿?*

How can i view the code for any program¿? How can i learn how to make an operating system¿? What script for logins ¿? What is script for A loading bar¿?


----------



## Mister2

*Re: How can i view the code for any program¿?*

Is this related to your question in this thread?

To view the code for a program simply open a Command Prompt window and use the command *type {program name}*. That won't tell you very much as the code is compiled from a 'human understandable' format into a 'machine readable' format'. Even if you could de-compile it to read it, this reverse engineering (as it is called) is usually forbidden in the software license agreement.

If you want to make an operating system you need to:
1. Understand how all common computer architecture and hardware works at low level
2. Understand how to program, allowing for any foreseeable combination of hardware, software and user input
3. Understand exactly what people want or need from an operating system
4. You will then end up with an OS that only you want to use - everyone else will be using Windows, Linux, OS X, Google Chrome ...

In short, if you need to ask basic questions like how to view code then it just ain't gonna happen :sigh:


----------



## rhinonsense

*Re: How can i view the code for any program¿?*

what does program name mean? says the system cannot find the file specified. how do i chane the word behind the > because the say c:\documents and settings\user>.


----------



## rhinonsense

*Re: How can i view the code for any program¿?*

how can i learn machine code


----------



## Mister2

*Re: How can i view the code for any program¿?*

*cd..* takes you up one directory.
*cd\* takes you straight to the root of the drive.

Else type the full path, eg *type c:\windows\system32\notepad.exe*

Before programming in machine code you would be better off learning a more friendly language such as Visual Basic, C+ and so on. You still need to understand the workings of loops, conditional statements and so on whatever language you use. Google something like 'visual basic 101' for ideas.


----------



## Squashman

*Re: How can i view the code for any program¿?*



rhinonsense said:


> how can i learn machine code


Are you serious! Nobody does that anymore. I don't even know anyone who programs in Assembler anymore.
You may just want to take a look at taking a programming class at a nearby community college. At this point you need some knowledge base to work from.


----------



## rhinonsense

*Re: How can i view the code for any program¿?*



Mister2 said:


> *cd..* takes you up one directory.
> *cd\* takes you straight to the root of the drive.
> 
> Else type the full path, eg *type c:\windows\system32\notepad.exe*
> 
> Before programming in machine code you would be better off learning a more friendly language such as Visual Basic, C+ and so on. You still need to understand the workings of loops, conditional statements and so on whatever language you use. Google something like 'visual basic 101' for ideas.


Thanks i add quotes and the .exe and it worked:tongue:


----------



## Mister2

*Re: How can i view the code for any program¿?*

Glad it worked, but it won't tell you much.

You really ought to consider Squashman's advice and get some basic programming practice with someone who can guide you along the way.


----------



## jamiemac2005

*Re: How can i view the code for any program¿?*



Squashman said:


> Are you serious! Nobody does that anymore. I don't even know anyone who programs in Assembler anymore.
> You may just want to take a look at taking a programming class at a nearby community college. At this point you need some knowledge base to work from.


Haha. I still program in assembler, as do some of my classmates, most of them prefer the slightly lower-level (than C)... It's really useful for embedded systems and low-runtime/time crutial programming. Though it is an effort and it is definately worth learning other languages first (i'd say C/C++ at the least, then you can embed asm quite easily).


----------



## shuuhen

*Re: How can i view the code for any program¿?*



Squashman said:


> Are you serious! Nobody does that anymore. I don't even know anyone who programs in Assembler anymore.
> You may just want to take a look at taking a programming class at a nearby community college. At this point you need some knowledge base to work from.


Computer Engineers learn assembly. It can be helpful for microprocessor courses and projects. Assembly would also be used in computer organization. It can be helpful for understaning what the compiler is doing. There could also be cases where libraries need to be written in (at least partially) assembly for a microprocessor.

Overall I'd recommend still using C, C++ and some other languages for most new code. It takes a very large amount of knowledge to really write more efficient assembly than a compiler would output. Also, C and C++ code would be fairly portable while the assembly would not.


@rhinonsense: I agree with Squashman that right now you need to get a knowledge base. A good book or course (or good course with a good book) would be the best place to start. Operating systems are very big projects with many components. Most will be written in C, but could have some programs/libraries written in C++ and components written in assembly or other languages. People on Unix-like systems can use sloccount to get an idea of how big the Linux, FreeBSD or other kernel is in source lines of code. There are also numerous other programs involved with operating systems, but that would give you an idea of how much work went into currently established operating systems.

For stuff like loading bars, it depends on what libraries you are using. The code for Qt would be different from GTK+, SDL or directly writing in OS-specific API's. Same with logins, but they will also depend on what you are logging into. Don't worry about these things until you have a knowledge base. If you really just wonder how they're implemented, look into open-source programs that do what you want.


----------



## rhinonsense

*Re: [SOLVED] How can i view the code for any program¿?*

How can i learn how to read the code ?


----------



## Engineer Babar

*Re: How can i view the code for any program¿?*



rhinonsense said:


> how can i learn machine code


:4-dontkno:4-dontkno

Impossible... If I am not wrong machine language is of 0 and 1.. Impossible to learn..


----------



## jamiemac2005

*Re: [SOLVED] How can i view the code for any program¿?*

You're not wrong that it's usually represented as hexidecimal... But it is possible. Though most people learn assembly language instead. You'd have to give us a good reason to want to learn machine code because quite frankly what you're asking us is seen as an intro to program plagurism and we won't help you with that. Also it seems like you're going about this in a reverse engineering sort of way. So you'll have to give us a decent reason for why you actually want to learn it, since a programmer would generally start with a higher-level language (e.g. C++, Java, VB)

Cheers,
Jamey


----------



## rhinonsense

*Re: [SOLVED] How can i view the code for any program¿?*



jamiemac2005 said:


> You're not wrong that it's usually represented as hexidecimal... But it is possible. Though most people learn assembly language instead. You'd have to give us a good reason to want to learn machine code because quite frankly what you're asking us is seen as an intro to program plagurism and we won't help you with that. Also it seems like you're going about this in a reverse engineering sort of way. So you'll have to give us a decent reason for why you actually want to learn it, since a programmer would generally start with a higher-level language (e.g. C++, Java, VB)
> 
> Cheers,
> Jamey


Whats assemlber? is this different from machine code? Can i use them for making robots and such?
I've always heard people say they looked at the code of the program and i was wondering how i could do this? Also i want to make my own programs/operating systyem .


----------



## Mister2

*Re: [SOLVED] How can i view the code for any program¿?*

Assembler
Machine Code
Programming Robots
View Code

How about coding something like this for your first project?


----------



## rhinonsense

*Re: [SOLVED] How can i view the code for any program¿?*

okay how though


----------



## Mister2

*Re: [SOLVED] How can i view the code for any program¿?*

IIRC you were advised in one of your many other threads to enrol on a basic programming course at a local college. I suggest you follow that advice - when you have a grasp of the basics you will be able to ask meaningful questions.


----------



## jamiemac2005

*Re: [SOLVED] How can i view the code for any program¿?*



rhinonsense said:


> okay how though


Start by learning to program in a higher level language, for example C++ (You can do that here: http://www.cprogramming.com/begin.html ).
Then if you are still interested in assembly the process of starting up is harder but familiarising yourself with this forum: http://www.winasm.net/forum/index.php (particularly their downloads section and the WinASM tutorials section) will get you going quite well. Do not attempt to learn Assembly without knowing at least C++ beforehand, it's not impossible it will just take you twice as long as learning both languages, and it will leave you with skiddy-like knowledge of the code.

Other than that there's no way for us to go "read this then do this" because you simply can't understand assembly without a whole lot of time, effort and experience.

Cheers,
Jamey


----------

