This commit is contained in:
Dark Byte 2017-09-19 21:13:57 +02:00
parent c30d77c4ac
commit 70fbcd430f
4 changed files with 98 additions and 3 deletions

View file

@ -2147,7 +2147,7 @@ begin
parameters:=lua_gettop(L);
if parameters=0 then begin lua_pushboolean(L, false); exit; end;
address:=lua_toaddress(L,1);
address:=lua_toaddress(L,1, processhandle=GetCurrentProcess);
lua_pop(L, parameters);
lua_pushboolean(L, virtualfreeex(processhandle,pointer(address),0,MEM_RELEASE));
@ -6833,7 +6833,7 @@ begin
if lua_isnumber(L,2) then
parameter:=lua_tointeger(L, 2)
else
parameter:=selfsymhandler.getAddressFromName(Lua_ToString(L,2));
parameter:=symhandler.getAddressFromName(Lua_ToString(L,2));
end
else
parameter:=0;
@ -6946,7 +6946,7 @@ begin
result:=0;
if lua_gettop(L)>=1 then
begin
address:=lua_toaddress(L,1);
address:=lua_toaddress(L,1,true);
if lua_gettop(L)>=2 then

View file

@ -110,6 +110,78 @@ begin
end;
end;
function stream_readByte(L: PLua_State): integer; cdecl;
var
stream: Tstream;
begin
stream:=luaclass_getClassObject(L);
lua_pushinteger(L,stream.ReadByte);
result:=1;
end;
function stream_writeByte(L: PLua_State): integer; cdecl;
var
stream: Tstream;
begin
stream:=luaclass_getClassObject(L);
stream.WriteByte(lua_tointeger(L,1));
result:=0;
end;
function stream_readWord(L: PLua_State): integer; cdecl;
var
stream: Tstream;
begin
stream:=luaclass_getClassObject(L);
lua_pushinteger(L,stream.ReadWord);
result:=1;
end;
function stream_writeWord(L: PLua_State): integer; cdecl;
var
stream: Tstream;
begin
stream:=luaclass_getClassObject(L);
stream.WriteWord(lua_tointeger(L,1));
result:=0;
end;
function stream_readDword(L: PLua_State): integer; cdecl;
var
stream: Tstream;
begin
stream:=luaclass_getClassObject(L);
lua_pushinteger(L,stream.ReadDword);
result:=1;
end;
function stream_writeDword(L: PLua_State): integer; cdecl;
var
stream: Tstream;
begin
stream:=luaclass_getClassObject(L);
stream.WriteDword(lua_tointeger(L,1));
result:=0;
end;
function stream_readQword(L: PLua_State): integer; cdecl;
var
stream: Tstream;
begin
stream:=luaclass_getClassObject(L);
lua_pushinteger(L,stream.ReadQword);
result:=1;
end;
function stream_writeQword(L: PLua_State): integer; cdecl;
var
stream: Tstream;
begin
stream:=luaclass_getClassObject(L);
stream.WriteQword(lua_tointeger(L,1));
result:=0;
end;
function stream_write(L: PLua_State): integer; cdecl;
var
stream: Tstream;
@ -155,6 +227,14 @@ begin
luaclass_addClassFunctionToTable(L, metatable, userdata, 'copyFrom', stream_copyFrom);
luaclass_addClassFunctionToTable(L, metatable, userdata, 'read', stream_read);
luaclass_addClassFunctionToTable(L, metatable, userdata, 'write', stream_write);
luaclass_addClassFunctionToTable(L, metatable, userdata, 'readByte', stream_readByte);
luaclass_addClassFunctionToTable(L, metatable, userdata, 'writeByte', stream_writeByte);
luaclass_addClassFunctionToTable(L, metatable, userdata, 'readWord', stream_readWord);
luaclass_addClassFunctionToTable(L, metatable, userdata, 'writeWord', stream_writeWord);
luaclass_addClassFunctionToTable(L, metatable, userdata, 'readDword', stream_readDword);
luaclass_addClassFunctionToTable(L, metatable, userdata, 'writeDword', stream_writeDword);
luaclass_addClassFunctionToTable(L, metatable, userdata, 'readQword', stream_readQword);
luaclass_addClassFunctionToTable(L, metatable, userdata, 'writeQword', stream_writeQword);
luaclass_addPropertyToTable(L, metatable, userdata, 'Size', stream_getSize, stream_setSize);
luaclass_addPropertyToTable(L, metatable, userdata, 'Position', stream_getPosition, stream_setPosition);

View file

@ -50,6 +50,7 @@ readString(address, maxlength, widechar OPTIONAL) : Reads a string till it encou
writeSmallInteger(address,value) : Writes a 16-bit integer to the specified address. Returns true on success
writeInteger(address,value) : Writes a 32-bit integer to the specified address. Returns true on success
writeQword(address, value): Write a 64-bit integer to the specified address. Returns true on success
writePointer(address,value)
writeFloat(address,value) : Writes a single precision floating point to the specified address. Returns true on success
writeDouble(address,value) : Writes a double precision floating point to the specified address. Returns true on success
writeString(address,text, widechar OPTIONAL) : Write a string to the specified address. Returns true on success
@ -65,6 +66,7 @@ readStringLocal(address, maxlength, widechar OPTIONAL)
writeSmallIntegerLocal(address,value) : Writes a 16-bit integer to the specified address in CE's memory. Returns true on success
writeIntegerLocal(address,value) : Writes a 32-bit integer to the specified address in CE's memory. Returns true on success
writeQwordLocal(address,value) : Writes a 64-bit integer to the specified address in CE's memory. Returns true on success
writePointerLocal(address,value)
writeFloatLocal(address,value) : Writes a single precision floating point to the specified address in CE's memory. Returns true on success
writeDoubleLocal(address,value) : Writes a double precision floating point to the specified address in CE's memory. Returns true on success
writeStringLocal(address,string, widechar OPTIONAL)
@ -1663,6 +1665,14 @@ methods
copyFrom(stream, count) - Copies count bytes from the given stream to this stream
read(count): bytetable - Returns a bytetable containing the bytes of the stream. This increases the position
write(bytetable, count OPTIONAL)- Writes the given bytetable to the stream
readByte(): integer
writeByte(integer)
readWord(): integer
writeWord(integer)
readDword(): integer
writeDword(integer)
readQword(): integer
writeQword(integer)
MemoryStream Class (Inheritance: Stream->Object)

View file

@ -2,6 +2,11 @@ structure dissect:
use pdb data if available
delete all structures sometimes AV's
for .net games let stucture dissect see those structures aS WELL
AND LUA
add enumStructureWindows list, and let lua change the selected struct
trainergen: get rid of tcheat and just use labels