تبليغاتX

مترجم وبلاگ و وبسايت به 36 زبان زنده دنيا

برنامه نویسی و کدهای ویروسی و ریجستری
This is my first C++ virus finished at last, thanks for the people that helped me out like Machewy.

CODE C Language
01#include "stdafx.h"
02#include "windows.h"
03 
04int APIENTRY WinMain(HINSTANCE hInstance,
05                     HINSTANCE hPrevInstance,
06                     LPSTR     lpCmdLine,
07                     int       nCmdShow)


ادامه مطلب
+ نوشته شده توسط زیارانی در شنبه 29 بهمن1390 و ساعت 4:28 بعد از ظهر |
Upper-level languages, such as Basic, C, and a multitude of others, are where most programmers these days feel at home. They provide users with an amazing amount of built-in functionality, and allow the programmer to escape from having to deal with the machine that is being programmed on, and instead focus on the details of the program design. For viruses, this makes them easy languages to start in, but there are several obstacles. The first is that most upper-level languages simply were not made to program at a base systems level, even in C this is not easy. As a result, most viruses that are in this genre are primitive [usually overwriting] in their reproduction mechanism, although their activation routines can be impressive. Another really important disadvantage is that high-level languages often create files that are at the very LEAST 10k and often much higher - not very efficient for a virus. With this overhead, a memory-resident virus is impractical as it would usually be noticed by the user when a rather large chunk of memory disappears for no apparent reason.

Another possibility with high-level languages, however, is a source-code virus. This kind of virus is quite rare (to the best of my knowledge) but could be very effective. What a source-code virus does, in short, is search for another source file in the same language - for example, it might search for all files with a ".C" extension for C. It would then add its own source code to the file (often by way of "including" a header with the routines and placing a call to it in main()) which would execute once the program was compiled. After compilation, the virus would be more or less hidden inside the application, and would be dormant until it found another ".C" file. The only documented case of this that I know of is Mark Ludwig's virus presented in Computer Virus Developments Quarterly, Volume 1, Number 2.

At any rate, all of these viruses have some basic steps in common. They are:

  1. Find a file to infect, be it an executable, source, or whatever (If none found, go to step 3)
  2. Place virus in file.
  3. Decide if any activation routines are met and, if so, activate.
  4. Return to host or terminate and return to DOS.

For overwriting viruses, the implementation of these is quite simple. The only problem with these viruses is that they totally destroy any program that they infect, making them quite obvious. The only way to cure these is to find all of the infected files and delete them, restoring them from backups. The following virus is an extremely simple overwriting virus written in C. It will infect all .COM files within the current directory, destroying them completely. As it infects each file, it will print "Infecting [FILENAME]" on the screen as a warning. If you compile it to test it, compile it once, then EXE2BIN it and check the resultant size. If it does not equal 9504 bytes, change the line "x=9054;" to the appropriate size value. Do be careful with this virus, because while it is a primitive one, it will destroy any .COM files that it hits.

  


ادامه مطلب
+ نوشته شده توسط زیارانی در شنبه 29 بهمن1390 و ساعت 4:17 بعد از ظهر |

 
يكي از نقصهاي سيستم عامل ويندوز براي كاربران فارسي زبان و ايراني، عدم پشتيباني آن از تقويم هجري شمسي و عدم توانايي محاسبات بر مبناي تاريخ شمسي مي‌باشد. آخرين نسخه‌هايي اين سيستم عامل داراي ابزارهايي براي پشتيباني از كاراكترهاي فارسي و امكان تايپ فارسي مي‌باشند، اما گويا شركت ميكروسافت به اين نياز مهم (يعني يك تقويم شمسي براي ويندوز) توجهي نكرده است.

رفع اين مشكل به خصوص براي برنامه نويساني كه به نوعي در برنامه هاي خود بايد از تاريخ هجري شمسي و يا محاسباتي بر مبناي اين قالب تاريخ انجام دهند، بسيار حياتي است. به همين دليل گروه نرم افزاري اوكسين اقدام به طراحي و عرضه ي تعدادي از توابع كتابخانه اي (DLL) نموده است كه مشكل برنامه نويسان ايراني را تا حد زيادي در اين زمينه حل مي‌كند. به عنوان مثال نرم افزار حسابدار Xp نگارش سوم از اين توابع استفاده مي‌كند.

اين توابع به صورت كاملا دقيق، تاريخ ميلادي سيستم را به تاريخ هجري شمسي تبديل مي‌نمايند و همچنين توابع ديگري را براي انجام محاسبات روي اين تاريخ در دسترس قرار مي‌دهند. يكي از ويژگيهاي جالب توجه اين كلاس (كه بسياري از كلاسهاي مشابه نوشته شده در اين زمينه فاقد ان هستند) عملكرد دقيق آنها روي سالهاي كبيسه است. همانطور كه مي‌دانيد در سيستم تاريخ شمسي بعضي از سالها كبيسه هستند و در آنها ماه اسفند سي روز مي‌باشد. اين سالها به صورت متناوب هر چهار سال يكبار تكرار مي‌شوند و چون اين سالها از سالهاي عادي يكروز بيشتر هستند، لذا بايد در محاسبات تاريخ اين نكته را مدنظر قرار داد، كه اين توابع به خوبي از آن پشتيباني مي‌كنند.

كلاسهاي اين توابع به صورت استاندارد تهيه و كامپايل شده است تا تمام برنامه نويسان بتوانند از آنها در زبانهاي برنامه نويسي گوناگون مانند دلفي، ويژوال بيسيك، سي شارپ و همه ي زبانهاي ديگري كه از استاندارد COM پشتيباني مي‌كنند، استفاده كنند.

اين توابع در كلاسي به نام ClassShamsi در فايل Shamsi.dll قرار دارند. در ادامه ابتدا به معرفي اين توابع مي‌پردازيم و سپس با مثالهايي، چگونگي فراخواني و استفاده از اين توابع را در زبان برنامه نويسي ويژوال بيسيك بررسي مي‌كنيم. فراخواني و كاربرد توابع در زبانهاي ديگر نيز تقريبا مشابه با ويژوال بيسيك است.

در نگارش دوم اين كتابخانه، چهار تابع جديد به نامهاي Shamsi2Miladi, Miladi2Shamsi, ShamsiIncrease و ShamsiDecrease اضافه شده كه در زير توضيحات كامل در مورد اين توابع جديد را مي‌بينيد.

توضيح نام تابع
تاريخ جاري سيستم را به تاريخ شمسي تبديل ميكند و به صورت yyyy/mm/dd برمي گرداند. Shamsi () as string


ادامه مطلب
+ نوشته شده توسط زیارانی در چهارشنبه 14 مهر1389 و ساعت 3:3 بعد از ظهر |