Search in sources :

Example 16 with WalkResult

use of com.google.security.zynamics.binnavi.disassembly.types.BaseTypeHelpers.WalkResult in project binnavi by google.

the class BaseTypeHelpersTests method testFindMemberArrayType3.

@Test
public void testFindMemberArrayType3() {
    final WalkResult result = BaseTypeHelpers.findMember(typeSystem.uintArrayType, typeSystem.uintArrayType.getBitSize() + 1);
    assertTrue(result.isValid());
    assertEquals("unsigned int[10]+1", result.getPathString());
    assertEquals(Lists.newArrayList(typeSystem.uintArrayTypeMember), result.getPath());
    assertEquals(typeSystem.uintArrayTypeMember, result.getMember());
}
Also used : WalkResult(com.google.security.zynamics.binnavi.disassembly.types.BaseTypeHelpers.WalkResult) Test(org.junit.Test)

Example 17 with WalkResult

use of com.google.security.zynamics.binnavi.disassembly.types.BaseTypeHelpers.WalkResult in project binnavi by google.

the class BaseTypeHelpersTests method testFindMemberNestedStructType6.

@Test
public void testFindMemberNestedStructType6() {
    final WalkResult result = BaseTypeHelpers.findMember(typeSystem.doubleNestedStruct, 96 + 320 - 32);
    assertNotNull(result);
    assertTrue(result.isValid());
    assertEquals(typeSystem.ssArrayMember, result.getMember());
    assertEquals(Lists.newArrayList(typeSystem.dnsNestedStructMember, typeSystem.nsSimpleStructMember, typeSystem.ssArrayMember), result.getPath());
    assertEquals(typeSystem.doubleNestedStruct.getName() + "." + typeSystem.dnsNestedStructMember.getName() + "." + typeSystem.nsSimpleStructMember.getName() + "." + typeSystem.ssArrayMember.getName() + "[9]", result.getPathString());
}
Also used : WalkResult(com.google.security.zynamics.binnavi.disassembly.types.BaseTypeHelpers.WalkResult) Test(org.junit.Test)

Example 18 with WalkResult

use of com.google.security.zynamics.binnavi.disassembly.types.BaseTypeHelpers.WalkResult in project binnavi by google.

the class BaseTypeHelpersTests method testFindMemberNestedStructType7.

@Test
public void testFindMemberNestedStructType7() {
    final WalkResult result = BaseTypeHelpers.findMember(typeSystem.doubleNestedStruct, 96 + 320);
    assertNotNull(result);
    assertTrue(result.isValid());
    assertEquals(typeSystem.dnsIntMember, result.getMember());
    assertEquals(Lists.newArrayList(typeSystem.dnsIntMember), result.getPath());
    assertEquals(typeSystem.doubleNestedStruct.getName() + "." + typeSystem.dnsIntMember.getName(), result.getPathString());
}
Also used : WalkResult(com.google.security.zynamics.binnavi.disassembly.types.BaseTypeHelpers.WalkResult) Test(org.junit.Test)

Example 19 with WalkResult

use of com.google.security.zynamics.binnavi.disassembly.types.BaseTypeHelpers.WalkResult in project binnavi by google.

the class BaseTypeHelpersTests method testFindMemberArrayType2.

@Test
public void testFindMemberArrayType2() {
    final WalkResult result = BaseTypeHelpers.findMember(typeSystem.uintArrayType, 32);
    assertNotNull(result);
    assertTrue(result.isValid());
    assertNotNull(result.getMember());
    assertEquals(typeSystem.uintArrayTypeMember, result.getMember());
    assertEquals(Lists.newArrayList(typeSystem.uintArrayTypeMember), result.getPath());
    assertEquals("unsigned int[1]", result.getPathString());
}
Also used : WalkResult(com.google.security.zynamics.binnavi.disassembly.types.BaseTypeHelpers.WalkResult) Test(org.junit.Test)

Example 20 with WalkResult

use of com.google.security.zynamics.binnavi.disassembly.types.BaseTypeHelpers.WalkResult in project binnavi by google.

the class BaseTypeHelpersTests method testFindMemberNestedStructType5.

@Test
public void testFindMemberNestedStructType5() {
    final WalkResult result = BaseTypeHelpers.findMember(typeSystem.doubleNestedStruct, 128);
    assertNotNull(result);
    assertTrue(result.isValid());
    assertEquals(typeSystem.ssArrayMember, result.getMember());
    assertEquals(Lists.newArrayList(typeSystem.dnsNestedStructMember, typeSystem.nsSimpleStructMember, typeSystem.ssArrayMember), result.getPath());
    assertEquals(typeSystem.doubleNestedStruct.getName() + "." + typeSystem.dnsNestedStructMember.getName() + "." + typeSystem.nsSimpleStructMember.getName() + "." + typeSystem.ssArrayMember.getName() + "[1]", result.getPathString());
}
Also used : WalkResult(com.google.security.zynamics.binnavi.disassembly.types.BaseTypeHelpers.WalkResult) Test(org.junit.Test)

Aggregations

WalkResult (com.google.security.zynamics.binnavi.disassembly.types.BaseTypeHelpers.WalkResult)20 Test (org.junit.Test)19 TypeMemberTreeNode (com.google.security.zynamics.binnavi.Gui.GraphWindows.types.TypeMemberTreeNode)1 TypeMember (com.google.security.zynamics.binnavi.disassembly.types.TypeMember)1 DefaultMutableTreeNode (javax.swing.tree.DefaultMutableTreeNode)1