我在编译后面的漏洞利用代码时遇到问题:
http://downloads.securityfocus.com/vulnerabilities/exploits/59846-1.c
我正在使用:"gcc file.c"和"gcc -O2 file.c",但它们都会出现以下错误:
sorbolinux-exec.c: In function ‘sc’:
sorbolinux-exec.c:76: error: stray ‘\302’ in program
sorbolinux-exec.c:76: error: stray ‘\244’ in program
sorbolinux-exec.c:76: error: ‘t’ undeclared (first use in this function)
sorbolinux-exec.c:76: error: (Each undeclared identifier is reported only once
sorbolinux-exec.c:76: error: for each function it appears in.)
Run Code Online (Sandbox Code Playgroud)
我尝试在Kali linux和Ubuntu 10.04上编译它们并得到相同的结果.
我没有在我在这里找到的程序中迷路"\ 302" ,而是收到了错误消息:
algo.c:118: error: stray ‘\303’ in program
algo.c:118: error: stray ‘\215’ in program
Run Code Online (Sandbox Code Playgroud)
我似乎无法弄明白,这是什么?
为了将来参考,stray'\ XXX'对编译器来说意味着一个难以理解的特征.解决方法是找到'\ XXX'字符(现在我发现它并不总是这个unicode,它不能是一个错误的定义,例如'## define'中的'##'),然后删除或纠正它.祝好运!
我有很多很多.txt有一些不需要的字符的文件â和点缀无处不有使用正则表达式来删除URL和之后的空白.我需要从所有文件中删除所有这些.
这些â不存在清洗文件之前,它们被产生作为清洁的结果.
我发现了一个适用于我的文本的正则表达式,并且正在删除URL.首先,我的清洁过程(注释掉的线条是我尝试的其他东西):
clean_file <- sapply(curr_file, function(x) {
gsub("&", "&", x) %>%
gsub("http\\S+\\s*", "", .) %>%
gsub("[^[:alpha:][:space:]&']", "", .) %>%
#gsub("[^[:alnum:][:space:]\\'-]", "", .) %>%
stripWhitespace() %>%
gsub("^ ", "", .) %>%
gsub(" $", "", .)
#gsub("â", "", .)
})
Run Code Online (Sandbox Code Playgroud)
示例输入文本(每行是一个字符串):
Gluskin’s Rosenberg: Don’t Bet on a Bear Market for Treasurys - Rising Treasury yields?... http://j.mp/UVM31t #FederalReserve
Jacquiline Chabolla liked Capital Preservation In a Secular Bear Market: Large investment asset losses …Run Code Online (Sandbox Code Playgroud)