LPCTSTR vmsCommandLine::getExeName() const { LPCTSTR ptsz = _tcsrchr (getExe (), '\\'); if (!ptsz) ptsz = _tcsrchr (getExe (), '/'); if (ptsz) ptsz++; return ptsz; }
void ToolManager::symLinkTools(std::vector<DesuraId> &list, const char* path) { if (!path) return; UTIL::FS::recMakeFolder(path); for (size_t x=0; x<list.size(); x++) { auto info = findItem(list[x].toInt64()); if (!info || !info->isInstalled()) continue; UTIL::FS::Path fp(info->getExe(), "", true); if (!UTIL::FS::isValidFile(fp)) continue; UTIL::FS::Path dp(path, "", false); dp += fp.getFile(); std::string src = fp.getFullPath(); std::string dest = dp.getFullPath(); int res = symlink(src.c_str(), dest.c_str()); if (res != 0) Debug(gcString("Failed to sym link: [{0}] to [{1}]\n", src, dest)); } }
//Setup for Sysnand void loadSys(void){ //Disable firm partition update if a9lh is installed if(!PDN_SPI_CNT){ getExe(firmLocation, firmSize, &exeOffset); memcpy((u8*)exeOffset, "kek", 3); } }
int vmsCommandLine::CompareEXEs(const vmsCommandLine &cl) const { LPCTSTR ptsz1 = getExe (); LPCTSTR ptsz2 = cl.getExe (); if (ptsz1 && ptsz2) return _tcsicmp (ptsz1, ptsz2); if (ptsz1 == NULL && ptsz2 == NULL) return 0; if (!ptsz1) return -1; return 1; }
/** * 获取进程的二进制文件绝对根目录 * @param pszExe(char *): 根目录存放内存地址 * @param uiExeLen(unsigned): 根目录存放内存长度 * @see * @return 0(成功) * @return -1(失败) */ int getExeRoot(char *pszExeRoot, unsigned uiExePathLen) { int i = 0; int iRes = getExe(pszExeRoot, uiExePathLen); if (-1 == iRes) { return -1; } for (i = uiExePathLen - 1; i > 0; --i) { if ('/' == pszExeRoot[i]) { pszExeRoot[i] = '\0'; break; } } return 0; }
void _if(nodeADT node, Block * my_block) { // printf("IF -> N = %d\n", getParam(node)); execute(getExe(node), my_block); if ((my_block->boolean) == TRUE) { execute(getNext(node), my_block); } else { nodeADT nodeENDIF = (nodeADT) getJump(node); if (getNext(nodeENDIF) != NULL ) { execute(getNext(nodeENDIF), my_block); } } }