Commit Graph

17 Commits

Author SHA1 Message Date
usiegl00 bceaf5cd70 Back from the dyld: clean up mmap.
The mmap permissions prior to mprotect during the region mapping should
be write only. I also added a few more comments detailing the usage of
structs in dyld4.
2022-10-07 09:57:53 +09:00
usiegl00 8aa01bfbcd Back from the dyld: fix addr_main assignment.
When using the legacy technique, addr_main was being redifined. This
caused the access to addr_main outside the if statement to segfault.
2022-09-30 06:46:45 +09:00
usiegl00 ce75cb2afc Back from the dyld: clean up source code.
This fixes a floating `\t` in a struct definition. This also adds more
clarity to a set of dprintf statements regarding the region. This fixes
the indentation for a comment as well.
2022-09-29 07:58:23 +09:00
usiegl00 64231dad67 Back from the dyld: vm_allocate to fix corruption.
This fixes the corruption incidentally resolved by assigning to an
unused variable by properly allocating memory for structs before
assigning to them. This will resolve the segfault on return issue, as
the saved return address is no longer clobbered.
2022-09-28 20:58:48 +09:00
usiegl00 2833f504d4 Back from the dyld: a fileless loader. (Again.)
By replicating the functionality of APIs::dlopen_from, we can bypass the
temporary file created when calling NSCreateObjectFileImageFromMemory on
macOS 12 and above. Constructing a custom JustInTimeLoader and running
through all the dyld calls required to fix it up manually results in
fileless MachO execution.
2022-09-22 17:50:04 +09:00
usiegl00 b9052be102 Use libdyld locator to fix osx stager on monterey
We locate the dyld_shared_cache in memory to find and resolve the
functions we need in libdyld.dylib. We retain the original dyld location
method on osx versions before Sierra.

Explicitly set length for osx x64 initial stage

The rdx register, used for passing the payload length, is being
clobbered by a system call in the new MacOS version. Instead of relying
on the register being untouched, we set it equal to the payload length.
2022-04-12 11:27:23 +09:00
Tim W bba9b76d25 fix infinite loop in find_macho
fix osx loader to work within python macho
2020-04-24 15:13:57 +08:00
Tim W 861c286739 fix osx stager compatibility with PluginProcessShim 2018-12-24 19:26:10 +08:00
Tim W d04070c528 fix osx stager when run under debugger 2018-12-18 14:12:36 +08:00
Tim W a01f0f3023 fix #9366, fix osx x64 stage location 2018-02-20 13:50:44 +08:00
Adam Cammack 64c725164a Add macOS reverse stager binary 2018-01-31 14:27:44 -06:00
Tim W 0ce125ec55 more fixes 2018-01-30 17:54:10 +08:00
Tim W 39c07e2289 add references 2018-01-30 17:52:01 +08:00
Tim W 9aaf93ff3b fix fix for older osx versions 2018-01-29 03:50:39 +08:00
Tim W 82fde6b1d1 fix for older osx versions 2018-01-21 08:04:26 +08:00
Tim W 46a45550fd add osx x64 stager 2018-01-03 14:04:14 +08:00
Matt Miller 699e013121 initial import of shellcode source into v3
git-svn-id: file:///home/svn/framework3/trunk@4813 4d416f70-5f16-0410-b530-b9f4589650da
2007-04-29 20:27:23 +00:00