reorganize and add v8 skeleton

This commit is contained in:
Akash Mozumdar 2018-09-17 21:40:54 -04:00
parent 6ae86a5988
commit bb48b1e64b
5 changed files with 37 additions and 3 deletions

View File

@ -13,7 +13,7 @@ set(vnrhook_src
pipe.cc pipe.cc
engine/engine.cc engine/engine.cc
engine/match.cc engine/match.cc
engine/pchooks.cc engine/native/pchooks.cc
hijack/texthook.cc hijack/texthook.cc
util/util.cc util/util.cc
util/ithsys/ithsys.cc util/ithsys/ithsys.cc

View File

@ -9,7 +9,8 @@
#include "engine/match.h" #include "engine/match.h"
#include "engine/engine.h" #include "engine/engine.h"
#include "engine/pchooks.h" #include "engine/native/pchooks.h"
#include "engine/v8/v8.h"
#include "util/growl.h" #include "util/growl.h"
#include "util/util.h" #include "util/util.h"
#include "main.h" #include "main.h"

View File

@ -1,7 +1,7 @@
// pchooks.cc // pchooks.cc
// 8/1/2014 jichi // 8/1/2014 jichi
#include "engine/pchooks.h" #include "pchooks.h"
#include "main.h" #include "main.h"
//#include <gdiplus.h> //#include <gdiplus.h>

33
vnrhook/engine/v8/v8.h Normal file
View File

@ -0,0 +1,33 @@
#pragma once
// v8.h
// 9/17/2018 Artikash
// Hooks for V8 JavaScript runtime
#include "common.h"
#include "types.h"
namespace V8
{
#pragma pack(1)
struct V8String
{
BYTE filler[7];
int length;
wchar_t string[1];
};
void SpecialHookV8String(DWORD dwDatabase, HookParam* hp, BYTE, DWORD* data, DWORD* split, DWORD* len)
{
V8String* str = *(V8String**)data;
*data = (DWORD)str->string;
*len = str->length;
if (hp->type & USING_SPLIT) *split = *(DWORD*)((BYTE*)hp->split + dwDatabase);
}
void HookV8Functions(HMODULE hModule)
{
const std::string V8_FUNCTIONS[] =
{
"",
""
};
}
}