Skip to content

Commit

Permalink
Cleanup wrapper header
Browse files Browse the repository at this point in the history
  • Loading branch information
elishacloud committed Feb 19, 2018
1 parent e48fda7 commit 6ab81a8
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 22 deletions.
2 changes: 1 addition & 1 deletion Dllmain/BuildNo.rc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#define BUILD_NUMBER 2381
#define BUILD_NUMBER 2382
2 changes: 1 addition & 1 deletion Stub/BuildNo.rc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#define BUILD_NUMBER 140
#define BUILD_NUMBER 141
18 changes: 16 additions & 2 deletions Wrappers/wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#include <vector>
#include <algorithm>
#include <fstream>

Expand Down Expand Up @@ -77,13 +78,26 @@
} \
}

#include "wrapper.h"

namespace Wrapper
{
struct wrapper_map
{
FARPROC Proc;
FARPROC *val;
};

// Forward function decalration
HRESULT __stdcall _jmpaddr();
HRESULT __stdcall _jmpaddrvoid();

// Varable decalration
constexpr FARPROC jmpaddr = (FARPROC)*_jmpaddr;
constexpr FARPROC jmpaddrvoid = (FARPROC)*_jmpaddrvoid;
std::vector<wrapper_map> jmpArray;
}

#include "wrapper.h"

__declspec(naked) HRESULT __stdcall Wrapper::_jmpaddrvoid()
{
__asm
Expand Down
18 changes: 0 additions & 18 deletions Wrappers/wrapper.h
Original file line number Diff line number Diff line change
@@ -1,25 +1,7 @@
#pragma once

#include <vector>

namespace Wrapper
{
struct wrapper_map
{
FARPROC Proc;
FARPROC *val;
};

// Forward function decalration
HRESULT __stdcall _jmpaddr();
HRESULT __stdcall _jmpaddrvoid();

// Varable decalration
constexpr FARPROC jmpaddr = (FARPROC)*_jmpaddr;
constexpr FARPROC jmpaddrvoid = (FARPROC)*_jmpaddrvoid;
extern std::vector<wrapper_map> jmpArray;

// Shared Functions
bool ValidProcAddress(FARPROC ProcAddress);
void ShimProc(FARPROC &var, FARPROC in, FARPROC &out);
HMODULE CreateWrapper(const char *ProxyDll, const char *WrapperMode);
Expand Down

0 comments on commit 6ab81a8

Please sign in to comment.