-
malaohu 说:
@ChatGPT CentOS7 查看所以连接的IP
你可以使用
ss
命令来查看当前所有连接的 IP。以下是如何使用
ss
命令:-
打开终端,使用 root 用户或者 sudo 身份登录。
-
执行
ss
命令来查看所有连接的 IP 地址:ss -tuan
该命令将会显示所有当前 TCP 和 UDP 连接的详细信息。
你也可以使用
grep
命令来过滤结果来仅显示 IP 地址:ss -tuan | grep -E "\.*\" | awk '{print $5}' | cut -d':' -f1
该命令将会仅显示当前所有 TCP 和 UDP 连接的 IP 地址列表。
值得注意的是,你需要以 root 或者 sudo 身份运行该命令才能够查看所有连接的 IP。
-
-
malaohu 说:
netstat -ntu | grep tcp | awk '{print $5}'
展示IP去重
可以将命令修改为:
netstat -ntu | grep tcp | awk '{print $5}' | cut -d: -f1 | sort | uniq
这条命令的作用是:
- 通过
netstat -ntu
命令获取所有 TCP 连接的信息; - 使用
grep tcp
过滤出 TCP 连接; - 使用
awk '{print $5}'
提取出每条连接的远程 IP 和端口; - 使用
cut -d: -f1
命令将每条连接的 IP 与端口分离,只保留 IP; - 使用
sort
命令按照 IP 排序; - 使用
uniq
命令删除重复的 IP。
这样修改后,就可以展示去重后的 IP 列表了。
- 通过
-
Joe 说:
@ChatGPT 使用js写一个三级联动的效果
以下是一个简单的使用JavaScript实现三级联动效果的示例代码:
HTML代码:
JavaScript代码:
// 省市区联动数据 const data = { '北京市': { '市辖区': ['东城区', '西城区', '朝阳区', '丰台区', '石景山区', '海淀区', '门头沟区', '房山区', '通州区', '顺义区', '昌平区', '大兴区', '怀柔区', '平谷区', '密云区', '延庆区'] }, '天津市': { '市辖区': ['和平区', '河东区', '河西区', '南开区', '河北区', '红桥区', '东丽区', '西青区', '津南区', '北辰区', '武清区', '宝坻区', '滨海新区', '宁河区', '静海区', '蓟州区'] }, '河北省': { '石家庄市': ['长安区', '桥西区', '新华区', '井陉矿区', '裕华区', '藁城区', '鹿泉区', '栾城区', '井陉县', '正定县', '行唐县', '灵寿县', '高邑县', '深泽县', '赞皇县', '无极县', '平山县', '元氏县', '赵县', '辛集市', '晋州市', '新乐市'], '唐山市': ['路南区', '路北区', '古冶区', '开平区', '丰南区', '丰润区', '曹妃甸区', '滦县', '滦南县', '乐亭县', '迁西县', '玉田县', '遵化市', '迁安市'], '秦皇岛市': ['海港区', '山海关区', '北戴河区', '抚宁区', '青龙满族自治县', '昌黎县', '卢龙县'], // 其他市区数据... }, // 其他省份数据... }; // 初始化省份数据 for (let province in data) { let option = document.createElement('option'); option.value = province; option.innerHTML = province; document.getElementById('province').appendChild(option); } // 省份改变时更新市区数据 document.getElementById('province').addEventListener('change', () => { let province = document.getElementById('province').value; let city_select = document.getElementById('city'); let district_select = document.getElementById('district'); city_select.innerHTML = '请选择市'; district_select.innerHTML = '请选择区/县'; for (let city in data[province]) { let option = document.createElement('option'); option.value = city; option.innerHTML = city; city_select.appendChild(option); } }); // 市改变时更新区县数据 document.getElementById('city').addEventListener('change', () => { let province = document.getElementById('province').value; let city = document.getElementById('city').value; let district_select = document.getElementById('district'); district_select.innerHTML = '请选择区/县'; for (let district of data[province][city]) { let option = document.createElement('option'); option.value = district; option.innerHTML = district; district_select.appendChild(option); } });
这段代码实现了三级联动的效果,基本思路是初始化省份数据,当省份改变时更新市区数据,当市改变时更新区县数据。因为数据较多,所以采用了对象来存储,其中省份数据为对象的属性,每个市区及县数据为对象的值。
-
// KeyGen-editplus.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include <windows.h> #include <time.h> char ReChar(char ch); char DeCodeChar(char ch); void GetDReg05Code(char* pUserName, int ulen); unsigned short* CreateTable(); void RandonRegCode(char* pRegCode, int rLen, char* pAsc, int aLen); char* FomartStr(char* str, WORD sNum); WORD SearchTable(int nNum, char* pCUserName, int len); int SprintfChars(char* pUserName, int len, char* pCUserName, int nNum); char ch5 = {}; unsigned short* pTable = {}; int _tmain(int argc, _TCHAR* argv[]) { srand((unsigned)time(NULL)); char AscArry[36] = { 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A }; char RegCode[29] = {}; char DRegCode[29] = {}; char UserName[10] = {}; RandonRegCode(RegCode, 29, AscArry, 36); printf("input Name:"); scanf_s("%s", UserName, 10); int ulen = strlen(UserName); int rlen = _countof(RegCode); pTable = CreateTable(); char* pAscii = (char*)malloc(sizeof(char) * 3000); int slen = SprintfChars(UserName, ulen, pAscii, 3000); WORD sNum = SearchTable(0, pAscii, slen); char* pCNum = (char*)malloc(sizeof(char) * 10); FomartStr(pCNum, sNum); GetDReg05Code(UserName, ulen); RegCode[2] = ReChar(pCNum[0]); RegCode[3] = ReChar(pCNum[1]); RegCode[4] = ReChar(ch5); for (int i = 0; i < 29; i++) { if ((i + 1) % 6) { char ret = DeCodeChar(RegCode[i]); ret >>= 1; if (ret >= 10) DRegCode[i] = ret + 55; else DRegCode[i] = ret + 48; } else DRegCode[i] = 0x2D; } slen = SprintfChars(DRegCode + 2, rlen - 2, pAscii, 3000); sNum = SearchTable(0, pAscii, slen); FomartStr(pCNum, sNum); RegCode[0] = ReChar(pCNum[0]); RegCode[1] = ReChar(pCNum[1]); printf("RegCode:"); for (int i = 0; i < 29; i++) { printf("%C", RegCode[i]); } system("pause"); return 0; } int SprintfChars(char* pUserName, int len, char* pCUserName, int nNum) { int ret; int i = 0; int j = 0; if (len <= 0) { pCUserName = NULL; ret = 0; } else { while (j < len) { sprintf_s(&pCUserName[i], nNum - i, "%04X", pUserName[j++]); i += 4; } pCUserName[i] = 0; ret = i; } return ret; } WORD SearchTable(int nNum, char* pCUserName, int len) { WORD ret; int index; char* p = pCUserName; if (len <= 0) { ret = nNum; } else { ret = nNum; while (p < pCUserName + len) { index = *p++^LOBYTE(ret); ret = pTable[index] ^ (ret >> 8); } } return ret; } char* FomartStr(char* str, WORD sNum) { sprintf_s(str, 10, "%04X", sNum); return str; } unsigned short* CreateTable() { unsigned short * pTable = (unsigned short *)malloc(0x200); memset(pTable, 0, 0x200); for (int i = 0; i < 0x100; i++) { int j = 1; unsigned short eax = 0xC0C1; while (j < 0x100) { //test edx,ecx; if (i&j) pTable[i] ^= eax; eax += eax; eax ^= 0x4003; j += j; } } return pTable; } char ReChar(char ch) { char arr[] = { 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A }; int len = _countof(arr); for (int i = 0; i < len; i++) { char tmp; char ret = DeCodeChar(arr[i]); ret >>= 1; if (ret >= 10) tmp = ret + 55; else tmp = ret + 48; if (tmp == ch) { return arr[i]; } } } char DeCodeChar(char ch) { //except:I/O char chArry[] = { 50, 51, 52, 53,// 2,3,4,5, 54, 55, 56, 57,// 6,7,8,9, 65, 66, 67, 68,// A,B,C,D, 69, 70, 71, 72,// E,F,G,H, 74, 75, 76, 77,// J,K,L,M, 78, 80, 81, 82,// N,P,Q,R, 83, 84, 85, 86,// S,T,U,V, 87, 88, 89, 90 // W,X,Y,Z }; char ret = 0; int v1 = 2; char* p = &chArry[1]; while (v1 - 2 < 32) { if (ch == *(p - 1)) ret = v1 - 2; if (ch == *(p)) ret = v1 - 1; if (ch == *(p + 1)) ret = v1; if (ch == *(p + 2)) ret = v1 + 1; p += 4; v1 += 4; } return ret; } void GetDReg05Code(char* pUserName, int ulen) { int nNum01 = 0; int nNum02 = 0; int nNum03 = 1; int i = 0; while (i < ulen - 1) { nNum01 += pUserName[i]; nNum02 += pUserName[i + 1]; i += 2; } if (i < ulen) nNum03 = pUserName[i] + 1; sprintf_s(&ch5, 2, "%01X", ((9 * (nNum01 + nNum02 + nNum03) + 0xA) / 3 + 36) % 16); } void RandonRegCode(char* pRegCode, int rLen, char* pAsc, int aLen) { for (int i = 0; i < rLen; i++) { if ((i + 1) % 6 == 0) pRegCode[i] = 0x2D; else pRegCode[i] = pAsc[rand() % aLen]; } }
@ChatGPT 以上代码请用javascript 实现一下
-
malaohu 说:
// KeyGen-editplus.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include #include char ReChar(char ch); char DeCodeChar(char ch); void GetDReg05Code(char* pUserName, int ulen); unsigned short* CreateTable(); void RandonRegCode(char* pRegCode, int rLen, char* pAsc, int aLen); char* FomartStr(char* str, WORD sNum); WORD SearchTable(int nNum, char* pCUserName, int len); int SprintfChars(char* pUserName, int len, char* pCUserName, int nNum); char ch5 = {}; unsigned short* pTable = {}; int _tmain(int argc, _TCHAR* argv[]) { srand((unsigned)time(NULL)); char AscArry[36] = { 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A }; char RegCode[29] = {}; char DRegCode[29] = {}; char UserName[10] = {}; RandonRegCode(RegCode, 29, AscArry, 36); printf("input Name:"); scanf_s("%s", UserName, 10); int ulen = strlen(UserName); int rlen = _countof(RegCode); pTable = CreateTable(); char* pAscii = (char*)malloc(sizeof(char) * 3000); int slen = SprintfChars(UserName, ulen, pAscii, 3000); WORD sNum = SearchTable(0, pAscii, slen); char* pCNum = (char*)malloc(sizeof(char) * 10); FomartStr(pCNum, sNum); GetDReg05Code(UserName, ulen); RegCode[2] = ReChar(pCNum[0]); RegCode[3] = ReChar(pCNum[1]); RegCode[4] = ReChar(ch5); for (int i = 0; i { if ((i + 1) % 6) { char ret = DeCodeChar(RegCode[i]); ret >>= 1; if (ret >= 10) DRegCode[i] = ret + 55; else DRegCode[i] = ret + 48; } else DRegCode[i] = 0x2D; } slen = SprintfChars(DRegCode + 2, rlen - 2, pAscii, 3000); sNum = SearchTable(0, pAscii, slen); FomartStr(pCNum, sNum); RegCode[0] = ReChar(pCNum[0]); RegCode[1] = ReChar(pCNum[1]); printf("RegCode:"); for (int i = 0; i { printf("%C", RegCode[i]); } system("pause"); return 0; } int SprintfChars(char* pUserName, int len, char* pCUserName, int nNum) { int ret; int i = 0; int j = 0; if (len { pCUserName = NULL; ret = 0; } else { while (j { sprintf_s(&pCUserName[i], nNum - i, "%04X", pUserName[j++]); i += 4; } pCUserName[i] = 0; ret = i; } return ret; } WORD SearchTable(int nNum, char* pCUserName, int len) { WORD ret; int index; char* p = pCUserName; if (len { ret = nNum; } else { ret = nNum; while (p { index = *p++^LOBYTE(ret); ret = pTable[index] ^ (ret >> 8); } } return ret; } char* FomartStr(char* str, WORD sNum) { sprintf_s(str, 10, "%04X", sNum); return str; } unsigned short* CreateTable() { unsigned short * pTable = (unsigned short *)malloc(0x200); memset(pTable, 0, 0x200); for (int i = 0; i { int j = 1; unsigned short eax = 0xC0C1; while (j { //test edx,ecx; if (i&j) pTable[i] ^= eax; eax += eax; eax ^= 0x4003; j += j; } } return pTable; } char ReChar(char ch) { char arr[] = { 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A }; int len = _countof(arr); for (int i = 0; i { char tmp; char ret = DeCodeChar(arr[i]); ret >>= 1; if (ret >= 10) tmp = ret + 55; else tmp = ret + 48; if (tmp == ch) { return arr[i]; } } } char DeCodeChar(char ch) { //except:I/O char chArry[] = { 50, 51, 52, 53,// 2,3,4,5, 54, 55, 56, 57,// 6,7,8,9, 65, 66, 67, 68,// A,B,C,D, 69, 70, 71, 72,// E,F,G,H, 74, 75, 76, 77,// J,K,L,M, 78, 80, 81, 82,// N,P,Q,R, 83, 84, 85, 86,// S,T,U,V, 87, 88, 89, 90 // W,X,Y,Z }; char ret = 0; int v1 = 2; char* p = &chArry[1]; while (v1 - 2 { if (ch == *(p - 1)) ret = v1 - 2; if (ch == *(p)) ret = v1 - 1; if (ch == *(p + 1)) ret = v1; if (ch == *(p + 2)) ret = v1 + 1; p += 4; v1 += 4; } return ret; } void GetDReg05Code(char* pUserName, int ulen) { int nNum01 = 0; int nNum02 = 0; int nNum03 = 1; int i = 0; while (i { nNum01 += pUserName[i]; nNum02 += pUserName[i + 1]; i += 2; } if (i nNum03 = pUserName[i] + 1; sprintf_s(&ch5, 2, "%01X", ((9 * (nNum01 + nNum02 + nNum03) + 0xA) / 3 + 36) % 16); } void RandonRegCode(char* pRegCode, int rLen, char* pAsc, int aLen) { for (int i = 0; i { if ((i + 1) % 6 == 0) pRegCode[i] = 0x2D; else pRegCode[i] = pAsc[rand() % aLen]; } }
@ChatGPT 以上代码请用javascript 实现一下
哎呀, OpenAI接口可能出问题了,请稍后再试!我这就PM站长~ @malaohu
-
malaohu 说:
// KeyGen-editplus.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include <windows.h> #include <time.h> char ReChar(char ch); char DeCodeChar(char ch); void GetDReg05Code(char* pUserName, int ulen); unsigned short* CreateTable(); void RandonRegCode(char* pRegCode, int rLen, char* pAsc, int aLen); char* FomartStr(char* str, WORD sNum); WORD SearchTable(int nNum, char* pCUserName, int len); int SprintfChars(char* pUserName, int len, char* pCUserName, int nNum); char ch5 = {}; unsigned short* pTable = {}; int _tmain(int argc, _TCHAR* argv[]) { srand((unsigned)time(NULL)); char AscArry[36] = { 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A }; char RegCode[29] = {}; char DRegCode[29] = {}; char UserName[10] = {}; RandonRegCode(RegCode, 29, AscArry, 36); printf("input Name:"); scanf_s("%s", UserName, 10); int ulen = strlen(UserName); int rlen = _countof(RegCode); pTable = CreateTable(); char* pAscii = (char*)malloc(sizeof(char) * 3000); int slen = SprintfChars(UserName, ulen, pAscii, 3000); WORD sNum = SearchTable(0, pAscii, slen); char* pCNum = (char*)malloc(sizeof(char) * 10); FomartStr(pCNum, sNum); GetDReg05Code(UserName, ulen); RegCode[2] = ReChar(pCNum[0]); RegCode[3] = ReChar(pCNum[1]); RegCode[4] = ReChar(ch5); for (int i = 0; i < 29; i++) { if ((i + 1) % 6) { char ret = DeCodeChar(RegCode[i]); ret >>= 1; if (ret >= 10) DRegCode[i] = ret + 55; else DRegCode[i] = ret + 48; } else DRegCode[i] = 0x2D; } slen = SprintfChars(DRegCode + 2, rlen - 2, pAscii, 3000); sNum = SearchTable(0, pAscii, slen); FomartStr(pCNum, sNum); RegCode[0] = ReChar(pCNum[0]); RegCode[1] = ReChar(pCNum[1]); printf("RegCode:"); for (int i = 0; i < 29; i++) { printf("%C", RegCode[i]); } system("pause"); return 0; } int SprintfChars(char* pUserName, int len, char* pCUserName, int nNum) { int ret; int i = 0; int j = 0; if (len <= 0) { pCUserName = NULL; ret = 0; } else { while (j < len) { sprintf_s(&pCUserName[i], nNum - i, "%04X", pUserName[j++]); i += 4; } pCUserName[i] = 0; ret = i; } return ret; } WORD SearchTable(int nNum, char* pCUserName, int len) { WORD ret; int index; char* p = pCUserName; if (len <= 0) { ret = nNum; } else { ret = nNum; while (p < pCUserName + len) { index = *p++^LOBYTE(ret); ret = pTable[index] ^ (ret >> 8); } } return ret; } char* FomartStr(char* str, WORD sNum) { sprintf_s(str, 10, "%04X", sNum); return str; } unsigned short* CreateTable() { unsigned short * pTable = (unsigned short *)malloc(0x200); memset(pTable, 0, 0x200); for (int i = 0; i < 0x100; i++) { int j = 1; unsigned short eax = 0xC0C1; while (j < 0x100) { //test edx,ecx; if (i&j) pTable[i] ^= eax; eax += eax; eax ^= 0x4003; j += j; } } return pTable; } char ReChar(char ch) { char arr[] = { 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A }; int len = _countof(arr); for (int i = 0; i < len; i++) { char tmp; char ret = DeCodeChar(arr[i]); ret >>= 1; if (ret >= 10) tmp = ret + 55; else tmp = ret + 48; if (tmp == ch) { return arr[i]; } } } char DeCodeChar(char ch) { //except:I/O char chArry[] = { 50, 51, 52, 53,// 2,3,4,5, 54, 55, 56, 57,// 6,7,8,9, 65, 66, 67, 68,// A,B,C,D, 69, 70, 71, 72,// E,F,G,H, 74, 75, 76, 77,// J,K,L,M, 78, 80, 81, 82,// N,P,Q,R, 83, 84, 85, 86,// S,T,U,V, 87, 88, 89, 90 // W,X,Y,Z }; char ret = 0; int v1 = 2; char* p = &chArry[1]; while (v1 - 2 < 32) { if (ch == *(p - 1)) ret = v1 - 2; if (ch == *(p)) ret = v1 - 1; if (ch == *(p + 1)) ret = v1; if (ch == *(p + 2)) ret = v1 + 1; p += 4; v1 += 4; } return ret; } void GetDReg05Code(char* pUserName, int ulen) { int nNum01 = 0; int nNum02 = 0; int nNum03 = 1; int i = 0; while (i < ulen - 1) { nNum01 += pUserName[i]; nNum02 += pUserName[i + 1]; i += 2; } if (i < ulen) nNum03 = pUserName[i] + 1; sprintf_s(&ch5, 2, "%01X", ((9 * (nNum01 + nNum02 + nNum03) + 0xA) / 3 + 36) % 16); } void RandonRegCode(char* pRegCode, int rLen, char* pAsc, int aLen) { for (int i = 0; i < rLen; i++) { if ((i + 1) % 6 == 0) pRegCode[i] = 0x2D; else pRegCode[i] = pAsc[rand() % aLen]; } }
@ChatGPT 以上代码请用javascript 实现一下
-
malaohu 说:
malaohu 说:
// KeyGen-editplus.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include #include char ReChar(char ch); char DeCodeChar(char ch); void GetDReg05Code(char* pUserName, int ulen); unsigned short* CreateTable(); void RandonRegCode(char* pRegCode, int rLen, char* pAsc, int aLen); char* FomartStr(char* str, WORD sNum); WORD SearchTable(int nNum, char* pCUserName, int len); int SprintfChars(char* pUserName, int len, char* pCUserName, int nNum); char ch5 = {}; unsigned short* pTable = {}; int _tmain(int argc, _TCHAR* argv[]) { srand((unsigned)time(NULL)); char AscArry[36] = { 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A }; char RegCode[29] = {}; char DRegCode[29] = {}; char UserName[10] = {}; RandonRegCode(RegCode, 29, AscArry, 36); printf("input Name:"); scanf_s("%s", UserName, 10); int ulen = strlen(UserName); int rlen = _countof(RegCode); pTable = CreateTable(); char* pAscii = (char*)malloc(sizeof(char) * 3000); int slen = SprintfChars(UserName, ulen, pAscii, 3000); WORD sNum = SearchTable(0, pAscii, slen); char* pCNum = (char*)malloc(sizeof(char) * 10); FomartStr(pCNum, sNum); GetDReg05Code(UserName, ulen); RegCode[2] = ReChar(pCNum[0]); RegCode[3] = ReChar(pCNum[1]); RegCode[4] = ReChar(ch5); for (int i = 0; i > { if ((i + 1) % 6) { char ret = DeCodeChar(RegCode[i]); ret >>= 1; if (ret >= 10) DRegCode[i] = ret + 55; else DRegCode[i] = ret + 48; } else DRegCode[i] = 0x2D; } slen = SprintfChars(DRegCode + 2, rlen - 2, pAscii, 3000); sNum = SearchTable(0, pAscii, slen); FomartStr(pCNum, sNum); RegCode[0] = ReChar(pCNum[0]); RegCode[1] = ReChar(pCNum[1]); printf("RegCode:"); for (int i = 0; i > { printf("%C", RegCode[i]); } system("pause"); return 0; } int SprintfChars(char* pUserName, int len, char* pCUserName, int nNum) { int ret; int i = 0; int j = 0; if (len > { pCUserName = NULL; ret = 0; } else { while (j > { sprintf_s(&pCUserName[i], nNum - i, "%04X", pUserName[j++]); i += 4; } pCUserName[i] = 0; ret = i; } return ret; } WORD SearchTable(int nNum, char* pCUserName, int len) { WORD ret; int index; char* p = pCUserName; if (len > { ret = nNum; } else { ret = nNum; while (p > { index = *p++^LOBYTE(ret); ret = pTable[index] ^ (ret >> 8); } } return ret; } char* FomartStr(char* str, WORD sNum) { sprintf_s(str, 10, "%04X", sNum); return str; } unsigned short* CreateTable() { unsigned short * pTable = (unsigned short *)malloc(0x200); memset(pTable, 0, 0x200); for (int i = 0; i > { int j = 1; unsigned short eax = 0xC0C1; while (j > { //test edx,ecx; if (i&j) pTable[i] ^= eax; eax += eax; eax ^= 0x4003; j += j; } } return pTable; } char ReChar(char ch) { char arr[] = { 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A }; int len = _countof(arr); for (int i = 0; i > { char tmp; char ret = DeCodeChar(arr[i]); ret >>= 1; if (ret >= 10) tmp = ret + 55; else tmp = ret + 48; if (tmp == ch) { return arr[i]; } } } char DeCodeChar(char ch) { //except:I/O char chArry[] = { 50, 51, 52, 53,// 2,3,4,5, 54, 55, 56, 57,// 6,7,8,9, 65, 66, 67, 68,// A,B,C,D, 69, 70, 71, 72,// E,F,G,H, 74, 75, 76, 77,// J,K,L,M, 78, 80, 81, 82,// N,P,Q,R, 83, 84, 85, 86,// S,T,U,V, 87, 88, 89, 90 // W,X,Y,Z }; char ret = 0; int v1 = 2; char* p = &chArry[1]; while (v1 - 2 > { if (ch == *(p - 1)) ret = v1 - 2; if (ch == *(p)) ret = v1 - 1; if (ch == *(p + 1)) ret = v1; if (ch == *(p + 2)) ret = v1 + 1; p += 4; v1 += 4; } return ret; } void GetDReg05Code(char* pUserName, int ulen) { int nNum01 = 0; int nNum02 = 0; int nNum03 = 1; int i = 0; while (i > { nNum01 += pUserName[i]; nNum02 += pUserName[i + 1]; i += 2; } if (i > nNum03 = pUserName[i] + 1; sprintf_s(&ch5, 2, "%01X", ((9 * (nNum01 + nNum02 + nNum03) + 0xA) / 3 + 36) % 16); } void RandonRegCode(char* pRegCode, int rLen, char* pAsc, int aLen) { for (int i = 0; i > { if ((i + 1) % 6 == 0) pRegCode[i] = 0x2D; else pRegCode[i] = pAsc[rand() % aLen]; } }
@ChatGPT 以上代码请用javascript 实现一下
哎呀, OpenAI接口可能出问题了,请稍后再试!我这就PM站长~ @malaohu
-
690779301gagacui 说:
@ChatGPT 资产证券化增信需要2A平台来增信?在中国哪部法律中有所规定
资产证券化是一种通过将现有的资产打包成可交易的证券来满足投资者需求的金融工具。在资产证券化过程中,确保证券化的资产质量和可信度非常重要,而2A评级平台是为此提供增信服务的一种机构。然而,对于增信的具体要求和规范在不同国家可能有所不同。
在中国,资产证券化的发展还相对较为年轻,相关法律法规也比较分散和灵活。目前,有些专门针对资产证券化的监管指引类文件中,提到了增信机构的角色和相关规定。例如:
- 《证券期货投资基金资产支持专项计划管理办法》规定,专项计划应当聘请正规资格的第三方机构对计划资产进行评估、估值、审计和评级等工作。
- 《关于加强债券市场风险管理的指导意见》明确,发行商和承销商应当获取权威的信用评级,并在信息披露中充分披露与评级相关的信息。
此外,China Securities Regulatory Commission(中国证券监督管理委员会)也发布过多个文件,强调加强资产证券化市场的监管和风险控制,其中也涉及到评级机构的审批、认证等问题。因此,在中国的资产证券化市场中,2A评级平台的增信作用是有一定法律依据和相关指引的。
-
for culture 说:
@ChatGPT selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable: [object HTMLSpanElement] has no size and location 这个报错怎么处理
这个报错通常表示Selenium无法交互元素,因为元素的大小和位置无效/无可用值。 这通常是由于以下原因之一引起的:
1.元素是不可见的,因此Selenium无法单击它。
2.元素尚未完全加载并呈现在屏幕上。
解决此问题的方法可能因具体情况而异,以下是一些您可以尝试的方法:
1.等待元素可见或使用显示/隐式等待让元素加载完全。
2.尝试模拟鼠标动作或使用Javascript单击元素。
3.检查元素是否被DOM树中的其他元素覆盖或阻塞。
4.检查您所使用的浏览器驱动程序和浏览器版本是否相同。
例如,在使用Python和Selenium WebDriver时,您可以使用以下方法来等待元素可见:
from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC # 等待元素可见 element = WebDriverWait(driver, 10).until( EC.visibility_of_element_located((By.XPATH, "your_xpath_here")) ) # 点击元素 element.click()
您可以将“10”更改为您要等待的秒数,将XPATH更改为您要单击的元素的实际XPATH。
希望能对您有所帮助!