@reversense/dxc-struct 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,199 @@
1
+ /*
2
+ *
3
+ * Reversense platform / dxc-struct : Reversense is an automated reverse engineering and analysis platform
4
+ * focused on security, privacy, quality, accessibility and safety assessment of software, including mobile app and firmware.
5
+ * Copyright (C) 2026 Reversense SAS
6
+ *
7
+ * This program is free software: you can redistribute it and/or modify
8
+ * it under the terms of the GNU Affero General Public License as published
9
+ * by the Free Software Foundation, either version 3 of the License, or
10
+ * (at your option) any later version.
11
+ *
12
+ * This program is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ * GNU Affero General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU Affero General Public License
18
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
+ *
20
+ */
21
+
22
+ import {Endianness} from "./common.js";
23
+ import {Operation} from "./Struct.js";
24
+
25
+
26
+ /**
27
+ * A utility class for decoding structured binary data into various data types.
28
+ * This class provides methods for byte-level transformations and conversions,
29
+ * mainly focusing on interpreting raw binary arrays as different primitive types.
30
+ */
31
+ export class StructDecoder {
32
+
33
+ // Raw byte arrays
34
+ /**
35
+ * Creates a subarray from the provided array, starting at the specified offset and including the defined number of elements.
36
+ *
37
+ * @param {any[]} pArr - The source array from which to extract elements.
38
+ * @param {number} pOffset - The starting index in the source array for extraction.
39
+ * @param {number} pLength - The number of elements to include in the subarray.
40
+ * @return {any[]} A new array containing elements extracted from the source array.
41
+ */
42
+ static byteArray(pArr:any[], pOffset:number, pLength:number):any[] {
43
+ return [pArr.slice(pOffset,pOffset+pLength)];
44
+ }
45
+
46
+
47
+ /**
48
+ * Converts the character code at the specified offset in the provided array to a character.
49
+ *
50
+ * @param {number[]} pArr - An array of numbers representing character codes.
51
+ * @param {number} pOffset - The index of the character code within the array to be converted.
52
+ * @return {string} The character corresponding to the character code at the specified offset.
53
+ */
54
+ static chr(pArr:number[], pOffset:number):string {
55
+ return String.fromCharCode(pArr[pOffset]);
56
+ }
57
+
58
+
59
+ // Read an (un)signed integers up to 32 bits.
60
+ /**
61
+ * Processes an array of bytes to extract an integer value based on endianness and operation specifications.
62
+ *
63
+ * @param {Endianness} pEndianness The endianness for reading the bytes (BIG_ENDIAN or LITTLE_ENDIAN).
64
+ * @param {Operation} pOp The operation specification that includes options like size and signedness.
65
+ * @param {any} pArr The array or buffer containing the bytes to process.
66
+ * @param {number} pOffset The starting offset in the array from where to begin processing.
67
+ * @return {number} The resulting integer value derived from the provided byte array and operation.
68
+ */
69
+ static int(pEndianness:Endianness, pOp:Operation, pArr: any, pOffset: number) : number {
70
+ let lsb:number, nsb:number;
71
+ if(pEndianness==Endianness.BIG_ENDIAN){
72
+ lsb = pOp.opts.size-1;
73
+ nsb = -1;
74
+ }else{
75
+ lsb = 0;
76
+ nsb = 1;
77
+ }
78
+
79
+ let stop = lsb+nsb*pOp.opts.size, rv, i, f;
80
+ for (rv = 0, i = lsb, f = 1; i != stop; rv+=(pArr[pOffset+i]*f), i+=nsb, f*=256);
81
+
82
+ // todo : replace by lsl
83
+ if (pOp.opts.bSigned && (rv & Math.pow(2, pOp.opts.size*8-1))) {
84
+ rv -= Math.pow(2, pOp.opts.size*8);
85
+ }
86
+ return rv;
87
+ };
88
+
89
+ // Read an (un)signed integers. This functions can support integers of more than 64 bits.
90
+ /**
91
+ * Decodes a sequence of bytes into a bigint value, with support for endianness and signed/unsigned formats.
92
+ *
93
+ * @param {Endianness} pEndianness The byte order, either LITTLE_ENDIAN or BIG_ENDIAN.
94
+ * @param {Operation} pOp An object describing the operation details (e.g., size and signed/unsigned format).
95
+ * @param {any} pArr The array or buffer containing the bytes to decode.
96
+ * @param {number} pOffset The offset in the array where decoding should begin.
97
+ * @return {bigint} The decoded bigint value.
98
+ */
99
+ static bigintDecoder(pEndianness:Endianness, pOp:Operation, pArr: any, pOffset: number) : bigint {
100
+
101
+ let lsb:number, nsb:number;
102
+ if(pEndianness==Endianness.BIG_ENDIAN){
103
+ lsb = pOp.opts.size-1;
104
+ nsb = -1;
105
+ }else{
106
+ lsb = 0;
107
+ nsb = 1;
108
+ }
109
+
110
+ let stop : number = lsb+nsb*pOp.opts.size;
111
+ let i : number;
112
+ let rv : bigint = BigInt(0);
113
+ let f : bigint = BigInt(1);
114
+ for (i = lsb; i != stop; i += nsb) {
115
+ rv += BigInt(pArr[pOffset + i]) * f;
116
+ f *= BigInt(256);
117
+ }
118
+ // Checks if it is a signed format, and if MSB is 1.
119
+ if (pOp.opts.bSigned && (rv >> BigInt(pOp.opts.size * 8 - 1)) == BigInt(1)) {
120
+ rv -= BigInt(1) << BigInt(pOp.opts.size*8);
121
+ }
122
+ return rv;
123
+ };
124
+
125
+
126
+ // ASCII character strings
127
+ /**
128
+ * Converts a segment of an array of numbers into a string, where each number is treated
129
+ * as the Unicode value of a character.
130
+ *
131
+ * @param {number[]} pArr - The array of numbers representing character Unicode values.
132
+ * @param {number} pOffset - The starting index in the array from where to begin processing.
133
+ * @param {number} pLen - The length of the segment to process from the array.
134
+ * @return {string} A string created by converting the specified segment of the number array.
135
+ */
136
+ static str(pArr:number[], pOffset:number, pLen:number):string {
137
+ let s:any[] = new Array(pLen);
138
+ for (let i = 0; i < pLen; s[i] = String.fromCharCode(pArr[pOffset+i]), i++);
139
+ return s.join('');
140
+ };
141
+
142
+
143
+ // ASCII character strings null terminated
144
+ /**
145
+ * Converts a portion of a given array into a null-terminated string, removing the trailing null character.
146
+ *
147
+ * @param {number[]} pArr - The array containing the string data.
148
+ * @param {number} pOffset - The starting index in the array to process.
149
+ * @param {number} pLen - The length of the portion of the array to process.
150
+ * @return {string} A null-terminated string extracted from the array.
151
+ */
152
+ static nullTerminatedStr(pArr:number[], pOffset:number, pLen:number) {
153
+ let str = StructDecoder.str(pArr, pOffset, pLen);
154
+ return str.substring(0, str.length - 1);
155
+ };
156
+
157
+ // Little-endian N-bit IEEE 754 floating point
158
+ /**
159
+ * Converts a floating-point number represented in IEEE 754 format based on the provided endianness and operation configuration.
160
+ *
161
+ * @param {Endianness} pEndianness The endianness of the byte array, either big-endian or little-endian.
162
+ * @param {Operation} pOp An object containing operation configuration, including size and mantissa length (mLen).
163
+ * @param {any[]} pArr The byte array containing the floating-point number in IEEE 754 format.
164
+ * @param {number} pOffset The offset within the byte array to start reading the floating-point number.
165
+ * @return {number} The resulting floating-point number in JavaScript's native format, or NaN/Infinity for special cases.
166
+ */
167
+ static ieee754_fp(pEndianness:Endianness, pOp:Operation, pArr:any[], pOffset:number):number {
168
+ let s, e, m, i, d, nBits, mLen, eLen, eBias, eMax;
169
+ mLen = pOp.opts.mLen, eLen = pOp.opts.size*8-pOp.opts.mLen-1, eMax = (1<<eLen)-1, eBias = eMax>>1;
170
+
171
+ i = (pEndianness==Endianness.BIG_ENDIAN)?0:(pOp.opts.size-1);
172
+ d = (pEndianness==Endianness.BIG_ENDIAN)?1:-1;
173
+ s = pArr[pOffset+i];
174
+ i+=d;
175
+ nBits = -7;
176
+
177
+ for (e = s&((1<<(-nBits))-1), s>>=(-nBits), nBits += eLen; nBits > 0; e=e*256+pArr[pOffset+i], i+=d, nBits-=8);
178
+ for (m = e&((1<<(-nBits))-1), e>>=(-nBits), nBits += mLen; nBits > 0; m=m*256+pArr[pOffset+i], i+=d, nBits-=8);
179
+
180
+ switch (e) {
181
+ case 0:
182
+ // Zero, or denormalized number
183
+ /**
184
+ *
185
+ */
186
+ e = 1-eBias;
187
+ break;
188
+ case eMax:
189
+ // NaN, or +/-Infinity
190
+ return m?NaN:((s?-1:1)*Infinity);
191
+ default:
192
+ // Normalized number
193
+ m = m + Math.pow(2, mLen);
194
+ e = e - eBias;
195
+ break;
196
+ }
197
+ return (s?-1:1) * m * Math.pow(2, e-mLen);
198
+ };
199
+ }
@@ -0,0 +1,185 @@
1
+ /*
2
+ *
3
+ * Reversense platform / dxc-struct : Reversense is an automated reverse engineering and analysis platform
4
+ * focused on security, privacy, quality, accessibility and safety assessment of software, including mobile app and firmware.
5
+ * Copyright (C) 2026 Reversense SAS
6
+ *
7
+ * This program is free software: you can redistribute it and/or modify
8
+ * it under the terms of the GNU Affero General Public License as published
9
+ * by the Free Software Foundation, either version 3 of the License, or
10
+ * (at your option) any later version.
11
+ *
12
+ * This program is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ * GNU Affero General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU Affero General Public License
18
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
+ *
20
+ */
21
+
22
+ import {Endianness} from "./common.js";
23
+ import {Operation} from "./Struct.js";
24
+
25
+ /**
26
+ * A utility class for encoding various data types into byte arrays, supporting operations on strings, integers, floating-point numbers,
27
+ * and big integers. This class provides methods for handling data representation with specific endianness and constraints.
28
+ */
29
+ export class StructEncoder {
30
+
31
+
32
+ /**
33
+ *
34
+ * Copy from array source `pSourceArr` to another array `pDestArr`, from offset
35
+ *
36
+ * @param {number[]} pDestArr Array where data are wrote
37
+ * @param {number} pOffset
38
+ * @param {number} pLen
39
+ * @param {number[]} pSourceArr Array to copy from offset 0 to `pLen`. Read 0 if out of bound.
40
+ */
41
+ static byteArray(pDestArr:number[], pOffset:number, pLen:number, pSourceArr:number[]) {
42
+ for (let i = 0; i < pLen; pDestArr[pOffset+i] = pSourceArr[i]?pSourceArr[i]:0, i++);
43
+ }
44
+
45
+
46
+ /**
47
+ * Copy a char `pChar` to `pDestArr`at offset `pOffset`
48
+ *
49
+ * @param pDestArr
50
+ * @param pOffset
51
+ * @param pChar
52
+ */
53
+ static chr(pDestArr:number[], pOffset:number, pChar:string):void {
54
+ pDestArr[pOffset] = pChar.charCodeAt(0);
55
+ };
56
+
57
+
58
+ /**
59
+ * Copies characters from a source string to a destination array.
60
+ *
61
+ * @param {number[]} pDestArr - The destination array to copy the characters to.
62
+ * @param {number} pOffset - The starting offset in the destination array.
63
+ * @param {number} pLen - The length of characters to copy.
64
+ * @param {string} pSourceStr - The source string to copy characters from.
65
+ * @returns {void}
66
+ */
67
+ static str(pDestArr:number[], pOffset:number, pLen:number, pSourceStr:string):void {
68
+ for (let t, i = 0; i < pLen; pDestArr[pOffset+i] = (t=pSourceStr.charCodeAt(i))?t:0, i++);
69
+ };
70
+
71
+ /**
72
+ * Encodes an integer value into a specified array in accordance with the provided endianness and operation configuration.
73
+ *
74
+ * @param {Endianness} pEndianness The endianness (BIG_ENDIAN or LITTLE_ENDIAN) to be used for encoding the integer.
75
+ * @param {Operation} pOp An operation object containing options such as size, minimum, and maximum permissible values for the integer.
76
+ * @param {any[]} pArr The array in which the encoded integer will be stored.
77
+ * @param {number} pOffset The offset in the array where the encoded integer will be written.
78
+ * @param {number} v The integer value to be encoded into the array.
79
+ * @return {void} This method does not return a value.
80
+ */
81
+ static int(pEndianness:Endianness, pOp:Operation, pArr:any[], pOffset:number, v:number):void {
82
+ let lsb:number, nsb:number; // lsb = (pEndianness==Endianness.BIG_ENDIAN)?(pOp.opts.size-1) : 0;
83
+ //let nsb = bBE?-1:1;
84
+ if(pEndianness==Endianness.BIG_ENDIAN){
85
+ lsb = pOp.opts.size-1;
86
+ nsb = -1;
87
+ }else{
88
+ lsb = 0;
89
+ nsb = 1;
90
+ }
91
+ let stop = lsb+nsb*pOp.opts.size, i;
92
+
93
+ v = (v<pOp.opts.min)?pOp.opts.min:(v>pOp.opts.max)?pOp.opts.max:v;
94
+ for (i = lsb; i != stop; pArr[pOffset+i]=v&0xff, i+=nsb, v>>=8);
95
+ };
96
+
97
+ // Encode bigInt into an array.
98
+
99
+ /**
100
+ * Encodes a bigint value into a byte array based on specified endianness and operation parameters.
101
+ *
102
+ * @param {Endianness} pEndianness - Specifies the byte order (either BIG_ENDIAN or LITTLE_ENDIAN).
103
+ * @param {Operation} pOp - Contains options such as size, minimum, and maximum allowed values for encoding.
104
+ * @param {any[]} pArr - The target array where the encoded bytes should be stored.
105
+ * @param {number} pOffset - The starting position in the target array for storing the encoded bytes.
106
+ * @param {bigint} v - The bigint value to be encoded within bounds specified by the operation.
107
+ * @return {void} This method does not return any value.
108
+ */
109
+ static bigintEncoder(pEndianness:Endianness, pOp:Operation, pArr:any[], pOffset:number, v:bigint):void {
110
+ let lsb:number, nsb:number; // lsb = (pEndianness==Endianness.BIG_ENDIAN)?(pOp.opts.size-1) : 0;
111
+ if(pEndianness==Endianness.BIG_ENDIAN){
112
+ lsb = pOp.opts.size-1;
113
+ nsb = -1;
114
+ }else{
115
+ lsb = 0;
116
+ nsb = 1;
117
+ }
118
+ let stop = lsb+nsb*pOp.opts.size, i;
119
+
120
+ v = BigInt((v<pOp.opts.min)?pOp.opts.min:(v>pOp.opts.max)?pOp.opts.max:v);
121
+ for (i = lsb; i != stop; pArr[pOffset+i]=v&BigInt(0xff), i+=nsb, v>>=BigInt(8));
122
+ }
123
+
124
+
125
+ // Little-endian N-bit IEEE 754 floating point
126
+ /**
127
+ * Converts a given floating point number to IEEE754 format and stores it in a destination array.
128
+ *
129
+ * @param {Endianness} pEndianness - The endianness of the destination array.
130
+ * @param {Operation} pOp - The operation to perform during conversion (e.g., single precision, double precision, etc.).
131
+ * @param {any[]} pDestArr - The destination array to store the converted value.
132
+ * @param {number} pOffset - The offset in the destination array to start storing the converted value.
133
+ * @param {number} pValue - The floating point number to convert.
134
+ * @return {void}
135
+ */
136
+ static ieee754_fp(pEndianness:Endianness, pOp:Operation, pDestArr:any[], pOffset:number, pValue:number) {
137
+ let s, e, m, i, d, c, mLen, eLen, eBias, eMax, abs:number;
138
+ mLen = pOp.opts.mLen, eLen = pOp.opts.size*8-pOp.opts.mLen-1, eMax = (1<<eLen)-1, eBias = eMax>>1;
139
+
140
+ // signed
141
+ s = pValue<0?1:0;
142
+ // abs
143
+ abs = Math.abs(pValue);
144
+ if (isNaN(abs) || (abs == Infinity)) {
145
+ m = isNaN(abs)?1:0;
146
+ e = eMax;
147
+ } else {
148
+ e = Math.floor(Math.log(abs)/Math.LN2); // Calculate log2 of the value
149
+
150
+ if (abs*(c = Math.pow(2, -e)) < 1) {
151
+ e--; c*=2; // Math.log() isn't 100% reliable
152
+ }
153
+
154
+ // Round by adding 1/2 the significand's LSD
155
+ if (e+eBias >= 1) {
156
+ abs += pOp.opts.rt/c; // Normalized: mLen significand digits
157
+ } else {
158
+ abs += pOp.opts.rt*Math.pow(2, 1-eBias); // Denormalized: <= mLen significand digits
159
+ }
160
+
161
+ if (abs*c >= 2) {
162
+ e++; c/=2; // Rounding can increment the exponent
163
+ }
164
+
165
+ if (e+eBias >= eMax) {
166
+ // Overflow
167
+ m = 0;
168
+ e = eMax;
169
+ } else if (e+eBias >= 1) {
170
+ // Normalized - term order matters, as Math.pow(2, 52-e) and v*Math.pow(2, 52) can overflow
171
+ m = (abs*c-1)*Math.pow(2, mLen);
172
+ e = e + eBias;
173
+ } else {
174
+ // Denormalized - also catches the '0' case, somewhat by chance
175
+ m = abs*Math.pow(2, eBias-1)*Math.pow(2, mLen);
176
+ e = 0;
177
+ }
178
+ }
179
+
180
+ for (i = (pEndianness==Endianness.BIG_ENDIAN)?(pOp.opts.size-1):0, d=(pEndianness==Endianness.BIG_ENDIAN)?-1:1; mLen >= 8; pDestArr[pOffset+i]=m&0xff, i+=d, m/=256, mLen-=8);
181
+ for (e=(e<<mLen)|m, eLen+=mLen; eLen > 0; pDestArr[pOffset+i]=e&0xff, i+=d, e/=256, eLen-=8);
182
+ pDestArr[pOffset+i-d] |= s*128;
183
+ };
184
+
185
+ }
package/src/common.ts ADDED
@@ -0,0 +1,25 @@
1
+ /*
2
+ *
3
+ * Reversense platform / dxc-struct : Reversense is an automated reverse engineering and analysis platform
4
+ * focused on security, privacy, quality, accessibility and safety assessment of software, including mobile app and firmware.
5
+ * Copyright (C) 2026 Reversense SAS
6
+ *
7
+ * This program is free software: you can redistribute it and/or modify
8
+ * it under the terms of the GNU Affero General Public License as published
9
+ * by the Free Software Foundation, either version 3 of the License, or
10
+ * (at your option) any later version.
11
+ *
12
+ * This program is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ * GNU Affero General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU Affero General Public License
18
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
+ *
20
+ */
21
+
22
+ export enum Endianness {
23
+ LITTLE_ENDIAN,
24
+ BIG_ENDIAN
25
+ }
@@ -0,0 +1,90 @@
1
+
2
+
3
+
4
+
5
+ /*
6
+ *
7
+ * Reversense platform / dxc-struct : Reversense is an automated reverse engineering and analysis platform
8
+ * focused on security, privacy, quality, accessibility and safety assessment of software, including mobile app and firmware.
9
+ * Copyright (C) 2026 Reversense SAS
10
+ *
11
+ * This program is free software: you can redistribute it and/or modify
12
+ * it under the terms of the GNU Affero General Public License as published
13
+ * by the Free Software Foundation, either version 3 of the License, or
14
+ * (at your option) any later version.
15
+ *
16
+ * This program is distributed in the hope that it will be useful,
17
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
18
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
+ * GNU Affero General Public License for more details.
20
+ *
21
+ * You should have received a copy of the GNU Affero General Public License
22
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
23
+ *
24
+ */
25
+
26
+ /**
27
+ *
28
+ */
29
+ export class MonitoredError extends Error {
30
+
31
+ static ERR_CODE_BASE = 1000;
32
+
33
+ static NEW_HOOK:((pErr:MonitoredError|null)=>void) = (()=>{});
34
+
35
+ /**
36
+ * Component name
37
+ *
38
+ * @field
39
+ * @type string
40
+ */
41
+ cmp:string;
42
+ code:number;
43
+ extra:any;
44
+
45
+ constructor( pCmp:string, pMsg:string, pCode = -1, pExtra:any = null) {
46
+ super(pMsg);
47
+ this.cmp = pCmp;
48
+ this.code = pCode;
49
+ this.extra = pExtra;
50
+ }
51
+
52
+ getCode():number {
53
+ return this.code;
54
+ }
55
+
56
+ getMessage():string {
57
+ return `[${this.cmp}][#${this.code}] ${this.message} `;
58
+ }
59
+
60
+ getExtra():any {
61
+ return this.extra;
62
+ }
63
+
64
+ toString():string {
65
+ return `[${this.cmp}] [#${this.code!=null ? this.code : "<null>"} ${this.message}`;
66
+ }
67
+
68
+ /**
69
+ * Called by children constructors, it help to implement
70
+ * extra action for every Exception thrown
71
+ *
72
+ * @method
73
+ */
74
+ protected _triggerNewHook(){
75
+ MonitoredError.NEW_HOOK.apply(null,[this]);
76
+ }
77
+
78
+ /**
79
+ *
80
+ * @param pIncludeExtra
81
+ */
82
+ toObject(pIncludeExtra=false):any {
83
+ return {
84
+ cmp: this.cmp,
85
+ code: this.code,
86
+ msg: this.message,
87
+ extra: pIncludeExtra ? this.extra : null
88
+ }
89
+ }
90
+ }
@@ -0,0 +1,41 @@
1
+
2
+ /*
3
+ *
4
+ * Reversense platform / dxc-struct : Reversense is an automated reverse engineering and analysis platform
5
+ * focused on security, privacy, quality, accessibility and safety assessment of software, including mobile app and firmware.
6
+ * Copyright (C) 2026 Reversense SAS
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU Affero General Public License as published
10
+ * by the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU Affero General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU Affero General Public License
19
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+
23
+ import {MonitoredError} from "./MonitoredError.js";
24
+
25
+ export class RuntimeException extends MonitoredError {
26
+
27
+ static WRITE_OOB = ()=>{
28
+ return new RuntimeException("Write Out-of-Bound",MonitoredError.ERR_CODE_BASE + 1) };
29
+
30
+ static READ_OOB = ()=>{
31
+ return new RuntimeException("Read Out-of-Bound",MonitoredError.ERR_CODE_BASE + 2) };
32
+
33
+ static UNKNOWN_FORMAT = (pToken:string)=>{
34
+ return new RuntimeException("Format is invalid. Following token is not recognized [token="+pToken+"]"
35
+ ,MonitoredError.ERR_CODE_BASE + 3) };
36
+
37
+
38
+ constructor( pMsg:string, pCode:number = null, pExtra:any = null) {
39
+ super('DXC-STRUCT', pMsg, pCode, pExtra);
40
+ }
41
+ }
File without changes