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
Quote capitalized exported names in decompilation so they aren't treated as Aliases #703
Comments
Keeps happening a few times a day, seems to randomly pop up without me doing any input at the time. |
Decompilation happens automatically in the background as references are being resolved, so the background stub index update would keep triggering it as it's not able to decompile and index the file, so OpenAPI is marking the file as unindexed. |
LDAPEx is one of my libraries (with some erlang code in it as well due to elixir limitations in ASN1 generation). What about it is not decompileable for you? Anything I can help with? |
So, it's not so much that it can't be decompiled, but that the way the indexing of decompiled modules works is there is two sides, there's the binary representation and a thing OpenAPI calls mirrors, which is the text you as a user can view when you open a It turns out that spotting the problem with the decompilation is pretty easy: you take the decompiled text shown when you open the |
If it is generating Elixir syntax from the BEAM, they it definitely will choke on that. ^.^ But here is what it infers from the beam file (nice that you can open those): # Source code recreated from a .beam file by IntelliJ Elixir
defmodule LDAPEx.ELDAPv3 do
# Macros
defmacro AddRequest() do
# body not decompiled
end
defmacro AddRequest(p0) do
# body not decompiled
end
defmacro AddRequest(p0, p1) do
# body not decompiled
end
defmacro AttributeValueAssertion() do
# body not decompiled
end
defmacro AttributeValueAssertion(p0) do
# body not decompiled
end
defmacro AttributeValueAssertion(p0, p1) do
# body not decompiled
end
defmacro BindRequest() do
# body not decompiled
end
defmacro BindRequest(p0) do
# body not decompiled
end
defmacro BindRequest(p0, p1) do
# body not decompiled
end
defmacro BindResponse() do
# body not decompiled
end
defmacro BindResponse(p0) do
# body not decompiled
end
defmacro BindResponse(p0, p1) do
# body not decompiled
end
defmacro CompareRequest() do
# body not decompiled
end
defmacro CompareRequest(p0) do
# body not decompiled
end
defmacro CompareRequest(p0, p1) do
# body not decompiled
end
defmacro Control() do
# body not decompiled
end
defmacro Control(p0) do
# body not decompiled
end
defmacro Control(p0, p1) do
# body not decompiled
end
defmacro ExtendedRequest() do
# body not decompiled
end
defmacro ExtendedRequest(p0) do
# body not decompiled
end
defmacro ExtendedRequest(p0, p1) do
# body not decompiled
end
defmacro ExtendedResponse() do
# body not decompiled
end
defmacro ExtendedResponse(p0) do
# body not decompiled
end
defmacro ExtendedResponse(p0, p1) do
# body not decompiled
end
defmacro IntermediateResponse() do
# body not decompiled
end
defmacro IntermediateResponse(p0) do
# body not decompiled
end
defmacro IntermediateResponse(p0, p1) do
# body not decompiled
end
defmacro LDAPMessage() do
# body not decompiled
end
defmacro LDAPMessage(p0) do
# body not decompiled
end
defmacro LDAPMessage(p0, p1) do
# body not decompiled
end
defmacro LDAPResult() do
# body not decompiled
end
defmacro LDAPResult(p0) do
# body not decompiled
end
defmacro LDAPResult(p0, p1) do
# body not decompiled
end
defmacro MatchingRuleAssertion() do
# body not decompiled
end
defmacro MatchingRuleAssertion(p0) do
# body not decompiled
end
defmacro MatchingRuleAssertion(p0, p1) do
# body not decompiled
end
defmacro ModifyDNRequest() do
# body not decompiled
end
defmacro ModifyDNRequest(p0) do
# body not decompiled
end
defmacro ModifyDNRequest(p0, p1) do
# body not decompiled
end
defmacro ModifyRequest() do
# body not decompiled
end
defmacro ModifyRequest(p0) do
# body not decompiled
end
defmacro ModifyRequest(p0, p1) do
# body not decompiled
end
defmacro ModifyRequest_changes_SEQOF() do
# body not decompiled
end
defmacro ModifyRequest_changes_SEQOF(p0) do
# body not decompiled
end
defmacro ModifyRequest_changes_SEQOF(p0, p1) do
# body not decompiled
end
defmacro PartialAttribute() do
# body not decompiled
end
defmacro PartialAttribute(p0) do
# body not decompiled
end
defmacro PartialAttribute(p0, p1) do
# body not decompiled
end
defmacro SaslCredentials() do
# body not decompiled
end
defmacro SaslCredentials(p0) do
# body not decompiled
end
defmacro SaslCredentials(p0, p1) do
# body not decompiled
end
defmacro SearchRequest() do
# body not decompiled
end
defmacro SearchRequest(p0) do
# body not decompiled
end
defmacro SearchRequest(p0, p1) do
# body not decompiled
end
defmacro SearchResultEntry() do
# body not decompiled
end
defmacro SearchResultEntry(p0) do
# body not decompiled
end
defmacro SearchResultEntry(p0, p1) do
# body not decompiled
end
defmacro SubstringFilter() do
# body not decompiled
end
defmacro SubstringFilter(p0) do
# body not decompiled
end
defmacro SubstringFilter(p0, p1) do
# body not decompiled
end
# Functions
def __info__(p0) do
# body not decompiled
end
def decode(p0, p1) do
# body not decompiled
end
def encode(p0, p1) do
# body not decompiled
end
def module_info() do
# body not decompiled
end
def module_info(p0) do
# body not decompiled
end
end I'm seeing two immediate problems:
The Elixir syntax functions can reverse an Elixir AST in to Elixir Syntax, but it is not always valid syntax even though it is a valid program. For note, those lines of codes are caused by: https://github.com/OvermindDL1/ldap_ex/blob/master/lib/ldap_ex/ELDAPv3.ex#L13-L15 for rec <- extract_all(from: "lib/asn1/ELDAPv3a.hrl") do
defrecord elem(rec, 0), elem(rec, 1)
end It is the auto-generated Erlang ASN1 LDAP definition file, not something that I can change as it is generated from the standard spec. Hope that information helps. :-)
For note, Elixir cannot represent all valid BEAM code, Elixir is a limited language compared to Erlang (though its macros are awesome hence why I use it), perhaps it would be best to try to decompile a BEAM file to elixir, and if that fails to reverse properly then decompile it to Erlang instead, or perhaps to CoreErlang as it can fully represent everything perfectly? |
I'm not reading the AST to generate the names, I'm reading the Atom and Export chunks and then applying some heuristics to produce parsable names and code, in your case I need to |
Version
5.1.0
Exception
Message
Stacktrace:
The text was updated successfully, but these errors were encountered: