|
[注意]一个邪恶的设想
俺也是电子蚊香的受害者,杯具了 |
|
[讨论]什么时候发看雪论坛精华10
永远期待 |
|
[讨论]谷歌高管称Java和C++太复杂 推崇自家语言Go
记得有本书的作者说过程序员最大的成就就是木有创建一门新的语言 |
|
|
|
|
|
[分享]换个能提高回帖率的头像
有假冒伪劣的嫌疑 |
|
[推荐]黑客反汇编揭秘:第二版
但愿别卖太贵了 |
|
[原创]我的新发现
最近新人太多了 |
|
[讨论]富士康发生“第12连跳”
杯具+餐具 |
|
|
|
[讨论]尾递归~
普通递归容易栈溢出,就是栈空间耗尽,为递归无此忧虑 |
|
[原创]Longene项目组希望和贵站合作
提议不错当然要支持咯 |
|
[求助]XP下, 如何修改本机 IP?
/************************************************* Function: NotifyChange Description: 通知系统网卡信息改变 Input: 网卡GUID字符串指针 LuaInput: 无 Output: 无 Return: 返回成功状态布尔值 LuaReturn: 无 Others: 非Lua直接调用函数,依赖于Setupapi.dll系统动态链接库 *************************************************/ BOOL NotifyChange(char * lpInsID) { struct DEVPARAM{DWORD a1;DWORD a2;DWORD a3;DWORD a4;DWORD a5;}; BOOL bResult = FALSE; HDEVINFO hDevInfo; hDevInfo = SetupDiGetClassDevs(&GUID_DEVCLASS_NET, 0, 0, DIGCF_PRESENT | DIGCF_PROFILE); if (INVALID_HANDLE_VALUE != hDevInfo) { DWORD dLoop = 0; SP_DEVINFO_DATA DeviceInfoData; DeviceInfoData.cbSize = sizeof(SP_DEVINFO_DATA); while ( SetupDiEnumDeviceInfo(hDevInfo, dLoop, &DeviceInfoData) ) { HKEY hKey = SetupDiOpenDevRegKey(hDevInfo, &DeviceInfoData, 1u, 0, 2u, 0x20019u); if ( INVALID_HANDLE_VALUE != hKey) { char szInsID[MAX_PATH]; DWORD dLen = MAX_PATH; if ( !RegQueryValueEx(hKey,"NetCfgInstanceId",NULL,NULL,(BYTE*)szInsID,&dLen) ) { RegCloseKey(hKey); if (!lstrcmpi(szInsID,lpInsID)) { DEVPARAM DevParams; DevParams.a1 = 8; DevParams.a2 = 18; DevParams.a3 = 3; DevParams.a4 = 2; DevParams.a5 = 0; if ( SetupDiSetClassInstallParams(hDevInfo, &DeviceInfoData,(PSP_CLASSINSTALL_HEADER) &DevParams, sizeof(DevParams)) ) { bResult = SetupDiCallClassInstaller(DIF_PROPERTYCHANGE, hDevInfo, &DeviceInfoData); } break; } } RegCloseKey(hKey); } ++dLoop; } SetupDiDestroyDeviceInfoList(hDevInfo); } return bResult; } /************************************************* Function: Lua_SetNetInfo Description: 设置所有网卡信息 Input: Lua虚拟机指针 LuaInput: 网卡信息表数组 Output: 无 Return: 返回Lua返回值个数 LuaReturn: 无 Others: 网卡信息表{IP=“”,SubnetMask=“”,Gateway=“”,DNS=“”} *************************************************/ int Lua_SetNetInfo(lua_State* luaVM) { EXCEPTION_RECORD ExceptionRecord; __try { luaL_checktype( luaVM, 1, LUA_TTABLE); IP_ADAPTER_INFO NetCarInfo[10] = {0}; ULONG uSize = sizeof(NetCarInfo); GetAdaptersInfo(NetCarInfo,&uSize); DWORD dCount = 0; while (*NetCarInfo[dCount].AdapterName && 10>=dCount) { ++dCount; } for (DWORD i = 0; i <= dCount; i++) { const char *lpIP = NULL; const char *lpMask = NULL; const char *lpGateway = NULL; const char *lpDNS = NULL; lua_rawgeti(luaVM,1,i+1); GetTabVal(luaVM,2,"IP"); lpIP = lua_tostring(luaVM,-1); lua_pop(luaVM,1); GetTabVal(luaVM,2,"SubnetMask"); lpMask = lua_tostring(luaVM,-1); lua_pop(luaVM,1); GetTabVal(luaVM,2,"Gateway"); lpGateway = lua_tostring(luaVM,-1); lua_pop(luaVM,1); GetTabVal(luaVM,2,"DNS"); lpDNS = lua_tostring(luaVM,-1); lua_pop(luaVM,2); HKEY hInst; char szInstKey[MAX_PATH] = "SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\"; lstrcat(szInstKey,NetCarInfo[i].AdapterName); if (ERROR_SUCCESS == RegOpenKey(HKEY_LOCAL_MACHINE,szInstKey,&hInst)) { RegSetValueEx(hInst,"IPAddress",NULL,REG_MULTI_SZ,(LPBYTE)lpIP,strlen(lpIP)); RegSetValueEx(hInst,"SubnetMask",NULL,REG_MULTI_SZ,(LPBYTE)lpMask,strlen(lpMask)); RegSetValueEx(hInst,"DefaultGateway",NULL,REG_MULTI_SZ,(LPBYTE)lpGateway,strlen(lpGateway)); RegSetValueEx(hInst,"NameServer",NULL,REG_SZ,(LPBYTE)lpDNS,strlen(lpDNS)); DWORD dValue = 0; RegSetValueEx(hInst,"EnableDHCP",NULL,REG_DWORD,(LPBYTE)&dValue,sizeof(dValue)); RegCloseKey(hInst); NotifyChange(NetCarInfo[i].AdapterName); } } } __except(ExceptionRecord = *(GetExceptionInformation())->ExceptionRecord ,EXCEPTION_EXECUTE_HANDLER) { CrackErr(luaVM,&ExceptionRecord); } return 0; } |
|
[公告]试办看雪学院密码学版期刊 (杂志)
希望能有些密码学普及的文章,偶密码学白痴 |
|
[翻译]翻译Load a Dll From Memory!
楼主辛苦了,俺收了 |
|
找工作之前,请大家给予学习指导,谢谢
两月太勉强了把,两年还可以 |
操作理由
RANk
{{ user_info.golds == '' ? 0 : user_info.golds }}
雪币
{{ experience }}
课程经验
{{ score }}
学习收益
{{study_duration_fmt}}
学习时长
基本信息
荣誉称号:
{{ honorary_title }}
能力排名:
No.{{ rank_num }}
等 级:
LV{{ rank_lv-100 }}
活跃值:
在线值:
浏览人数:{{ visits }}
最近活跃:{{ last_active_time }}
注册时间:{{ user_info.create_date_jsonfmt }}
勋章
兑换勋章
证书
证书查询 >
能力值