Skip to content

Commit

Permalink
renamed a few things
Browse files Browse the repository at this point in the history
cleaned up Fas plugin a bit
tightened up the DumpState plugin's output
  • Loading branch information
eteran committed Mar 19, 2024
1 parent 5b5864a commit b2951d2
Show file tree
Hide file tree
Showing 15 changed files with 191 additions and 125 deletions.
1 change: 1 addition & 0 deletions cspell.config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ dictionaries: []
words:
- Antialiasing
- CLASSINFO
- darkprof
- debuggee
- demangled
- DEMANGLING
Expand Down
6 changes: 3 additions & 3 deletions plugins/Bookmarks/Bookmarks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,9 @@ void Bookmarks::restoreState(const QVariantMap &state) {
for (auto &entry : bookmarks) {
auto bookmark = entry.value<QVariantMap>();

edb::address_t address = edb::address_t::fromHexString(bookmark["address"].toString());
QString type = bookmark["type"].toString();
QString comment = bookmark["comment"].toString();
auto address = edb::address_t::fromHexString(bookmark["address"].toString());
QString type = bookmark["type"].toString();
QString comment = bookmark["comment"].toString();

qDebug() << "Restoring bookmark with address: " << address.toHexString();

Expand Down
32 changes: 16 additions & 16 deletions plugins/DumpState/DumpState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,23 +207,23 @@ void DumpState::dumpRegisters(const State &state) {
}
cout << "\n";
} else {
cout << " rax:" << format_register(state["rax"]);
cout << " rax:" << format_register(state["rax"]);
cout << " rcx:" << format_register(state["rcx"]);
cout << " rdx:" << format_register(state["rdx"]);
cout << " rbx:" << format_register(state["rbx"]);
cout << " rflags:" << format_register(state["rflags"]);
cout << " rdx:" << format_register(state["rdx"]);
cout << " rbx:" << format_register(state["rbx"]);
cout << " rflags:" << format_register(state["rflags"]);
cout << "\n";
cout << " rsp:" << format_register(state["rsp"]);
cout << " rsp:" << format_register(state["rsp"]);
cout << " rbp:" << format_register(state["rbp"]);
cout << " rsi:" << format_register(state["rsi"]);
cout << " rdi:" << format_register(state["rdi"]);
cout << " rip:" << format_register(state["rip"]);
cout << " rsi:" << format_register(state["rsi"]);
cout << " rdi:" << format_register(state["rdi"]);
cout << " rip:" << format_register(state["rip"]);
cout << "\n";
cout << " r8:" << format_register(state["r8"]);
cout << " r8:" << format_register(state["r8"]);
cout << " r9:" << format_register(state["r9"]);
cout << " r10:" << format_register(state["r10"]);
cout << " r11:" << format_register(state["r11"]);
cout << " ";
cout << " r10:" << format_register(state["r10"]);
cout << " r11:" << format_register(state["r11"]);
cout << " ";

const Register rflagsR = state["rflags"];
if (rflagsR) {
Expand All @@ -240,12 +240,12 @@ void DumpState::dumpRegisters(const State &state) {
}

cout << "\n";
cout << " r12:" << format_register(state["r12"]);
cout << " r12:" << format_register(state["r12"]);
cout << " r13:" << format_register(state["r13"]);
cout << " r14:" << format_register(state["r14"]);
cout << " r15:" << format_register(state["r15"]);
cout << " r14:" << format_register(state["r14"]);
cout << " r15:" << format_register(state["r15"]);
cout << "\n";
cout << " es:" << format_segment(state["es"]);
cout << " es:" << format_segment(state["es"]);
cout << " cs:" << format_segment(state["cs"]);
cout << " ss:" << format_segment(state["ss"]);
cout << " ds:" << format_segment(state["ds"]);
Expand Down
10 changes: 5 additions & 5 deletions plugins/DumpState/DumpState.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ public Q_SLOTS:
[[nodiscard]] QWidget *optionsPage() override;

private:
void dumpCode(const State &state);
void dumpRegisters(const State &state);
void dumpStack(const State &state);
void dumpData(edb::address_t address);
void dumpLines(edb::address_t address, int lines);
static void dumpCode(const State &state);
static void dumpRegisters(const State &state);
static void dumpStack(const State &state);
static void dumpData(edb::address_t address);
static void dumpLines(edb::address_t address, int lines);

private:
QMenu *menu_ = nullptr;
Expand Down
76 changes: 0 additions & 76 deletions plugins/FasLoader/.gitignore

This file was deleted.

22 changes: 21 additions & 1 deletion plugins/FasLoader/Fas/Core.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
/*
* @file: Core.cpp
*
* This file part of RT ( Reconstructive Tools )
* Copyright (c) 2018 darkprof <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* 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, see <http://www.gnu.org/licenses/>.
**/


#include "Core.hpp"
#include "Exception.hpp"
Expand Down Expand Up @@ -29,7 +49,7 @@ void Core::load(const std::string &fileName) {
qDebug() << fasSymbols_.size();
deleteAnonymousSymbols();
loadSymbols();
} catch (std::exception &e) {
} catch (const Exception &e) {
qWarning() << e.what();
}
}
Expand Down
27 changes: 26 additions & 1 deletion plugins/FasLoader/Fas/Core.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,26 @@
#pragma once
/*
* @file: Core.hpp
*
* This file part of RT ( Reconstructive Tools )
* Copyright (c) 2018 darkprof <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* 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, see <http://www.gnu.org/licenses/>.
**/


#ifndef FAS_CORE_H_
#define FAS_CORE_H_

#include "Header.hpp"
#include "PluginSymbol.hpp"
Expand Down Expand Up @@ -45,4 +67,7 @@ class Core {
FasSymbols fasSymbols_;
PluginSymbols symbols_;
};

}

#endif
5 changes: 4 additions & 1 deletion plugins/FasLoader/Fas/Exception.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
**/

#pragma once
#ifndef FAS_EXCEPTION_H_
#define FAS_EXCEPTION_H_

#include <exception>
#include <string>
Expand All @@ -37,3 +38,5 @@ class Exception : public std::exception {
};

}

