-
-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add "x86 disassembly syntax" selection to View menu (#142).
- Loading branch information
1 parent
25fae16
commit dc0bc6d
Showing
13 changed files
with
243 additions
and
11 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/* Reverse Engineer's Hex Editor | ||
* Copyright (C) 2022 Daniel Collins <solemnwarning@solemnwarning.net> | ||
* | ||
* This program is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License version 2 as published by | ||
* the Free Software Foundation. | ||
* | ||
* This program is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
* more details. | ||
* | ||
* You should have received a copy of the GNU General Public License along with | ||
* this program; if not, write to the Free Software Foundation, Inc., 51 | ||
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
*/ | ||
|
||
#include "AppSettings.hpp" | ||
|
||
wxDEFINE_EVENT(REHex::PREFERRED_ASM_SYNTAX_CHANGED, wxCommandEvent); | ||
|
||
REHex::AppSettings::AppSettings(): | ||
preferred_asm_syntax(AsmSyntax::INTEL) {} | ||
|
||
REHex::AppSettings::AppSettings(wxConfig *config): AppSettings() | ||
{ | ||
long preferred_asm_syntax = config->ReadLong("preferred-asm-syntax", -1); | ||
switch(preferred_asm_syntax) | ||
{ | ||
case (long)(AsmSyntax::INTEL): | ||
case (long)(AsmSyntax::ATT): | ||
this->preferred_asm_syntax = (AsmSyntax)(preferred_asm_syntax); | ||
break; | ||
|
||
default: | ||
break; | ||
} | ||
} | ||
|
||
void REHex::AppSettings::write(wxConfig *config) | ||
{ | ||
config->Write("preferred-asm-syntax", (long)(preferred_asm_syntax)); | ||
} | ||
|
||
REHex::AsmSyntax REHex::AppSettings::get_preferred_asm_syntax() const | ||
{ | ||
return preferred_asm_syntax; | ||
} | ||
|
||
void REHex::AppSettings::set_preferred_asm_syntax(AsmSyntax preferred_asm_syntax) | ||
{ | ||
if(this->preferred_asm_syntax != preferred_asm_syntax) | ||
{ | ||
this->preferred_asm_syntax = preferred_asm_syntax; | ||
|
||
wxCommandEvent event(PREFERRED_ASM_SYNTAX_CHANGED); | ||
event.SetEventObject(this); | ||
|
||
wxPostEvent(this, event); | ||
} | ||
} |
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,50 @@ | ||
/* Reverse Engineer's Hex Editor | ||
* Copyright (C) 2022 Daniel Collins <solemnwarning@solemnwarning.net> | ||
* | ||
* This program is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License version 2 as published by | ||
* the Free Software Foundation. | ||
* | ||
* This program is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
* more details. | ||
* | ||
* You should have received a copy of the GNU General Public License along with | ||
* this program; if not, write to the Free Software Foundation, Inc., 51 | ||
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
*/ | ||
|
||
#ifndef REHEX_APPSETTINGS_HPP | ||
#define REHEX_APPSETTINGS_HPP | ||
|
||
#include <wx/config.h> | ||
#include <wx/wx.h> | ||
|
||
namespace REHex | ||
{ | ||
enum class AsmSyntax | ||
{ | ||
INTEL = 1, | ||
ATT = 2, | ||
}; | ||
|
||
class AppSettings: public wxEvtHandler | ||
{ | ||
public: | ||
AppSettings(); | ||
AppSettings(wxConfig *config); | ||
|
||
void write(wxConfig *config); | ||
|
||
AsmSyntax get_preferred_asm_syntax() const; | ||
void set_preferred_asm_syntax(AsmSyntax preferred_asm_syntax); | ||
|
||
private: | ||
AsmSyntax preferred_asm_syntax; | ||
}; | ||
|
||
wxDECLARE_EVENT(PREFERRED_ASM_SYNTAX_CHANGED, wxCommandEvent); | ||
} | ||
|
||
#endif /* !REHEX_APPSETTINGS_HPP */ |
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.