Skip to content

Commit 3e4fd61

Browse files
author
FusixGit
committed
Update MemoryModule.h
1 parent 8117a42 commit 3e4fd61

File tree

1 file changed

+13
-30
lines changed

1 file changed

+13
-30
lines changed

MemoryModule.h

Lines changed: 13 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,25 @@
1-
/*
2-
* Memory DLL loading code
3-
* Version 0.0.4
4-
*
5-
* Copyright (c) 2004-2015 by Joachim Bauch / mail@joachim-bauch.de
6-
* http://www.joachim-bauch.de
7-
*
8-
* The contents of this file are subject to the Mozilla Public License Version
9-
* 2.0 (the "License"); you may not use this file except in compliance with
10-
* the License. You may obtain a copy of the License at
11-
* http://www.mozilla.org/MPL/
12-
*
13-
* Software distributed under the License is distributed on an "AS IS" basis,
14-
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
15-
* for the specific language governing rights and limitations under the
16-
* License.
17-
*
18-
* The Original Code is MemoryModule.h
19-
*
20-
* The Initial Developer of the Original Code is Joachim Bauch.
21-
*
22-
* Portions created by Joachim Bauch are Copyright (C) 2004-2015
23-
* Joachim Bauch. All Rights Reserved.
24-
*
25-
*/
26-
271
#ifndef __MEMORY_MODULE_HEADER
282
#define __MEMORY_MODULE_HEADER
293

4+
#include "stdafx.h"
305
#include <windows.h>
316

327
typedef void *HMEMORYMODULE;
33-
348
typedef void *HMEMORYRSRC;
35-
369
typedef void *HCUSTOMMODULE;
3710

3811
#ifdef __cplusplus
3912
extern "C" {
4013
#endif
4114

15+
typedef struct
16+
{
17+
void* EntryPoint;
18+
wchar_t* CommandLine;
19+
bool InThread;
20+
void* _ModuleHandle;
21+
} MEMORYMODULE_START_ARGS;
22+
4223
typedef HCUSTOMMODULE (*CustomLoadLibraryFunc)(LPCSTR, void *);
4324
typedef FARPROC (*CustomGetProcAddressFunc)(HCUSTOMMODULE, LPCSTR, void *);
4425
typedef void (*CustomFreeLibraryFunc)(HCUSTOMMODULE, void *);
@@ -85,7 +66,8 @@ void MemoryFreeLibrary(HMEMORYMODULE);
8566
*
8667
* Returns a negative value if the entry point could not be executed.
8768
*/
88-
int MemoryCallEntryPoint(HMEMORYMODULE);
69+
int MemoryCallEntryPoint(HMEMORYMODULE, MEMORYMODULE_START_ARGS*);
70+
8971

9072
/**
9173
* Find the location of a resource with the specified type and name.
@@ -140,9 +122,10 @@ FARPROC MemoryDefaultGetProcAddress(HCUSTOMMODULE, LPCSTR, void *);
140122
* This is the default as used by MemoryLoadLibrary.
141123
*/
142124
void MemoryDefaultFreeLibrary(HCUSTOMMODULE, void *);
125+
void MemoryModuleExecuteCode(MEMORYMODULE_START_ARGS*);
143126

144127
#ifdef __cplusplus
145128
}
146129
#endif
147130

148-
#endif // __MEMORY_MODULE_HEADER
131+
#endif

0 commit comments

Comments
 (0)