-
Notifications
You must be signed in to change notification settings - Fork 169
/
libnvwavm-lib.so.c
14798 lines (14406 loc) · 386 KB
/
libnvwavm-lib.so.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
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* This file was generated by the Hex-Rays decompiler.
Copyright (c) 2007-2020 Hex-Rays <[email protected]>
Detected compiler: GNU C++
*/
#include <defs.h>
#include <stdarg.h>
//-------------------------------------------------------------------------
// Function declarations
// int __fastcall _cxa_finalize(void *);
// void __fastcall _aeabi_memclr8(void *, size_t); idb
// int ZTH11g_lastStack(void); weak
// int __fastcall _emutls_get_address(_DWORD); weak
// void free(void *p);
// int pthread_mutex_lock(pthread_mutex_t *mutex);
// int pthread_mutex_unlock(pthread_mutex_t *mutex);
// size_t strlen(const char *);
// int sprintf(char *s, const char *format, ...);
// void __fastcall _aeabi_memclr4(void *, size_t); idb
// char *strdup(const char *);
// void *malloc(size_t byte_count);
// void *calloc(size_t item_count, size_t item_size);
// void __fastcall _aeabi_memclr(void *, size_t); idb
// void __fastcall _aeabi_memcpy(void *, const void *, size_t); idb
// _DWORD __fastcall std::__call_once(std::__ndk1 *__hidden this, volatile unsigned int *, void *, void (__fastcall *)(void *)); idb
// void __fastcall operator delete(void *); idb
// _DWORD __fastcall operator new(unsigned int); idb
// FILE *fopen(const char *filename, const char *modes);
// int fseek(FILE *stream, int off, int whence);
// int ftell(FILE *stream);
// size_t fread(void *ptr, size_t size, size_t n, FILE *stream);
// int fclose(FILE *stream);
// uLong adler32(uLong adler, const Bytef *buf, uInt len);
// int uncompress(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen);
// int vsnprintf(char *s, size_t maxlen, const char *format, __gnuc_va_list arg);
// int __fastcall _cxa_guard_acquire(__guard *);
// void __fastcall _cxa_guard_release(__guard *);
// int open(const char *file, int oflag, ...);
// int _errno(void); weak
// void *memcpy(void *, const void *, size_t);
// int mkstemp(char *);
// int unlink(const char *name);
// char *getenv(const char *);
// void *memset(void *, int, size_t);
// ssize_t write(int fd, const void *buf, size_t n);
// int sysconf(int name);
// void *mmap(void *addr, size_t len, int prot, int flags, int fd, __off_t offset);
// int close(int fd);
// int ftruncate(int fd, __off_t length);
// int munmap(void *addr, size_t len);
// void abort(void);
// int pthread_mutex_init(pthread_mutex_t *mutex, const pthread_mutexattr_t *mutexattr);
// int fprintf(FILE *stream, const char *format, ...);
// int fflush(FILE *stream);
// int __fastcall dladdr(_DWORD, _DWORD); weak
// int snprintf(char *s, size_t maxlen, const char *format, ...);
// int __fastcall _gnu_Unwind_Find_exidx(_DWORD, _DWORD); weak
int sub_1698();
int __fastcall sub_16A8(int a1, int a2, int **a3, int a4);
__int64 __fastcall Java_com_xunmeng_nvwavm_NvwaVM_nwvmLoad(int a1, int a2, int a3, int a4, int a5);
int __fastcall sub_1940(int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8);
void __fastcall Java_com_xunmeng_nvwavm_NvwaVM_nwvmDestory(int a1, int a2, void *a3);
int __fastcall Java_com_xunmeng_nvwavm_NvwaVM_callV(int a1, int a2, int a3, int a4, int a5, int a6, int a7);
int __fastcall Java_com_xunmeng_nvwavm_NvwaVM_callZ(int a1, int a2, int a3, int a4, int a5, int a6, int a7);
int __fastcall Java_com_xunmeng_nvwavm_NvwaVM_callC(int a1, int a2, int a3, int a4, int a5, int a6, int a7);
int __fastcall Java_com_xunmeng_nvwavm_NvwaVM_callB(int a1, int a2, int a3, int a4, int a5, int a6, int a7);
int __fastcall Java_com_xunmeng_nvwavm_NvwaVM_callS(int a1, int a2, int a3, int a4, int a5, int a6, int a7);
int __fastcall Java_com_xunmeng_nvwavm_NvwaVM_callI(int a1, int a2, int a3, int a4, int a5, int a6, int a7);
int __fastcall Java_com_xunmeng_nvwavm_NvwaVM_callF(int a1, int a2, int a3, int a4, int a5, int a6, int a7);
__int64 __fastcall Java_com_xunmeng_nvwavm_NvwaVM_callJ(int a1, int a2, int a3, int a4, int a5, int a6, int a7);
__int64 __fastcall Java_com_xunmeng_nvwavm_NvwaVM_callD(int a1, int a2, int a3, int a4, int a5, int a6, int a7);
int __fastcall Java_com_xunmeng_nvwavm_NvwaVM_callL(int a1, int a2, int a3, int a4, int a5, int a6, int a7);
int __fastcall Java_com_xunmeng_nvwavm_NvwaVM_prepareClass(int a1, int a2, int a3, int a4, int a5);
int __fastcall Java_com_xunmeng_nvwavm_NvwaVM_callVM(int a1, int a2, _DWORD *a3, int a4, int a5, int a6);
_DWORD *__fastcall sub_2160(int a1, int a2);
int __fastcall sub_21D4(int a1);
int __fastcall sub_2224(int a1);
int __fastcall sub_2274(int a1);
int __fastcall sub_22C4(int a1);
int __fastcall sub_2314(int a1);
int __fastcall sub_2364(int a1);
int __fastcall sub_23B4(int a1);
int __fastcall sub_2404(int a1);
int __fastcall sub_2454(int a1, int a2);
int __fastcall sub_2482(int *a1, unsigned int **a2);
_DWORD *__fastcall sub_26DE(_DWORD *result);
_DWORD *__fastcall sub_273E(_DWORD *result);
int __fastcall sub_2792(int a1, int a2);
int __fastcall sub_28E0(int a1, int a2);
int __fastcall sub_2984(int a1, int a2);
_DWORD *__fastcall sub_29B8(_DWORD *a1);
int __fastcall sub_29FA(int a1, int a2, unsigned int **a3);
int __fastcall sub_2BD0(int a1, int a2);
int __fastcall sub_2C2A(int result, int a2, char *a3, int a4);
int __fastcall sub_2C7C(int a1, int a2, int a3, void (__fastcall *a4)(void *));
int __fastcall sub_2CD0(_DWORD *a1, int a2, int a3, int a4, int a5, char a6, unsigned int a7);
void sub_5F3E();
void sub_5F7C();
void sub_5FBA();
int sub_6590(); // weak
int sub_684A(); // weak
void sub_6888();
void sub_68A2();
void sub_68B0();
void sub_68BE();
void sub_68CC();
void sub_68DA();
void sub_68E8();
void sub_695A();
void sub_697C();
void sub_69A0();
void sub_69C4();
void sub_69E8();
void sub_69F6();
void sub_6A04();
void sub_6A12();
void sub_6A20();
void sub_6A2E();
void sub_6A52();
void sub_6A76();
void sub_6ADA();
void sub_6B1A();
void sub_6B3A();
void sub_6B48();
void sub_6B56();
void sub_6B64();
void sub_6B72();
void sub_6B80();
void sub_6BA0();
void __noreturn sub_6BC4();
int sub_6C10();
int sub_6CBE();
void sub_6CFC();
void sub_6D24();
void __noreturn sub_6F0C();
int sub_6F4E();
int sub_6F86();
int sub_6FBE();
int sub_7050();
void __fastcall sub_70A4(int a1, int a2, int a3, int a4, int a5);
int sub_726C();
int sub_72CC();
int sub_7314();
int sub_7354();
int sub_7388();
int sub_73FC();
void sub_7468();
_DWORD *__fastcall sub_751C(_DWORD *result, int a2);
_DWORD *__fastcall sub_7556(_DWORD *result, int a2);
int __fastcall sub_7592(_DWORD *a1, int a2);
int __fastcall sub_75E8(int a1, int a2, char *a3, int *a4, int a5);
int __fastcall sub_776C(_DWORD *a1);
int __fastcall sub_77C0(int a1, int a2);
void *__fastcall sub_7994(void *a1);
void __fastcall sub_7A2E(int a1, _DWORD *a2);
int __fastcall sub_7A54(int ***a1);
int __fastcall sub_7F7C(int a1, int a2, int *a3, _QWORD *a4);
int __fastcall sub_7FF0(int a1, int a2, int **a3, int *a4);
int *__fastcall sub_801C(int *result, int *a2);
_DWORD *__fastcall sub_8152(int a1, int *a2);
_DWORD *__fastcall sub_818C(int *a1, int a2, const char *a3);
int __fastcall sub_82F8(const void *a1, int a2, _DWORD *a3, int a4);
int sub_8590(int a1, int a2, int a3, const char *a4, ...);
int __fastcall sub_8634(int result, int a2);
int __fastcall sub_86C0(int a1, int a2, unsigned int a3);
int __fastcall sub_8738(int a1, int a2, unsigned int *a3, int a4);
bool __fastcall sub_8CE4(_DWORD *a1);
int sub_8D18(int a1, int a2, const char *a3, ...);
int __fastcall sub_8D94(int a1, int a2);
int __fastcall sub_8DE8(int a1);
_DWORD *__fastcall sub_8E38(int *a1);
int __fastcall sub_8E98(int, int, char *); // idb
int __fastcall sub_8F50(int a1);
_DWORD *__fastcall sub_8FA0(_DWORD *a1);
_DWORD *__fastcall sub_9068(_DWORD *a1, int *a2);
int __fastcall sub_928C(int a1, int a2, int a3, _DWORD *a4, int a5, int a6);
int __fastcall sub_92F2(int a1, int *a2, int a3, int a4, int a5);
int __fastcall sub_9346(int result, int a2, _DWORD *a3);
int __fastcall sub_9380(int a1, int a2, int a3, void (__fastcall *a4)(void *));
int __fastcall sub_93DC(int result, int a2);
int __fastcall sub_93F4(int ***a1);
int __fastcall sub_946C(int a1, int a2, unsigned int **a3);
int __fastcall sub_9514(int a1, int a2);
int __fastcall sub_9570(int a1, int a2);
int __fastcall sub_97D4(int a1);
bool __fastcall sub_9824(int a1, int *a2);
int __fastcall sub_A100(int *a1, int a2, int a3, int a4, int **a5);
int __fastcall sub_A48C(const char *a1, int a2, int a3, int a4);
int __fastcall sub_A548(const char *a1, int a2, int a3, int a4);
int __fastcall sub_A568(signed int a1, int a2);
unsigned int __fastcall sub_A870(unsigned int a1, unsigned int a2, int a3);
int *__fastcall sub_C388(int *result);
int __fastcall sub_D2B8(_DWORD *a1);
int __fastcall sub_D564(_DWORD *a1, int a2);
void *__fastcall sub_D7F8(_DWORD *a1, __int64 (__fastcall *a2)(), void *a3, int a4, int a5);
int __fastcall sub_E184(int *a1);
int __fastcall sub_E6EC(int *a1);
int __fastcall sub_E720(int a1, void (__fastcall *a2)(int, int, _DWORD *, int, _DWORD), int a3, int a4);
int __fastcall sub_E7E8(int a1, void (__fastcall *a2)(int, int, unsigned int *, int), int a3, int a4);
char *__fastcall sub_EB98(_DWORD *a1, _DWORD *a2, int a3, int a4, int a5);
int __fastcall sub_ECA0(int a1);
int __fastcall sub_ECB0(int a1, _DWORD *a2, __int64 (__fastcall *a3)());
int sub_ECE0(); // weak
void sub_ED18();
void __fastcall sub_ED30(int a1, int a2, int a3, int a4);
void sub_ED60();
void __fastcall sub_ED78(int a1, int a2, int a3, int a4);
void __fastcall sub_EDB0(int a1, int a2, int a3, int a4, int a5, int a6);
unsigned int *__fastcall sub_EDF4(unsigned int *result, int *a2, int *a3);
int __fastcall sub_EE48(int a1, int a2, unsigned int a3, unsigned int a4);
int __fastcall sub_F104(int a1, int a2, unsigned int a3, int a4, int *a5);
int __fastcall sub_F1E4(int a1, unsigned int a2, unsigned int a3, unsigned int a4);
int sub_F354(); // weak
int sub_F3B8(); // weak
int sub_F3C0(); // weak
int __fastcall sub_F3C8(const void *a1, int *a2, char a3);
void __fastcall __noreturn sub_F4F8(int *a1, int a2, int a3, int a4);
int __fastcall sub_F580(_DWORD *a1, int a2, int a3, int a4, int a5);
_QWORD *__fastcall sub_F598(_QWORD *result);
_QWORD *__fastcall sub_F5A0(_QWORD *result);
_QWORD *__fastcall sub_F5A8(_QWORD *result);
void sub_F5B0();
void sub_F5F4();
int __fastcall sub_F608(int a1, const void *a2);
int __fastcall sub_F650(int a1, int a2, _DWORD *a3);
int __fastcall sub_F688(int a1, int a2, int a3);
int __fastcall sub_F6D4(int a1, int a2, int a3, int a4);
int __fastcall sub_F710(int a1);
int __fastcall sub_F716(int a1, int a2);
int __fastcall sub_F736(int a1);
int __fastcall sub_F74A(int a1);
int __fastcall sub_F754(int a1, int a2);
int __fastcall sub_F774(int a1, int a2);
int __fastcall sub_F82C(int result, int a2, int a3);
int __fastcall sub_F8EC(int a1, int a2);
__int64 __fastcall sub_F90C(int a1, int a2);
_DWORD *__fastcall sub_F912(int a1, int a2, int a3, int a4);
int __fastcall sub_F918(_DWORD *a1);
_DWORD *__fastcall sub_F96A(int a1, _DWORD *a2);
int __fastcall sub_F984(int a1);
int __fastcall sub_F99C(int a1);
int __fastcall sub_F9A4(int a1, char *a2, size_t a3, _DWORD *a4);
int __fastcall sub_FA14(int *a1, int a2);
int *__fastcall sub_FA84(int a1, int a2);
int __fastcall sub_FA8A(int result);
__int64 __fastcall sub_FA94(int a1, int a2);
_DWORD *__fastcall sub_FB74(int a1, int a2, int a3, int a4);
int __fastcall sub_FC60(int a1);
_DWORD *__fastcall sub_FCB8(int a1);
int __fastcall sub_FD08(int *a1, int a2, _DWORD *a3);
_DWORD *__fastcall sub_FF10(_DWORD *a1, int a2, int a3, _DWORD *a4, int a5, int a6, int a7, _DWORD *a8);
int __fastcall sub_102F4(int a1);
void sub_10308();
void sub_10310();
void sub_10318();
_DWORD *__fastcall sub_10320(int *a1);
_DWORD *__fastcall sub_10364(int *a1);
int __fastcall sub_10380(__int64 a1, __int64 a2);
int __fastcall sub_105FC(int result);
int __fastcall sub_10640(int a1, int a2, int a3, unsigned int a4);
int __fastcall sub_1068C(__int64 a1);
int __fastcall sub_10888(__int64 a1);
int __fastcall sub_10904(void *a1, void *a2, int a3, void *a4);
unsigned int __fastcall sub_10918(int a1);
unsigned int __fastcall sub_1093E(unsigned int a1, unsigned int a2);
unsigned int __fastcall sub_10970(int a1, int a2, int a3, unsigned int a4);
unsigned int __fastcall sub_109BC(__int64 a1);
unsigned int __fastcall sub_10A04(__int64 a1, int a2, unsigned int a3);
int __fastcall sub_10BE0(int result, unsigned int a2, int a3, unsigned int a4, int a5, int a6, int a7, int a8);
int __fastcall sub_10DC6(int result, int a2, int a3, unsigned int a4);
int __fastcall sub_10E38(unsigned int a1, unsigned int a2, unsigned int a3, int a4);
unsigned int __fastcall sub_10EB4(unsigned int a1, int a2, unsigned int a3, unsigned int a4);
unsigned int __fastcall sub_10EC4(unsigned int a1, unsigned int a2, unsigned int a3, int a4);
int __fastcall sub_10EE8(unsigned int a1, unsigned int a2, unsigned int a3, int a4);
unsigned int __fastcall sub_10F38(unsigned int a1, int a2);
int __fastcall sub_10F88(int result, int a2);
int __fastcall sub_10FE8(int a1, int a2);
void __fastcall __spoils<R2,R3,R12> sub_10FF0(int a1, int a2);
int __fastcall sub_11014(int a1, int a2);
void j_free(void *p);
int __fastcall j_pthread_mutex_unlock(pthread_mutex_t *mutex);
void __fastcall operator delete(void *); // idb
int __fastcall sub_11094(int a1);
_DWORD *__fastcall sub_110A4(int *a1);
//-------------------------------------------------------------------------
// Data declarations
int dword_0 = 1179403647; // weak
char byte_4 = '\x01'; // weak
char byte_8[] = { '\0' }; // weak
int dword_20 = 78340; // weak
int dword_138 = 132; // weak
_UNKNOWN loc_477A; // weak
_UNKNOWN loc_47E6; // weak
_UNKNOWN loc_4800; // weak
_UNKNOWN loc_4820; // weak
_UNKNOWN loc_4842; // weak
_UNKNOWN loc_488E; // weak
_UNKNOWN loc_48D6; // weak
_UNKNOWN loc_48FE; // weak
_UNKNOWN loc_4942; // weak
_UNKNOWN loc_4970; // weak
_UNKNOWN loc_49AE; // weak
_UNKNOWN loc_49D4; // weak
_UNKNOWN loc_49FA; // weak
_UNKNOWN loc_4A20; // weak
_UNKNOWN loc_4A72; // weak
_UNKNOWN loc_4ADC; // weak
_UNKNOWN loc_4B30; // weak
_UNKNOWN loc_4B8C; // weak
_UNKNOWN loc_4BD2; // weak
_UNKNOWN loc_4C42; // weak
_UNKNOWN loc_4C90; // weak
_UNKNOWN loc_4CD4; // weak
_UNKNOWN loc_4CFA; // weak
_UNKNOWN loc_4D20; // weak
_UNKNOWN loc_4D44; // weak
_UNKNOWN loc_4D7A; // weak
_UNKNOWN loc_4DE2; // weak
_UNKNOWN loc_4E04; // weak
_UNKNOWN loc_4E3A; // weak
_UNKNOWN loc_4E66; // weak
_UNKNOWN loc_4EC8; // weak
_UNKNOWN loc_4F02; // weak
_UNKNOWN loc_4F48; // weak
_UNKNOWN loc_4F9A; // weak
_UNKNOWN loc_500C; // weak
_UNKNOWN loc_5086; // weak
_UNKNOWN loc_512E; // weak
_UNKNOWN loc_5154; // weak
_UNKNOWN loc_517C; // weak
_UNKNOWN loc_51AA; // weak
_UNKNOWN loc_51D6; // weak
_UNKNOWN loc_5202; // weak
_UNKNOWN loc_522A; // weak
_UNKNOWN loc_5258; // weak
_UNKNOWN loc_5284; // weak
_UNKNOWN loc_52B0; // weak
_UNKNOWN loc_52D8; // weak
_UNKNOWN loc_5310; // weak
_UNKNOWN loc_533C; // weak
_UNKNOWN loc_5368; // weak
_UNKNOWN loc_53A2; // weak
_UNKNOWN loc_53DE; // weak
_UNKNOWN loc_540A; // weak
_UNKNOWN loc_5436; // weak
_UNKNOWN loc_546C; // weak
_UNKNOWN loc_54B0; // weak
_UNKNOWN loc_54DA; // weak
_UNKNOWN loc_5512; // weak
_UNKNOWN loc_5536; // weak
_UNKNOWN loc_5560; // weak
_UNKNOWN loc_5586; // weak
_UNKNOWN loc_55AC; // weak
_UNKNOWN loc_55DA; // weak
_UNKNOWN loc_562C; // weak
_UNKNOWN loc_565A; // weak
_UNKNOWN loc_56B2; // weak
_UNKNOWN loc_56E0; // weak
_UNKNOWN loc_5738; // weak
_UNKNOWN loc_5760; // weak
_UNKNOWN loc_578E; // weak
_UNKNOWN loc_57B6; // weak
_UNKNOWN loc_57E4; // weak
_UNKNOWN loc_580C; // weak
_UNKNOWN loc_583A; // weak
_UNKNOWN loc_5866; // weak
_UNKNOWN loc_588A; // weak
_UNKNOWN loc_58B0; // weak
_UNKNOWN loc_58D6; // weak
_UNKNOWN loc_58F0; // weak
_UNKNOWN loc_5916; // weak
_UNKNOWN loc_5940; // weak
_UNKNOWN loc_5966; // weak
_UNKNOWN loc_598C; // weak
_UNKNOWN loc_59B2; // weak
_UNKNOWN loc_59D8; // weak
_UNKNOWN loc_5A02; // weak
_UNKNOWN loc_5A28; // weak
_UNKNOWN loc_5A4A; // weak
_UNKNOWN loc_5A6C; // weak
_UNKNOWN loc_5A8E; // weak
_UNKNOWN loc_5AE0; // weak
_UNKNOWN loc_5B56; // weak
_UNKNOWN loc_5BE8; // weak
_UNKNOWN loc_5C08; // weak
_UNKNOWN loc_5C28; // weak
_UNKNOWN loc_5C4A; // weak
_UNKNOWN loc_5C6A; // weak
_UNKNOWN loc_5C8A; // weak
_UNKNOWN loc_5CAA; // weak
_UNKNOWN loc_5CCC; // weak
_UNKNOWN loc_5CEE; // weak
_UNKNOWN loc_5D10; // weak
_UNKNOWN loc_5D32; // weak
_UNKNOWN loc_5D54; // weak
_UNKNOWN loc_5D74; // weak
_UNKNOWN loc_5DC6; // weak
_UNKNOWN loc_5E18; // weak
_UNKNOWN loc_5E2C; // weak
_UNKNOWN loc_5E94; // weak
_UNKNOWN loc_5ED4; // weak
_UNKNOWN sub_61A4; // weak
_UNKNOWN sub_61E4; // weak
_UNKNOWN sub_6212; // weak
_UNKNOWN sub_6240; // weak
_UNKNOWN sub_626E; // weak
_UNKNOWN sub_629C; // weak
_UNKNOWN sub_62CA; // weak
_UNKNOWN sub_62F8; // weak
_UNKNOWN sub_6326; // weak
_UNKNOWN sub_6358; // weak
_UNKNOWN sub_6396; // weak
_UNKNOWN sub_63CC; // weak
_UNKNOWN sub_6402; // weak
_UNKNOWN sub_6438; // weak
_UNKNOWN sub_646E; // weak
_UNKNOWN sub_64A4; // weak
_UNKNOWN sub_64DA; // weak
_UNKNOWN sub_6510; // weak
_UNKNOWN sub_6546; // weak
_UNKNOWN sub_6704; // weak
_UNKNOWN sub_671C; // weak
_UNKNOWN sub_6726; // weak
_UNKNOWN sub_6730; // weak
_UNKNOWN sub_673A; // weak
_UNKNOWN sub_6744; // weak
_UNKNOWN sub_674E; // weak
_UNKNOWN sub_6766; // weak
_UNKNOWN sub_6782; // weak
_UNKNOWN sub_67A8; // weak
_UNKNOWN sub_67C6; // weak
_UNKNOWN sub_67D6; // weak
_UNKNOWN sub_67E8; // weak
_UNKNOWN sub_67FA; // weak
_UNKNOWN sub_680A; // weak
_UNKNOWN sub_681A; // weak
_UNKNOWN loc_682C; // weak
_UNKNOWN loc_6C5A; // weak
_UNKNOWN loc_73B6; // weak
int dword_82A0 = 25202; // weak
int dword_918C = 23131; // weak
int dword_91AC = 6778732; // weak
int dword_91B8 = 5908776; // weak
int dword_91C0 = 4401448; // weak
int dword_91D4 = 4335912; // weak
int dword_EDE8[2] = { -498089976, -450891772 }; // weak
int dword_FA0C = 29477; // weak
__int16 word_FFFE = 164; // weak
int dword_101A0 = 25456; // weak
int dword_101A4 = 3224420; // weak
int dword_101A8 = 3158884; // weak
int dword_101AC = 3748452; // weak
int dword_101B0 = 3682916; // weak
int dword_101B4 = 3617380; // weak
int dword_101B8 = 3551844; // weak
int dword_101BC = 3486308; // weak
int dword_101C0 = 3420772; // weak
int dword_101C4 = 3355236; // weak
int dword_101C8 = 3289700; // weak
int dword_101CC = 3224164; // weak
int dword_101D0 = 3158628; // weak
int dword_101D4 = 3748196; // weak
int dword_101D8 = 3682660; // weak
int dword_101DC = 3617124; // weak
int dword_101E0 = 3551588; // weak
int dword_101E4 = 3486052; // weak
int dword_101E8 = 3420516; // weak
int dword_101EC = 3354980; // weak
int dword_101F0 = 3289444; // weak
int dword_101F4 = 3223908; // weak
int dword_101F8 = 3158372; // weak
int dword_101FC = 14692; // weak
int dword_10200 = 14436; // weak
int dword_10204 = 14180; // weak
int dword_10208 = 13924; // weak
int dword_1020C = 13668; // weak
int dword_10210 = 13412; // weak
int dword_10214 = 13156; // weak
int dword_10218 = 12900; // weak
int dword_1021C = 12644; // weak
int dword_10220 = 12388; // weak
int dword_10224 = 3224435; // weak
int dword_10228 = 3158899; // weak
int dword_1022C = 3748467; // weak
int dword_10230 = 3682931; // weak
int dword_10234 = 3617395; // weak
int dword_10238 = 3551859; // weak
int dword_1023C = 3486323; // weak
int dword_10240 = 3420787; // weak
int dword_10244 = 3355251; // weak
int dword_10248 = 3289715; // weak
int dword_1024C = 3224179; // weak
int dword_10250 = 3158643; // weak
int dword_10254 = 3748211; // weak
int dword_10258 = 3682675; // weak
int dword_1025C = 3617139; // weak
int dword_10260 = 3551603; // weak
int dword_10264 = 3486067; // weak
int dword_10268 = 3420531; // weak
int dword_1026C = 3354995; // weak
int dword_10270 = 3289459; // weak
int dword_10274 = 3223923; // weak
int dword_10278 = 3158387; // weak
int dword_1027C = 14707; // weak
int dword_10280 = 14451; // weak
int dword_10284 = 14195; // weak
int dword_10288 = 13939; // weak
int dword_1028C = 13683; // weak
int dword_10290 = 13427; // weak
int dword_10294 = 13171; // weak
int dword_10298 = 12915; // weak
int dword_1029C = 12659; // weak
int dword_102A0 = 12403; // weak
int dword_102A4 = 3289458; // weak
int dword_102A8 = 3223922; // weak
int dword_102AC = 3158386; // weak
int dword_102B0 = 14706; // weak
int dword_102B4 = 14450; // weak
int dword_102B8 = 14194; // weak
int dword_102BC = 13938; // weak
int dword_102C0 = 13682; // weak
int dword_102C4 = 13426; // weak
int dword_102C8 = 13170; // weak
int dword_102CC = 12914; // weak
int dword_102D0 = 12658; // weak
int dword_102D4 = 12402; // weak
int dword_102D8 = 28787; // weak
int dword_102DC = 29292; // weak
_UNKNOWN unk_120E4; // weak
int (*off_13CA0)() = &sub_A548; // weak
void *off_13CF0 = &unk_12138; // weak
void *off_13D60 = (void *)0xF751; // weak
_UNKNOWN unk_14000; // weak
_UNKNOWN unk_14004; // weak
int dword_14014 = -1; // weak
char byte_14018; // weak
_DWORD dword_1401C[14]; // idb
char byte_14054; // weak
int dword_14058[]; // weak
int dword_1405C; // weak
int dword_14060; // weak
int dword_14064[]; // weak
int dword_14068; // weak
int dword_1406C; // weak
int dword_14070; // weak
int dword_14074; // weak
int dword_14078; // weak
int dword_1407C; // weak
int dword_14080; // weak
int dword_14084; // weak
int dword_14190; // weak
int dword_1420C; // weak
int dword_14210; // weak
int dword_14214; // weak
int dword_14218; // weak
char algn_1421C[4]; // weak
int dword_14220; // weak
int dword_14224; // weak
int dword_14228; // weak
int dword_1422C; // weak
int dword_14230; // weak
int dword_14234; // weak
int dword_14238; // weak
int dword_1423C; // weak
int dword_14240; // weak
int dword_14244; // weak
char algn_14248[8]; // weak
_UNKNOWN unk_14250; // weak
// extern _UNKNOWN _stack_chk_guard; weak
// extern _UNKNOWN _sF; weak
// extern _UNKNOWN _ZTH11g_lastStack; weak
//----- (00001698) --------------------------------------------------------
int sub_1698()
{
return _cxa_finalize(&unk_14000);
}
//----- (000016A8) --------------------------------------------------------
int __fastcall sub_16A8(int a1, int a2, int **a3, int a4)
{
int *v6; // r0
int v7; // r11
int v8; // r4
int *v9; // r8
int *v10; // r10
int v11; // r4
_DWORD *v12; // r0
__int16 v13; // r1
int v14; // r0
int **v15; // r4
_DWORD *v16; // r12
int v17; // r9
int *v18; // r2
int v19; // r5
int v20; // r1
int v21; // r8
_DWORD *v22; // r11
_DWORD *v23; // r0
__int16 v24; // r1
int v25; // r4
int v27; // [sp+10h] [bp-40h] BYREF
int *v28; // [sp+14h] [bp-3Ch]
int v29; // [sp+18h] [bp-38h]
int v30; // [sp+1Ch] [bp-34h]
_DWORD v31[5]; // [sp+20h] [bp-30h] BYREF
v29 = a2;
v6 = *a3;
v30 = *(_DWORD *)a4;
v7 = *v6;
v8 = *(_DWORD *)(a4 + 52) + *(_DWORD *)(a4 + 56) + 1;
v9 = &v27 - 2 * v8;
memset(v9, 0, 8 * v8);
v31[0] = v7;
v31[1] = (char *)&v27 - ((12 * v8 + 7) & 0xFFFFFFF8);
v31[2] = 0;
v10 = v9;
if ( !*(_BYTE *)(a4 + 24) )
{
v11 = *a3[1];
if ( v11 )
{
v12 = sub_2160((int)v31, v11);
v13 = *((_WORD *)v12 + 1);
*((_BYTE *)v12 + 1) = 1;
*((_WORD *)v12 + 1) = v13 + 1;
}
else
{
v11 = 0;
}
*v9 = v11;
v10 = v9 + 2;
}
v14 = *(_DWORD *)(a4 + 60);
if ( v14 >= 1 )
{
v15 = a3 + 2;
v16 = v31;
v17 = 0;
while ( 1 )
{
v18 = v15[v17];
switch ( *(_BYTE *)(*(_DWORD *)(a4 + 20) + v17) )
{
case 'B':
v10[2 * v17] = *(char *)v18;
goto LABEL_20;
case 'C':
v10[2 * v17] = *(unsigned __int16 *)v18;
goto LABEL_20;
case 'D':
case 'J':
*(_QWORD *)&v10[2 * v17] = *(_QWORD *)v18;
goto LABEL_20;
case 'E':
case 'G':
case 'H':
case 'K':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
goto LABEL_27;
case 'F':
case 'I':
v10[2 * v17] = *v18;
goto LABEL_20;
case 'L':
v19 = *v18;
if ( *v18 )
{
v20 = *v18;
v28 = v9;
v21 = v7;
v22 = v16;
v23 = sub_2160((int)v16, v20);
v16 = v22;
v7 = v21;
v9 = v28;
v24 = *((_WORD *)v23 + 1) + 1;
*((_BYTE *)v23 + 1) = 1;
*((_WORD *)v23 + 1) = v24;
v14 = *(_DWORD *)(a4 + 60);
}
else
{
v19 = 0;
}
v10[2 * v17] = v19;
goto LABEL_20;
case 'S':
v10[2 * v17] = *(__int16 *)v18;
goto LABEL_20;
default:
if ( *(_BYTE *)(*(_DWORD *)(a4 + 20) + v17) != 90 )
{
LABEL_27:
sub_8590(
v30,
v7,
3,
"Unhandled argument type %c of `%s.%s`",
*(unsigned __int8 *)(*(_DWORD *)(a4 + 20) + v17),
*(const char **)(*(_DWORD *)(a4 + 8) + 80),
*(const char **)(a4 + 12));
return _stack_chk_guard - v31[3];
}
v10[2 * v17] = *(unsigned __int8 *)v18;
LABEL_20:
if ( ++v17 >= v14 )
goto LABEL_21;
break;
}
}
}
LABEL_21:
sub_2CD0((_DWORD *)a4, v7, (int)v9, (int)v31, v29, 0, 0);
v25 = v30;
if ( *(_BYTE *)(v30 + 56) )
{
if ( &_ZTH11g_lastStack )
ZTH11g_lastStack();
if ( !*(_DWORD *)_emutls_get_address(&unk_14004) && (*(int (__fastcall **)(int))(*(_DWORD *)v7 + 912))(v7) )
sub_8D94(v25, v7);
}
return _stack_chk_guard - v31[3];
}
// 13E0: using guessed type int ZTH11g_lastStack(void);
// 13EC: using guessed type int __fastcall _emutls_get_address(_DWORD);
//----- (000018B4) --------------------------------------------------------
__int64 __fastcall Java_com_xunmeng_nvwavm_NvwaVM_nwvmLoad(int a1, int a2, int a3, int a4, int a5)
{
const char *v8; // r6
_DWORD *v9; // r0
int v10; // r4
char v11; // r1
int v12; // r0
v8 = (const char *)(*(int (__fastcall **)(int, int, _DWORD))(*(_DWORD *)a1 + 676))(a1, a4, 0);
v9 = sub_818C((int *)a1, a3, v8);
v10 = (int)v9;
if ( v9 )
{
v11 = a5;
v12 = v9[1];
if ( a5 )
v11 = 1;
*(_BYTE *)(v10 + 56) = v11;
if ( v12 >= 0 )
{
sub_28E0(*(_DWORD *)(*(_DWORD *)(*(_DWORD *)(v10 + 44) + 4 * v12) + 8), a1);
if ( !sub_8D94(v10, a1) )
sub_1940(a1, 0, v10, 0, *(_DWORD *)(v10 + 4), 0, 0, 0);
}
}
(*(void (__fastcall **)(int, int, const char *))(*(_DWORD *)a1 + 680))(a1, a4, v8);
return (unsigned int)v10;
}
//----- (00001940) --------------------------------------------------------
int __fastcall sub_1940(int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8)
{
int v10; // r8
int v11; // r5
int *v12; // r6
int *v13; // r1
int v14; // r5
_DWORD *v15; // r0
__int16 v16; // r1
int *v17; // r6
int v18; // r5
int v19; // r9
int v20; // r11
int v21; // r0
__int64 v22; // r0
int v23; // r1
_DWORD *v24; // r0
__int16 v25; // r1
int v27[2]; // [sp+10h] [bp-38h] BYREF
_DWORD v28[5]; // [sp+18h] [bp-30h] BYREF
v10 = *(_DWORD *)(*(_DWORD *)(a3 + 44) + 4 * a5);
v11 = *(_DWORD *)(v10 + 52) + *(_DWORD *)(v10 + 56) + 1;
v12 = &v27[-2 * v11];
memset(v12, 0, 8 * v11);
v28[0] = a1;
v28[1] = (char *)v27 - ((12 * v11 + 7) & 0xFFFFFFF8);
v28[2] = 0;
v13 = v12;
if ( !*(_BYTE *)(v10 + 24) )
{
v14 = a7;
if ( a7 )
{
v15 = sub_2160((int)v28, a7);
v16 = *((_WORD *)v15 + 1);
*((_BYTE *)v15 + 1) = 1;
*((_WORD *)v15 + 1) = v16 + 1;
}
else
{
v14 = 0;
}
*v12 = v14;
v13 = v12 + 2;
}
v27[0] = (int)v12;
v17 = v13;
if ( *(int *)(v10 + 60) >= 1 )
{
v18 = 0;
v19 = *(_DWORD *)(v10 + 20);
v27[1] = *(_DWORD *)(a3 + 52);
while ( 1 )
{
v20 = (*(int (__fastcall **)(int, int, int))(*(_DWORD *)a1 + 692))(a1, a8, v18);
if ( sub_8D94(a3, a1) )
return _stack_chk_guard - v28[3];
switch ( *(_BYTE *)(v19 + v18) )
{
case 'B':
v21 = sub_2274(a1);
goto LABEL_22;
case 'C':
v21 = sub_2224(a1);
goto LABEL_22;
case 'D':
LODWORD(v22) = sub_2404(a1);
*(_QWORD *)&v17[2 * v18] = v22;
goto LABEL_23;
case 'E':
case 'G':
case 'H':
case 'K':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
goto LABEL_33;
case 'F':
v21 = sub_2364(a1);
goto LABEL_22;
case 'I':
v21 = sub_2314(a1);
goto LABEL_22;
case 'J':
v17[2 * v18] = sub_23B4(a1);
v17[2 * v18 + 1] = v23;
goto LABEL_23;
case 'L':
if ( v20 )
{
v24 = sub_2160((int)v28, v20);
v25 = *((_WORD *)v24 + 1);
*((_BYTE *)v24 + 1) = 1;
*((_WORD *)v24 + 1) = v25 + 1;
v21 = v20;
}
else
{
v21 = 0;
}
goto LABEL_22;
case 'S':
v21 = sub_22C4(a1);
goto LABEL_22;
default:
if ( *(_BYTE *)(v19 + v18) != 90 )
{
LABEL_33:
sub_8590(
a3,
a1,
3,
"Cannot handle argument type %c of `%s.%s`",
*(unsigned __int8 *)(v19 + v18),
*(const char **)(*(_DWORD *)(v10 + 8) + 80),
*(const char **)(v10 + 12));
return _stack_chk_guard - v28[3];
}
v21 = sub_21D4(a1);
LABEL_22:
v17[2 * v18] = v21;
LABEL_23:
if ( *(_BYTE *)(v19 + v18) != 76 )
(*(void (__fastcall **)(int, int))(*(_DWORD *)a1 + 92))(a1, v20);
if ( sub_8D94(a3, a1) )
return _stack_chk_guard - v28[3];
if ( ++v18 >= *(_DWORD *)(v10 + 60) )
goto LABEL_27;
break;
}
}
}
LABEL_27:
sub_2CD0((_DWORD *)v10, a1, v27[0], (int)v28, a6, 0, 0);
if ( *(_BYTE *)(a3 + 56) )
{
if ( &_ZTH11g_lastStack )
ZTH11g_lastStack();
if ( !*(_DWORD *)_emutls_get_address(&unk_14004) && (*(int (__fastcall **)(int))(*(_DWORD *)a1 + 912))(a1) )
sub_8D94(a3, a1);
}
return _stack_chk_guard - v28[3];
}
// 1A70: variable 'v22' is possibly undefined
// 1AAC: variable 'v23' is possibly undefined
// 13E0: using guessed type int ZTH11g_lastStack(void);
// 13EC: using guessed type int __fastcall _emutls_get_address(_DWORD);
//----- (00001BDC) --------------------------------------------------------
void __fastcall Java_com_xunmeng_nvwavm_NvwaVM_nwvmDestory(int a1, int a2, void *a3)
{
if ( a3 )
{
sub_8634((int)a3, a1);
j_free(a3);
}
}
//----- (00001BF8) --------------------------------------------------------
int __fastcall Java_com_xunmeng_nvwavm_NvwaVM_callV(int a1, int a2, int a3, int a4, int a5, int a6, int a7)
{
return sub_1940(a1, a5, a3, a4, a5, 0, a6, a7);
}
//----- (00001C14) --------------------------------------------------------
int __fastcall Java_com_xunmeng_nvwavm_NvwaVM_callZ(int a1, int a2, int a3, int a4, int a5, int a6, int a7)
{
char v8[12]; // [sp+10h] [bp-18h] BYREF
sub_1940(a1, (int)v8, a3, a4, a5, (int)v8, a6, a7);
return (unsigned __int8)v8[0];
}
//----- (00001C5C) --------------------------------------------------------
int __fastcall Java_com_xunmeng_nvwavm_NvwaVM_callC(int a1, int a2, int a3, int a4, int a5, int a6, int a7)
{
__int16 v8[6]; // [sp+10h] [bp-18h] BYREF
sub_1940(a1, (int)v8, a3, a4, a5, (int)v8, a6, a7);
return (unsigned __int16)v8[0];
}
//----- (00001CA4) --------------------------------------------------------
int __fastcall Java_com_xunmeng_nvwavm_NvwaVM_callB(int a1, int a2, int a3, int a4, int a5, int a6, int a7)
{
char v8[12]; // [sp+10h] [bp-18h] BYREF
sub_1940(a1, (int)v8, a3, a4, a5, (int)v8, a6, a7);
return v8[0];
}
//----- (00001CEC) --------------------------------------------------------
int __fastcall Java_com_xunmeng_nvwavm_NvwaVM_callS(int a1, int a2, int a3, int a4, int a5, int a6, int a7)
{
__int16 v8[6]; // [sp+10h] [bp-18h] BYREF
sub_1940(a1, (int)v8, a3, a4, a5, (int)v8, a6, a7);
return v8[0];
}
//----- (00001D34) --------------------------------------------------------
int __fastcall Java_com_xunmeng_nvwavm_NvwaVM_callI(int a1, int a2, int a3, int a4, int a5, int a6, int a7)
{
int v8[3]; // [sp+10h] [bp-18h] BYREF
sub_1940(a1, (int)v8, a3, a4, a5, (int)v8, a6, a7);
return v8[0];
}
//----- (00001D7C) --------------------------------------------------------
int __fastcall Java_com_xunmeng_nvwavm_NvwaVM_callF(int a1, int a2, int a3, int a4, int a5, int a6, int a7)
{
int v8[3]; // [sp+10h] [bp-18h] BYREF
sub_1940(a1, (int)v8, a3, a4, a5, (int)v8, a6, a7);
return v8[0];
}
//----- (00001DC4) --------------------------------------------------------
__int64 __fastcall Java_com_xunmeng_nvwavm_NvwaVM_callJ(int a1, int a2, int a3, int a4, int a5, int a6, int a7)
{
__int64 v8; // [sp+10h] [bp-18h] BYREF