#endif
26 changes: 25 additions & 1 deletion plugins/FasLoader/Fas/Header.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,26 @@
#pragma once
/*
* @file: Header.hpp
*
* This file part of RT ( Reconstructive Tools )
* Copyright (c) 2018 darkprof <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* 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, see <http://www.gnu.org/licenses/>.
**/


#ifndef FAS_HEADER_H_
#define FAS_HEADER_H_

#include <cstdint>

Expand Down Expand Up @@ -28,3 +50,5 @@ struct Header {
#pragma pack(pop)

}

#endif
26 changes: 25 additions & 1 deletion plugins/FasLoader/Fas/PluginSymbol.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,26 @@
#pragma once
/*
* @file: PluginSymbol.cpp
*
* This file part of RT ( Reconstructive Tools )
* Copyright (c) 2018 darkprof <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* 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, see <http://www.gnu.org/licenses/>.
**/


#ifndef FAS_PLUGIN_SYMBOL_H_
#define FAS_PLUGIN_SYMBOL_H_

#include <cstdint>
#include <string>
Expand All @@ -12,3 +34,5 @@ struct PluginSymbol {
};

}

#endif
26 changes: 25 additions & 1 deletion plugins/FasLoader/Fas/Symbol.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,26 @@
#pragma once
/*
* @file: Symbol.hpp
*
* This file part of RT ( Reconstructive Tools )
* Copyright (c) 2018 darkprof <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* 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, see <http://www.gnu.org/licenses/>.
**/


#ifndef FAS_SYMBOL_H_
#define FAS_SYMBOL_H_

#include <cstdint>

Expand Down Expand Up @@ -39,3 +61,5 @@ struct Symbol {
#pragma pack(pop)

}

#endif
23 changes: 22 additions & 1 deletion plugins/FasLoader/FasLoader.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
#pragma once
/*
Copyright (C) 2006 - 2023 * Evan Teran [email protected]
* darkprof [email protected]
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
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, see <http://www.gnu.org/licenses/>.
*/

#ifndef FAS_LOADER_HPP_
#define FAS_LOADER_HPP_

#include "Fas/Core.hpp"
#include "IPlugin.h"
Expand Down Expand Up @@ -29,3 +48,5 @@ private Q_SLOTS:
};

}

#endif
Loading

0 comments on commit b2951d2

Please sign in to comment.