【发布时间】:2018-03-18 17:25:51
【问题描述】:
我正在使用Windows,我正在尝试使用Retargetable Decompiler 提供的cURL API。由于 cURL 是一个 Linux 实用程序,我从 here 下载了一个 Windows 构建。假设我要执行以下反编译:
这是使用可以工作并产生结果的浏览器。现在,当尝试在命令行中使用 cURL 执行相同操作时,出现错误。
输出:
>curl --form "mode=raw" --form "input=code.bin" --form "architecture=powerpc" --form "endian=big" --form "raw_entry_point=0x0" --form "raw_section_vma=0x0" -u my-secret-api-key: "https://retdec.com/service/api/decompiler/decompilations" { "id": "yVWe4pe5", "links": { "decompilation": "https://retdec.com/service/api/decompiler/decompilations/yVWe4pe5", "status": "https://retdec.com/service/api/decompiler/decompilations/yVWe4pe5/status", "outputs": "https://retdec.com/service/api/decompiler/decompilations/yVWe4pe5/outputs" }}
{
"code": 400,
"description": "The input file is missing.",
"message": "Missing Input File"
}
curl: (3) [globbing] unmatched brace in column 1
curl: (6) Could not resolve host: id
curl: (6) Could not resolve host: yVWe4pe5,
curl: (6) Could not resolve host: links
curl: (3) [globbing] unmatched brace in column 1
curl: (6) Could not resolve host: decompilation
{
"code": 405,
"description": "The method is not allowed for the requested URL.",
"message": "Method Not Allowed"
}
curl: (6) Could not resolve host: status
{
"code": 404,
"description": "The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.",
"message": "Not Found"
}
curl: (6) Could not resolve host: outputs
{
"code": 405,
"description": "The method is not allowed for the requested URL.",
"message": "Method Not Allowed"
}
curl: (3) [globbing] unmatched close brace/bracket in column 1
同样,code.bin 与命令行(脚本)位于同一目录中。我怎样才能让它工作? 我实际上更喜欢Java 而不是cURL 中的解决方案,但首先在cURL 中执行它可能更容易理解,因为没有提供Java 示例或文档。
【问题讨论】:
-
input=@code.bin? -
@JoeC:这似乎无关紧要。我也添加了
filename=code.bin,然后就可以了。另外,以{开头的部分是我错误地用作输入的输出,因此出现了所有错误。