From 75a0f7fd1de03de38f4db528e30f848e0142e868 Mon Sep 17 00:00:00 2001 From: cr0nyx Date: Sun, 26 Jan 2025 15:23:27 +0300 Subject: [PATCH] udp support for csharp templates --- neoreg.py | 233 +++++++++++++++++++++++++++++++----------- templates/tunnel.ashx | 137 +++++++++++++++++++------ templates/tunnel.aspx | 89 +++++++++++++++- templates/tunnel.cs | 152 ++++++++++++++++++++------- 4 files changed, 481 insertions(+), 130 deletions(-) diff --git a/neoreg.py b/neoreg.py index 2c8abbc..d528984 100755 --- a/neoreg.py +++ b/neoreg.py @@ -370,8 +370,27 @@ def parseSocks5(self, sock): if cmd == b"\x02": # BIND raise SocksCmdNotImplemented("Socks5 - BIND not implemented") elif cmd == b"\x03": # UDP - raise SocksCmdNotImplemented("Socks5 - UDP not implemented") + self.cmd = "UDP" + try: + serverIp = inet_aton(target) + except: + # Forged temporary address 0.0.0.0 + serverIp = inet_aton('0.0.0.0') + mark = self.setupUDPRelay(target, targetPortNum) + if mark: + self.udpSocket = socket(AF_INET, SOCK_DGRAM) + self.udpSocket.bind(('', 0)) # ! + self.udpClientAddr = self.pSocket.getpeername()[0] + self.udpClientPort = None + + sock.sendall(VER + SUCCESS + b"\x00" + b"\x01" + inet_aton(self.udpSocket.getsockname()[0]) + self.udpSocket.getsockname()[1].to_bytes(2, 'big')) + return True + else: + sock.sendall(VER + REFUSED + b"\x00" + b"\x01" + serverIp + targetPort) + return False + elif cmd == b"\x01": # CONNECT + self.cmd = "CONNECT" try: serverIp = inet_aton(target) except: @@ -478,6 +497,32 @@ def setupRemoteSession(self, target, port): else: return False + def setupUDPRelay(self, target, port): + self.mark = self.session_mark() + self.target = target.encode() + self.port = port + + info = {'CMD': 'UDP', 'MARK': self.mark, 'IP': self.target, 'PORT': str(self.port)} + + if ( '.php' in self.connectURLs[0] or PHPSERVER ) and not GOSERVER: + try: + rinfo = self.neoreg_request(info, timeout=PHPTIMEOUT) + except: + log.info("[UDP] [%s:%d] Session mark (%s)" % (self.target, self.port, self.mark)) + return self.mark + else: + log.debug("[DEBUG] setupUDPRelay, info: " + str(info)) + rinfo = self.neoreg_request(info) + log.debug("[DEBUG] setupUDPRelay, rinfo: " + str(rinfo)) + + status = rinfo["STATUS"] + log.debug("[DEBUG] setupUDPRelay, status: " + str(status)) + log.debug("[DEBUG] setupUDPRelay, data: " + str(rinfo["DATA"])) + if status == "OK": + log.info("[UDP] [%s:%d] Session mark: %s" % (self.target, self.port, self.mark)) + return self.mark + else: + return False def closeRemoteSession(self): if not self.connect_closed: @@ -500,69 +545,143 @@ def closeRemoteSession(self): def reader(self): - try: - info = {'CMD': 'READ', 'MARK': self.mark} - n = 0 - while True: - try: - if self.connect_closed or self.pSocket.fileno() == -1: - break - rinfo = self.neoreg_request(info) - if rinfo['STATUS'] == 'OK': - data = rinfo['DATA'] - data_len = len(data) - - if data_len == 0: - sleep(READINTERVAL) - elif data_len > 0: - n += 1 - transferLog.info("[%s:%d] [%s] No.%d <<<< [%d byte]" % (self.target, self.port, self.mark, n, data_len)) - while data: - writed_size = self.pSocket.send(data) - data = data[writed_size:] - if data_len < 500: + if self.cmd == "CONNECT": + try: + info = {'CMD': 'READ', 'MARK': self.mark} + n = 0 + while True: + try: + if self.connect_closed or self.pSocket.fileno() == -1: + break + rinfo = self.neoreg_request(info) + if rinfo['STATUS'] == 'OK': + data = rinfo['DATA'] + data_len = len(data) + + if data_len == 0: sleep(READINTERVAL) - else: - break + elif data_len > 0: + n += 1 + transferLog.info("[%s:%d] [%s] No.%d <<<< [%d byte]" % (self.target, self.port, self.mark, n, data_len)) + while data: + writed_size = self.pSocket.send(data) + data = data[writed_size:] + if data_len < 500: + sleep(READINTERVAL) + else: + break - except error: # python2 socket.send error - pass - except Exception as ex: - log.exception(ex) - break - finally: - self.closeRemoteSession() + except error: # python2 socket.send error + pass + except Exception as ex: + log.exception(ex) + break + finally: + self.closeRemoteSession() + elif self.cmd == "UDP": + try: + info = {'CMD': 'READ', 'MARK': self.mark} + n = 0 + while True: + try: + if self.udpClientPort == None: + continue + if self.connect_closed or self.pSocket.fileno() == -1: + break + rinfo = self.neoreg_request(info) + if rinfo['STATUS'] == 'OK': + data = rinfo['DATA'] + data_len = len(data) + + if data_len == 0: + sleep(READINTERVAL) + elif data_len > 0: + n += 1 + transferLog.info("[%s:%d] [%s] No.%d <<<< [%d byte]" % (self.target, self.port, self.mark, n, data_len)) + header = b"\x00\x00" + b"\x00" + b"\x01" + inet_aton(str(rinfo['IP'])) + int(str(rinfo['PORT'])).to_bytes(2, 'big') + while data: + writed_size = self.udpSocket.sendto(header + data, (self.udpClientAddr, self.udpClientPort)) + data = data[writed_size:] + if data_len < 500: + sleep(READINTERVAL) + else: + break + except error: # python2 socket.send error + pass + except Exception as ex: + log.exception(ex) + break + finally: + self.closeRemoteSession() def writer(self): - try: - info = {'CMD': 'FORWARD', 'MARK': self.mark} - n = 0 - while True: - try: - raw_data = self.pSocket.recv(READBUFSIZE) - if not raw_data: + if self.cmd == "CONNECT": + try: + info = {'CMD': 'FORWARD', 'MARK': self.mark} + n = 0 + while True: + try: + raw_data = self.pSocket.recv(READBUFSIZE) + if not raw_data: + break + info['DATA'] = raw_data + rinfo = self.neoreg_request(info) + if rinfo['STATUS'] != "OK": + break + n += 1 + transferLog.info("[%s:%d] [%s] No.%d >>>> [%d byte]" % (self.target, self.port, self.mark, n, len(raw_data))) + if len(raw_data) < READBUFSIZE: + sleep(WRITEINTERVAL) + except timeout: + continue + except error: break - info['DATA'] = raw_data - rinfo = self.neoreg_request(info) - if rinfo['STATUS'] != "OK": + except OSError: break - n += 1 - transferLog.info("[%s:%d] [%s] No.%d >>>> [%d byte]" % (self.target, self.port, self.mark, n, len(raw_data))) - if len(raw_data) < READBUFSIZE: - sleep(WRITEINTERVAL) - except timeout: - continue - except error: - break - except OSError: - break - except Exception as ex: - log.exception(ex) - break - finally: - self.closeRemoteSession() - + except Exception as ex: + log.exception(ex) + break + finally: + self.closeRemoteSession() + elif self.cmd == "UDP": + try: + info = {'CMD': 'FORWARD', 'MARK': self.mark} + n = 0 + while True: + try: + raw_data, address = self.udpSocket.recvfrom(READBUFSIZE) + if address[0] != self.udpClientAddr: + log.error("[UDP Relay] packet from non client") + continue + + if self.udpClientPort == None: + self.udpClientPort = address[1] + + if not raw_data: + break + info['IP'] = str(int(raw_data[4])) + "." + str(int(raw_data[5])) + "." + str(int(raw_data[6])) + "." + str(int(raw_data[7])) + info['PORT'] = str(int.from_bytes(raw_data[8:10])) + info['DATA'] = raw_data[10:] + data_len = len(info['DATA']) + rinfo = self.neoreg_request(info) + if rinfo['STATUS'] != "OK": + break + n += 1 + transferLog.info("[%s:%d] [%s] No.%d >>>> [%d byte]" % (self.target, self.port, self.mark, n, data_len)) + if data_len < READBUFSIZE: + sleep(WRITEINTERVAL) + except timeout: + continue + except error: + break + except OSError: + break + except Exception as ex: + log.exception(ex) + break + finally: + self.closeRemoteSession() def run(self): try: diff --git a/templates/tunnel.ashx b/templates/tunnel.ashx index e3773a3..605eeec 100644 --- a/templates/tunnel.ashx +++ b/templates/tunnel.ashx @@ -212,6 +212,34 @@ public class GenericHandler1 : IHttpHandler, System.Web.SessionState.IRequiresSe rinfo[STATUS] = "FAIL"; rinfo[ERROR] = ex.Message; } + } else if (cmd == "UDP") { + try { + String target = (String) info[IP]; + int port = int.Parse((String) info[PORT]); + IPAddress ip; + try { + ip = IPAddress.Parse(target); + } catch (Exception ex) { + IPHostEntry host = Dns.GetHostByName(target); + ip = host.AddressList[0]; + } + System.Net.IPEndPoint localEP = new IPEndPoint(ip, port); + Socket relay = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); + + try { + relay.Bind(localEP); + relay.Blocking = false; + context.Application.Add(mark, relay); + rinfo[STATUS] = "OK"; + rinfo[DATA] = ((IPEndPoint)relay.LocalEndPoint).Address.ToString() + ":" + ((IPEndPoint)relay.LocalEndPoint).Port.ToString(); + } catch (Exception ex) { + rinfo[STATUS] = "FAIL"; + rinfo[ERROR] = ex.Message; + } + } catch (Exception ex) { + rinfo[STATUS] = "FAIL"; + rinfo[ERROR] = ex.Message; + } } else if (cmd == "DISCONNECT") { try { Socket s = (Socket) context.Application[mark]; @@ -221,41 +249,90 @@ public class GenericHandler1 : IHttpHandler, System.Web.SessionState.IRequiresSe context.Application.Remove(mark); } else if (cmd == "FORWARD") { Socket s = (Socket) context.Application[mark]; - try { - s.Send((byte[]) info[DATA]); - rinfo[STATUS] = "OK"; - } catch (Exception ex) { - rinfo[STATUS] = "FAIL"; - rinfo[ERROR] = ex.Message; + if (s.ProtocolType == ProtocolType.Tcp) { + try { + s.Send((byte[]) info[DATA]); + rinfo[STATUS] = "OK"; + } catch (Exception ex) { + rinfo[STATUS] = "FAIL"; + rinfo[ERROR] = ex.Message; + } + } else if (s.ProtocolType == ProtocolType.Udp) { + try { + String target = (String) info[IP]; + int port = int.Parse((String) info[PORT]); + IPAddress ip = IPAddress.Parse(target); + System.Net.IPEndPoint remoteEP = new IPEndPoint(ip, port); + + s.SendTo((byte[]) info[DATA], remoteEP); + rinfo[STATUS] = "OK"; + } catch (Exception ex) { + rinfo[STATUS] = "FAIL"; + rinfo[ERROR] = ex.Message; + } } } else if (cmd == "READ") { - try { - Socket s = (Socket) context.Application[mark]; - int maxRead = MAXREADSIZE; - int readbuflen = READBUF; - int readLen = 0; - byte[] readBuff = new byte[readbuflen]; - MemoryStream readData = new MemoryStream(); + Socket s = (Socket) context.Application[mark]; + if (s.ProtocolType == ProtocolType.Tcp) { try { - int c = s.Receive(readBuff); - while (c > 0) { - byte[] newBuff = new byte[c]; - System.Buffer.BlockCopy(readBuff, 0, newBuff, 0, c); - string b64 = Convert.ToBase64String(newBuff); - readData.Write(newBuff, 0, c); - readLen += c; - if (c < readbuflen || readLen >= maxRead) - break; - c = s.Receive(readBuff); + int maxRead = MAXREADSIZE; + int readbuflen = READBUF; + int readLen = 0; + byte[] readBuff = new byte[readbuflen]; + MemoryStream readData = new MemoryStream(); + try { + int c = s.Receive(readBuff); + while (c > 0) { + byte[] newBuff = new byte[c]; + System.Buffer.BlockCopy(readBuff, 0, newBuff, 0, c); + string b64 = Convert.ToBase64String(newBuff); + readData.Write(newBuff, 0, c); + readLen += c; + if (c < readbuflen || readLen >= maxRead) + break; + c = s.Receive(readBuff); + } + rinfo[DATA] = readData.ToArray(); + rinfo[STATUS] = "OK"; + } catch (SocketException ex) { + rinfo[STATUS] = "OK"; } - rinfo[DATA] = readData.ToArray(); - rinfo[STATUS] = "OK"; - } catch (SocketException ex) { - rinfo[STATUS] = "OK"; + } catch (Exception ex) { + rinfo[STATUS] = "FAIL"; + rinfo[ERROR] = ex.Message; + } + } else if (s.ProtocolType == ProtocolType.Udp) { + try { + int maxRead = MAXREADSIZE; + int readbuflen = READBUF; + int readLen = 0; + byte[] readBuff = new byte[readbuflen]; + MemoryStream readData = new MemoryStream(); + try { + EndPoint remoteEP = (EndPoint) new IPEndPoint(IPAddress.Any, 0); + int c = s.ReceiveFrom(readBuff, ref remoteEP); + while (c > 0) { + byte[] newBuff = new byte[c]; + System.Buffer.BlockCopy(readBuff, 0, newBuff, 0, c); + string b64 = Convert.ToBase64String(newBuff); + readData.Write(newBuff, 0, c); + readLen += c; + if (c < readbuflen || readLen >= maxRead) + break; + c = s.ReceiveFrom(readBuff, ref remoteEP); + } + var address = remoteEP.ToString().Split(':'); + rinfo[IP] = address[0]; + rinfo[PORT] = address[1]; + rinfo[DATA] = readData.ToArray(); + rinfo[STATUS] = "OK"; + } catch (SocketException ex) { + rinfo[STATUS] = "OK"; + } + } catch (Exception ex) { + rinfo[STATUS] = "FAIL"; + rinfo[ERROR] = ex.Message; } - } catch (Exception ex) { - rinfo[STATUS] = "FAIL"; - rinfo[ERROR] = ex.Message; } } context.Response.Write(StrTr(Convert.ToBase64String(blv_encode(rinfo)), en, de)); diff --git a/templates/tunnel.aspx b/templates/tunnel.aspx index 49a49b9..128e0bf 100644 --- a/templates/tunnel.aspx +++ b/templates/tunnel.aspx @@ -208,6 +208,34 @@ if (cmd != null) { rinfo[STATUS] = "FAIL"; rinfo[ERROR] = ex.Message; } + } else if (cmd == "UDP") { + try { + String target = (String) info[IP]; + int port = int.Parse((String) info[PORT]); + IPAddress ip; + try { + ip = IPAddress.Parse(target); + } catch (Exception ex) { + IPHostEntry host = Dns.GetHostByName(target); + ip = host.AddressList[0]; + } + System.Net.IPEndPoint localEP = new IPEndPoint(ip, port); + Socket relay = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); + + try { + relay.Bind(localEP); + relay.Blocking = false; + Application.Add(mark, relay); + rinfo[STATUS] = "OK"; + rinfo[DATA] = ((IPEndPoint)relay.LocalEndPoint).Address.ToString() + ":" + ((IPEndPoint)relay.LocalEndPoint).Port.ToString(); + } catch (Exception ex) { + rinfo[STATUS] = "FAIL"; + rinfo[ERROR] = ex.Message; + } + } catch (Exception ex) { + rinfo[STATUS] = "FAIL"; + rinfo[ERROR] = ex.Message; + } } else if (cmd == "DISCONNECT") { try { Socket s = (Socket)Application[mark]; @@ -215,8 +243,9 @@ if (cmd != null) { } catch (Exception ex){ } Application.Remove(mark); - } else if (cmd == "FORWARD") { - Socket s = (Socket)Application[mark]; + } else if (cmd == "FORWARD") { + Socket s = (Socket)Application[mark]; + if (s.ProtocolType == ProtocolType.Tcp) { try { s.Send((byte[]) info[DATA]); rinfo[STATUS] = "OK"; @@ -224,9 +253,26 @@ if (cmd != null) { rinfo[STATUS] = "FAIL"; rinfo[ERROR] = ex.Message; } - } else if (cmd == "READ") { + } + else if (s.ProtocolType == ProtocolType.Udp) { + try { + String target = (String) info[IP]; + int port = int.Parse((String) info[PORT]); + IPAddress ip = IPAddress.Parse(target); + System.Net.IPEndPoint remoteEP = new IPEndPoint(ip, port); + + s.SendTo((byte[]) info[DATA], remoteEP); + rinfo[STATUS] = "OK"; + } catch (Exception ex) { + rinfo[STATUS] = "FAIL"; + rinfo[ERROR] = ex.Message; + } + } + + } else if (cmd == "READ") { + Socket s = (Socket)Application[mark]; + if (s.ProtocolType == ProtocolType.Tcp) { try { - Socket s = (Socket)Application[mark]; int maxRead = MAXREADSIZE; int readbuflen = READBUF; int readLen = 0; @@ -253,8 +299,41 @@ if (cmd != null) { rinfo[STATUS] = "FAIL"; rinfo[ERROR] = ex.Message; } + } else if (s.ProtocolType == ProtocolType.Udp) { + try { + int maxRead = MAXREADSIZE; + int readbuflen = READBUF; + int readLen = 0; + byte[] readBuff = new byte[readbuflen]; + MemoryStream readData = new MemoryStream(); + try { + EndPoint remoteEP = (EndPoint) new IPEndPoint(IPAddress.Any, 0); + int c = s.ReceiveFrom(readBuff, ref remoteEP); + while (c > 0) { + byte[] newBuff = new byte[c]; + System.Buffer.BlockCopy(readBuff, 0, newBuff, 0, c); + string b64 = Convert.ToBase64String(newBuff); + readData.Write(newBuff, 0, c); + readLen += c; + if (c < readbuflen || readLen >= maxRead) + break; + c = s.ReceiveFrom(readBuff, ref remoteEP); + } + var address = remoteEP.ToString().Split(':'); + rinfo[IP] = address[0]; + rinfo[PORT] = address[1]; + rinfo[DATA] = readData.ToArray(); + rinfo[STATUS] = "OK"; + } catch (SocketException ex) { + rinfo[STATUS] = "OK"; + } + } catch (Exception ex) { + rinfo[STATUS] = "FAIL"; + rinfo[ERROR] = ex.Message; + } } - Response.Write(StrTr(Convert.ToBase64String(blv_encode(rinfo)), en, de)); + } + Response.Write(StrTr(Convert.ToBase64String(blv_encode(rinfo)), en, de)); } else { Response.Write(Encoding.Default.GetString(Convert.FromBase64String(StrTr(GeorgHello, de, en)))); } diff --git a/templates/tunnel.cs b/templates/tunnel.cs index 35470ba..4b28ccb 100644 --- a/templates/tunnel.cs +++ b/templates/tunnel.cs @@ -164,6 +164,35 @@ public Neoreg() rinfo[ERROR] = ex.Message; } } + else if (cmd == "UDP") { + try { + String target = (String) info[IP]; + int port = int.Parse((String) info[PORT]); + IPAddress ip; + try { + ip = IPAddress.Parse(target); + } catch (Exception ex) { + IPHostEntry host = Dns.GetHostByName(target); + ip = host.AddressList[0]; + } + System.Net.IPEndPoint localEP = new IPEndPoint(ip, port); + Socket relay = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); + + try { + relay.Bind(localEP); + relay.Blocking = false; + application.Add(mark, relay); + rinfo[STATUS] = "OK"; + rinfo[DATA] = ((IPEndPoint)relay.LocalEndPoint).Address.ToString() + ":" + ((IPEndPoint)relay.LocalEndPoint).Port.ToString(); + } catch (Exception ex) { + rinfo[STATUS] = "FAIL"; + rinfo[ERROR] = ex.Message; + } + } catch (Exception ex) { + rinfo[STATUS] = "FAIL"; + rinfo[ERROR] = ex.Message; + } + } else if (cmd == "DISCONNECT") { try @@ -180,56 +209,103 @@ public Neoreg() else if (cmd == "FORWARD") { Socket s = (Socket)application[mark]; - try - { - s.Send((byte[])info[DATA]); - rinfo[STATUS] = "OK"; + if (s.ProtocolType == ProtocolType.Tcp) { + try + { + s.Send((byte[])info[DATA]); + rinfo[STATUS] = "OK"; + } + catch (Exception ex) + { + rinfo[STATUS] = "FAIL"; + rinfo[ERROR] = ex.Message; + } } - catch (Exception ex) - { - rinfo[STATUS] = "FAIL"; - rinfo[ERROR] = ex.Message; + else if (s.ProtocolType == ProtocolType.Udp) { + try { + String target = (String) info[IP]; + int port = int.Parse((String) info[PORT]); + IPAddress ip = IPAddress.Parse(target); + System.Net.IPEndPoint remoteEP = new IPEndPoint(ip, port); + + s.SendTo((byte[]) info[DATA], remoteEP); + rinfo[STATUS] = "OK"; + } catch (Exception ex) { + rinfo[STATUS] = "FAIL"; + rinfo[ERROR] = ex.Message; + } } } else if (cmd == "READ") { - try - { - Socket s = (Socket)application[mark]; - int maxRead = MAXREADSIZE; - int readbuflen = READBUF; - int readLen = 0; - byte[] readBuff = new byte[readbuflen]; - MemoryStream readData = new MemoryStream(); - try - { - int c = s.Receive(readBuff); - while (c > 0) + Socket s = (Socket)application[mark]; + if (s.ProtocolType == ProtocolType.Tcp) { + try { + int maxRead = MAXREADSIZE; + int readbuflen = READBUF; + int readLen = 0; + byte[] readBuff = new byte[readbuflen]; + MemoryStream readData = new MemoryStream(); + try { + int c = s.Receive(readBuff); + while (c > 0) { + byte[] newBuff = new byte[c]; + System.Buffer.BlockCopy(readBuff, 0, newBuff, 0, c); + string b64 = Convert.ToBase64String(newBuff); + readData.Write(newBuff, 0, c); + readLen += c; + if (c < readbuflen || readLen >= maxRead) + break; + c = s.Receive(readBuff); + } + + rinfo[DATA] = readData.ToArray(); + rinfo[STATUS] = "OK"; + } + catch (SocketException ex) { - byte[] newBuff = new byte[c]; - System.Buffer.BlockCopy(readBuff, 0, newBuff, 0, c); - string b64 = Convert.ToBase64String(newBuff); - readData.Write(newBuff, 0, c); - readLen += c; - if (c < readbuflen || readLen >= maxRead) - break; - c = s.Receive(readBuff); + rinfo[STATUS] = "OK"; } - - rinfo[DATA] = readData.ToArray(); - rinfo[STATUS] = "OK"; } - catch (SocketException ex) + catch (Exception ex) { - rinfo[STATUS] = "OK"; + rinfo[STATUS] = "FAIL"; + rinfo[ERROR] = ex.Message; } } - catch (Exception ex) - { - rinfo[STATUS] = "FAIL"; - rinfo[ERROR] = ex.Message; + else if (s.ProtocolType == ProtocolType.Udp) { + try { + int maxRead = MAXREADSIZE; + int readbuflen = READBUF; + int readLen = 0; + byte[] readBuff = new byte[readbuflen]; + MemoryStream readData = new MemoryStream(); + try { + EndPoint remoteEP = (EndPoint) new IPEndPoint(IPAddress.Any, 0); + int c = s.ReceiveFrom(readBuff, ref remoteEP); + while (c > 0) { + byte[] newBuff = new byte[c]; + System.Buffer.BlockCopy(readBuff, 0, newBuff, 0, c); + string b64 = Convert.ToBase64String(newBuff); + readData.Write(newBuff, 0, c); + readLen += c; + if (c < readbuflen || readLen >= maxRead) + break; + c = s.ReceiveFrom(readBuff, ref remoteEP); + } + var address = remoteEP.ToString().Split(':'); + rinfo[IP] = address[0]; + rinfo[PORT] = address[1]; + rinfo[DATA] = readData.ToArray(); + rinfo[STATUS] = "OK"; + } catch (SocketException ex) { + rinfo[STATUS] = "OK"; + } + } catch (Exception ex) { + rinfo[STATUS] = "FAIL"; + rinfo[ERROR] = ex.Message; + } } - } httpResponse.Write(StrTr(Convert.ToBase64String(blv_encode(rinfo)), en, de)); }