Skip to main content
replaced http://reverseengineering.stackexchange.com/ with https://reverseengineering.stackexchange.com/
Source Link

I am trying to iterate all the C statement (could be very coarse-grained, it's fine) in IDA-Pro recovered assembly program.

Suppose I only consider these statements:

State :: =
  | if-else cond;
  | loop;
  | assignment;
  | function call
  | return
  | {s1; s2; s3 ...}

And after some quick search, I know that there are some (third-party) plugins that can help to identify some C control-flow structure, and I list some of them below:

if-else cond : N/A

loop : link1link1 link2 link3

So my questions are:

  1. Is there any plugins that can recover if/else statement? It looks easier than loop, but I just cannot find a well-developed way to recover the statement.

  2. Is there anyway/api/scripts to iterate C statements in IDA-Pro? Or I have to implement myself?

Ideally it should look like this as this is essentially used in source code analysis... (sorry for this pseudo code, I just want to clarify)

let aux s =
    match s with
    | If e1 b1 b2 -> analyze e1 b1 b2
    | Loop e1 e2 e3 b1 -> analyze e1 e2 e3 b1
    | Assign v1 v2 -> analyze v1 v2 
    | States sl -> List.iter analyze sl
    | ...  in
List.iter aux statement_list
...

I am trying to iterate all the C statement (could be very coarse-grained, it's fine) in IDA-Pro recovered assembly program.

Suppose I only consider these statements:

State :: =
  | if-else cond;
  | loop;
  | assignment;
  | function call
  | return
  | {s1; s2; s3 ...}

And after some quick search, I know that there are some (third-party) plugins that can help to identify some C control-flow structure, and I list some of them below:

if-else cond : N/A

loop : link1 link2 link3

So my questions are:

  1. Is there any plugins that can recover if/else statement? It looks easier than loop, but I just cannot find a well-developed way to recover the statement.

  2. Is there anyway/api/scripts to iterate C statements in IDA-Pro? Or I have to implement myself?

Ideally it should look like this as this is essentially used in source code analysis... (sorry for this pseudo code, I just want to clarify)

let aux s =
    match s with
    | If e1 b1 b2 -> analyze e1 b1 b2
    | Loop e1 e2 e3 b1 -> analyze e1 e2 e3 b1
    | Assign v1 v2 -> analyze v1 v2 
    | States sl -> List.iter analyze sl
    | ...  in
List.iter aux statement_list
...

I am trying to iterate all the C statement (could be very coarse-grained, it's fine) in IDA-Pro recovered assembly program.

Suppose I only consider these statements:

State :: =
  | if-else cond;
  | loop;
  | assignment;
  | function call
  | return
  | {s1; s2; s3 ...}

And after some quick search, I know that there are some (third-party) plugins that can help to identify some C control-flow structure, and I list some of them below:

if-else cond : N/A

loop : link1 link2 link3

So my questions are:

  1. Is there any plugins that can recover if/else statement? It looks easier than loop, but I just cannot find a well-developed way to recover the statement.

  2. Is there anyway/api/scripts to iterate C statements in IDA-Pro? Or I have to implement myself?

Ideally it should look like this as this is essentially used in source code analysis... (sorry for this pseudo code, I just want to clarify)

let aux s =
    match s with
    | If e1 b1 b2 -> analyze e1 b1 b2
    | Loop e1 e2 e3 b1 -> analyze e1 e2 e3 b1
    | Assign v1 v2 -> analyze v1 v2 
    | States sl -> List.iter analyze sl
    | ...  in
List.iter aux statement_list
...
added 32 characters in body
Source Link
lllllllllllll
  • 2.5k
  • 2
  • 34
  • 51

I am trying to iterate all the C statement (could be very coarse-grained, it's fine) in IDA-Pro recovered assembly program.

Suppose I only consider these statements:

State :: =
  | if-else cond;
  | loop;
  | assignment;
  | function call
  | return
  | {s1; s2; s3 ...}

And after some quick search, I know that there isare some (third-party) plugins that can help to identify some C control-flow structure, and I list some of them below:

if-else cond : N/A

loop : link1 link2 link3

So my questions are:

  1. Is there any plugins that can recover if/else statement? It looks easier than loop, but I just cannot find a well-developed way to recover the statement.

  2. Is there anyway/api/scripts to iterate C statements in IDA-Pro? Or I have to implement myself?

Ideally it should look like this as this is essentially used in source code analysis... (sorry for this pseudo code, I just want to clarify)

let aux s =
    match s with
    | If e1 b1 b2 -> analyze e1 b1 b2
    | Loop e1 e2 e3 b1 -> analyze e1 e2 e3 b1
    | Assign v1 v2 -> analyze v1 v2 
    | States sl -> List.iter analyze sl
    | ...  in
List.iter aux statement_list
...

I am trying to iterate all the C statement (could be very coarse-grained, it's fine) in IDA-Pro recovered assembly program.

Suppose I only consider these statements:

State :: =
  | if-else cond;
  | loop;
  | assignment;
  | function call
  | return
  | {s1; s2; s3 ...}

And after some quick search, I know that there is some (third-party) plugins that can help to identify some C control-flow structure, and I list some of them below:

if-else cond : N/A

loop : link1 link2 link3

So my questions are:

  1. Is there any plugins that can recover if/else statement? It looks easier than loop, but I just cannot find a well-developed way to recover the statement.

  2. Is there anyway/api/scripts to iterate C statements in IDA-Pro?

Ideally it should look like this as this is essentially used in source code analysis... (sorry for this pseudo code, I just want to clarify)

let aux s =
    match s with
    | If e1 b1 b2 -> analyze e1 b1 b2
    | Loop e1 e2 e3 b1 -> analyze e1 e2 e3 b1
    | Assign v1 v2 -> analyze v1 v2 
    | States sl -> List.iter analyze sl
    | ...  in
List.iter aux statement_list
...

I am trying to iterate all the C statement (could be very coarse-grained, it's fine) in IDA-Pro recovered assembly program.

Suppose I only consider these statements:

State :: =
  | if-else cond;
  | loop;
  | assignment;
  | function call
  | return
  | {s1; s2; s3 ...}

And after some quick search, I know that there are some (third-party) plugins that can help to identify some C control-flow structure, and I list some of them below:

if-else cond : N/A

loop : link1 link2 link3

So my questions are:

  1. Is there any plugins that can recover if/else statement? It looks easier than loop, but I just cannot find a well-developed way to recover the statement.

  2. Is there anyway/api/scripts to iterate C statements in IDA-Pro? Or I have to implement myself?

Ideally it should look like this as this is essentially used in source code analysis... (sorry for this pseudo code, I just want to clarify)

let aux s =
    match s with
    | If e1 b1 b2 -> analyze e1 b1 b2
    | Loop e1 e2 e3 b1 -> analyze e1 e2 e3 b1
    | Assign v1 v2 -> analyze v1 v2 
    | States sl -> List.iter analyze sl
    | ...  in
List.iter aux statement_list
...
Source Link
lllllllllllll
  • 2.5k
  • 2
  • 34
  • 51

Is there anyway I can iterate all the C-level statements in IDA-Pro?

I am trying to iterate all the C statement (could be very coarse-grained, it's fine) in IDA-Pro recovered assembly program.

Suppose I only consider these statements:

State :: =
  | if-else cond;
  | loop;
  | assignment;
  | function call
  | return
  | {s1; s2; s3 ...}

And after some quick search, I know that there is some (third-party) plugins that can help to identify some C control-flow structure, and I list some of them below:

if-else cond : N/A

loop : link1 link2 link3

So my questions are:

  1. Is there any plugins that can recover if/else statement? It looks easier than loop, but I just cannot find a well-developed way to recover the statement.

  2. Is there anyway/api/scripts to iterate C statements in IDA-Pro?

Ideally it should look like this as this is essentially used in source code analysis... (sorry for this pseudo code, I just want to clarify)

let aux s =
    match s with
    | If e1 b1 b2 -> analyze e1 b1 b2
    | Loop e1 e2 e3 b1 -> analyze e1 e2 e3 b1
    | Assign v1 v2 -> analyze v1 v2 
    | States sl -> List.iter analyze sl
    | ...  in
List.iter aux statement_list
...