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

x64 support #513

Merged
merged 159 commits into from
Mar 6, 2019
Merged

x64 support #513

merged 159 commits into from
Mar 6, 2019

Conversation

xkubov
Copy link
Contributor

@xkubov xkubov commented Mar 6, 2019

Provides experimental support for decomilation of architecture Intel x64. This PR
contains mainly reimplementation of parameter analysis which was
essential in order to provide support of x64 architecture.

Peter Kubov added 30 commits March 6, 2019 11:35
Test cases share same module so it means that by not cleaning
AbiProvider two test cases maight obtain same abi which
can lead to failure of test.
Some architectures (for example MIPS) are
modeled with special double registers
that are created as merge of two
FP registers. ABI must provide information
about possible double register so that
parameter analysis may use this information
to find double parameters.
Provides special ABI for Pic32. This type of Mips
architecture passes parameters differently
than regular Mips and to reflect this we should
have separated Pic32 ABI that would be suitable
for other changes that my emerge by deompilation
of sufficient Pic32 binary files.
Using abi makes code more readable than gaining informations
from configuration. It is clear that abi module contains
abi specific informations.
module param_return contains block counting registers which result
is not used anywhere in code and thus it is unnecessary to do so.
code that searched for register to which store return value
was redundant and should be be done better. For example
if abi can tell to which register store value it can be
searched in module for appropriate store or
perhaps manually create one.
There is redundant code in param_return module which purpose
is to cleverly identify parameters on stack. This is probably
not wanted as it may unwillingly take arguments from stack
which were not intended for called function.
Old module param_return used informations from configuraton but
with change of usage abi there is no need to include register
configuration in tests.
Test expects that powerpc uses just 7 registers as parameters
for function. The truth is that powerpc uses 8 registers and
test forced module to generate incorrect output.
Method filterRegisters() is filtering all values, not just
registers and thus shuld jave appropriate name.
This code assumes that paramter registers will be returned from abi
sorted from lowest to highest. This is not true as values of regsiters
are dependent on their value in capstone.
Provides support for Intel x86-64 architecture. Specifically
represents System V ABI and conventions that are present in
this ABI.
Provides integration of class Abi X64 into general class
ABI.
This commit proived suport for testing of parameter analysis
of x64 binary files.
Peter Kubov added 2 commits March 6, 2019 12:03
Currently it was unable to apply the x64 YARA signatures because
path to existing sgnatures was incorrect and code in module stacofin
did not expect to get binary of x64 format.
@PeterMatula PeterMatula merged commit 4094b88 into avast:master Mar 6, 2019
@PeterMatula
Copy link
Collaborator

Merged. Doxygen errors were fixed, other CI tests will probably fail, because they are run against the current master and not against avast/retdec-regression-tests#20.

s3rvac added a commit that referenced this pull request Mar 6, 2019
There was only a reference to the issue (but not to the PR).
@xkubov xkubov deleted the x64-support branch March 6, 2019 15:03
@silverbacknet
Copy link

Holy cow, this is a MASSIVE PR. I hope there's a new TC build or release soon, I'd love to experiment with this (and VB6). Thank you xkubov and everyone who contributed to make this happen, even in this raw state!

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

Successfully merging this pull request may close these issues.

4 participants