-
Notifications
You must be signed in to change notification settings - Fork 0
/
comila.min.js
20 lines (20 loc) · 32.5 KB
/
comila.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/*!
* ComilaJS v0.3.0
* Copyright (c) 2018 Danitso
* http://www.comilajs.org/
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("comilajs",[],e):"object"==typeof exports?exports.comilajs=e():t.comilajs=e()}(window,function(){return function(t){var e={};function i(s){if(e[s])return e[s].exports;var r=e[s]={i:s,l:!1,exports:{}};return t[s].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=t,i.c=e,i.d=function(t,e,s){i.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:s})},i.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="/assets/",i(i.s=73)}([function(t,e){t.exports=new function(){"use strict";this.ASSEMBLY=32,this.ASSEMBLY_OS=34,this.ASSEMBLY_PROCESSOR=33,this.ASSEMBLY_REF=35,this.ASSEMBLY_REF_OS=37,this.ASSEMBLY_REF_PROCESSOR=36,this.CLASS_LAYOUT=15,this.CONSTANT=11,this.CUSTOM_ATTRIBUTE=12,this.DECL_SECURITY=14,this.EVENT=20,this.EVENT_MAP=18,this.EXPORTED_TYPE=39,this.FIELD=4,this.FIELD_LAYOUT=16,this.FIELD_MARSHAL=13,this.FIELD_RVA=29,this.FILE=38,this.GENERIC_PARAM=42,this.GENERIC_PARAM_CONSTRAINT=44,this.IMPL_MAP=28,this.INTERFACE_IMPL=9,this.MANIFEST_RESOURCE=40,this.MEMBER_REF=10,this.METHOD_DEF=6,this.METHOD_IMPL=25,this.METHOD_SEMANTICS=24,this.MODULE=0,this.MODULE_REF=26,this.NESTED_CLASS=41,this.PARAM=8,this.PROPERTY=23,this.PROPERTY_MAP=21,this.STAND_ALONE_SIG=17,this.TYPE_REF=1,this.TYPE_DEF=2,this.TYPE_SPEC=27}},function(t,e){t.exports=function(t,e){"use strict";this.rowIndex=-1,this.tableIndex=-1,function(t,e,i){if(0===i.length)t.rowIndex=e.readUInt(3)-1,t.tableIndex=e.readUInt(1);else{for(var s,r=1,n=2,a=e.readTables();(s=Math.pow(2,r-1))<i.length;)r++;for(var h=0;h<i.length;h++)if(a[i[h]]&&a[i[h]].length>65535){n=4;break}var o=e.readUInt(n);t.tableIndex=i[o&s-1],t.rowIndex=o>>r}}(this,t,e)}},function(t,e,i){"use strict";var s=Object.prototype.hasOwnProperty,r=Object.prototype.toString,n=function(t){return"function"==typeof Array.isArray?Array.isArray(t):"[object Array]"===r.call(t)},a=function(t){if(!t||"[object Object]"!==r.call(t))return!1;var e,i=s.call(t,"constructor"),n=t.constructor&&t.constructor.prototype&&s.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!i&&!n)return!1;for(e in t);return void 0===e||s.call(t,e)};t.exports=function t(){var e,i,s,r,h,o,d=arguments[0],c=1,u=arguments.length,_=!1;for("boolean"==typeof d&&(_=d,d=arguments[1]||{},c=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});c<u;++c)if(null!=(e=arguments[c]))for(i in e)s=d[i],d!==(r=e[i])&&(_&&r&&(a(r)||(h=n(r)))?(h?(h=!1,o=s&&n(s)?s:[]):o=s&&a(s)?s:{},d[i]=t(_,o,r)):void 0!==r&&(d[i]=r));return d}},function(t,e){t.exports=function(t,e,i){"use strict";this.code=e,this.name=i}},function(t,e,i){var s=i(10),r=i(2);t.exports=function(t){"use strict";r(!0,this,new s(t,"ParserException"))}},function(t,e){t.exports=new function(){"use strict";this.ADD=88,this.ADD_OVF=214,this.ADD_OVF_UN=215,this.ARGLIST=65024,this.AND=95,this.BEQ=59,this.BEQ_S=46,this.BGE=60,this.BGE_S=47,this.BGE_UN=65,this.BGE_UN_S=52,this.BGT=61,this.BGT_S=48,this.BGT_UN=66,this.BGT_UN_S=53,this.BLE=62,this.BLE_S=49,this.BLE_UN=67,this.BLE_UN_S=54,this.BLT=63,this.BLT_S=50,this.BLT_UN=68,this.BLT_UN_S=55,this.BNE_UN=64,this.BNE_UN_S=51,this.BOX=140,this.BR=56,this.BR_S=43,this.BREAK=1,this.BRFALSE=57,this.BRFALSE_S=44,this.BRINST=58,this.BRINST_S=45,this.BRNULL=57,this.BRNULL_S=44,this.BRTRUE=58,this.BRTRUE_S=45,this.BRZERO=57,this.BRZERO_S=44,this.CALL=40,this.CALLI=41,this.CALLVIRT=111,this.CASTCLASS=116,this.CEQ=65025,this.CGT=65026,this.CGT_UN=65027,this.CKFINITE=195,this.CLT=65028,this.CLT_UN=65029,this.CONSTRAINED=65046,this.CONV_I=211,this.CONV_I1=103,this.CONV_I2=104,this.CONV_I4=105,this.CONV_I8=106,this.CONV_OVF_I=212,this.CONV_OVF_I_UN=138,this.CONV_OVF_I1=179,this.CONV_OVF_I1_UN=130,this.CONV_OVF_I2=181,this.CONV_OVF_I2_UN=131,this.CONV_OVF_I4=183,this.CONV_OVF_I4_UN=132,this.CONV_OVF_I8=183,this.CONV_OVF_I8_UN=132,this.CONV_OVF_U=213,this.CONV_OVF_U_UN=139,this.CONV_OVF_U1=180,this.CONV_OVF_U1_UN=134,this.CONV_OVF_U2=182,this.CONV_OVF_U2_UN=135,this.CONV_OVF_U4=184,this.CONV_OVF_U4_UN=136,this.CONV_OVF_U8=186,this.CONV_OVF_U8_UN=137,this.CONV_R_UN=118,this.CONV_R4=107,this.CONV_R8=108,this.CONV_U=224,this.CONV_U1=210,this.CONV_U2=209,this.CONV_U4=109,this.CONV_U8=110,this.CPBLK=65047,this.CPOBJ=112,this.DIV=91,this.DIV_UN=92,this.DUP=37,this.ENDFAULT=220,this.ENDFILTER=65041,this.ENDFINALLY=220,this.INITBLK=65048,this.INITOBJ=65045,this.ISINST=117,this.JMP=117,this.LDARG=65033,this.LDARG_0=2,this.LDARG_1=3,this.LDARG_2=4,this.LDARG_3=5,this.LDARG_S=14,this.LDARGA=65034,this.LDARGA_S=15,this.LDC_I4=32,this.LDC_I4_0=22,this.LDC_I4_1=23,this.LDC_I4_2=24,this.LDC_I4_3=25,this.LDC_I4_4=26,this.LDC_I4_5=27,this.LDC_I4_6=28,this.LDC_I4_7=29,this.LDC_I4_8=30,this.LDC_I4_M1=21,this.LDC_I4_S=31,this.LDC_I8=33,this.LDC_R4=34,this.LDC_R8=35,this.LDELEM=163,this.LDELEM_I=151,this.LDELEM_I1=144,this.LDELEM_I2=146,this.LDELEM_I4=148,this.LDELEM_I8=150,this.LDELEM_R4=152,this.LDELEM_R8=153,this.LDELEM_REF=154,this.LDELEM_U1=145,this.LDELEM_U2=147,this.LDELEM_U4=149,this.LDELEM_U8=150,this.LDELEMA=143,this.LDFLD=123,this.LDFLDA=124,this.LDFTN=65030,this.LDIND_I=77,this.LDIND_I1=70,this.LDIND_I2=72,this.LDIND_I4=74,this.LDIND_I8=76,this.LDIND_R4=78,this.LDIND_R8=79,this.LDIND_REF=80,this.LDIND_U1=71,this.LDIND_U2=73,this.LDIND_U4=75,this.LDIND_U8=76,this.LDLEN=142,this.LDLOC=65036,this.LDLOC_0=6,this.LDLOC_1=7,this.LDLOC_1=8,this.LDLOC_1=9,this.LDLOC_S=17,this.LDLOCA=65037,this.LDLOCA_S=18,this.LDNULL=20,this.LDOBJ=113,this.LDSFLD=126,this.LDSFLDA=127,this.LDSTR=114,this.LDTOKEN=208,this.LDVIRTFTN=65031,this.LEAVE=221,this.LEAVE_S=222,this.LOCALLOC=65039,this.MKREFANY=198,this.MUL=90,this.MUL_OVF=216,this.MUL_OVF_UN=217,this.NEG=101,this.NEWARR=141,this.NEWOBJ=115,this.NO_TYPE_RANGE_NULL_CHECK=65049,this.NOP=0,this.NOT=102,this.OR=96,this.POP=38,this.READONLY=65054,this.REFANYTYPE=65053,this.REFANYVAL=194,this.REM=93,this.REM_UN=94,this.RET=42,this.RETHROW=65050,this.SHL=98,this.SHR=99,this.SHR_UN=100,this.SIZEOF=65052,this.STARG=65035,this.STARG_S=16,this.STELEM=164,this.STELEM_I=155,this.STELEM_I1=156,this.STELEM_I2=157,this.STELEM_I4=158,this.STELEM_I8=159,this.STELEM_R4=160,this.STELEM_R8=161,this.STELEM_REF=162,this.STFLD=125,this.STIND_I=223,this.STIND_I1=82,this.STIND_I2=83,this.STIND_I4=84,this.STIND_I8=85,this.STIND_R4=86,this.STIND_R8=87,this.STIND_REF=81,this.STLOC=65038,this.STLOC_0=10,this.STLOC_1=11,this.STLOC_2=12,this.STLOC_3=13,this.STLOC_S=19,this.STOBJ=129,this.STSFLD=128,this.SUB=89,this.SUB_OVF=218,this.SUB_OVF_UN=219,this.SWITCH=69,this.TAIL=65044,this.THROW=122,this.UNALIGNED=65042,this.UNBOX=121,this.UNBOX_ANY=165,this.VOLATILE=65043,this.XOR=97}},function(t,e,i){var s=i(10),r=i(2);t.exports=function(t){"use strict";r(!0,this,new s(t,"NotImplementedException"))}},function(t,e,i){t.exports=function(t){"use strict";this.characteristics=t.readUInt(4),this.timeDateStamp=t.readUInt(4),this.majorVersion=t.readUInt(2),this.minorVersion=t.readUInt(2),this.numberOfNamedEntries=t.readUInt(2),this.numberOfIdEntries=t.readUInt(2),this.entries=new Array(this.numberOfIdEntries+this.numberOfNamedEntries);for(var e=t.getPosition(),i=0;i<this.entries.length;i++)t.setPosition(e+8*i),this.entries[i]=new s(t)};var s=i(23)},function(t,e){t.exports=new function(){"use strict";this.IMAGE_DOS_SIGNATURE=23117,this.IMAGE_NT_OPTIONAL_HDR64_MAGIC=523,this.IMAGE_NT_OPTIONAL_HDR32_MAGIC=267,this.IMAGE_NT_SIGNATURE=17744,this.IMAGE_ROM_OPTIONAL_HDR_MAGIC=263}},function(t,e,i){var s=i(2),r=i(3),n=i(1);t.exports=function(t,e,i){"use strict";s(!0,this,new r(t,e,i)),this.token=new n(t,[])}},function(t,e){t.exports=function(t,e){"use strict";this._message=t,this._type=void 0!==e?e:"CustomException",this.getMessage=function(){return this._message},this.getType=function(){return this._type},this.toString=function(){return this.getMessage()}}},function(t,e){t.exports=function(t){"use strict";this.virtualAddress=t.readUInt(4),this.size=t.readUInt(4)}},function(t,e,i){var s=i(6);t.exports=function(t){"use strict";this._blob={},this._guid={},this._strings={},this._tables={},this._unicodeStrings={},this.run=function(){throw new s("The run() function has not been implemented")}}},function(t,e,i){i(12);var s=i(6);t.exports=function(t){"use strict";this.compile=function(){throw console.log(t.readDOSHeader()),console.log(t.readCOFFHeader()),console.log(t.readOptionalHeader()),console.log(t.readSectionHeaders()),console.log(t.readResourceDirectory()),console.log(t.readCORHeader()),console.log(t.readMetadataHeader()),console.log(t.readTablesHeader()),console.log(t.readTables()),console.log(t.readMethodBodies()),new s("The compile() function has not been fully implemented")}}},function(t,e){t.exports=function(t){"use strict";this.signature=t.readBlobIndex()}},function(t,e,i){var s=i(1),r=i(0);t.exports=function(t){"use strict";this.resolutionScope=new s(t,[r.MODULE,r.MODULE_REF,r.ASSEMBLY_REF,r.TYPE_REF]),this.typeName=t.readStringIndex(),this.typeNamespace=t.readStringIndex()}},function(t,e,i){var s=i(1),r=i(0);t.exports=function(t){"use strict";this.flags=t.readUInt(4),this.typeName=t.readStringIndex(),this.typeNamespace=t.readStringIndex(),this.extends=new s(t,[r.TYPE_DEF,r.TYPE_REF,r.TYPE_SPEC]),this.fieldList=new s(t,[r.FIELD]),this.methodList=new s(t,[r.METHOD_DEF])}},function(t,e){t.exports=function(t){"use strict";var e,i;this.reserved1=t.readUInt(4),this.majorVersion=t.readUInt(1),this.minorVersion=t.readUInt(1),this.heapOffsetSizes=t.readUInt(1),this.reserved2=t.readUInt(1),this.maskValidArray=[e=t.readUInt(4),i=t.readUInt(4)],this.maskValid=i<<32|e,this.maskSortedArray=[e=t.readUInt(4),i=t.readUInt(4)],this.maskSorted=i<<32|e,this.tablesOffset=t.getPosition()}},function(t,e){t.exports=function(t){"use strict";this.signature=t.readBlobIndex()}},function(t,e){t.exports=function(t){"use strict";this.flags=t.readUInt(2),this.name=t.readStringIndex(),this.type=t.readBlobIndex()}},function(t,e,i){var s=i(1),r=i(0);t.exports=function(t){"use strict";this.parent=new s(t,[r.TYPE_DEF]),this.propertyList=new s(t,[r.PROPERTY])}},function(t,e){t.exports=function(t){"use strict";this.name=t.readUTF8String(8,!0),this.misc=t.readUInt(4),this.virtualAddress=t.readUInt(4),this.sizeOfRawData=t.readUInt(4),this.pointerToRawData=t.readUInt(4),this.pointerToRelocations=t.readUInt(4),this.pointerToLinenumbers=t.readUInt(4),this.numberOfRelocations=t.readUInt(2),this.numberOfLinenumbers=t.readUInt(2),this.characteristics=t.readUInt(4)}},function(t,e){t.exports=function(t){"use strict";this.offsetToData=t.getFileOffset(t.readUInt(4)),this.size=t.readUInt(4),this.codePage=t.readUInt(4),this.reserved=t.readUInt(4)}},function(t,e,i){var s=i(22),r=i(7);t.exports=function(t){"use strict";this.name=t.readUInt(4),this.offsetToData=t.readUInt(4),this.data=null,this.directory=null,this.offsetToData>>>31==1?(this.offsetToData=t.getResourceDirectoryFileOffset()+(this.offsetToData<<1>>>1),t.setPosition(this.offsetToData),this.directory=new r(t)):(this.offsetToData=t.getResourceDirectoryFileOffset()+this.offsetToData,t.setPosition(this.offsetToData),this.data=new s(t))}},function(t,e,i){var s=i(11),r=i(8);t.exports=function(t){"use strict";this.magic=t.readUInt(2),this.majorLinkerVersion=t.readUInt(1),this.minorLinkerVersion=t.readUInt(1),this.sizeOfCode=t.readUInt(4),this.sizeOfInitializedData=t.readUInt(4),this.sizeOfUninitializedData=t.readUInt(4),this.addressOfEntryPoint=t.readUInt(4),this.baseOfCode=t.readUInt(4),this.baseOfData=t.readUInt(this.magic===r.IMAGE_NT_OPTIONAL_HDR64_MAGIC?0:4),this.imageBase=t.readUInt(this.magic===r.IMAGE_NT_OPTIONAL_HDR64_MAGIC?8:4),this.sectionAlignment=t.readUInt(4),this.fileAlignment=t.readUInt(4),this.majorOperatingSystemVersion=t.readUInt(2),this.minorOperatingSystemVersion=t.readUInt(2),this.majorImageVersion=t.readUInt(2),this.minorImageVersion=t.readUInt(2),this.majorSubsystemVersion=t.readUInt(2),this.minorSubsystemVersion=t.readUInt(2),this.win32VersionValue=t.readUInt(4),this.sizeOfImage=t.readUInt(4),this.sizeOfHeaders=t.readUInt(4),this.checkSum=t.readUInt(4),this.subsystem=t.readUInt(2),this.dllCharacteristics=t.readUInt(2),this.sizeOfStackReserve=t.readUInt(this.magic===r.IMAGE_NT_OPTIONAL_HDR64_MAGIC?8:4),this.sizeOfStackCommit=t.readUInt(this.magic===r.IMAGE_NT_OPTIONAL_HDR64_MAGIC?8:4),this.sizeOfHeapReserve=t.readUInt(this.magic===r.IMAGE_NT_OPTIONAL_HDR64_MAGIC?8:4),this.sizeOfHeapCommit=t.readUInt(this.magic===r.IMAGE_NT_OPTIONAL_HDR64_MAGIC?8:4),this.loaderFlags=t.readUInt(4),this.numberOfRvaAndSizes=t.readUInt(4),this.dataDirectory=new Array(this.numberOfRvaAndSizes);for(var e=0;e<this.dataDirectory.length;e++)this.dataDirectory[e]=new s(t)}},function(t,e){t.exports=function(t){"use strict";this.magic=t.readUInt(2),this.cblp=t.readUInt(2),this.cp=t.readUInt(2),this.crlc=t.readUInt(2),this.cparhdr=t.readUInt(2),this.minAlloc=t.readUInt(2),this.maxAlloc=t.readUInt(2),this.ss=t.readUInt(2),this.sp=t.readUInt(2),this.csum=t.readUInt(2),this.ip=t.readUInt(2),this.cs=t.readUInt(2),this.lfarlc=t.readUInt(2),this.ovno=t.readUInt(2),this.res1=t.readUIntArray(2,4),this.oemid=t.readUInt(2),this.oeminfo=t.readUInt(2),this.res2=t.readUIntArray(2,10),this.lfanew=t.readUInt(4)}},function(t,e){t.exports=function(t){"use strict";this.signature=t.readUInt(4),this.machine=t.readUInt(2),this.numberOfSections=t.readUInt(2),this.timeDateStamp=t.readUInt(4),this.pointerToSymbolTable=t.readUInt(4),this.numberOfSymbols=t.readUInt(4),this.sizeOfOptionalHeader=t.readUInt(2),this.characteristics=t.readUInt(2)}},function(t,e,i){i(4);t.exports=function(t,e){"use strict";this._data=void 0!==e?new Uint8Array(e):null,this._path=t,this._position=0,this.getPath=function(){return this._path},this.getPosition=function(){return this._position},this.getSize=function(){return this._data.byteLength},this.loadFile=function(t,e){var i,s=new XMLHttpRequest;return s.open("GET",this.getPath(),!0),s.responseType="arraybuffer",s.onreadystatechange=(i=this,function(){s.readyState===XMLHttpRequest.DONE&&(200===s.status?(i._data=new Uint8Array(s.response),i._position=0,t(i)):e(i,s.status))}),s.send(null),this},this.readBytes=function(t){for(var e=[],i=0;i<t&&!(this._position>=this.getSize());i++)e.push(this._data[this._position++]);return e},this.readString=function(t,e,i){for(var s,r="";null!==(s=this.readUInt(1));)if(r+=String.fromCharCode(s),t>0){if(r.length===t)break}else if((!i||r.length%i==0)&&r.endsWith(String.fromCharCode(0)))break;return e&&(s=r.indexOf(String.fromCharCode(0)))>-1&&(r=r.substring(0,s)),r},this.readUInt=function(t){var e=this.readBytes(t),i=0;if(e.length!=t)return null;for(var s=t-1;s>-1;s--)i|=e[s]<<8*s;return i},this.readUIntArray=function(t,e){for(var i=[],s=0;s<e;s++){var r=this.readUInt(t);if(null===r)break;i.push(r)}return i},this.readUTF8String=function(t,e){for(var i,s="";null!==(i=this.readUInt(1));)if(s+=String.fromCharCode(i),t>0){if(s.length===t)break}else if(s.endsWith(String.fromCharCode(0,0)))break;return e&&(i=s.indexOf(String.fromCharCode(0,0)))>-1&&(s=s.substring(0,i)),decodeURI(encodeURIComponent(s))},this.setPath=function(t){return this._path=t,this},this.setPosition=function(t){return this._position=t,this}}},function(t,e,i){var s=i(27),r=i(26),n=i(25),a=i(2),h=i(8),o=i(4),d=i(24),c=i(7),u=i(21);t.exports=function(t,e){"use strict";a(!0,this,new s(t,e)),this._coffHeader=null,this._dosHeader=null,this._optionalHeader=null,this._resourceDirectory=null,this._resourceDirectoryFileOffset=null,this._sectionHeaders=null,this.getFileOffset=function(t){for(var e=this.readSectionHeaders(),i=0;i<e.length;i++)if(t>=e[i].virtualAddress&&t<=e[i].virtualAddress+e[i].sizeOfRawData)return e[i].pointerToRawData+(t-e[i].virtualAddress);return-1},this.getResourceDirectoryFileOffset=function(){if(!this._resourceDirectoryFileOffset){for(var t=this.readSectionHeaders(),e=null,i=0;i<t.length;i++)if(".rsrc"===t[i].name){e=t[i];break}this._resourceDirectoryFileOffset=e?e.pointerToRawData:-1}return this._resourceDirectoryFileOffset},this.readCOFFHeader=function(){if(!this._coffHeader&&(this.setPosition(this.readDOSHeader().lfanew),this._coffHeader=new r(this),this._coffHeader.signature!==h.IMAGE_NT_SIGNATURE))throw new o("Invalid COFF header");return this._coffHeader},this.readDOSHeader=function(){if(!this._dosHeader&&(this.setPosition(0),this._dosHeader=new n(this),this._dosHeader.magic!==h.IMAGE_DOS_SIGNATURE))throw new o("Invalid DOS header");return this._dosHeader},this.readOptionalHeader=function(){if(!this._optionalHeader&&this.readCOFFHeader().sizeOfOptionalHeader>0&&(this.setPosition(this.readDOSHeader().lfanew+24),this._optionalHeader=new d(this),this._optionalHeader.magic!==h.IMAGE_NT_OPTIONAL_HDR64_MAGIC&&this._optionalHeader.magic!==h.IMAGE_NT_OPTIONAL_HDR32_MAGIC&&this._optionalHeader.magic!==h.IMAGE_ROM_OPTIONAL_HDR_MAGIC))throw new o("Invalid optional header");return this._optionalHeader},this.readResourceDirectory=function(){return this.getResourceDirectoryFileOffset()<1?this._resourceDirectory:(this.setPosition(this.getResourceDirectoryFileOffset()),this._resourceDirectory=new c(this),this._resourceDirectory)},this.readSectionHeaders=function(){if(!this._sectionHeaders){this.setPosition(this.readDOSHeader().lfanew+24+this.readCOFFHeader().sizeOfOptionalHeader),this._sectionHeaders=new Array(this.readCOFFHeader().numberOfSections);for(var t=0;t<this._sectionHeaders.length;t++)this._sectionHeaders[t]=new u(this)}return this._sectionHeaders}}},function(t,e){t.exports=function(t){"use strict";this.flags=t.readUInt(2),this.sequence=t.readUInt(2),this.name=t.readStringIndex()}},function(t,e){t.exports=function(t){"use strict";this.generation=t.readUInt(2),this.name=t.readStringIndex(),this.mvid=t.readGUIDIndex(),this.encId=t.readGUIDIndex(),this.encBaseId=t.readGUIDIndex()}},function(t,e){t.exports=function(t){"use strict";this.name=t.readStringIndex()}},function(t,e,i){var s=i(1),r=i(0);t.exports=function(t){"use strict";this.semantics=t.readUInt(2),this.method=new s(t,[r.METHOD_DEF]),this.association=new s(t,[r.EVENT,r.PROPERTY])}},function(t,e,i){var s=i(1),r=i(0);t.exports=function(t){"use strict";this.class=new s(t,[r.TYPE_DEF]),this.methodBody=new s(t,[r.METHOD_DEF,r.MEMBER_REF]),this.methodDeclaration=new s(t,[r.METHOD_DEF,r.MEMBER_REF])}},function(t,e,i){var s=i(2),r=i(3);t.exports=function(t,e,i){"use strict";s(!0,this,new r(t,e,i))}},function(t,e,i){var s=i(2),r=i(3);t.exports=function(t,e,i){"use strict";s(!0,this,new r(t,e,i))}},function(t,e,i){var s=i(2),r=i(9);t.exports=function(t,e,i){"use strict";s(!0,this,new r(t,e,i))}},function(t,e,i){var s=i(2),r=i(3),n=i(5);t.exports=function(t,e,i){"use strict";s(!0,this,new r(t,e,i)),this.index=e>=n.LDARG_0&&e<=n.LDARG_3?e-n.LDARG_0:e===n.LDARG?t.readUInt(2):e===n.LDARG_S?t.readUInt(1):-1}},function(t,e,i){var s=i(2),r=i(9);t.exports=function(t,e,i){"use strict";s(!0,this,new r(t,e,i))}},function(t,e,i){var s=i(38),r=i(37),n=i(36),a=(i(3),i(35)),h=i(5),o=i(4),d=i(34);t.exports=new function(){"use strict";this._classes=[],this.parse=function(t,e,i){if(!this._classes[e])throw new o("Unsupported IL operation '"+i+"' (0x"+e.toString(16).toUpperCase()+")");return new this._classes[e](t,e,i)},this.register=function(t,e){this._classes[t]=e},this.register(h.CALL,s),this.register(h.LDARG,r),this.register(h.LDARG_0,r),this.register(h.LDARG_1,r),this.register(h.LDARG_2,r),this.register(h.LDARG_3,r),this.register(h.LDARG_S,r),this.register(h.LDSTR,n),this.register(h.NOP,a),this.register(h.RET,d)}},function(t,e){t.exports=new function(){"use strict";this.FAT_FORMAT=3,this.INITIALIZE_LOCALS=16,this.MORE_SECTIONS=8,this.TINY_FORMAT=2}},function(t,e,i){var s=i(40);t.exports=function(t){"use strict";var e=t.readUInt(1),i=!0;0==(e&s.TINY_FORMAT)&&(t.setPosition(t.getPosition()-1),e=t.readUInt(2),i=!1),this.flags=i?3&e:4095&e,this.headerSize=i?1:e>>12,this.maxStack=i?8:t.readUInt(2),this.operationsSize=i?e>>2:t.readUInt(4),this.localVarSigTok=i?0:t.readUInt(4),this.operationsOffset=t.getPosition()}},function(t,e,i){var s=i(41),r=(i(3),i(39)),n=i(5),a=i(4);t.exports=function(t){"use strict";for(this.header=new s(t),this.operations=[];t.getPosition()<this.header.operationsOffset+this.header.operationsSize;){var e=null,i=t.readUInt(1);for(var h in 254===i&&(t.setPosition(t.getPosition()-1),i=t.readUInt(2)),n)n.hasOwnProperty(h)&&n[h]===i&&(e=h.toLowerCase().replace("_","."));if(!e)throw new a("Invalid IL operation 0x"+i.toString(16).toUpperCase());this.operations.push(r.parse(t,i,e))}}},function(t,e,i){var s=i(1),r=i(0);t.exports=function(t){"use strict";this.rva=t.readUInt(4),this.implFlags=t.readUInt(2),this.flags=t.readUInt(2),this.name=t.readStringIndex(),this.signature=t.readBlobIndex(),this.paramList=new s(t,[r.PARAM])}},function(t,e,i){var s=i(1),r=i(0);t.exports=function(t){"use strict";this.nestedClass=new s(t,[r.TYPE_DEF]),this.enclosingClass=new s(t,[r.TYPE_DEF])}},function(t,e,i){var s=i(1),r=i(0);t.exports=function(t){"use strict";this.class=new s(t,[r.TYPE_DEF,r.TYPE_REF,r.MODULE_REF,r.METHOD_DEF,r.TYPE_SPEC]),this.name=t.readStringIndex(),this.signature=t.readBlobIndex()}},function(t,e){t.exports=function(t){"use strict";this.offset=t.readUInt(4),this.size=t.readUInt(4),this.name=t.readString(0,!0,4)}},function(t,e,i){var s=i(46);t.exports=function(t){"use strict";var e;for(this.offset=t.getPosition(),this.signature=t.readUInt(4),this.majorVersion=t.readUInt(2),this.minorVersion=t.readUInt(2),this.reserved=t.readUInt(4),this.versionLength=e=(e=t.readUInt(4))+e%4,this.version=t.readUTF8String(e,!0),this.flags=t.readUInt(2),this.streams=t.readUInt(2),this.streamHeaders=new Array(this.streams),e=0;e<this.streamHeaders.length;e++)this.streamHeaders[e]=new s(t)}},function(t,e,i){var s=i(1),r=i(0);t.exports=function(t){"use strict";this.offset=t.readUInt(4),this.flags=t.readUInt(4),this.name=t.readStringIndex(),this.implementation=new s(t,[r.FILE,r.ASSEMBLY_REF,r.EXPORTED_TYPE])}},function(t,e,i){var s=i(1),r=i(0);t.exports=function(t){"use strict";this.class=new s(t,[r.TYPE_DEF]),this.interface=new s(t,[r.TYPE_DEF,r.TYPE_REF,r.TYPE_SPEC])}},function(t,e,i){var s=i(1),r=i(0);t.exports=function(t){"use strict";this.mappingFlags=t.readUInt(2),this.memberForwarded=new s(t,[r.FIELD,r.METHOD_DEF]),this.importName=t.readStringIndex(),this.importScope=new s(t,[r.MODULE])}},function(t,e,i){var s=i(1),r=i(0);t.exports=function(t){"use strict";this.owner=new s(t,[r.GENERIC_PARAM]),this.constraint=new s(t,[r.TYPE_DEF,r.TYPE_REF,r.TYPE_SPEC])}},function(t,e,i){var s=i(1),r=i(0);t.exports=function(t){"use strict";this.number=t.readUInt(2),this.flags=t.readUInt(2),this.owner=new s(t,[r.TYPE_DEF,r.METHOD_DEF]),this.name=t.readStringIndex()}},function(t,e){t.exports=function(t){"use strict";this.flags=t.readUInt(4),this.name=t.readStringIndex(),this.hashValue=t.readBlobIndex()}},function(t,e,i){var s=i(1),r=i(0);t.exports=function(t){"use strict";this.parent=new s(t,[r.FIELD,r.PARAM]),this.nativeType=t.readBlobIndex()}},function(t,e,i){var s=i(1),r=i(0);t.exports=function(t){"use strict";this.offset=t.readUInt(4),this.field=new s(t,[r.FIELD])}},function(t,e,i){var s=i(1),r=i(0);t.exports=function(t){"use strict";this.rva=t.readUInt(4),this.field=new s(t,[r.FIELD])}},function(t,e){t.exports=function(t){"use strict";this.type=t.readUInt(2),this.name=t.readStringIndex(),this.signature=t.readBlobIndex()}},function(t,e,i){var s=i(1),r=i(0);t.exports=function(t){"use strict";this.flags=t.readUInt(4),this.typeDefId=t.readUInt(4),this.typeName=t.readStringIndex(),this.typeNamespace=t.readStringIndex(),this.implementation=new s(t,[r.FILE,r.EXPORTED_TYPE])}},function(t,e,i){var s=i(1),r=i(0);t.exports=function(t){"use strict";this.eventFlags=t.readUInt(2),this.name=t.readStringIndex(),this.eventType=new s(t,[r.TYPE_DEF,r.TYPE_REF,r.TYPE_SPEC])}},function(t,e,i){var s=i(1),r=i(0);t.exports=function(t){"use strict";this.parent=new s(t,[r.TYPE_DEF]),this.eventList=new s(t,[r.EVENT])}},function(t,e,i){var s=i(1),r=i(0);t.exports=function(t){"use strict";this.action=t.readUInt(2),this.parent=new s(t,[r.TYPE_DEF,r.METHOD_DEF,r.ASSEMBLY]),this.permissionSet=t.readBlobIndex()}},function(t,e,i){var s=i(1),r=i(0);t.exports=function(t){"use strict";this.parent=new s(t,[r.METHOD_DEF,r.FIELD,r.TYPE_REF,r.TYPE_DEF,r.PARAM,r.INTERFACE_IMPL,r.MEMBER_REF,r.MODULE,-1,r.PROPERTY,r.EVENT,r.STAND_ALONE_SIG,r.MODULE_REF,r.TYPE_SPEC,r.ASSEMBLY,r.ASSEMBLY_REF,r.FILE,r.EXPORTED_TYPE,r.MANIFEST_RESOURCE]),this.type=new s(t,[-1,-1,r.METHOD_DEF,r.MEMBER_REF,-1]),this.value=t.readBlobIndex()}},function(t,e,i){var s=i(11);t.exports=function(t){"use strict";this.sizeOfHeader=t.readUInt(4),this.majorRuntimeVersion=t.readUInt(2),this.minorRuntimeVersion=t.readUInt(2),this.metadata=new s(t),this.flags=t.readUInt(4),this.entryPoint=t.readUInt(4),this.resources=new s(t),this.strongNameSignature=new s(t),this.codeManagerTable=new s(t),this.vTableFixups=new s(t),this.exportAddressTableJumps=new s(t),this.managedNativeHeader=new s(t)}},function(t,e,i){var s=i(1),r=i(0);t.exports=function(t){"use strict";this.type=t.readUInt(1)+t.readUInt(1),this.parent=new s(t,[r.FIELD,r.PARAM,r.PROPERTY]),this.value=t.readBlobIndex()}},function(t,e,i){var s=i(1),r=i(0);t.exports=function(t){"use strict";this.packingSize=t.readUInt(2),this.classSize=t.readUInt(4),this.parent=new s(t,[r.TYPE_DEF])}},function(t,e){t.exports=function(t){"use strict";this.hashAlgId=t.readUInt(4),this.majorVersion=t.readUInt(2),this.minorVersion=t.readUInt(2),this.buildNumber=t.readUInt(2),this.revisionNumber=t.readUInt(2),this.flags=t.readUInt(4),this.publicKey=t.readBlobIndex(),this.name=t.readStringIndex(),this.culture=t.readStringIndex()}},function(t,e){t.exports=function(t){"use strict";this.majorVersion=t.readUInt(2),this.minorVersion=t.readUInt(2),this.buildNumber=t.readUInt(2),this.revisionNumber=t.readUInt(2),this.flags=t.readUInt(4),this.publicKeyOrToken=t.readBlobIndex(),this.name=t.readStringIndex(),this.culture=t.readStringIndex(),this.hashValue=t.readBlobIndex()}},function(t,e,i){var s=i(1),r=i(0);t.exports=function(t){"use strict";this.processor=t.readUInt(4),this.assemblyRef=new s(t,[r.ASSEMBLY_REF])}},function(t,e,i){var s=i(1),r=i(0);t.exports=function(t){"use strict";this.osPlatformID=t.readUInt(4),this.osMajorVersion=t.readUInt(4),this.osMinorVersion=t.readUInt(4),this.assemblyRef=new s(t,[r.ASSEMBLY_REF])}},function(t,e){t.exports=function(t){"use strict";this.processor=t.readUInt(4)}},function(t,e){t.exports=function(t){"use strict";this.osPlatformID=t.readUInt(4),this.osMajorVersion=t.readUInt(4),this.osMinorVersion=t.readUInt(4)}},function(t,e,i){var s=i(71),r=i(70),n=i(69),a=i(68),h=i(67),o=i(66),d=i(65),c=i(64),u=i(63),_=i(62),f=i(61),I=i(60),E=i(59),l=i(58),O=i(2),U=i(57),D=i(56),L=i(55),S=i(54),T=i(53),p=i(52),R=i(51),A=i(50),m=i(49),g=i(4),N=i(48),F=i(47),M=i(45),C=i(44),P=i(43),w=i(42),x=i(33),H=i(32),v=i(31),b=i(30),V=i(29),y=i(28),B=i(20),G=i(19),Y=i(18),z=i(0),j=i(17),k=i(16),X=i(15),K=i(14);t.exports=function(t,e){"use strict";O(!0,this,new y(t,e)),this._corHeader=null,this._metadataHeader=null,this._methodBodies=null,this._tables=null,this._tablesHeader=null,this.getStreamHeader=function(t){for(var e=this.readMetadataHeader().streamHeaders,i=0;i<e.length;i++)if(e[i].name===t)return e[i];return null},this.readBlobIndex=function(){return 0!=(4&this.readTablesHeader().heapOffsetSizes)?this.readUInt(4):this.readUInt(2)},this.readCORHeader=function(){if(!this._corHeader){if(this.readOptionalHeader().dataDirectory.length<15||this.readOptionalHeader().dataDirectory[14].size<1)throw new g("The CLR data directory is missing");if(this.setPosition(this.getFileOffset(this.readOptionalHeader().dataDirectory[14].virtualAddress)),this._corHeader=new u(this),72!==this._corHeader.sizeOfHeader)throw new g("Invalid COR header (size: "+this._corHeader.sizeOfHeader+" - expected: 72)")}return this._corHeader},this.readGUIDFromHeap=function(t){var e=this.getStreamHeader("#GUID");if(!e)throw new g("The #GUID stream is missing");this.setPosition(this.readMetadataHeader().offset+e.offset+t);for(var i="",s=this.readString(16),r=0;r<s.length;r++){4!==r&&6!==r&&8!==r&&10!==r||(i+="-");var n=s.charCodeAt(r).toString(16);i+=2===n.length?n:"0"+n}return i},this.readGUIDIndex=function(){return 0!=(2&this.readTablesHeader().heapOffsetSizes)?this.readUInt(4):this.readUInt(2)},this.readMetadataHeader=function(){if(!this._metadataHeader){if(this.readCORHeader().metadata.size<1)throw new g("The metadata header is missing");if(this.setPosition(this.getFileOffset(this.readCORHeader().metadata.virtualAddress)),this._metadataHeader=new F(this),1112167234!==this._metadataHeader.signature)throw new g("Invalid metadata header (signature: 0x"+this._metadataHeader.signature.toString(16).toUpperCase()+" - expected: 0x424A5342)")}return this._metadataHeader},this.readMethodBodies=function(){if(!this._methodBodies){var t=this.readTables();this._methodBodies=new Array(t[z.METHOD_DEF].length);for(var e=0;e<t[z.METHOD_DEF].length;e++)this.setPosition(this.getFileOffset(t[z.METHOD_DEF][e].rva)),this._methodBodies[e]=new w(this)}return this._methodBodies},this.readMethodInstructions=function(t){return this.setPosition(t.codeOffset),this.readBytes(t.codeSize)},this.readStringFromHeap=function(t){var e=this.getStreamHeader("#Strings");if(!e)throw new g("The #Strings stream is missing");return this.setPosition(this.readMetadataHeader().offset+e.offset+t),decodeURIComponent(encodeURIComponent(this.readString(0,!0)))},this.readStringIndex=function(){return 0!=(1&this.readTablesHeader().heapOffsetSizes)?this.readUInt(4):this.readUInt(2)},this.readTables=function(){if(!this._tables){var t=this.readTablesHeader();this.setPosition(t.tablesOffset),this._tables=[];for(var e=0;e<64;e++)e<32&&0==(t.maskValidArray[0]&Math.pow(2,e))||e>=32&&0==(t.maskValidArray[1]&Math.pow(2,e-32))||(this._tables[e]=new Array(this.readUInt(4)));for(e=0;e<64;e++)if(this._tables[e])for(var i=this._getTableRowClass(e),s=this._tables[e].length,r=0;r<s;r++)this._tables[e][r]=new i(this)}return this._tables},this.readTablesHeader=function(){if(!this._tablesHeader){var t=this.getStreamHeader("#~");if(!t)throw new g("The #~ stream is missing");if(this.setPosition(this.readMetadataHeader().offset+t.offset),this._tablesHeader=new j(this),2!==this._tablesHeader.majorVersion||0!==this._tablesHeader.minorVersion)throw new g("Invalid tables header (version: "+this._tablesHeader.majorVersion+"."+this._tablesHeader.minorVersion+" - expected: 2.0)")}return this._tablesHeader},this._getTableRowClass=function(t){switch(t){case z.ASSEMBLY:return o;case z.ASSEMBLY_OS:return s;case z.ASSEMBLY_PROCESSOR:return r;case z.ASSEMBLY_REF:return h;case z.ASSEMBLY_REF_OS:return n;case z.ASSEMBLY_REF_PROCESSOR:return a;case z.CLASS_LAYOUT:return d;case z.CONSTANT:return c;case z.CUSTOM_ATTRIBUTE:return _;case z.DECL_SECURITY:return f;case z.EVENT:return E;case z.EVENT_MAP:return I;case z.EXPORTED_TYPE:return l;case z.FIELD:return U;case z.FIELD_LAYOUT:return L;case z.FIELD_MARSHAL:return S;case z.FIELD_RVA:return D;case z.FILE:return T;case z.GENERIC_PARAM:return p;case z.GENERIC_PARAM_CONSTRAINT:return R;case z.IMPL_MAP:return A;case z.INTERFACE_IMPL:return m;case z.MANIFEST_RESOURCE:return N;case z.MEMBER_REF:return M;case z.NESTED_CLASS:return C;case z.METHOD_DEF:return P;case z.METHOD_IMPL:return x;case z.METHOD_SEMANTICS:return H;case z.MODULE:return b;case z.MODULE_REF:return v;case z.PARAM:return V;case z.PROPERTY:return G;case z.PROPERTY_MAP:return B;case z.STAND_ALONE_SIG:return Y;case z.TYPE_DEF:return k;case z.TYPE_REF:return X;case z.TYPE_SPEC:return K;default:throw new g("Unsupported metadata table at index "+t)}}}},function(t,e,i){var s=i(72),r=i(13);t.exports=new function(){"use strict";this.run=function(t){return console.info("Downloading application '"+t+"'"),new s(t).loadFile(function(t){var e;console.info("Compiling application '"+t.getPath()+"'");try{e=new r(t).compile()}catch(e){return void console.error("Failed to compile application '"+t.getPath()+"': "+e.getMessage())}console.info("Running application '"+t.getPath()+"'");try{e.run()}catch(e){console.error("Failed to run application '"+t.getPath()+"': "+e.getMessage())}},function(t,e){console.error("Failed to download application '"+t.getPath()+"' (HTTP "+e+")")}),this}}}])});
//# sourceMappingURL=comila.min.js.map