aboutsummaryrefslogtreecommitdiffstats
path: root/bruiser/executioner.h
diff options
context:
space:
mode:
authorbloodstalker <thabogre@gmail.com>2018-01-12 15:06:46 +0000
committerbloodstalker <thabogre@gmail.com>2018-01-12 15:06:46 +0000
commit575615c5a41592f3701853f90e1762c6dce4abe4 (patch)
treefca52890bb597c587441db1a99a1d16c63f98694 /bruiser/executioner.h
parentupdate (diff)
downloadmutator-575615c5a41592f3701853f90e1762c6dce4abe4.tar.gz
mutator-575615c5a41592f3701853f90e1762c6dce4abe4.zip
you can now run objects that are loaded into bruiser from a shared library from lua. right now very simple examples work. i have to figure out how to handles runtime pointer recasts.
Diffstat (limited to 'bruiser/executioner.h')
-rw-r--r--bruiser/executioner.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/bruiser/executioner.h b/bruiser/executioner.h
index 0113d6c..26bd042 100644
--- a/bruiser/executioner.h
+++ b/bruiser/executioner.h
@@ -36,6 +36,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.*
/**********************************************************************************************************************/
namespace { // start of anonymous namespace
using XObject = void(*)(void);
+ using xobj_2int = int(*)(int, int);
+ using LuaRegFunc = int(*)(lua_State*);
constexpr int MEMORY_SIZE = 32768;
std::vector<uint8_t> memory(MEMORY_SIZE, 0);
@@ -178,10 +180,7 @@ class Executioner {
std::vector<uint64_t> getAllArgs(lua_State* __ls) {
int numargs = lua_gettop(__ls);
std::vector<uint64_t> args;
-
- for (int i = 0; i < numargs; ++i) {
- }
-
+ for (int i = 0; i < numargs; ++i) {}
return args;
}
@@ -203,6 +202,8 @@ class Executioner {
lua_register(_lua_State, "xobjwrapper", LuaXobjWrapper);
}
+ XObject getXobject(void* _ptr) {return (XObject)_ptr;}
+
void xobjsGetPtrs(void) {
for (auto& iter : obj_mem_ptrs) {
XObject dummy = (XObject)iter.first;