File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 11#define WIN32_LEAN_AND_MEAN
22#include <Windows.h>
33#include <luart.h>
4- //using namespace std;
4+ //using namespace std; // don't need this garbage?
55
66// process.FindWindow(windowName) method
77// returns a userdata and the ID of the of the process
@@ -37,6 +37,8 @@ LUA_METHOD(process, WriteProcessMemory)
3737 CloseHandle (pHandle );
3838
3939 /*
40+ // checks if it was written with success
41+ // returns false if no and true if yes.
4042 if (memory == bytes) {
4143 lua_pushboolean(L,1); // returns true if the bytes were written correctly
4244 return 1;
@@ -60,7 +62,7 @@ LUA_METHOD(process, ReadProcessMemory)
6062 const int pID = lua_tonumber (L , 1 );
6163 const int address = lua_tonumber (L ,2 );
6264 const int size = lua_tonumber (L ,3 );
63- char memory [size ];
65+ char memory [size ]; // the string to be returned
6466
6567 HANDLE pHandle = OpenProcess (PROCESS_ALL_ACCESS , 0 , pID );
6668
@@ -104,4 +106,4 @@ int __declspec(dllexport) luaopen_process(lua_State *L)
104106{
105107 lua_regmodulefinalize (L , process );
106108 return 1 ;
107- }
109+ }
You can’t perform that action at this time.
0 commit comments