-
Notifications
You must be signed in to change notification settings - Fork 0
/
XMLChar.o.c++
686 lines (557 loc) · 13.4 KB
/
XMLChar.o.c++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
typedef unsigned char undefined;
typedef unsigned char bool;
typedef unsigned char byte;
typedef unsigned char dwfenc;
typedef unsigned int dword;
typedef long double longdouble;
typedef long long longlong;
typedef unsigned long qword;
typedef unsigned char uchar;
typedef unsigned int uint;
typedef unsigned long ulong;
typedef unsigned long long ulonglong;
typedef unsigned char undefined1;
typedef unsigned short undefined2;
typedef unsigned int undefined4;
typedef unsigned long undefined8;
typedef unsigned short ushort;
typedef int wchar_t;
typedef unsigned short word;
typedef undefined __unknown__[32];
typedef longdouble __float128;
typedef ushort XMLCh;
typedef struct XMemory XMemory, *PXMemory;
struct XMemory {
undefined field0_0x0;
};
typedef uchar XMLByte;
typedef struct XMLDeleter XMLDeleter, *PXMLDeleter;
struct XMLDeleter {
int (** _vptr.XMLDeleter)(...);
};
typedef struct XMLBuffer XMLBuffer, *PXMLBuffer;
typedef struct MemoryManager MemoryManager, *PMemoryManager;
typedef struct XMLBufferFullHandler XMLBufferFullHandler, *PXMLBufferFullHandler;
struct MemoryManager {
int (** _vptr.MemoryManager)(...);
};
struct XMLBuffer { // Missing member super_XMemory : XMemory at offset 0x0 [conflict with fIndex]
uint fIndex;
uint fCapacity;
uint fFullSize;
bool fUsed;
undefined field4_0xd;
undefined field5_0xe;
undefined field6_0xf;
struct MemoryManager * fMemoryManager;
struct XMLBufferFullHandler * fFullHandler;
XMLCh * fBuffer;
};
struct XMLBufferFullHandler {
int (** _vptr.XMLBufferFullHandler)(...);
};
typedef ulong size_t;
typedef struct XMLChar1_0 XMLChar1_0, *PXMLChar1_0;
struct XMLChar1_0 {
undefined field0_0x0;
};
typedef struct XMLChar1_1 XMLChar1_1, *PXMLChar1_1;
struct XMLChar1_1 {
undefined field0_0x0;
};
typedef struct XMLString XMLString, *PXMLString;
struct XMLString {
undefined field0_0x0;
};
typedef struct 7lldiv_t 7lldiv_t, *P7lldiv_t;
struct 7lldiv_t {
longlong quot;
longlong rem;
};
typedef struct 5div_t 5div_t, *P5div_t;
struct 5div_t {
int quot;
int rem;
};
typedef int (* __compar_fn_t)(void *, void *);
typedef struct 7lldiv_t lldiv_t;
typedef struct 6ldiv_t 6ldiv_t, *P6ldiv_t;
struct 6ldiv_t {
long quot;
long rem;
};
typedef struct 6ldiv_t ldiv_t;
typedef struct 5div_t div_t;
typedef struct BaseRefVectorOf<short_unsigned_int> BaseRefVectorOf<short_unsigned_int>, *PBaseRefVectorOf<short_unsigned_int>;
struct BaseRefVectorOf<short_unsigned_int> { // Original name: BaseRefVectorOf<short unsigned int>
};
typedef struct XMLLCPTranscoder XMLLCPTranscoder, *PXMLLCPTranscoder;
struct XMLLCPTranscoder {
};
typedef struct Elf64_Rela Elf64_Rela, *PElf64_Rela;
struct Elf64_Rela {
qword r_offset; // location to apply the relocation action
qword r_info; // the symbol table index and the type of relocation
qword r_addend; // a constant addend used to compute the relocatable field value
};
typedef struct Elf64_Shdr Elf64_Shdr, *PElf64_Shdr;
typedef enum Elf_SectionHeaderType {
SHT_NULL=0,
SHT_PROGBITS=1,
SHT_SYMTAB=2,
SHT_STRTAB=3,
SHT_RELA=4,
SHT_HASH=5,
SHT_DYNAMIC=6,
SHT_NOTE=7,
SHT_NOBITS=8,
SHT_REL=9,
SHT_SHLIB=10,
SHT_DYNSYM=11,
SHT_INIT_ARRAY=14,
SHT_FINI_ARRAY=15,
SHT_PREINIT_ARRAY=16,
SHT_GROUP=17,
SHT_SYMTAB_SHNDX=18,
SHT_ANDROID_REL=1610612737,
SHT_ANDROID_RELA=1610612738,
SHT_GNU_ATTRIBUTES=1879048181,
SHT_GNU_HASH=1879048182,
SHT_GNU_LIBLIST=1879048183,
SHT_CHECKSUM=1879048184,
SHT_SUNW_move=1879048186,
SHT_SUNW_COMDAT=1879048187,
SHT_SUNW_syminfo=1879048188,
SHT_GNU_verdef=1879048189,
SHT_GNU_verneed=1879048190,
SHT_GNU_versym=1879048191
} Elf_SectionHeaderType;
struct Elf64_Shdr {
dword sh_name;
enum Elf_SectionHeaderType sh_type;
qword sh_flags;
qword sh_addr;
qword sh_offset;
qword sh_size;
dword sh_link;
dword sh_info;
qword sh_addralign;
qword sh_entsize;
};
typedef struct Elf64_Ehdr Elf64_Ehdr, *PElf64_Ehdr;
struct Elf64_Ehdr {
byte e_ident_magic_num;
char e_ident_magic_str[3];
byte e_ident_class;
byte e_ident_data;
byte e_ident_version;
byte e_ident_osabi;
byte e_ident_abiversion;
byte e_ident_pad[7];
word e_type;
word e_machine;
dword e_version;
qword e_entry;
qword e_phoff;
qword e_shoff;
dword e_flags;
word e_ehsize;
word e_phentsize;
word e_phnum;
word e_shentsize;
word e_shnum;
word e_shstrndx;
};
typedef struct Elf64_Sym Elf64_Sym, *PElf64_Sym;
struct Elf64_Sym {
dword st_name;
byte st_info;
byte st_other;
word st_shndx;
qword st_value;
qword st_size;
};
bool xercesc_2_7::XMLChar1_0::isAllSpaces(XMLCh *toCheck,uint count)
{
ushort uVar1;
XMLCh *curCh;
XMLCh *endPtr;
curCh = toCheck;
do {
if (toCheck + count <= curCh) {
return true;
}
uVar1 = *curCh;
curCh = curCh + 1;
} while ((char)fgCharCharsTable1_0[(int)(uint)uVar1] < '\0');
return false;
}
bool xercesc_2_7::XMLChar1_0::containsWhiteSpace(XMLCh *toCheck,uint count)
{
ushort uVar1;
XMLCh *curCh;
XMLCh *endPtr;
curCh = toCheck;
do {
if (toCheck + count <= curCh) {
return false;
}
uVar1 = *curCh;
curCh = curCh + 1;
} while (-1 < (char)fgCharCharsTable1_0[(int)(uint)uVar1]);
return true;
}
bool xercesc_2_7::XMLChar1_0::isValidNCName(XMLCh *toCheck,uint count)
{
ushort uVar1;
bool bVar2;
XMLCh *curCh;
XMLCh *endPtr;
curCh = toCheck;
if ((*toCheck == 0x3a) ||
(curCh = toCheck + 1, (fgCharCharsTable1_0[(int)(uint)*toCheck] & 2) == 0)) {
bVar2 = true;
}
else {
bVar2 = false;
}
if (!bVar2) {
do {
if (toCheck + count <= curCh) {
return true;
}
uVar1 = *curCh;
curCh = curCh + 1;
} while ((fgCharCharsTable1_0[(int)(uint)uVar1] & 1) != 0);
}
return false;
}
bool xercesc_2_7::XMLChar1_0::isValidNmtoken(XMLCh *toCheck,uint count)
{
ushort uVar1;
XMLCh *curCh;
XMLCh *endPtr;
curCh = toCheck;
do {
if (toCheck + count <= curCh) {
return true;
}
uVar1 = *curCh;
curCh = curCh + 1;
} while ((fgCharCharsTable1_0[(int)(uint)uVar1] & 4) != 0);
return false;
}
bool xercesc_2_7::XMLChar1_0::isValidName(XMLCh *toCheck,uint count)
{
byte bVar1;
ushort *puVar2;
XMLCh *curCh;
XMLCh *endPtr;
bVar1 = fgCharCharsTable1_0[(int)(uint)*toCheck] & 2;
puVar2 = toCheck + 1;
while( true ) {
if (bVar1 == 0) {
return false;
}
if (toCheck + count <= puVar2) break;
bVar1 = fgCharCharsTable1_0[(int)(uint)*puVar2] & 4;
puVar2 = puVar2 + 1;
}
return true;
}
bool xercesc_2_7::XMLChar1_0::isValidQName(XMLCh *toCheck,uint count)
{
bool bVar1;
undefined uVar2;
uint count_00;
int length;
int colonPos;
count_00 = xercesc_2_7::XMLString::indexOf(toCheck,0x3a);
if ((count_00 == 0) || (count_00 == count - 1)) {
uVar2 = 0;
}
else {
if ((count_00 != 0xffffffff) && (bVar1 = isValidNCName(toCheck,count_00), bVar1 == false)) {
return false;
}
uVar2 = isValidNCName(toCheck + (long)(int)count_00 + 1,(count - count_00) - 1);
}
return (bool)uVar2;
}
bool xercesc_2_7::XMLChar1_0::isPublicIdChar(XMLCh toCheck,XMLCh toCheck2)
{
XMLCh XVar1;
ushort *puVar2;
XMLCh *curTable;
if (toCheck2 != 0) {
return false;
}
curTable = (XMLCh *)gPublicIdChars;
while (*curTable != 0) {
puVar2 = curTable + 1;
if (toCheck < *curTable) goto LAB_0010038e;
curTable = curTable + 2;
if (toCheck <= *puVar2) {
return true;
}
}
LAB_001003cb:
do {
if (*curTable == 0) {
return false;
}
XVar1 = *curTable;
curTable = curTable + 1;
} while (toCheck != XVar1);
return true;
LAB_0010038e:
do {
curTable = puVar2;
puVar2 = curTable + 1;
XVar1 = *curTable;
curTable = puVar2;
} while (XVar1 != 0);
goto LAB_001003cb;
}
void xercesc_2_7::XMLChar1_0::enableNELWS(void)
{
if (enableNEL != true) {
enableNEL = true;
fgCharCharsTable1_0[133] = fgCharCharsTable1_0[10];
fgCharCharsTable1_0[8232] = fgCharCharsTable1_0[10];
}
return;
}
bool xercesc_2_7::XMLChar1_1::isAllSpaces(XMLCh *toCheck,uint count)
{
ushort uVar1;
XMLCh *curCh;
XMLCh *endPtr;
curCh = toCheck;
do {
if (toCheck + count <= curCh) {
return true;
}
uVar1 = *curCh;
curCh = curCh + 1;
} while ((char)fgCharCharsTable1_1[(int)(uint)uVar1] < '\0');
return false;
}
bool xercesc_2_7::XMLChar1_1::containsWhiteSpace(XMLCh *toCheck,uint count)
{
ushort uVar1;
XMLCh *curCh;
XMLCh *endPtr;
curCh = toCheck;
do {
if (toCheck + count <= curCh) {
return false;
}
uVar1 = *curCh;
curCh = curCh + 1;
} while (-1 < (char)fgCharCharsTable1_1[(int)(uint)uVar1]);
return true;
}
bool xercesc_2_7::XMLChar1_1::isValidNCName(XMLCh *toCheck,uint count)
{
ushort uVar1;
bool bVar2;
bool gotLeadingSurrogate;
XMLCh nextCh;
XMLCh *curCh;
XMLCh *endPtr;
curCh = toCheck + 1;
uVar1 = *toCheck;
if ((uVar1 < 0xd800) || (0xdb7f < uVar1)) {
if ((uVar1 == 0x3a) || ((fgCharCharsTable1_1[(int)(uint)uVar1] & 2) == 0)) {
return false;
}
}
else {
uVar1 = *curCh;
if ((uVar1 < 0xdc00) || (curCh = toCheck + 2, 0xdfff < uVar1)) {
return false;
}
}
bVar2 = false;
do {
while( true ) {
if (toCheck + count <= curCh) {
return true;
}
uVar1 = *curCh;
if ((uVar1 < 0xd800) || (0xdbff < uVar1)) break;
if ((0xdb7f < uVar1) || (bVar2)) {
return false;
}
bVar2 = true;
curCh = curCh + 1;
}
if ((uVar1 < 0xdc00) || (0xdfff < uVar1)) {
if (bVar2) {
return false;
}
if ((fgCharCharsTable1_1[(int)(uint)uVar1] & 1) == 0) {
return false;
}
}
else if (!bVar2) {
return false;
}
bVar2 = false;
curCh = curCh + 1;
} while( true );
}
bool xercesc_2_7::XMLChar1_1::isValidNmtoken(XMLCh *toCheck,uint count)
{
ushort uVar1;
bool bVar2;
bool gotLeadingSurrogate;
XMLCh nextCh;
XMLCh *curCh;
XMLCh *endPtr;
bVar2 = false;
curCh = toCheck;
do {
while( true ) {
if (toCheck + count <= curCh) {
return true;
}
uVar1 = *curCh;
if ((uVar1 < 0xd800) || (0xdbff < uVar1)) break;
if ((0xdb7f < uVar1) || (bVar2)) {
return false;
}
bVar2 = true;
curCh = curCh + 1;
}
if ((uVar1 < 0xdc00) || (0xdfff < uVar1)) {
if (bVar2) {
return false;
}
if ((fgCharCharsTable1_1[(int)(uint)uVar1] & 4) == 0) {
return false;
}
}
else if (!bVar2) {
return false;
}
bVar2 = false;
curCh = curCh + 1;
} while( true );
}
bool xercesc_2_7::XMLChar1_1::isValidName(XMLCh *toCheck,uint count)
{
ushort uVar1;
bool bVar2;
bool gotLeadingSurrogate;
XMLCh nextCh;
XMLCh *curCh;
XMLCh *endPtr;
curCh = toCheck + 1;
uVar1 = *toCheck;
if ((uVar1 < 0xd800) || (0xdb7f < uVar1)) {
if ((fgCharCharsTable1_1[(int)(uint)uVar1] & 2) == 0) {
return false;
}
}
else {
uVar1 = *curCh;
if ((uVar1 < 0xdc00) || (curCh = toCheck + 2, 0xdfff < uVar1)) {
return false;
}
}
bVar2 = false;
do {
while( true ) {
if (toCheck + count <= curCh) {
return true;
}
uVar1 = *curCh;
if ((uVar1 < 0xd800) || (0xdbff < uVar1)) break;
if ((0xdb7f < uVar1) || (bVar2)) {
return false;
}
bVar2 = true;
curCh = curCh + 1;
}
if ((uVar1 < 0xdc00) || (0xdfff < uVar1)) {
if (bVar2) {
return false;
}
if ((fgCharCharsTable1_1[(int)(uint)uVar1] & 4) == 0) {
return false;
}
}
else if (!bVar2) {
return false;
}
bVar2 = false;
curCh = curCh + 1;
} while( true );
}
bool xercesc_2_7::XMLChar1_1::isValidQName(XMLCh *toCheck,uint count)
{
bool bVar1;
undefined uVar2;
uint count_00;
int length;
int colonPos;
count_00 = xercesc_2_7::XMLString::indexOf(toCheck,0x3a);
if ((count_00 == 0) || (count_00 == count - 1)) {
uVar2 = 0;
}
else {
if ((count_00 != 0xffffffff) && (bVar1 = isValidNCName(toCheck,count_00), bVar1 == false)) {
return false;
}
uVar2 = isValidNCName(toCheck + (long)(int)count_00 + 1,(count - count_00) - 1);
}
return (bool)uVar2;
}
bool xercesc_2_7::XMLChar1_1::isPublicIdChar(XMLCh toCheck,XMLCh toCheck2)
{
XMLCh XVar1;
ushort *puVar2;
XMLCh *curTable;
if (toCheck2 != 0) {
return false;
}
curTable = (XMLCh *)gPublicIdChars;
while (*curTable != 0) {
puVar2 = curTable + 1;
if (toCheck < *curTable) goto LAB_00100980;
curTable = curTable + 2;
if (toCheck <= *puVar2) {
return true;
}
}
LAB_001009bd:
do {
if (*curTable == 0) {
return false;
}
XVar1 = *curTable;
curTable = curTable + 1;
} while (toCheck != XVar1);
return true;
LAB_00100980:
do {
curTable = puVar2;
puVar2 = curTable + 1;
XVar1 = *curTable;
curTable = puVar2;
} while (XVar1 != 0);
goto LAB_001009bd;
}
void __thiscall xercesc_2_7::XMLDeleter::_XMLDeleter(XMLDeleter *this)
{
this->_vptr_XMLDeleter = (anon_subr_int_varargs **)&PTR__XMLDeleter_00121188;
return;
}
void __thiscall xercesc_2_7::XMLDeleter::_XMLDeleter(XMLDeleter *this)
{
_XMLDeleter(this);
operator_delete(this);
return;
}