Skip to content

danielrempel/asminjector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

An example program, using mprotect call to change rights on memory, writes some opcodes and launches them.

void* mapWritableMemory(int length, void** deleteptr)
Method creates about 8192 + length bytes memory, changes access rights to +rwx on length of them.
Arguments:

  • length - count bytes to prepare
  • deleteptr - pointer to voidptr, receives address of the whole mapped memory area (not only executable area) or NULL on error

Return value:

  • address of the first of length bytes of executable memory or NULL on error

Mapped memory must be free()-d by hand, using deleteptr, not return value!

It was a very interesting theme for me, but I didn't find anything like that, so I had to do that by hands.
Daniel Rempel [email protected], 2014.

About

A little program, a base for writing Linux x86_64 self-modifying programs.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages