Created
June 19, 2012 03:03
-
-
Save DinisCruz/2952069 to your computer and use it in GitHub Desktop.
O2 Script used to create the 'Script the Script' PoC
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var _script = (script as object).castViaTypeConfusion<ascx_Simple_Script_Editor>(); | |
| _script.execute(); | |
| return _script.Code; | |
| //O2Tag_SetInvocationParametersToDynamic | |
| //O2Tag_DontUseCachedAssemblyIfAvailable | |
| //O2Tag_DontAddExtraO2Files | |
| //O2File:ascx_Simple_Script_Editor.cs.o2 | |
| //O2File:_Extra_methods_TypeConfusion.cs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //var topPanel = panel.clear().add_Panel(); | |
| var topPanel = "PoC - Script the Script".popupWindow(1200,400); | |
| var script = topPanel.insert_Left("Script to Script").add_Script(false); | |
| script.Code = "return 42;"; | |
| var scriptHost = topPanel.title("original Script").add_Script(false); | |
| scriptHost.onCompileExecuteOnce(); | |
| scriptHost.InvocationParameters.add("script", script); | |
| var code = @" | |
| var _script = (script as object).castViaTypeConfusion<ascx_Simple_Script_Editor>(); | |
| _script.execute(); | |
| return _script.Code; | |
| //O2Tag_SetInvocationParameters"+@"ToDynamic | |
| //O2Tag_DontUseCachedAssemblyIfAvailable | |
| //O2Tag_DontAddExtraO2Files | |
| //O2File:ascx_Simple_Script_Editor.cs.o2 | |
| //O2File:_Extra_methods_TypeConfusion.cs | |
| ".trim(); | |
| scriptHost.set_Script(code); | |
| //O2File:Scripts_ExtensionMethods.cs | |
| //O2Tag_DontAddExtraO2Files |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment