Coder Social home page Coder Social logo

changeofpace / force-page-protection Goto Github PK

View Code? Open in Web Editor NEW
101.0 101.0 36.0 338 KB

This x64dbg plugin sets the page protection for memory mapped views in scenarios which cause NtProtectVirtualMemory to fail.

License: GNU General Public License v3.0

C++ 8.85% C 86.66% Objective-C 4.49%

force-page-protection's People

Contributors

changeofpace avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

force-page-protection's Issues

Not a valid memory region

Hello. First let me say thank you for this plugin! When I try and use it on a sample that behaves very similar to your sample, I get the error "Not a valid memory region".

This sample does the following:

CreateSection() with these argument values:

  • DesiredAccess = SECTION_ALL_ACCESS (0xF001F)
  • SectionPageProtection = PAGE_EXECUTE_READWRITE
  • AllocationAttributes = SEC_COMMIT|SEC_NO_CHANGE (0x08400000)

MapViewOfFileEx() with these argument values:

  • hFileMappingObject = result of CreateSection()
  • dwDesiredAccess = SECTION_ALL_ACCESS (0xF001F)

VirtualProtect() with these argument values:

  • lpAddress = base address of module
  • dwSize = SizeOfImage from PE header
  • flNewProtect = PAGE_EXECUTE_READWRITE (0x40)

At this point, x64dbg seems to forget about only the .text segment of the original module. That is, it disappears from the memory map, relative address syntax (e.g. :0 + 0xF000) fails, and if I try to navigate the CPU disassembly window to an instruction in the .text segment , it reports "Invalid memory address". Figuring that perhaps the fpp command was to establish rules for future enforcement, I have tried running it on an EA from the .text segment of the module both before and after the VirtualProtect() call. In the before case, the command seems to work, but does not prevent the .text segment from disappearing.

I'm not sure it's relevant, but after this the sample I'm working with will also:

  • Copy the entire module into the address returned by MapViewOfFile()
  • Call UnmapViewOfFile() on the original module location. This causes the entire module to disappear from the Memory Map window in x64dbg, whereas before it was only the .text segment.

I'm not sure if this is a bug, I am somehow using it wrong, or if something about this sample is unsupported. I would appreciate any guidance you can give. I can certainly give you any additional information that you might need.

Thank you for your time.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.