Thread: (Question);

Results 1 to 9 of 9
  1. #1
    Death-Dev's Avatar
    Join Date
    Dec 2011
    Gender
    male
    Posts
    50
    Reputation
    10
    Thanks
    0

    (Question);

    what is Virtual protect and what is it used for ??
    REGARDS.

  2. #2
    darlwis's Avatar
    Join Date
    Feb 2012
    Gender
    male
    Posts
    228
    Reputation
    33
    Thanks
    53
    My Mood
    Inspired
    What i know it is for:
    1- It is For Convert Asm to C++ without WINAPI.
    2- Its Used for most time,to protect a Pointer or Multiple Pointers with Bytes.
    Example:
    Nopping Way.

  3. #3
    UltraPGNoob's Avatar
    Join Date
    May 2010
    Gender
    male
    Posts
    671
    Reputation
    15
    Thanks
    611
    My Mood
    Fine
    it changes permissions to read or write or execute

    more about it here : VirtualProtect function
    My Threads:

    - CrossFire Mods:
    Wooden Knife

    - CrossFire Tutorials:
    How to make a logger
    Total number of guns in weaponmgr

    - CrossFire NA Addies:
    Video Settings (not useful but just wanted to share) OUTDATED

    - CrossFire NA Hacks:
    UltraPGNoob Public Hack v1 DETECTED (02-24-2011)
    UltraPGNoob Public Hack v2 DETECTED (06-22-2011)
    UltraPGNoob Public Hack v3 DETECTED (07-04-2011)

    - CrossFire EU Hacks:
    UltraPGNoob Public Hack - Special Edition (Knife Weapon Hack) DETECTED (02-26-2012)

  4. #4
    Zacherl's Avatar
    Join Date
    May 2009
    Gender
    male
    Posts
    150
    Reputation
    10
    Thanks
    42
    My Mood
    Aggressive
    Quote Originally Posted by darlwis View Post
    It is For Convert Asm to C++ without WINAPI.
    OMFG hahaha made my day

  5. The Following 2 Users Say Thank You to Zacherl For This Useful Post:

    giniyat101 (04-23-2012),~FALLEN~ (04-21-2012)

  6. #5
    ~FALLEN~'s Avatar
    Join Date
    May 2009
    Gender
    male
    Location
    devenv.exe
    Posts
    529
    Reputation
    23
    Thanks
    328
    My Mood
    Inspired
    Quote Originally Posted by Zacherl View Post
    OMFG hahaha made my day
    I read that and I was like... lolwut and I swear I had a slight black out from the stupidity of that statement.

  7. #6
    Ryuzaki™'s Avatar
    Join Date
    Apr 2011
    Gender
    male
    Location
    At my headquarter, catching KIRA
    Posts
    1,671
    Reputation
    41
    Thanks
    6,252
    My Mood
    Lurking
    I think this is a VirtualProtect code, I am not sure you gonna need to update the addys
    (Note: This is leeched, so don`t ask me how to update because IDK how but I am not using it anymore)

    Code:
    BYTE nop = 0x90;
    DWORD d, ds;
    
    VirtualProtect((LPVOID)(CShell+0x85723), 17, PAGE_EXECUTE_READWRITE, &d);
    
    for (int i=0; i<17;i++)
    memcpy((LPVOID)(CShell+0x85723+i), &nop, 1);
    
    VirtualProtect((LPVOID)(CShell+0x85723), 17, d, &ds);



  8. #7
    derh.acker's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Location
    localhost
    Posts
    826
    Reputation
    14
    Thanks
    616
    My Mood
    Angelic
    It sets the protection of memory.
    In xmen's example, 17 Bytes are getting protected, that these 17 Bytes are readable, writable and that they can get executed.
    Then some NOPs are being copied into these 17 Bytes and then the protection is set to the protection before the first call of VirtualProtect.

    @darlwis
    What are you talking about?

  9. #8
    giniyat101's Avatar
    Join Date
    Sep 2011
    Gender
    male
    Location
    Not telling.
    Posts
    1,935
    Reputation
    130
    Thanks
    1,380
    My Mood
    Dead
    Quote Originally Posted by darlwis View Post
    What i know it is for:
    1- It is For Convert Asm to C++ without WINAPI.
    2- Its Used for most time,to protect a Pointer or Multiple Pointers with Bytes.
    Example:
    Nopping Way.
    wtf you kidding?

    Quote Originally Posted by Zacherl View Post
    OMFG hahaha made my day
    same here

    @Death-Dev
    VirtualProtect changes the memory protection as some memories are read only or execute only
    if you want to overwrite some piece of code (e.g hooking, patching stuff etc)
    you must call VirtualProtect to allow writing

    for example try this code to write two nops in MessageBoxA API in a windows application:
    Code:
    FARPROC MessageBoxA_Addr = GetProcAddress(GetModuleHandleA("user32.dll"), "MessageBoxA");
    *(WORD*)(MessageBoxA_Addr = 0x9090; // error, memory protection is PAGE_EXECUTE only!
    solution:

    Code:
    DWORD dwOld;
    VirtualProtect(MessageBoxA_Addr, 2, PAGE_EXECUTE_READWRITE, &dwOld);//Allow read, write, execute access for first 2 bytes
    *(WORD*)(MessageBoxA_Addr = 0x9090; //will not make error
    VirtuallProtect(MessageBoxA_Addr, 2, dwOld, &dwOld); //restore old protection
    sorry for my bad english
    hope i helped
    someone correct me if i said something wrong
    Last edited by giniyat101; 04-22-2012 at 08:24 PM.


     



    [img]https://i43.photobucke*****m/albums/e367/DeteSting/Steam-update.gif[/img]

  10. #9
    darlwis's Avatar
    Join Date
    Feb 2012
    Gender
    male
    Posts
    228
    Reputation
    33
    Thanks
    53
    My Mood
    Inspired
    Quote Originally Posted by giniyat101 View Post
    wtf you kidding?



    same here

    @Death-Dev
    VirtualProtect changes the memory protection as some memories are read only or execute only
    if you want to overwrite some piece of code (e.g hooking, patching stuff etc)
    you must call VirtualProtect to allow writing

    for example try this code to write two nops in MessageBoxA API in a windows application:
    Code:
    FARPROC MessageBoxA_Addr = GetProcAddress(GetModuleHandleA("user32.dll"), "MessageBoxA");
    *(WORD*)(MessageBoxA_Addr = 0x9090; // error, memory protection is PAGE_EXECUTE only!
    solution:

    Code:
    DWORD dwOld;
    VirtualProtect(MessageBoxA_Addr, 2, PAGE_EXECUTE_READWRITE, &dwOld);//Allow read, write, execute access for first 2 bytes
    *(WORD*)(MessageBoxA_Addr = 0x9090; //will not make error
    VirtuallProtect(MessageBoxA_Addr, 2, dwOld, &dwOld); //restore old protection
    sorry for my bad english
    hope i helped
    someone correct me if i said something wrong
    Thats is what my friend say me on msn.
    Sorry if i am wrong

Similar Threads

  1. WPE Pro Question...
    By OutZida in forum General Game Hacking
    Replies: 4
    Last Post: 08-08-2011, 01:02 AM
  2. Hacking world of warcraft? & a noob question
    By arsholio in forum General Game Hacking
    Replies: 9
    Last Post: 04-08-2006, 01:55 PM
  3. Photoshop Question
    By arunforce in forum Art & Graphic Design
    Replies: 6
    Last Post: 01-15-2006, 11:38 AM
  4. Quick Question..Please Answer
    By ypg_gamer in forum WarRock - International Hacks
    Replies: 4
    Last Post: 01-04-2006, 10:32 AM
  5. question
    By wardo1926 in forum WarRock - International Hacks
    Replies: 0
    Last Post: 12-30-2005, 07:36 PM