Skip to content

Commit

Permalink
update copyright, remove doxygen
Browse files Browse the repository at this point in the history
  • Loading branch information
rentzsch committed Aug 10, 2012
1 parent 6daacb7 commit 03de67e
Show file tree
Hide file tree
Showing 10 changed files with 53 additions and 1,073 deletions.
969 changes: 0 additions & 969 deletions mach_inject/Doxyfile

This file was deleted.

3 changes: 0 additions & 3 deletions mach_inject/doxygen.command

This file was deleted.

10 changes: 4 additions & 6 deletions mach_inject/mach_inject.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
/*******************************************************************************
mach_inject.c
Copyright (c) 2003-2009 Jonathan 'Wolf' Rentzsch: <http://rentzsch.com>
Some rights reserved: <http://opensource.org/licenses/mit-license.php>
***************************************************************************/
// mach_inject.c semver:1.2.0
// Copyright (c) 2003-2012 Jonathan 'Wolf' Rentzsch: http://rentzsch.com
// Some rights reserved: http://opensource.org/licenses/mit
// https://github.com/rentzsch/mach_inject

#include "mach_inject.h"

Expand Down
35 changes: 9 additions & 26 deletions mach_inject/mach_inject.h
Original file line number Diff line number Diff line change
@@ -1,21 +1,8 @@
/*******************************************************************************
mach_inject.h
Copyright (c) 2003-2009 Jonathan 'Wolf' Rentzsch: <http://rentzsch.com>
Some rights reserved: <http://opensource.org/licenses/mit-license.php>
***************************************************************************/
// mach_inject.h semver:1.2.0
// Copyright (c) 2003-2012 Jonathan 'Wolf' Rentzsch: http://rentzsch.com
// Some rights reserved: http://opensource.org/licenses/mit
// https://github.com/rentzsch/mach_inject

/***************************************************************************//**
@mainpage mach_inject
@author Jonathan 'Wolf' Rentzsch: <http://rentzsch.com>
This package, coded in C to the Mach API, allows you to "inject" code into
an arbitrary process. "Injection" means both 1) copying over the necessary
code into the target's address space and 2) remotely creating a new thread
to execute the code.
***************************************************************************/

#ifndef _mach_inject_
#define _mach_inject_

Expand All @@ -24,19 +11,17 @@
#include <mach/vm_types.h>
#include <stddef.h> // for ptrdiff_t

