I'm on Windows
and I'm trying to use the cURL API provided by Retargetable Decompiler
. Since cURL is a Linux utility, I downloaded a Windows
build from here. Let's say I want to perform the following decompilation:
This is using the browser which works and produces a result. Now when trying to do the same using cURL
from the command line, I get errors.
Output:
>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
Also yes, the code.bin is in the same directory as the command line (script). How can I make it work? I actually prefer a solution in Java
and not cURL
but doing it in cURL
first might be easier for understanding since no Java
examples or documentation is provided.