Skip to content

Commit

Permalink
Initial project
Browse files Browse the repository at this point in the history
Adds all the source files of the first version of the program.  This first versions includes:

- A fully functional Dolphin accessor for Windows and Linux
- A fully functional memory scanner supporting every common types in 4 number base
- A fully functionnal memory watcher with file saving support

All this in a very clunky for now GUI and works in runtime as Dolphin runs a game.
  • Loading branch information
aldelaro5 committed Aug 6, 2017
1 parent e1430c6 commit 57efbec
Show file tree
Hide file tree
Showing 40 changed files with 5,046 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Source/[Bb]uild*/
Source/[Bb]inary/
Source/obj/
Source/*.ipch
Source/*.opensdf
Source/*.sdf
Source/*.suo
Source/*.vcxproj.user
Source/*.obj
Source/*.tlog
Source/*.VC.opendb
Source/*.VC.db
Source/.vs/
Source/.vscode/
16 changes: 16 additions & 0 deletions Source/.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
AlignAfterOpenBracket: 'true'
AllowAllParametersOfDeclarationOnNextLine: 'true'
AllowShortFunctionsOnASingleLine: None
AlwaysBreakBeforeMultilineStrings: 'true'
AlwaysBreakTemplateDeclarations: 'true'
BreakBeforeBraces: Allman
BreakStringLiterals: 'true'
ColumnLimit: '100'
Cpp11BracedListStyle: 'true'
Language: Cpp
PointerAlignment: Left
Standard: Cpp11
UseTab: Never

...
37 changes: 37 additions & 0 deletions Source/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
cmake_minimum_required(VERSION 3.5.0)
project(Dolphin-memory-engine)

if(WIN32)
set(DolphinProcessSrc DolphinProcess/Windows/WindowsDolphinProcess.cpp)
endif(WIN32)

if(UNIX)
set(DolphinProcessSrc DolphinProcess/Linux/LinuxDolphinProcess.cpp)
endif(UNIX)

set(SRCS ${DolphinProcessSrc}
DolphinProcess/DolphinAccessor.cpp
Common/MemoryCommon.cpp
MemoryWatch/MemoryWatch.cpp
MemoryScanner/MemoryScanner.cpp
GUI/GUICommon.cpp
GUI/MemWatcher/MemWatchTreeNode.cpp
GUI/MemWatcher/MemWatchDelegate.cpp
GUI/MemWatcher/MemWatchModel.cpp
GUI/MemWatcher/DlgChangeType.cpp
GUI/MemWatcher/DlgAddWatchEntry.cpp
GUI/MemWatcher/MemWatchWidget.cpp
GUI/MemScanner/ResultsListModel.cpp
GUI/MemScanner/MemScanWidget.cpp
GUI/MainWindow.cpp
main.cpp)

set(CMAKE_INCLUE_CURRENT_DIR ON)

find_package(Qt5Widgets REQUIRED)

set(CMAKE_AUTOMOC ON)

add_executable(Dolphin-memory-engine ${SRCS})

target_link_libraries(Dolphin-memory-engine Qt5::Widgets)
13 changes: 13 additions & 0 deletions Source/Common/CommonTypes.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#pragma once

#include <cstdint>

typedef uint64_t u64;
typedef uint32_t u32;
typedef uint16_t u16;
typedef uint8_t u8;

typedef int64_t s64;
typedef int32_t s32;
typedef int16_t s16;
typedef int8_t s8;
51 changes: 51 additions & 0 deletions Source/Common/CommonUtils.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#pragma once

#ifdef __linux__
#include <byteswap.h>
#elif _WIN32
#include <stdlib.h>
#endif

#include "CommonTypes.h"

namespace Common
{
#ifdef _WIN32
inline u16 bSwap16(u16 data)
{
return _byteswap_ushort(data);
}
inline u32 bSwap32(u32 data)
{
return _byteswap_ulong(data);
}
inline u64 bSwap64(u64 data)
{
return _byteswap_uint64(data);
}

#elif __linux__
inline u16 bSwap16(u16 data)
{
return bswap_16(data);
}
inline u32 bSwap32(u32 data)
{
return bswap_32(data);
}
inline u64 bSwap64(u64 data)
{
return bswap_64(data);
}
#endif

inline u32 dolphinAddrToOffset(u32 addr)
{
return addr &= 0x7FFFFFFF;
}

inline u32 offsetToDolphinAddr(u32 offset)
{
return offset |= 0x80000000;
}
}
Loading

0 comments on commit 57efbec

Please sign in to comment.