Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
openmm
Commits
86d09347
"vscode:/vscode.git/clone" did not exist on "3cfcd746c93b62edc7e953f961e6e323fa029c34"
Commit
86d09347
authored
Oct 09, 2014
by
peastman
Browse files
Deleted obsolete files
parent
8b69b9c0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
153 deletions
+0
-153
libraries/asmjit/contrib/winremoteruntime.cpp
libraries/asmjit/contrib/winremoteruntime.cpp
+0
-79
libraries/asmjit/contrib/winremoteruntime.h
libraries/asmjit/contrib/winremoteruntime.h
+0
-74
No files found.
libraries/asmjit/contrib/winremoteruntime.cpp
deleted
100644 → 0
View file @
8b69b9c0
// [AsmJit/WinRemoteRuntime]
// Contribution for remote process handling.
//
// [License]
// Zlib - See LICENSE.md file in the package.
// [Export]
#define ASMJIT_EXPORTS
// [Dependencies - AsmJit]
#include "../base.h"
// [Guard - Windows]
#if defined(ASMJIT_OS_WINDOWS)
#include "winremoteruntime.h"
namespace
asmjit
{
namespace
contrib
{
// ============================================================================
// [asmjit::contrib::WinRemoteRuntime - Construction / Destruction]
// ============================================================================
WinRemoteRuntime
::
WinRemoteRuntime
(
HANDLE
hProcess
)
:
_memMgr
(
hProcess
)
{
// We are patching another process so enable keep-virtual-memory option.
_memMgr
.
setKeepVirtualMemory
(
true
);
}
WinRemoteRuntime
::~
WinRemoteRuntime
()
{}
// ============================================================================
// [asmjit::contrib::WinRemoteRuntime - Interface]
// ============================================================================
uint32_t
WinRemoteRuntime
::
add
(
void
**
dest
,
BaseAssembler
*
assembler
)
{
// Disallow generation of no code.
size_t
codeSize
=
assembler
->
getCodeSize
();
if
(
codeSize
==
0
)
{
*
dest
=
NULL
;
return
kErrorInvalidState
;
}
// Allocate temporary memory where the code will be stored and relocated.
void
*
codeData
=
ASMJIT_ALLOC
(
codeSize
);
if
(
codeData
==
NULL
)
{
*
dest
=
NULL
;
return
kErrorNoHeapMemory
;
}
// Allocate a permanent remote process memory.
void
*
processMemPtr
=
_memMgr
.
alloc
(
codeSize
,
kVMemAllocPermanent
);
if
(
processMemPtr
==
NULL
)
{
ASMJIT_FREE
(
codeData
);
*
dest
=
NULL
;
return
kErrorNoVirtualMemory
;
}
// Relocate and write the code to the process memory.
assembler
->
relocCode
(
codeData
,
(
uintptr_t
)
processMemPtr
);
::
WriteProcessMemory
(
getProcessHandle
(),
processMemPtr
,
codeData
,
codeSize
,
NULL
);
ASMJIT_FREE
(
codeData
);
*
dest
=
processMemPtr
;
return
kErrorOk
;
}
// NOP.
Error
WinRemoteRuntime
::
release
(
void
*
p
)
{
return
kErrorOk
;
}
}
// contrib namespace
}
// asmjit namespace
// [Guard - Windows]
#endif // ASMJIT_OS_WINDOWS
libraries/asmjit/contrib/winremoteruntime.h
deleted
100644 → 0
View file @
8b69b9c0
// [AsmJit]
// Complete x86/x64 JIT and Remote Assembler for C++.
//
// [License]
// Zlib - See LICENSE.md file in the package.
// [Guard]
#ifndef _ASMJIT_CONTRIB_WINREMOTERUNTIME_H
#define _ASMJIT_CONTRIB_WINREMOTERUNTIME_H
#include "../base.h"
#if defined(ASMJIT_OS_WINDOWS)
namespace
asmjit
{
namespace
contrib
{
//! \addtogroup asmjit_contrib
//! \{
// ============================================================================
// [asmjit::contrib::WinRemoteRuntime]
// ============================================================================
//! WinRemoteRuntime can be used to inject code to a remote process.
struct
WinRemoteRuntime
:
public
Runtime
{
ASMJIT_NO_COPY
(
WinRemoteRuntime
)
// --------------------------------------------------------------------------
// [Construction / Destruction]
// --------------------------------------------------------------------------
//! Create a `WinRemoteRuntime` instance for a given `hProcess`.
ASMJIT_API
WinRemoteRuntime
(
HANDLE
hProcess
);
//! Destroy the `WinRemoteRuntime` instance.
ASMJIT_API
virtual
~
WinRemoteRuntime
();
// --------------------------------------------------------------------------
// [Accessors]
// --------------------------------------------------------------------------
//! Get the remote process handle.
ASMJIT_INLINE
HANDLE
getProcessHandle
()
const
{
return
_memMgr
.
getProcessHandle
();
}
//! Get the remote memory manager.
ASMJIT_INLINE
VMemMgr
*
getMemMgr
()
const
{
return
const_cast
<
VMemMgr
*>
(
&
_memMgr
);
}
// --------------------------------------------------------------------------
// [Interface]
// --------------------------------------------------------------------------
ASMJIT_API
virtual
uint32_t
add
(
void
**
dest
,
BaseAssembler
*
assembler
);
ASMJIT_API
virtual
Error
release
(
void
*
p
);
// --------------------------------------------------------------------------
// [Members]
// --------------------------------------------------------------------------
//! Remove memory manager.
VMemMgr
_memMgr
;
};
//! \}
}
// contrib namespace
}
// asmjit namespace
// [Guard]
#endif // ASMJIT_OS_WINDOWS
#endif // _ASMJIT_CONTRIB_WINREMOTERUNTIME_H
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment