-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rewrite implementation, now a namespace and datatype is created.
- Loading branch information
1 parent
e2b2877
commit 9f0d23b
Showing
5 changed files
with
458 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.