Skip to content

Commit

Permalink
Rewrite implementation, now a namespace and datatype is created.
Browse files Browse the repository at this point in the history
  • Loading branch information
antoniovazquezblanco committed Jan 4, 2024
1 parent e2b2877 commit 9f0d23b
Show file tree
Hide file tree
Showing 5 changed files with 458 additions and 28 deletions.
54 changes: 54 additions & 0 deletions src/main/java/devicetreeblob/Block.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/* ###
* IP: GHIDRA
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package devicetreeblob;

import java.util.Objects;

public class Block {
private Long mAddress;
private Long mSize;
private int mHashCode;

public Block(Long addr, Long size) {
mAddress = addr;
mSize = size;
mHashCode = Objects.hash(addr, size);
}

public Long getAddress() {
return mAddress;
}

public Long getSize() {
return mSize;
}

@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
Block that = (Block) o;
return this.mAddress.longValue() == that.getAddress().longValue()
&& this.mSize.longValue() == that.getSize().longValue();
}

@Override
public int hashCode() {
return mHashCode;
}
}
38 changes: 38 additions & 0 deletions src/main/java/devicetreeblob/BlockInfo.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/* ###
* IP: GHIDRA
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package devicetreeblob;

import java.util.ArrayList;
import java.util.List;

import devicetreeblob.parser.DtbBlock;
import devicetreeblob.parser.DtbRegion;

public class BlockInfo {
public Block block;
public String name;
public boolean isReadable;
public boolean isWritable;
public boolean isExecutable;
public boolean isVolatile;
public List<DtbBlock> blocks;
public List<DtbRegion> regions;

public BlockInfo() {
blocks = new ArrayList<DtbBlock>();
regions = new ArrayList<DtbRegion>();
}
}
15 changes: 15 additions & 0 deletions src/main/java/devicetreeblob/DtbFileDialog.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/* ###
* IP: GHIDRA
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package devicetreeblob;

import java.io.File;
Expand Down
Loading

0 comments on commit 9f0d23b

Please sign in to comment.