Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LLVM ERROR: Could not acquire a cryptographic context: The specified procedure could not be found. (0x7F) #565

Closed
snanang opened this issue Apr 30, 2019 · 5 comments

Comments

@snanang
Copy link

snanang commented Apr 30, 2019

When decompiling my code, I found the following error:
LLVM ERROR: Could not acquire a cryptographic context: The specified procedure could not be found. (0x7F)

Below are some parts of the messages:
-> running SelfAssignOptimizer ( 1148.68s )
Warning: out of memory; trying to recover
-> running VarDefForLoopOptimizer ( 1149.69s )
-> running VarDefStmtOptimizer ( 1150.00s )
Warning: out of memory; trying to recover
-> running EmptyStmtOptimizer ( 1152.41s )
-> running GotoStmtOptimizer ( 1152.69s )
-> running SimplifyArithmExprOptimizer ( 1152.92s )
-> running DeadCodeOptimizer ( 1153.97s )
-> running DerefToArrayIndexOptimizer ( 1154.22s )
Warning: out of memory; trying to recover
-> running IfToSwitchOptimizer ( 1155.30s )
-> running CCastOptimizer ( 1155.43s )
Warning: out of memory; trying to recover
-> running CArrayArgOptimizer ( 1158.86s )
Running phase: variable renaming [readable] ( 1159.13s )
Running phase: converting constants to symbolic names ( 1170.18s )
LLVM ERROR: Could not acquire a cryptographic context: The specified procedure could not be found. (0x7F)
Error: Decompilation of file d:\tmp\autodraw.exe.bc failed

@snanang
Copy link
Author

snanang commented Apr 30, 2019

This is the python command I used:
python c:\retdec\bin\retdec-decompiler.py d:\tmp\autodraw.exe

@snanang
Copy link
Author

snanang commented Apr 30, 2019

Please help to figure out what I did wromg

@snanang snanang closed this as completed Apr 30, 2019
@snanang snanang reopened this Apr 30, 2019
@silverbacknet
Copy link

That's usually an indication that you've run out of memory. Did you try the 64-bit version?

Still, there are several Autodraws but if it's the one designed to use with Autodesk Inventor, you're talking about a 166mb file, which is going to require an obnoxious amount of memory no matter how you slice it. You should probably examine the file beforehand and determine a good small range of functions to decompile, instead of trying to do the whole program at once.

@s3rvac
Copy link
Member

s3rvac commented May 1, 2019

Hi. As @silverbacknet wrote above, you do not have enough memory, which is supported by the following lines in the output:

Warning: out of memory; trying to recover
...
Warning: out of memory; trying to recover

The Could not acquire a cryptographic context error is caused by insufficient memory and has already been discussed in #73 and #387, so see these two issues for more details. My suggestion is to use selective decompilation to decompile only the given functions:

python c:\retdec\bin\retdec-decompiler.py --select-functions MyFunction1,MyFunction2 --select-decode-only d:\tmp\autodraw.exe

or the given address ranges:

python c:\retdec\bin\retdec-decompiler.py --select-ranges 0x40000000-0x40005000 --select-decode-only d:\tmp\autodraw.exe

(These are just examples, you will need to adjust the names of the functions and ranges by yourself.)

@snanang
Copy link
Author

snanang commented May 1, 2019

Thank you for your prompt reply and suggestion, I will download the 64 bit retdec and try to decompile certain range.
The autodraw is the program that I developed my self and I lost the source code due to hard disk crash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants