-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactored CapstoneTool, Implemented ARM Thumb, added the capability to add modes
- Loading branch information
Showing
32 changed files
with
300 additions
and
115 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,6 @@ | ||
{ | ||
"files.associations": { | ||
"*.embeddedhtml": "html", | ||
"xiosbase": "cpp" | ||
} | ||
} |
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
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
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 |
---|---|---|
@@ -1,14 +1,7 @@ | ||
#include "Arm32CapstoneHelperFactory.h" | ||
#include "ICapstoneHelper.h" | ||
#include "Arm32CapstoneHelper.h" | ||
|
||
Arm32CapstoneHelperFactory::Arm32CapstoneHelperFactory(bool bIsThumb) | ||
: mIsThumb(bIsThumb) | ||
{ | ||
} | ||
|
||
ICapstoneHelper* Arm32CapstoneHelperFactory::MakeHelper() | ||
{ | ||
if (mIsThumb == false) | ||
return new Arm32CapstoneHelper(); | ||
return new Arm32CapstoneHelper(); | ||
} |
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
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,7 @@ | ||
#include "Arm32ThumbCapstoneHelper.h" | ||
|
||
Arm32ThumbCapstoneHelper::Arm32ThumbCapstoneHelper() | ||
: Arm32CapstoneHelper() | ||
{ | ||
setMode(CS_MODE_THUMB); | ||
} |
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,9 @@ | ||
#pragma once | ||
|
||
#include "Arm32CapstoneHelper.h" | ||
|
||
class Arm32ThumbCapstoneHelper : public Arm32CapstoneHelper | ||
{ | ||
public: | ||
Arm32ThumbCapstoneHelper(); | ||
}; |
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,7 @@ | ||
#include "Arm32ThumbCapstoneHelperFactory.h" | ||
#include "Arm32ThumbCapstoneHelper.h" | ||
|
||
ICapstoneHelper* Arm32ThumbCapstoneHelperFactory::MakeHelper() | ||
{ | ||
return new Arm32ThumbCapstoneHelper(); | ||
} |
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,10 @@ | ||
#pragma once | ||
|
||
#include "ICapstoneHelperFactory.h" | ||
|
||
class Arm32ThumbCapstoneHelperFactory : public ICapstoneHelperFactory | ||
{ | ||
public: | ||
ICapstoneHelper* MakeHelper() override; | ||
}; | ||
|
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
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 |
---|---|---|
@@ -1,12 +1,22 @@ | ||
#include "ELF32BinaryFormat.h" | ||
#include "Arm32CapstoneHelperFactory.h" | ||
#include "Arm32ThumbCapstoneHelperFactory.h" | ||
|
||
bool ELF32BinaryFormat::MakeCapstoneHelper(CapstoneHelperProvider* pProvider, ICapstoneHelper** outHelper) | ||
bool ELF32BinaryFormat::MakeCapstoneHelper(CapstoneHelperProvider* pProvider, ICapstoneHelper** outHelper, std::string mode) | ||
{ | ||
if (outHelper == nullptr) | ||
return false; | ||
|
||
*outHelper = pProvider->getInstance(std::make_unique<Arm32CapstoneHelperFactory>()); | ||
*outHelper = nullptr; | ||
|
||
if (mode == "default") | ||
mode = "arm"; | ||
|
||
if (mode == "arm") | ||
*outHelper = pProvider->getInstance(std::make_unique<Arm32CapstoneHelperFactory>()); | ||
|
||
if (mode == "thumb") | ||
*outHelper = pProvider->getInstance(std::make_unique<Arm32ThumbCapstoneHelperFactory>()); | ||
|
||
return *outHelper != nullptr; | ||
} |
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
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
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
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
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
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.