-
Notifications
You must be signed in to change notification settings - Fork 0
/
deobfuscate-optimize-rand-inlining.js
76 lines (65 loc) · 33.3 KB
/
deobfuscate-optimize-rand-inlining.js
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
// 1. Total iterations - 1565
// 2. True branch for regular ints is never executed
let path = 'check_flag_standalone_unflattened.js' // process.argv[2];
let esprima = require('esprima');
let fs = require('fs');
let astring = require('astring');
let estraverse = require('estraverse');
let code = fs.readFileSync(path, 'utf8');
let tree = esprima.parse(code);
random_vals = [0.9409662359975814, 0.8785819538827613, 0.5130407304372815, 0.7256221596588996, 0.17527533615471103, 0.9929672978757351, 0.8623205489359524, 0.9598383713854883, 0.5711906828499043, 0.4324858231578699, 0.5829236999651066, 0.603258416933854, 0.1062005853649004, 0.35083911966653125, 0.3972588960559926, 0.6728039460116046, 0.49706002636427304, 0.498302182450747, 0.20045974291630908, 0.7113368487259963, 0.6370372950911851, 0.7185463472203986, 0.7266535381272237, 0.5647282141241159, 0.22238613035308075, 0.3181251255095592, 0.950624061171341, 0.07201262575749845, 0.41704744656565995, 0.2947339061054659, 0.535163957946913, 0.23854184122022426, 0.2627791125936856, 0.1791971118865201, 0.21455900020328555, 0.2843399438862031, 0.9133030883564446, 0.00637371868173231, 0.5830816613364265, 0.9963795449431474, 0.7407188228278767, 0.341482291882629, 0.5698031760588698, 0.5613148552507368, 0.2628392414875107, 0.8732338042302414, 0.06530649049555715, 0.4229707287086475, 0.18098656211303843, 0.5486857660078461, 0.5110753928130285, 0.13571943906931194, 0.34220003706547986, 0.776176774683949, 0.6631186273507577, 0.9045357149992808, 0.0288770539515959, 0.6015997505343975, 0.3458740440791066, 0.27731162517152885, 0.5342441306909258, 0.4264696403782178, 0.5416690629272434, 0.806306500885783, 0.6833569901793795, 0.27749008641093953, 0.11590670996082353, 0.7236133681636572, 0.8644215435931437, 0.006492304552551342, 0.7767719152491883, 0.179907907495239, 0.7007319162215224, 0.98279624011341, 0.929137068393938, 0.0078011861699898155, 0.4404894844177696, 0.935502483628672, 0.33881554427022165, 0.3463475561801317, 0.3309244339504287, 0.38372450235794764, 0.2437250655646972, 0.5735044249122541, 0.8271451587978975, 0.06369320355762831, 0.06153044672451968, 0.3542348468352716, 0.8944769732534952, 0.7398887887726955, 0.2463087321285775, 0.17486127402793739, 0.22066750176600292, 0.23282708932784857, 0.0010882632931834557, 0.26750820858918645, 0.18092100807697964, 0.565204260220872, 0.7879099209490519, 0.6549597972445036, 0.7400364668214334, 0.07333708187481869, 0.2936707607503424, 0.46656324649056113, 0.3547609329965795, 0.05486740342701113, 0.630199427510455, 0.7304656606300881, 0.15899875160421817, 0.10895973894986666, 0.647169660304129, 0.03424617207955083, 0.3787181142748708, 0.549982535180584, 0.21376763028277312, 0.9606150759361598, 0.6540058125959436, 0.38764944008088764, 0.5159992278949381, 0.599294482874652, 0.05888975522375084, 0.2738381402490422, 0.7335709271761668, 0.3537867848075946, 0.23015199401156128, 0.6738462210558347, 0.6194049161768698, 0.5446402698252073, 0.8040206049641885, 0.9545989244300332, 0.40853587590573603, 0.8542157739156697, 0.23780364489498207, 0.6005195975131148, 0.38717148000237156, 0.1131842017054221, 0.702202892003059, 0.05767984781140445, 0.10968549599702082, 0.19298793548639392, 0.45709328002697447, 0.3425251337687383, 0.48845188302326936, 0.3539755866998262, 0.8952568484138794, 0.1651091081828444, 0.8422411796462024, 0.8578704773764338, 0.42679898499554647, 0.7170826202731602, 0.7253748641274971, 0.3038038331551538, 0.7348070481822828, 0.9389699705541887, 0.2752141999232016, 0.5006871475951966, 0.5820085195147855, 0.6120355764830774, 0.4695965575076666, 0.680186187255424, 0.11812433980749937, 0.10187323858882524, 0.2477312363960964, 0.8101838725109065, 0.03877639487861284, 0.4979991586764503, 0.6969128572258849, 0.28176301960371086, 0.9627513942539541, 0.26263201116849166, 0.19712204077942164, 0.1788825227527644, 0.7520392980514135, 0.8996270946283538, 0.6589295335140541, 0.84654505100735, 0.6721280645726586, 0.692704650549028, 0.989418968585621, 0.9297203580455944, 0.7082134066255912, 0.8827055370048735, 0.5296584158825224, 0.7091127428704338, 0.5915382678809664, 0.2795467849193005, 0.4156825219200655, 0.8043702692110102, 0.5155904462971039, 0.4941239582408823, 0.13350664064335604, 0.40217938770093675, 0.28969104191571726, 0.3490248241310918, 0.48929338818354395, 0.6517968786790722, 0.45766218691876315, 0.2789427734056926, 0.44214394849009686, 0.6291411627752104, 0.5029468913534545, 0.7553403231207663, 0.21602588464432015, 0.7036619494679759, 0.8939071184596601, 0.08163789104259322, 0.8279361891381434, 0.004010411945564618, 0.9337346842442484, 0.17904684126843962, 0.4047892864311664, 0.3302202369071936, 0.6217300500734357, 0.7802100237956788, 0.7824031789092778, 0.482517773500178, 0.043271508472267683, 0.4143900994693004, 0.9388893327515218, 0.335740543780386, 0.7778363686666177, 0.8110189872348224, 0.4232864849659339, 0.4447332406855946, 0.4893264028996316, 0.4335118990362896, 0.6761071377760481, 0.26037162602039654, 0.4267712249174642, 0.8236038671765447, 0.27228855813836317, 0.8206516827730264, 0.9530284872079045, 0.2423676400872572, 0.388871870234875, 0.8312855406145065, 0.9885934937448673, 0.5152142840640153, 0.8133331159038288, 0.29406453323546966, 0.20900722543680383, 0.9117537251115746, 0.052793719533408945, 0.5854073097987118, 0.655417829562063, 0.7821402522649257, 0.5691784612258439, 0.38426366253552113, 0.1727754919880755, 0.5532896238152989, 0.24295194431972722, 0.34460138326159506, 0.1008972524751286, 0.9998298576526041, 0.45771307640168524, 0.08264322576025096, 0.9631861965627142, 0.3074582811125135, 0.4604028230430879, 0.5681104259689576, 0.12393963105871286, 0.44011223246042297, 0.7687983121112494, 0.9365177582280644, 0.009672303235903623, 0.09743630383969948, 0.5957025899398187, 0.43612407854369417, 0.6441470772198097, 0.8759764635407992, 0.8908547911960474, 0.059265380312290894, 0.08729517342640647, 0.2686354358188219, 0.315212727604959, 0.06195427275216492, 0.7633111011337002, 0.44482657188955055, 0.2574311436313008, 0.9147567572840758, 0.8414117678419859, 0.4813483089420125, 0.28613637626230237, 0.8603644288256311, 0.5187577092108917, 0.9296571861263412, 0.8965166270234373, 0.49414580640641215, 0.6954649877952208, 0.8896055441382382, 0.6543463423001512, 0.01220015023434251, 0.4276562677223603, 0.2188975021362054, 0.23824720529709498, 0.9554293082973111, 0.27564281922630673, 0.2393339347384038, 0.9490683717347319, 0.29987353247677295, 0.8136091746751628, 0.8328545436843997, 0.8746038501182016, 0.5026074100625906, 0.13481551306816075, 0.6666294375933068, 0.4121440507760714, 0.9228124837817262, 0.5598920634554461, 0.8560760879474476, 0.5354562836607273, 0.2857135660320562, 0.29089624169752826, 0.9742909642946771, 0.10216220151795596, 0.8227104180573077, 0.7490977605317659, 0.14241007397722139, 0.6277613914655251, 0.49172734894376435, 0.18312953058606785, 0.09703880323953751, 0.8984495178861633, 0.6816828624977989, 0.3373274946810718, 0.48206240110779586, 0.06008137870595909, 0.6864640543739067, 0.5741226906620924, 0.9125708140701148, 0.6119985467746256, 0.13096932540586037, 0.9246498726304206, 0.6265579971160551, 0.4057029686223388, 0.020772667097878506, 0.2747196130681775, 0.9134429296574995, 0.6160460944338872, 0.9655473843675972, 0.7057025275206688, 0.008344561625632796, 0.05236932443674669, 0.16514446076350064, 0.49326722016878977, 0.8851762668253509, 0.17496260259620233, 0.7148401107098568, 0.7257832456256841, 0.866460540745611, 0.4414130547610706, 0.6619497563914787, 0.36090332459159824, 0.36305924219899155, 0.014463545359319596, 0.8964298638726653, 0.460045882985334, 0.7113111199028619, 0.9838912748923636, 0.30864191194131485, 0.829011962212681, 0.5428348862596926, 0.1357666831694313, 0.38413843995671004, 0.4806853810322116, 0.71559461132334, 0.5162812807036767, 0.9557435250348327, 0.047994433338300224, 0.0971580595903756, 0.0244850007923767, 0.82903704542006, 0.6759567854251873, 0.23588565239965442, 0.5753197679894184, 0.5527255694979905, 0.7350470582518953, 0.12808299884173113, 0.6174314035628548, 0.9046448885117244, 0.5828640371030189, 0.7092483971230874, 0.8693405381251851, 0.2774514165274664, 0.7739703771146182, 0.5305597898114907, 0.11793427157857916, 0.4843339780913405, 0.7727095634286822, 0.1248442688239555, 0.14301347673138953, 0.6615864719295397, 0.18055017477663649, 0.07128996641676322, 0.6044083418129922, 0.9630996577752224, 0.5516009186443562, 0.10456781158572426, 0.3380598730766413, 0.4814820545974292, 0.7547352225505704, 0.5148175031635189, 0.903441506311706, 0.6151331635001802, 0.9439472610103405, 0.7476776632104323, 0.3009583967704115, 0.6989046635703886, 0.28276452027017873, 0.6869179407686663, 0.13920375895432158, 0.5658515825068744, 0.70475817055953, 0.27284245258804063, 0.23214731126143962, 0.6714126865091263, 0.8671133878904043, 0.7781196465520381, 0.7343470608900298, 0.6700819541123462, 0.1466257823578485, 0.7025536586769525, 0.2668266082714488, 0.6084033755252622, 0.18112241561274423, 0.9645221547487883, 0.7681495081960408, 0.8758557822867632, 0.37412482283947024, 0.4929938026657028, 0.9419549483892964, 0.14059170191959525, 0.5096618312663794, 0.7042250734751518, 0.5277410378534515, 0.07101692328457787, 0.012696813072470281, 0.3608682514457602, 0.27283538643928296, 0.4323094445618276, 0.648712224038337, 0.34847766978126504, 0.6082315913276619, 0.9527355662555614, 0.5447633132112448, 0.11728327282909135, 0.732851765554613, 0.301200974968606, 0.2582437898252914, 0.2729574630858784, 0.6283717933696602, 0.2729808841214869, 0.30960627388551965, 0.3600312874392555, 0.2906862911827013, 0.021351823216172017, 0.2734408421040728, 0.7591933613534152, 0.526727319952663, 0.6106647070723938, 0.5101611130430248, 0.14809933078634918, 0.45437858399652464, 0.8019432560395086, 0.11552281889586458, 0.06642863241699781, 0.6655157389116921, 0.5856336572651419, 0.7572426788566635, 0.7352981455822227, 0.2920018691334334, 0.5476478910095475, 0.15741395146710668, 0.9999559351775791, 0.13604354364098992, 0.899309781889142, 0.8812645848092415, 0.6938188924645681, 0.5287509967320334, 0.1365871523546478, 0.9398487010965364, 0.8551560680014603, 0.47256700067439583, 0.02439327732888974, 0.13739053807646107, 0.8580781215454645, 0.3635805424217329, 0.4740869998442747, 0.8205631926505346, 0.14549893813557868, 0.8548428034292157, 0.3993839741886638, 0.7367064954895497, 0.5145594296564935, 0.5036258398602518, 0.37384395156465877, 0.7562748336985567, 0.7636790711825447, 0.5436843080490708, 0.7304958047743371, 0.7982889397309321, 0.9328393459215412, 0.8862229289037928, 0.3763460425129661, 0.6368441738010109, 0.65677826639684, 0.8820766112283349, 0.8412687325328316, 0.2999963138103352, 0.9458824888369772, 0.5306579140901213, 0.34802868072479587, 0.7065177553773265, 0.933874650156129, 0.4562918166695322, 0.9152560762951789, 0.009976102061436398, 0.2857237616093966, 0.2362722716434953, 0.6994731157500844, 0.5920285102394358, 0.8991759729978122, 0.5944870605876424, 0.4769982118679754, 0.9085264255873167, 0.5623675722138539, 0.9959938049344326, 0.3679597597738813, 0.7249763129870186, 0.46504504264125535, 0.6388214142581787, 0.9929512938080745, 0.5260311193161857, 0.7947175148461902, 0.7032519550177054, 0.9110142692276082, 0.5722164880944822, 0.8792320016393091, 0.34034528037859535, 0.7458759587105304, 0.26681323983359384, 0.42126531218686925, 0.01854636295087153, 0.9052307050924058, 0.3561765813143831, 0.4244711176601015, 0.6421797964171543, 0.03598782512174581, 0.0780126744274372, 0.3508539512390676, 0.22085123631519887, 0.9011717475571415, 0.5356402802959961, 0.6574351526234483, 0.7754608280203741, 0.04192142395613874, 0.0751732434167609, 0.7430853432725468, 0.2688811914147886, 0.638328474725663, 0.9245983413676591, 0.7746517106801347, 0.02197255910506657, 0.874754442018262, 0.5265957548954376, 0.28548479834846363, 0.7730146694218507, 0.09202547161748442, 0.2071478252427983, 0.708508800674484, 0.9581978866686005, 0.4328485945655678, 0.932033831768134, 0.4039423350448985, 0.5260553431486688, 0.18529388991789042, 0.06656582499306896, 0.05747518052267675, 0.5903882424452465, 0.49708603640526183, 0.2952833939151396, 0.14893139291770874, 0.9151859916718814, 0.9513844549155077, 0.02187885174789672, 0.07473813240044436, 0.1621120270500911, 0.31239252786835436, 0.9548093760795993, 0.7665641902336144, 0.2652736249057108, 0.2541137667588942, 0.23884490120974844, 0.7228401625277057, 0.29635665564041114, 0.9100195291202435, 0.13064938893399614, 0.5320159502869151, 0.503316660224352, 0.13712730069833023, 0.2987825794821801, 0.22617320274286, 0.034589825783124306, 0.7610017005018019, 0.9615334552591599, 0.632710287841014, 0.2499193438068108, 0.36096724980584893, 0.4735796575812026, 0.7153421130285986, 0.2545384835487223, 0.8303427857334029, 0.6381908910553296, 0.42796386521891194, 0.28932088846335247, 0.3147693234701452, 0.9128127038316998, 0.33622514417250526, 0.19517619083399684, 0.18654230616226397, 0.7478659903900382, 0.8479154452901212, 0.05974071155605998, 0.7121533602841315, 0.4317713787537021, 0.9378680181094783, 0.30042872692892186, 0.8484300848832853, 0.5945141380217198, 0.5220033846026266, 0.8067023544937431, 0.36217285300052726, 0.3459467639857583, 0.9763090600459512, 0.35902714475008013, 0.8400400229927381, 0.6179550973900481, 0.2309508855126876, 0.8041749489274006, 0.030053966416904387, 0.8891122750307996, 0.051454355312275935, 0.5532633527511583, 0.1478449876155794, 0.6843775544703852, 0.4983069847716872, 0.795658481806609, 0.7847691163328179, 0.21209969609263069, 0.7898631340914166, 0.5040913212361384, 0.5502311922092433, 0.4931148830420635, 0.893101225732637, 0.8641845321507247, 0.7168714469835695, 0.2366555138333999, 0.667249933702283, 0.800309700259755, 0.195628086172984, 0.8685248050067937, 0.11243414159076148, 0.020204637060710517, 0.8174122314189491, 0.6368480284688682, 0.28487553943016053, 0.8953524896938161, 0.8419414136176775, 0.7362765738510901, 0.46012522198559225, 0.7659781042623022, 0.4319372024889905, 0.9864006442964972, 0.7858924098106326, 0.5385337753282153, 0.8676633382900194, 0.5332265939865988, 0.7483441722833264, 0.1493085702750243, 0.11567312675265473, 0.2715370050404431, 0.7530910488368139, 0.3367512018829826, 0.8871442628522535, 0.804736552377769, 0.3598590423489032, 0.5891506694284985, 0.9227461996275812, 0.3744975501697585, 0.37411092787061917, 0.8333315650518083, 0.52513659605679, 0.5798512433164369, 0.7124414017834932, 0.3475541448768884, 0.8540216927551436, 0.7840698114030791, 0.5992385798569786, 0.49838676223783596, 0.865131882733851, 0.34543156367985683, 0.6447960287448733, 0.31372424083960815, 0.8668551634384867, 0.6356209570147611, 0.7691194332375995, 0.09995061149563722, 0.8525029454878177, 0.999624161189341, 0.9901885803084345, 0.9411622222608098, 0.6032583228731845, 0.6512166020278742, 0.8433424137698831, 0.2703961378065196, 0.9891529604293374, 0.7058966218982516, 0.8865151011814836, 0.4199538518536212, 0.6184604275687748, 0.9015523284273053, 0.14665333790686041, 0.5812522580593196, 0.0255242249977099, 0.645149256766633, 0.37947067735681705, 0.6725374945225804, 0.5238224617620191, 0.7573625947421097, 0.3471319820496226, 0.4160308780839479, 0.024456763697447315, 0.6519850241792857, 0.8236804541490512, 0.08104889120182857, 0.9443289301649391, 0.39112454705328803, 0.7772379309870778, 0.9194501981708811, 0.9497607791483167, 0.1258332992220179, 0.782759083186807, 0.9783792580185382, 0.47884062328492183, 0.6240691091532176, 0.830712699328318, 0.21851712307387405, 0.43770820802636545, 0.2167977618468402, 0.38158037054160054, 0.6323753557157679, 0.2407578220267248, 0.1379712517724503, 0.6047450919300343, 0.16563648912049933, 0.5178517346030422, 0.18548351598524748, 0.27365838638089657, 0.5708749272476972, 0.5638008436645277, 0.8891895868882189, 0.3052780916079949, 0.9641201921469633, 0.3125147712244949, 0.9971499860203654, 0.35087227383220254, 0.18884105549712982, 0.5159642610582282, 0.43626009675145916, 0.733751639745406, 0.2687080580289991, 0.19993720026516026, 0.6097515728280212, 0.863796883302975, 0.9024803220267246, 0.054775858379677134, 0.6256107432514795, 0.3163881296410709, 0.07512210492406846, 0.4266106108908012, 0.7815090073812592, 0.8537046311731971, 0.47710185160356544, 0.3373833852559438, 0.5971252567264604, 0.5955636906242694, 0.3827083564006233, 0.431977223185666, 0.7359765409634145, 0.34958035289407996, 0.08302675948586846, 0.791148606090629, 0.21320222754285756, 0.1864416392745729, 0.6942809413060453, 0.43155407183231076, 0.6575428804260612, 0.9371705249739248, 0.5349223386990243, 0.9616282662458762, 0.9159305787902436, 0.26985387190145116, 0.4291045380356715, 0.8819355708737706, 0.2677304486695795, 0.26451789167253614, 0.9696196313133509, 0.4089636594253989, 0.08064526513823744, 0.0033913239795022587, 0.8739787096973284, 0.7442982652745098, 0.9291666210240874, 0.6038253054792608, 0.8675750090347403, 0.5495481230939498, 0.5791704389027941, 0.12954142399030544, 0.0156401029917399, 0.6257699155743988, 0.7482793460329049, 0.2947167553061858, 0.22327110815515572, 0.39458049431009257, 0.7174503707820776, 0.5800085397548858, 0.7400363230312312, 0.3322716336836171, 0.9927122697096546, 0.9996503986274647, 0.6302865299240288, 0.03274182547926463, 0.46448767196887464, 0.9490624202478923, 0.7367519403468312, 0.07955591110640281, 0.21755297457248157, 0.36562019514726196, 0.17997566062344306, 0.7438908582047512, 0.40991019856816235, 0.7622988324839148, 0.8384519207416399, 0.8301735823125087, 0.04459512665947529, 0.9825312068779948, 0.14329395641685294, 0.023160082645502067, 0.8814915124863008, 0.6069040890340518, 0.7524996671501278, 0.14823585658294802, 0.15173039004485145, 0.6435665674030393, 0.7868278378060116, 0.9099964524375124, 0.060467503446199, 0.5525155565675295, 0.7434842867657623, 0.7302798674624142, 0.3421533495133935, 0.22550521272569823, 0.3182859715724249, 0.6446505551109583, 0.4746906226387815, 0.028905494088955708, 0.2663109576383367, 0.6123196927555326, 0.9374873894618072, 0.21193591016072566, 0.392845241905315, 0.8780895108843643, 0.20124289014914165, 0.20092640823235097, 0.6466334636253037, 0.808540266054659, 0.7138910133871958, 0.2923342226634371, 0.04616558168727747, 0.038128171474565375, 0.07104993617952227, 0.5997483145829838, 0.5650677807011768, 0.8267361943247535, 0.7351446148222591, 0.3625004530667282, 0.30500646630057315, 0.40635567664656014, 0.8378726171445787, 0.7587338072553598, 0.43978111671417075, 0.26943504359399073, 0.29023462446643555, 0.5024924939902977, 0.6711550211752839, 0.20486964239133298, 0.8277078354094893, 0.5756962268982484, 0.9523484349652009, 0.8018507575251279, 0.6527813196148491, 0.43293857786852197, 0.032149047567502365, 0.8237270955870568, 0.12692928063039477, 0.7380226023067091, 0.5713231632599975, 0.33094507180424415, 0.24836468390705901, 0.2527637684708479, 0.5701930443063359, 0.47330220434962444, 0.33797737878857603, 0.025996227298248575, 0.08948079067705583, 0.7443339446383961, 0.2815825792222457, 0.0014489846215479663, 0.11593882269005906, 0.021932851722720637, 0.9586074265317375, 0.6877274815719769, 0.3973900232574259, 0.36493820364068386, 0.012212542801629978, 0.5045813170160753, 0.5716252403111126, 0.9597443224846656, 0.36979475305480713, 0.2014396900973101, 0.6833574491536631, 0.6277650882629353, 0.7901073414865001, 0.03971712331187738, 0.0980861007462066, 0.29133526684420263, 0.7084270598489375, 0.07508908815905646, 0.6335142870955022, 0.7492473194615983, 0.9561370504783973, 0.9443688070346852, 0.44724565347485834, 0.4108799596210384, 0.06833768365189452, 0.9987613596005565, 0.30433912725330736, 0.41558216146261473, 0.0916477669899598, 0.37605477744491633, 0.8312505055218125, 0.0527029903394014, 0.2100891976027639, 0.04288532692409741, 0.5328029055803347, 0.9799248540136216, 0.769850816427319, 0.836429228032199, 0.4330459227364394, 0.09553106154047009, 0.9931762509392343, 0.31372570091046037, 0.09770807208347643, 0.41809894254329794, 0.6187820343251069, 0.1254797975998132, 0.5663943507395934, 0.25466226871067654, 0.33996266442602696, 0.3050918989698297, 0.08583093289828425, 0.15344756686681382, 0.9624606095359967, 0.9700588181115786, 0.021986251505871524, 0.5662223608354564, 0.7826867536886437, 0.005117935075067859, 0.029796815800914755, 0.8341197759863801, 0.5414119179796277, 0.06974998805192545, 0.5427278362669885, 0.5176443009096316, 0.2700845353831878, 0.6200225796087069, 0.4163584341505713, 0.48500579969293334, 0.6215791151060168, 0.2590339935393684, 0.803487070368595, 0.6052246191850268, 0.05635802129840228, 0.12742527761248623, 0.35195427616815955, 0.7396670318515912, 0.06497096637554733, 0.053564265510515296, 0.6701305762875285, 0.8906714032502208, 0.40195633909044837, 0.7922230102903367, 0.9808519292582096, 0.2549474763547439, 0.8511357771812249, 0.9089320227790028, 0.7419707238334441, 0.9690075727681071, 0.48005941464388213, 0.06362683453395857, 0.09109169151094632, 0.5127164741742358, 0.8864404517173852, 0.5360599647240807, 0.7731494522810298, 0.5603780465370343, 0.5807244620292382, 0.8677587238996016, 0.854266472273852, 0.823382954283044, 0.8152625378225138, 0.9658807466035382, 0.9835120272793754, 0.7265470872998723, 0.11617100543725889, 0.6666987212209015, 0.6837678067869739, 0.05159914892684481, 0.6216315315643701, 0.8307792277685151, 0.021474159762402634, 0.8474879307436176, 0.3358808199255592, 0.3832878987738033, 0.7140008812634031, 0.8606466094585736, 0.356796168630112, 0.017815293530254017, 0.9956163918721883, 0.07201825454928179, 0.623373085215293, 0.7039237291586999, 0.7927801466186015, 0.6438780846419072, 0.6899249398708132, 0.4311899515626503, 0.23920630093276363, 0.08792475138940925, 0.5380137721184881, 0.2436912811167189, 0.35987781545805, 0.38752567836250496, 0.061219118870213585, 0.8612516750038657, 0.26159030996689103, 0.6671099906282014, 0.602022224190432, 0.986485695618877, 0.022550748343993954, 0.9520453265703559, 0.31508477350464115, 0.6260703817646114, 0.6443646345763889, 0.3504356579016301, 0.5894828344081904, 0.2804017702991426, 0.33344084233289295, 0.17947891326608967, 0.34555269817097245, 0.02107697021169508, 0.15216153669331933, 0.681875771432223, 0.5822984117160228, 0.6309537413050774, 0.7709246807733516, 0.5537907970582931, 0.558550807828182, 0.40062897173546586, 0.15592608581938072, 0.8951770832339365, 0.8009294344979137, 0.8692123846399411, 0.8407531700624242, 0.5640016318598648, 0.07053379218146172, 0.7186321269635894, 0.5097754185375176, 0.2606409153698075, 0.7984264824863243, 0.23054467293299385, 0.014516825246460696, 0.13591278831987275, 0.13532984435843365, 0.6921620002800879, 0.8683727150066154, 0.21871177503159878, 0.9459464678532952, 0.20450579447593276, 0.7962514225595283, 0.9771209981585827, 0.4253166155288881, 0.5629887612982838, 0.6983603602389252, 0.17941582903146847, 0.3727733792180785, 0.6313274889811666, 0.6886699566319827, 0.6845357115083921, 0.3511302799792373, 0.4487989564551178, 0.03244258616527662, 0.14258329484845422, 0.920338961916493, 0.7480533647377028, 0.2391810906736651, 0.4086066382599589, 0.7077876183051475, 0.33755213569816056, 0.35420211868185514, 0.16749014246585392, 0.5950271972102765, 0.7863976340196506, 0.7751508464326144, 0.9380279774842215, 0.39285162964943776, 0.778304019735186, 0.292045701958743, 0.6480634399237444, 0.9494464528586803, 0.9323976898306676, 0.666204895451477, 0.24057966175946066, 0.4703063887999672, 0.5663449564172423, 0.4377630467339284, 0.6550850008371787, 0.8235058809872859, 0.8631528213541153, 0.3505944422910603, 0.18934258320877073, 0.2474352526179595, 0.7326440460194816, 0.17108758496262655, 0.6483807814054958, 0.8695265430308199, 0.989434185522784, 0.9821955974402938, 0.39200846961476077, 0.16027971643024985, 0.6597528335243279, 0.5853000973509261, 0.558213079269352, 0.4069041705230785, 0.18157127539443918, 0.3489983226290625, 0.4860582404124554, 0.838424796054307, 0.5159235218863285, 0.5828643774259581, 0.3011779022581311, 0.5794128535697898, 0.7123643677049818, 0.6417544513313969, 0.232520361230816, 0.04003281423440508, 0.8494980226992683, 0.37497145530037157, 0.8327383192527635, 0.350939491310962, 0.7912384599760705, 0.6525038724421879, 0.9263530376514029, 0.7128516418494237, 0.6727513034734938, 0.19769479746208618, 0.17860456700877236, 0.581761782893407, 0.29101585775617234, 0.9174193389294893, 0.9238738179434662, 0.676009377158953, 0.4538550626674953, 0.4525998434925418, 0.5177181379320064, 0.36947449005881006, 0.3218469063143512, 0.4157065630912973, 0.4474269498709824, 0.44503920202117, 0.4012368199545415, 0.98411821420861, 0.29877708160476946, 0.049367872620740716, 0.5495893715091933, 0.7413217117241311, 0.5374647047755161, 0.49648991752820537, 0.9633103609472096, 0.2845151132638357, 0.009429542420319459, 0.5688308305739302, 0.5876703288063616, 0.3493781530408939, 0.18672321773960388, 0.19586625909459077, 0.3622045821105302, 0.25598778532985755, 0.00647784611212221, 0.6671022078516531, 0.11739691597598134, 0.672591221002498, 0.29588520229334536, 0.32162615180952114, 0.2031766390034031, 0.12109774040621968, 0.0786272581387899, 0.788767276259337, 0.9309337347656572, 0.9026823941006283, 0.3299715953155411, 0.11345859542225689, 0.10613564511194773, 0.9501398751098478, 0.7786935788170348, 0.4639098954630554, 0.08076377455663852, 0.44360733963244203, 0.664385892060952, 0.5455675498511492, 0.882483214294739, 0.524118175927625, 0.5856319601538933, 0.9625018712284699, 0.46118904166577557, 0.5730643359763823, 0.3273555894443594, 0.07348666510675805, 0.9297684054344806, 0.8706226508149293, 0.5969187804364398, 0.2315195190794046, 0.050484619757591664, 0.4182677700806663, 0.2905796978671613, 0.7416154875725556, 0.13625417153544972, 0.23494048561825487, 0.6873069634745326, 0.19563050650100866, 0.45777808541459586, 0.6724570891858603, 0.7903750032432733, 0.24663833963065174, 0.6680211268660556, 0.5907548680463761, 0.14350618073527732, 0.6245221106356924, 0.12748022190984054, 0.07252713191583093, 0.24538386468119744, 0.9982324632808768, 0.9728212618936378, 0.8726358236234908, 0.957920768919446, 0.8621776061645143, 0.34564703048390544, 0.9512550194318234, 0.1337780401921893, 0.5163386266587615, 0.13399547541547174, 0.7803960301300232, 0.0373686459297522, 0.9994254342796745, 0.301356760521982, 0.06460936482025104, 0.7060810222430773, 0.6749887506153309, 0.9616932786232311, 0.9770553861125661, 0.025554304293953, 0.7838601347104992, 0.2755777370842314, 0.39649926668780555, 0.26726131485992055, 0.9446130768519392, 0.830166027525687, 0.8964318931893336, 0.4105281051616543, 0.4915299348948634, 0.4082965237515581, 0.6865391407990618, 0.5404702784057391, 0.7857715993687069, 0.34527517626660376, 0.9788402821262248, 0.18161100732854663, 0.44655295029662745, 0.060856858143288894, 0.6185989247630543, 0.8532772416802401, 0.0676832597228969, 0.3867017821709664, 0.14089397701316808, 0.44543316443839065, 0.1361947603505429, 0.9903359028336334, 0.7734484790632341, 0.4456999644742583, 0.5673709088709911, 0.42515236881607477, 0.7491246770062874, 0.7947244757725829, 0.0650617350227809, 0.627233443444779, 0.17499585308794385, 0.0036673008849628097, 0.4968743711068455, 0.7723667297879273, 0.8234792241222411, 0.3237012949107809, 0.31396327181980066, 0.127131239529932, 0.2952308930693017, 0.6778615445792591, 0.902860999684896, 0.431093113943523, 0.9775245726390269, 0.32180270832567115, 0.14911753611954937, 0.4686840789921456, 0.5090077908703441, 0.22840044638350854, 0.4440164312790509, 0.8726578451275544, 0.5721224829235863, 0.39957489602002494, 0.33474738968368034, 0.658911777352641, 0.8970980759262863, 0.2137691358802647, 0.8897921074397539, 0.5113705804574005, 0.7238519007481712, 0.04483845125264807, 0.36221266550075026, 0.6720171817367044, 0.7938993254432296, 0.3928852098210789, 0.15785903099817267, 0.311481596553161, 0.7746597088482452, 0.9156084524153076, 0.04940463628844238, 0.4278022699374513, 0.7056807081807395, 0.38646527929087027, 0.5757116401394129, 0.8389750902022066, 0.1771803391117639, 0.7507089654439565, 0.9796987882441073, 0.4311947023982705, 0.033240391024207394, 0.2715207503113577, 0.7883464716454034, 0.6498489575746405, 0.6243139432602711, 0.7154690691521515, 0.9818774255249354, 0.48041823065475464, 0.4989699116501709, 0.5488001747269509, 0.24762878411040878, 0.8483605879387415, 0.19422755760416477, 0.679036053486866, 0.8430644626477577, 0.6795049719265229, 0.4829859740636806, 0.06429419207608378, 0.9679510128243816, 0.5487909818836378, 0.8952269100620438, 0.5581180936148988, 0.9114474666310897, 0.025847003405203184, 0.8407562044209009, 0.2900120744461061, 0.551051147318574, 0.6699414759325497, 0.8623207781090969, 0.6312823104013394, 0.3261820296069011, 0.7587230429649632, 0.12528856921136144, 0.09022151920719024, 0.701324166969755, 0.2942397518820836, 0.608389185460797, 0.5763274745085438, 0.025945074188743256, 0.5560697444975078, 0.12318367858542945, 0.46499644538590856, 0.3948282066589046, 0.1904332800063635, 0.7468948266016426, 0.07035870755319329, 0.533596303461517, 0.8656437453678705, 0.5388765171827954, 0.7053578947586945, 0.14494551368013342, 0.6489461919562509, 0.7097805992491395, 0.8690681224367045, 0.6432702314968972, 0.37648881725871375, 0.8302245215840283, 0.7614564253137723, 0.29651419704719784, 0.4683868880072397, 0.9139673514177171, 0.3860212549406483, 0.16070099269652327, 0.23921113777975922, 0.4944028158468503, 0.011187464669670799, 0.5070182073537775, 0.8243643418519784, 0.8463932920411217, 0.20664945210283858, 0.15620992133137301, 0.09925425539238453, 0.29545026515434447, 0.6010213843960208, 0.7735543346387337, 0.6188689180221436, 0.31649840317504396, 0.40675838630896144, 0.06741203758916114, 0.2417974791150579, 0.6027980702773867, 0.4816208914805573, 0.08322953634626384, 0.43387031605937887, 0.5382990779206496, 0.9337775753004445, 0.77300115075684, 0.6048060284155059, 0.6433552482725731, 0.016209033434549047, 0.963528673275813, 0.20066759074890772, 0.6513346896001557, 0.5545649640637269, 0.32299905734933176, 0.9196493868542113, 0.3693275336742623, 0.6630269421118802, 0.007866377570974636, 0.049827653679026085, 0.35427955744684003, 0.013266245410366473, 0.21426778242509803, 0.5079550406488222, 0.7936692833875796, 0.23171096409706005, 0.45935875451767405, 0.23313432438492376, 0.034178885882145016, 0.26667433573606303, 0.9708701034647484, 0.7372074351023288, 0.393054262117001, 0.8101408589929804, 0.6551491079405858, 0.9788426841985634, 0.4252152675625491, 0.036279275559232715, 0.649901600461249, 0.8258724792292318, 0.15222148027593674, 0.3718142112280829, 0.99936050458723, 0.49833331975189044, 0.6255033167043307, 0.30495936499851806, 0.1774608806577611, 0.6014745209936967, 0.4972221608577565, 0.42365676666575913, 0.9215675559078629, 0.8647914356509405, 0.9890161509266848, 0.7109106283987507, 0.9661620555422525, 0.9406978723016717, 0.6658402299280277, 0.4889393036976275, 0.81587863318173, 0.1224354145269324, 0.9422474199632718, 0.9737993586646796, 0.5310335827746206, 0.3318654495781608, 0.6725454922696636, 0.30500265527014037, 0.9386743393039347, 0.2511272421430819, 0.4067035727653694, 0.9033281575338057, 0.5350376403171686, 0.193716331472237, 0.35299693196614457, 0.7383973406664035, 0.8337884182888156, 0.5136352679858054, 0.9584056899557951, 0.7271392103329655, 0.31571806952178916, 0.37101491729400227, 0.5244702736010485, 0.889907149324944, 0.6026561259436847, 0.9490842276141822, 0.389457230928717, 0.9892555980400557, 0.9274553600141311, 0.8530964600920734, 0.4312354742657507, 0.3574594182498094, 0.9478714201844554, 0.37731835697648397, 0.9135778526836724, 0.34827790426636973, 0.06509558150880057, 0.4950044637441926, 0.8586158407207312, 0.21844596537063432, 0.7030964344093811, 0.7885896330471036, 0.058245713339033056, 0.9147924395065818, 0.5927808820395628, 0.6033010369255551, 0.12724008277902166, 0.637046706844578, 0.3515915691497624, 0.9735914469523486, 0.9439492610296489, 0.633262475266033, 0.7168940176445757, 0.4439013470995312, 0.89902152121792, 0.3146409723154233, 0.7022744442257398, 0.7262554590990697, 0.853091694544788, 0.7008374710093452, 0.5238741557451152, 0.1521110625586939, 0.40996441623315194, 0.1966628415320053, 0.7365327953127119, 0.8142892562902004];
var random_idx = 0;
var total_replaced = 0;
deobfuscated = estraverse.replace(tree, {
enter: function (node, parent) {
if (node.type == 'UpdateExpression' && node.argument.name == 'rand_idx') {
random_idx++;
return;
}
if (node.type == 'MemberExpression' && node.object.name == 'random_vals') {
var value = random_vals[random_idx];
random_idx++;
total_replaced++;
return {
type: 'Literal',
value: value
};
}
if (node.type != 'IfStatement') return;
if (node.test == undefined) return;
if (node.test.left == undefined) return;
if (node.type == 'IfStatement' && node.test.left.type == 'MemberExpression' && node.test.left.object.name == 'random_vals') {
total_replaced++;
var new_node = {
type: 'Literal',
value: random_vals[random_idx],
raw: random_vals[random_idx]
};
node.test.left = new_node;
if (random_vals[random_idx] < 0.5) {
// node = {
// type: 'BlockStatement',
// body: node.consequent.body
// }
node.alternate = {
type: 'BlockStatement',
body: []
};
} else {
// node = {
// type: 'BlockStatement',
// body: node.alternate.body
// }
node.consequent = {
type: 'BlockStatement',
body: []
};
}
random_idx++;
return node;
}
}
});
console.log('Replaced ' + total_replaced + ' random calls');
console.log('Random index: ' + random_idx);
fs.writeFileSync('check_flag_standalone_unflattened_replaced_rand_calls.js', astring.generate(deobfuscated));