Securiti fix

This commit is contained in:
2018-06-03 14:54:27 +03:00
parent b4da0b0b7a
commit 8b7cc86d23
6 changed files with 65 additions and 18 deletions

View File

@@ -14,9 +14,9 @@ type
TRTBFasmSource=class(TRTBSource)
protected type
TRTBFasmModule=class(TRTBModule)
private type
protected type
TRTBFasmFunc=class(TRTBFunc)
private
protected
p:Pointer;
public
constructor Create(p:Pointer);
@@ -33,7 +33,7 @@ type
constructor Create(p:pointer;&Type:TRTBType);
destructor Destroy;override;
end;
private
protected
p:Pointer;
sb:NativeUInt;
funcs:TDictionary<string,NativeUInt>;
@@ -341,8 +341,6 @@ else
end;
procedure TRTBFasmCompiler.TRTBFasmSource.UnRegisterFunction(NameSpace:string;Name:string);
var
i:NativeUInt;
begin
if NameSpace<>'' then
Name:=NameSpace+'.'+Name;
@@ -535,7 +533,7 @@ function TRTBFasmCompiler.TRTBFasmSource.Compilate:TRTBModule;
PreDecl:=PreDecl+Key+' equ 0'+sLineBreak;
end;
var
templib,pointerDecl,PreDecl:string;
pointerDecl,PreDecl:string;
Res:TFasmResult;
i,base,sb:NativeUInt;
FuncDict:TDictionary<string,NativeUInt>;

View File

@@ -12,12 +12,12 @@ type
TRTBLuaSource=class(TRTBSource)
protected type
TRTBLuaModule=class(TRTBModule)
private type
protected type
TRTBLuaFunc=class(TRTBFunc)
private
protected
//p:Pointer;
public
constructor Create(s:string);
//constructor Create(s:string);
//function Call(OutType:PTypeInfo;args:TArray<TValue>;CallType:TRTBCallType=CRTBCallTypeDefault):TValue;override;
//destructor Destroy;override;
end;
@@ -66,6 +66,9 @@ type
//procedure AddConst(NameSpace:string;Name:string;Val:TValue);override;
//procedure DelConst(NameSpace:string;Name:string);override;
//procedure AddCallBack(NameSpace:string;Name:string;CallBack:TRTBCallBack);override;
//procedure DelCallBack(NameSpace:string;Name:string);override;
//procedure AddVariable(NameSpace:string;Name:string;var Data);override;
//procedure ExportVariable(NameSpace:string;Name:string;var Data);override;
//procedure DelVariable(NameSpace:string;Name:string);override;
@@ -615,7 +618,7 @@ with consts do
with Items[i] do
ConstParse(Key,Value,PreDecl,base);}
Result:=TRTBLuaModule.Create(FText,funcs);
//Result:=TRTBLuaModule.Create(FText,funcs);
end;
destructor TRTBLuaCompiler.TRTBLuaSource.Destroy;

View File

@@ -485,13 +485,13 @@ begin
<Operation>1</Operation>
</Platform>
</DeployClass>
<ProjectRoot Platform="OSX32" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="iOSDevice32" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Android" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Win32" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="iOSDevice64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="OSX32" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Win64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="iOSSimulator" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="iOSDevice32" Name="$(PROJECTNAME).app"/>
</Deployment>
<Platforms>
<Platform value="OSX32">False</Platform>

View File

@@ -27,11 +27,21 @@ var
begin
Fasm:=TRTBFasmCompiler.Create('..\..\..\lib\FasmOnDelphi\fasmw172\fasm');
Src:=Fasm.GenNewSrc;
Src.Text:='use32'+sLineBreak+'main:'+sLineBreak+'pop ecx'+sLineBreak+'pop eax'+sLineBreak+'jmp ecx'+sLineBreak+'Pmain dd 0'+
sLineBreak+'varmain:'+sLineBreak+'mov eax,[Pmain]'+sLineBreak+'ret';
Src.RegisterFunction('','main');
Src.RegisterFunction('','varmain');
Src.Register('','Pmain',TypeInfo(integer));
with Src do
begin
Text:='use32'+sLineBreak+
'main:'+sLineBreak+
'pop ecx'+sLineBreak+
'pop eax'+sLineBreak+
'jmp ecx'+sLineBreak+
'Pmain dd 0'+sLineBreak+
'varmain:'+sLineBreak+
'mov eax,[Pmain]'+sLineBreak+
'ret';
RegisterFunction('','main');
RegisterFunction('','varmain');
Register('','Pmain',TypeInfo(integer));
end;
Module:=Src.Compilate;
Func1:=Module.Funtion['main'];
Func2:=Module.Funtion['varmain'];

View File

@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<test-results name="W:\RuntimeBuilder\Tests\Win64\Debug\Project2.exe" total="2" errors="2" failures="0" ignored="0" inconclusive="0" not-run="0" skipped="0" invalid="0" date="2018-06-03" time="0.107">
<culture-info current-culture="en" current-uiculture="en" />
<test-suite type="Assembly" name="Project2.exe" executed="true" result="Failure" success="False" time="0.107" asserts="0">
<results>
<test-suite type="Namespace" name="Unit1" executed="true" result="Success" success="True" time="0.107" asserts="0" >
<results>
<test-suite type="Fixture" name="TRuntimeBuilderTestObject" executed="True" result="Success" success="True" time="0.107" >
<results>
<test-case name="FasmTest." executed="True" result="Error" success="False" time="0.083" asserts="0" >
<failure>
<message>
<![CDATA[ Error in FasmTest ]]>
</message>
<stack-trace>
<![CDATA[ ]]>
</stack-trace>
</failure>
</test-case>
<test-case name="LuaTest." executed="True" result="Error" success="False" time="0.023" asserts="0" >
<failure>
<message>
<![CDATA[ Abstract Error ]]>
</message>
<stack-trace>
<![CDATA[ ]]>
</stack-trace>
</failure>
</test-case>
</results>
</test-suite>
</results>
</test-suite>
</results>
</test-suite>
</test-results>