15

I found the solution. Double click the variable name (configSpaceBuffer in this case) which brings up the stack window for the method where you can undefine the invalid variables and then define it as an array. Here is the output after this change: _this->ConfigSpace1 = configSpaceBuffer[1]; _this->ConfigSpace0 = configSpaceBuffer[0]; ...


13

Although these terms are being used interchangeably, there is an intrinsic difference between disassembler and decompiler definitions traditionally. Let's first consider common steps involved in converting low level code to high level human readable code. This is similar to compilation where you convert high level code to low level machine code or an ...


10

The classic work on the decompilation is Cristina Cifuentes' PhD thesis "Reverse Compilation Techniques". She describes generation of C code in Chapter 7. The author of the REC decompiler also has a nice summary about the decompilation process, though it's more informal: http://www.backerstreet.com/decompiler/introduction.htm For completeness, here's ...


9

No. Decompilers can include special pattern-matching heuristics layered on top of their other functionality to detect macros, but in general, macros are just pieces of code that get treated by the compiler the same way as other pieces of code. They might be subject to optimizations that transform their appearance, such as constant propagation, dead code ...


9

According to the developer of Resource Hacker, this product is discontinued (and hasn't been updated since Sep 2011): I have been overwhelmed by the interest in Resource HackerTM, the emails of thanks, encouragement and suggestions. It's been downloaded many millions of times. However, I've moved on to other things and have no plans to continue its ...


9

IDA's decompiler only supports ARM and x86. With that said, there are a couple you can try: REC - This one has already been mentioned. Last I used it, it would segfault when you issued the 'help' command, so YMMV. Retargetable Decompiler - This is an online decompiler that supports various architectures, including MIPS. It's OK at getting a general idea of ...


9

Short answer: No, there is no other interactive decompiler, at least not for native codes. Long answer: The Hex-Rays decompiler was created with the idea of interactiveness while all the other decompilers for native code that I know (I'm not talking about Java or .NET) were created as batch tools. The closest to a half interactive decompiler is Snowman, but ...


8

First, you cannot answer to this question without having to define what you mean by AI... Because this is probably the worst name for a domain in computer science. Where people think about "programs mimicking human reasoning", the reality is more about "automated heuristics to recognize patterns in tons of samples"... So, I will take the more accurate ...


7

-1640531527 is hexadecimal '0x9e3779b9'. This number is used in boost hash function. The code here in function ub4 hash( k, length, initval) looks similar to yours, at least in the last part. I think that it is a good point to start googling from. As far as I can say it is probably intermediate variant(lookup2) of Jenkins Hash


6

COERCE_TYPE(x) is the same thing as *(TYPE *)&x. Hex-Rays uses COERCE_... macros when &x is illegal. For example: COERCE_DOUBLE(__PAIR__(i1,i2)) Is the same as *(double *)&__PAIR__(i1, i2), but since & can not be applied to calls, we end up seeing COERCE. Its name correctly conveys its meaning.


6

Some more low-level details: What is the purpose of (*(_BYTE *)(content + 7) << 24) isn't a byte only 8 bits, so won't it be 0 every time? In C, shifts implicitly promote the operand to at least an int/unsigned int, so the _BYTE value gets promoted to an unsigned int. This is probably because most processors support shifts on a single word size and ...


6

You can enable the auto-comment option in IDA, to have something like this: Or also give a try to snowman, a free decompiler for IDA Pro, that is able to transform this compiled program: #include <stdio.h> int main() { printf("Hello, World!\n"); return 0; } into int64_t main() { puts("Hello, World!"); return 0; }


6

This is annoyingly hard to find the answer to. This is a good starting point, but I don't think I found everything yet. Variable names From Function.java: param_ local_ local_res temp_ From database.cc <-- this function has most (maybe all?) of the variable naming logic. There are multiple pieces of this function that I don't yet understand; I'm ...


5

Try C4Decompiler and REC Studio 4.


5

When I assembled the code, the offending instruction was: 0x6c 40 ff d1 call rcx You will need to use Change Stack Pointer command in IDA to fix this in disassembly. As per IDA documentation: This command allows you to specify how the stack pointer (SP) is modified by the current instruction. You cannot use this command if ...


4

if( (__PAIR__(a4, a3) & 0x8000000000000000ui64) == 0i64 ) becomes if(a4 >= 0 && a3 >= 0) No, that's not correct. The correct simplification is: if ((int)a4 >= 0) if ( (__PAIR__(v17, v12) & 0x8000000000000000ui64) != 0i64 ) { should look like this if( v17 < 0 || v12 < 0 ) { Nope, it should look like this: ...


4

My answer is a little late; newcomer to this site. The Decompiler project was initiated in order to decompile MS-DOS EXE and COM binaries. The project has both a command-line and a GUI tool: https://sourceforge.net/projects/decompiler/ Use the following command with the command-line tool to decompile COM programs: decompile --default-to ms-dos-com myprog....


4

The only MIPS decompiler I know is REC. There is also this, but I didn't try it myself.


4

(reposting answer from SO) MicroAPL offers a tool called Relogix which is supposedly able to do it: http://www.microapl.com/asm2c/sample.html


4

I don't think any public tool for decompilation of M68K exists. You will probably need to do it yourself (write a decompilation tool) or do manual decompilation. I recommend you to give a try to writing a decompiler for your project if it's worth the effort: even if your decompiler is not very good, it will help you a lot in manual decompilation. BTW, ...


4

Just a small addition to the previous answers. The following shift construct, asked in 3, is a widely used way to convert a byte stream into a 32-bit integer. (*(_BYTE *)(content + 7) << 24) + (*(_BYTE *)(content + 6) << 16) + (*(_BYTE *)(content + 5) << 8) + *(_BYTE *)(content + 4) 31 24 23 16 15 8 7 0 ...


4

__PAIR__() seems to be a macro that computes an unsigned long value from its two arguments, which it interprets as containing the high and low bits of that value. The topic linked by Guntram - Understanding __PAIR__ macro from IDA PRO Pseudo Decompiler to look better contains a definition for the macro and examples of its use, but no explanation of it. // ...


4

The first tool is IDA decompiler (a plugin for IDA). As far as I know for now IDA has decompilers for x86, x64, ARM32, ARM64, PPC, PPC64, and MIPS (see here for more details, each of them costs additional money and should be purchased separately). The second is hopper which has much weaker decompiler and claims to be able to decompile arm64. There is also a ...


4

The answer is that I was trying to open a 32bit file in idaq64 and so the decompiler doesn't work.


4

Although I initially voted to close this question as primarily opinion-based, given both answers side with the same general answer ("No!") I'll answer as well. I just love being the devil's advocate. A general stance This question is very difficult to answer. As someone who came from the security field and had worked on quite a few machine learning related ...


4

There's no technical limitation preventing software development in Java verses C. The only major advantage is execution speed. Moreover, as JEB is directed towards Java programs (android APKs) writing it in Java makes sense. However, this question is not really about reverse engineering.


3

IDA Pro and a number of other disassemblers will disassemble your file, assuming that it isn't compressed or otherwise obfuscated. But this is only the first step in producing a working assembly language program, which you will need if you are to translate it into a higher language. Essentially you are looking at two projects. The first is to produce a ...


3

Parsing PE files correctly is hard and there are almost always ways to make tools crash or refuse to work, while the Windows loader still executes the program normally. See e.g. Pimp My PE, Undocumented PECOFF A loop in the resource tree structure might be enough to crash Resource Hacker. Although these papers are mainly about malicious files, this applies ...


3

No. Macros are pieces of code that you have named.At compilation time when the compiler encounters a macro it just replaces it with the code behind it, then continues the compilation.


3

It's not very surprising that Hex-Rays was unable to decompile those files, seeing as Hex-Rays supports the x86 and ARM processor families (in separate editions). If you do find a tool for decompiling code for that processor family, it will be subject to the limitations that I laid out in this answer. In fact, for ROM dumps, the situation will be even more ...


Only top voted, non community-wiki answers of a minimum length are eligible