#ifdef __cplusplus
extern "C" {
#endif

#define err_threadEntry_image_not_found (err_local|1)

#define INJECT_ENTRY injectEntry
#define INJECT_ENTRY_SYMBOL "injectEntry"

typedef void (*mach_inject_entry)( ptrdiff_t codeOffset, void *paramBlock,
size_t paramSize, void* dummy_pthread_data );

__BEGIN_DECLS

/***************************************************************************//**
/*******************************************************************************
Starts executing threadEntry in a new thread in the process specified by
targetProcess.
Expand All @@ -60,7 +45,7 @@ mach_inject(
pid_t targetProcess,
vm_size_t stackSize );

/***************************************************************************//**
/*******************************************************************************
Given a pointer, returns its Mach-O image and image size.
@param pointer -> Required pointer.
Expand All @@ -81,7 +66,5 @@ machImageForPointer(
unsigned int *jumpTableOffset,
unsigned int *jumpTableSize );

#ifdef __cplusplus
}
#endif
__END_DECLS
#endif // _mach_inject_
10 changes: 4 additions & 6 deletions mach_inject_bundle/mach_inject_bundle.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
/*******************************************************************************
mach_inject_bundle.c
Copyright (c) 2003-2009 Jonathan 'Wolf' Rentzsch: <http://rentzsch.com>
Some rights reserved: <http://opensource.org/licenses/mit-license.php>
***************************************************************************/
// mach_inject_bundle.c semver:1.2.0
// Copyright (c) 2003-2012 Jonathan 'Wolf' Rentzsch: http://rentzsch.com
// Some rights reserved: http://opensource.org/licenses/mit
// https://github.com/rentzsch/mach_inject

#include "mach_inject_bundle.h"
#include "mach_inject.h"
Expand Down
37 changes: 11 additions & 26 deletions mach_inject_bundle/mach_inject_bundle.h
Original file line number Diff line number Diff line change
@@ -1,27 +1,18 @@
/*******************************************************************************
mach_inject_bundle.h
Copyright (c) 2003-2009 Jonathan 'Wolf' Rentzsch: <http://rentzsch.com>
Some rights reserved: <http://opensource.org/licenses/mit-license.php>
// mach_inject_bundle.h semver:1.2.0
// Copyright (c) 2003-2012 Jonathan 'Wolf' Rentzsch: http://rentzsch.com
// Some rights reserved: http://opensource.org/licenses/mit
// https://github.com/rentzsch/mach_inject

***************************************************************************/

/***************************************************************************//**
@mainpage mach_inject_bundle
@author Jonathan 'Wolf' Rentzsch: <http://rentzsch.com>
/*******************************************************************************
Higher-level interface for mach_inject. This framework, intended to be
embedded into your application, allows you to "inject and forget" an
arbitrary bundle into an arbitrary process. It supplies the primitive code
block that gets squirted across the address spaces
(mach_inject_bundle_stub), which was the trickiest thing to write.
It's a Cocoa framework right now, but I intend to make it usable from Carbon
apps as well. Indeed, it already may be -- it doesn't use Cocoa or
Objective-C at all. I just haven't tried yet.
@todo Supply a higher-level interface to specifying processes than just a
process ID. I'm thinking offering lookup via application ID
("com.apple.Finder") and via type/creator ('FNDR', 'MACS').
("com.apple.Finder").
***************************************************************************/

Expand All @@ -31,21 +22,17 @@
#include <sys/types.h>
#include <mach/error.h>

#ifdef __cplusplus
extern "C" {
#endif

#define err_mach_inject_bundle_couldnt_load_framework_bundle (err_local|1)
#define err_mach_inject_bundle_couldnt_find_injection_bundle (err_local|2)
#define err_mach_inject_bundle_couldnt_load_injection_bundle (err_local|3)
#define err_mach_inject_bundle_couldnt_find_inject_entry_symbol (err_local|4)

/***************************************************************************//**
__BEGIN_DECLS

/*******************************************************************************
@param bundlePackageFileSystemRepresentation -> Required pointer
@param pid ->
@result <- mach_error_t
@result <- mach_error_t
***************************************************************************/

Expand All @@ -54,7 +41,5 @@ mach_inject_bundle_pid(
const char *bundlePackageFileSystemRepresentation,
pid_t pid );

#ifdef __cplusplus
}
#endif
__END_DECLS
#endif // _mach_inject_bundle_
10 changes: 4 additions & 6 deletions mach_inject_bundle_stub/load_bundle.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
/*******************************************************************************
load_bundle.c
Copyright (c) 2003-2009 Jonathan 'Wolf' Rentzsch: <http://rentzsch.com>
Some rights reserved: <http://opensource.org/licenses/mit-license.php>
***************************************************************************/
// load_bundle.c semver:1.2.0
// Copyright (c) 2003-2012 Jonathan 'Wolf' Rentzsch: http://rentzsch.com
// Some rights reserved: http://opensource.org/licenses/mit
// https://github.com/rentzsch/mach_inject

#include "load_bundle.h"
#include <CoreServices/CoreServices.h>
Expand Down
20 changes: 7 additions & 13 deletions mach_inject_bundle_stub/load_bundle.h
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
/*******************************************************************************
load_bundle.h
Copyright (c) 2003-2009 Jonathan 'Wolf' Rentzsch: <http://rentzsch.com>
Some rights reserved: <http://opensource.org/licenses/mit-license.php>
***************************************************************************/
// load_bundle.h semver:1.2.0
// Copyright (c) 2003-2012 Jonathan 'Wolf' Rentzsch: http://rentzsch.com
// Some rights reserved: http://opensource.org/licenses/mit
// https://github.com/rentzsch/mach_inject

#ifndef _loader_
#define _loader_

#include <mach/error.h>

#ifdef __cplusplus
extern "C" {
#endif

#define err_load_bundle_undefined_symbol (err_local|1)
#define err_load_bundle_link_failed (err_local|2)
#define err_load_bundle_url_from_path (err_local|3)
Expand All @@ -30,6 +24,8 @@
(err_local|7+NSObjectFileImageFormat)
#define err_load_bundle_NSObjectFileImageAccess \
(err_local|7+NSObjectFileImageAccess)

__BEGIN_DECLS

// High-level: For loading 'MyBundle.bundle'. Calls load_bundle_executable().
mach_error_t
Expand All @@ -41,7 +37,5 @@ load_bundle_package(
load_bundle_executable(
const char *bundleExecutableFileSystemRepresentation );

#ifdef __cplusplus
}
#endif
__END_DECLS
#endif // _loader_
16 changes: 7 additions & 9 deletions mach_inject_bundle_stub/mach_inject_bundle_stub.c
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
/*******************************************************************************
mach_inject_bundle_stub.c
Copyright (c) 2003-2009 Jonathan 'Wolf' Rentzsch: <http://rentzsch.com>
Some rights reserved: <http://opensource.org/licenses/mit-license.php>
Design inspired by SCPatchLoader, by Jon Gotow of St. Clair Software:
<http://www.stclairsoft.com>
***************************************************************************/
// mach_inject_bundle_stub.c semver:1.2.0
// Copyright (c) 2003-2012 Jonathan 'Wolf' Rentzsch: http://rentzsch.com
// Some rights reserved: http://opensource.org/licenses/mit
// https://github.com/rentzsch/mach_inject
//
// Design inspired by SCPatchLoader by Jon Gotow of St. Clair Software:
// http://www.stclairsoft.com

#include "mach_inject_bundle_stub.h"
#include "load_bundle.h"
Expand Down
16 changes: 7 additions & 9 deletions mach_inject_bundle_stub/mach_inject_bundle_stub.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
/*******************************************************************************
mach_inject_bundle_stub.h
Copyright (c) 2003-2009 Jonathan 'Wolf' Rentzsch: <http://rentzsch.com>
Some rights reserved: <http://opensource.org/licenses/mit-license.php>
Design inspired by SCPatchLoader, by Jon Gotow of St. Clair Software:
<http://www.stclairsoft.com>
***************************************************************************/
// mach_inject_bundle_stub.h semver:1.2.0
// Copyright (c) 2003-2012 Jonathan 'Wolf' Rentzsch: http://rentzsch.com
// Some rights reserved: http://opensource.org/licenses/mit
// https://github.com/rentzsch/mach_inject
//
// Design inspired by SCPatchLoader by Jon Gotow of St. Clair Software:
// http://www.stclairsoft.com

#ifndef _mach_inject_bundle_stub_
#define _mach_inject_bundle_stub_
Expand Down

0 comments on commit 03de67e

Please sign in to comment.