اطلاعیه

Collapse
No announcement yet.

اموزش شماره چهار مسايل پايه اي (جون داداش)4

Collapse
X
 
  • Filter
  • زمان
  • Show
Clear All
new posts

  • اموزش شماره چهار مسايل پايه اي (جون داداش)4

    سلام خدمت دوستان
    ما كه مترجم نيستيم ولي از اونجايي كه ...بماند
    بعضي ها رو ديدم ميرن دنبال اين ميرجم پارس ميگردن و يه حال و حولي ميبرن وخيال راحت... اما ماها كه هي دنبالش گشتيم چيزي نيافتيم حتي سي دي سوختش رو ... به فكر ما هم باشيد تنها تنها :confused:
    اما متن زير به مروري بر چند مطلب اساسي ميگزرد كه مخ ادمو يه جوراي باز ميكنه و براي كرك كردن اماده تر .....اين شما واين...
    Packed/ Compressed
    A packed target is simply one that has been compressed with a packer.
    خوب کارش فشرده کردن هست اما چه جوری ...
    PE Compressors pack the given executable, and then wrap unpacking code around this compressed data. When the program is executed, the unpacking code (or loader, as its more commonly referred to) unpacks the compressed data into memory. It then jumps to the OEP (original entry point) of the exe, in memory, and the program runs as normal.
    پس داده ها را داخل حفاظ میزاره و سپس بعد از اجرا به نفطه شروع برنامه میرود. که بدست اوردن این نقطه کار هر کسی نیست!!!!!!!
    The benefits of packing an exe are obviously that the size of it is usually significantly less.
    بیشتر .و قبلا برای کم کردن جحم برنامه استفاده میشد اما امروزه
    But more commonly, packers are used as a form of anti-cracking.
    در اصل کار ش ضد کرک کردنه
    Packed targets cannot be disassembled until they are unpacked. While tools exist for a whole range of popular packers, we are increasingly seeing more packers which must be unpacked by hand, or at least in a semiautomated way. For this, Procdump <http://procdump.tsx.org/> is a great tool. It allows you to wait until a target has unpacked itself into memory, and then procdump will allow you to dump the unpacked memory to disk. After this, you can repair any lost PE structure by hand, and end up with an unpacked target, which you can then disassemble.
    به راحتی دیس اسمبل نمیشه .و باید یا دستی یا با برنامه های معروف این کار را کرد
    Modern packers which concentrate on anticracking protection,
    جدیدا رو ی ضد دیباگ هم کار کردن
    often include antidebug measures, and encyrption, to attempt to prevent you
    tracing through the loader code.
    و اونو هم کد کردن تا به فایل اصلی دست پیدا نکنید و حتی ضد دیباگ هم روش گذاشتن

    Packers such as AsProtect <http://www.aspack.com/> encrypt the exe in such a way that the import tables are not immediately recoverable, even after dumping.
    یک پک معروف به نام اس پک فایل اجرایی را رمز دار میکند که حتی جدوال صادر شده بعد از دامپ قابل اجرا و باز یابی نیست

    Also includes measures such as copying windows API code into memory, to prevent debuggers such as Softice from breaking on key API breakpoints.

    وapi های دارد که جلوی debug را میگیرد.

    Although AsProtect is possibly the most advanced packer we have to face today, as always, there are still ways to defeat it ;-)
    شاید اس پک یکی از قوی ها در این رده باشه اما باز یه راه هایی برای اچبر کردنش هست جون تو!!!
    Loader
    لودر چه کا میکند
    A loader is the term given to any entity which is responsible for preparing and launching a process.
    یک اصطلاح هست برای اماده شدن برنامه برای بار گزاری توسط ویندوز
    When you launch any application in windows, the windows loader reads the disk image of the app,
    که لودر ویندوز
    ایمیج برنامه را از روی دیسک میخونه
    parses the structure of it,
    تقسیم به قسمت های کوچک میکند
    prepares it into memory,
    برای حافطه اماده اش میکند
    and then passes control to the processes entrypoint.
    و کنتر ل ها را به شروع کردن برنامه هدایت میکند

    In cracking terms, a loader is more commonly used to describe a program which performs a memory patch of an application
    در اصطلاح کرک یک لودر باعث میشه برنامه اجرا بشه و در اصل یک مموری پچ هست
    , in order to remove the protection.
    تا حفاظت را از بین ببرد
    This technique could be used for several reasons, perhaps the application cannot be registered elegantly via a serial/keyfile
    برای موارد زیر جواب میده شاید برنامه با سریال رجیستر نمیشه و از طرفی رمز دار و پک شد هست که نمیتوان پچ دیسکی براش ساخت,
    and is compressed or encrypted and a disk patch cannot be made. The loader launches the target, waits for a delay or predetermined condition to occur, and then applies a patch to the processes code.
    لودر وای میسته تا برنامه اجرا بشه و سپس پچ رادر کد ها ی ا جرا یی به کار میبرد
    Memory patchers / loaders are made simple thanks to the ReadProcessMemory <http://msdn.microsoft.com/library/psdk/winbase/debug_2mpl.htm> / WriteProcessmemory <http://msdn.microsoft.com/library/psdk/winbase/debug_35rt.htm> Windows API's.

    و به طور ساده از این ای پی آی ها استفاده میکنن.

  • #2
    سلام اين قسمت دوم فكر كنم بدرد مرور شما عزيزان ميخوره وبدرد مبتدي ها خلاصه ...
    Im looking at target in ollydbg(softice) that I want to patch on disk. How do I convert this address to a disk offset ?
    چگونه من فایل هایم را پچ کنم وقتی افست اونو ندارم وتنها ادرس اونو میبینم؟


    I'll demonstrate the process of converting between disk offsets and virtual addresses using Winzip 7.0, as it has properties in its sections which make it a good example for this task.
    برای مثال شما یک برنامه مث وین زیپ 7 یا هرچی دیگه را برای این کار استفاده میکینم

    Imagine you're in ollydbg(SoftIce), and you decide you want to perform a disk patch of the address youre looking at. Now, I have chosen a completely random address within WinZip. Lets say the instruction at..
    اینا راحته بخونی میفهمی !
    ما میریم وبرنامه را در یک دیباگر لود میکینم و به هر جایی میخواهیم میریم و مثلا میخواهیم این کد زیر را پچ کنیم..

    0045ADEB 5B pop ebx
    این ادرس مجازی ما توی دیباگر هست
    Ok, now we need a half decent PE editor, to view the section headers in our PE. I have chosen to use ProcDump, mainly through habit ;)

    Fire up ProcDump, and click on the PE Editor button. Then select winzip32.exe from the resulting file dialog.

    ProcDump now presents you with a brief summary of winzip's PE header. Make a note of the image base, (this is the location where the PE should be loaded, and is important in our calculations). In winzips case, the image base is unsurprisingly, 400000h.
    ایمیج افست برای ما مهم هست
    Now click on the sections button, we'll take a look at the section headers within the PE. This brings up a dialog showing the various properties of each section. We are interested in the .text section, since this is where our code is located.

    Amongst other things, ProcDump shows us the following information about the .text section..

    .text Virtual offset=1000h Raw Offset=400h
    قسمت تکست هم مهم هست که دارای 2 تا چیز هست 1 افست مجازی 2افست قسمت داده های خام
    Now we have all the information we need to convert our virtual address to the corresponding offset in the executable on disk.
    حالا ما همه چیز لازم برای تهیه افست فایل روی دیسک از روی ادرس مجازی اون داریم
    Taking our address of 45ADEBh, we first want to calculate how far into the code section this instruction lies. We can do this by subtracting both the imagebase and the virtual offset of the code section, from our virtual address.
    اول ادرسی که از دیباگر داشتیم را بررسی میکیم ببینیم این کجای کدسکشن هست
    So 45ADEBh - 400000h - 1000h = 59DEBh
    خوب ما ایمیج بیس برنامه و افست مجازی سکشن مونو را از ادرس مجازی برنامه تو دیباگر کم میکینیم
    So we now know that our instruction lies 59DEBh bytes into the code section. ProcDump tells us that the code section starts at byte 400h (raw offset) in the exe file, on disk. So by adding this value onto our previous result, we can calculate the disk offset of our instruction.
    حالا ما میدونیم چقدر داخل کد سکشن مون هستیم
    برنامه پروک دامپ به ما میگه کد سکشن ما در افست خام 400 مثلا شروع میشه در فایل اجرایی روی دیسک شروع میشه
    پس ما اینو به اون عددی که بدست اوردیم اضافه میکینم
    59DEBh + 400h = 5A1EBh

    So there we have it. Open winzip32.exe in any hexeditor, go to offset 5A1EBh, and there you will see the opcode of our instruction (5B).
    پس حالا میتونیم بریم تو ی هگزا ادیتور و اپکد بالا که توی دیباگر بوده ببینیم
    If you try this on your target, but the opcodes still dont match what you see in SoftICE, it tends to suggest the target is either packed or crypted. Your options are then to unpack, decrypt or to write an in memory process patcher (a loader <http://www.dreamimpression.com/palmdemon/faq.html>).
    اگر فایل پک (یا خراب) باشه نمیشه این کار را کرد و باید لودر نوشت یا اونو از حالت پک در اورد
    Carpathia.


    اقايون يه حرفي يه اس ام اسي يه پي امي خدارو خوش نمياد

    Comment


    • #3
      واااااااااااااااااااااااا ااااي
      اينا چيه ديگه!! :eek: :eek:


      نه بابا شوخي كردم دست درد نكنه اگه اين آموزشا رو در قالب pdf بدي و آپ كني كه ما سر حوصله مطالعه كنيم بهتره.

      ممنون از مطالبت.
      احب الاعمال الي الله أدومها وان قل


      پیامبر اکرم (ص):
      محبوبترين كارها در پيش خدا كاريست كه دوام آن بيشتر است ، اگر چه اندك باشد .


      سایت شهر سامن: http://csamen.ir
      گالری تصاویر : http://gallery.csamen.ir

      Comment


      • #4
        دستت درد نكنه professional jnop790 ,,, پنج ستاره واسه تو ....
        Last edited by Avenger; 09-25-2005, 09:01 PM.
        Bugs found = 2
        ... recompile <
        Bugs found = 65534
        :confused:

        Comment

        Working...
        X