Skip to content

Commit 9dd5d64

Browse files
committed
feat: added 'compilers' analyzer module
1 parent b83c01d commit 9dd5d64

15 files changed

Lines changed: 1465 additions & 0 deletions

File tree

.github/workflows/notify.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Notify Workspace
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
7+
jobs:
8+
notify:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/github-script@v9
13+
with:
14+
github-token: ${{ secrets.RD_WORKSPACE_CI_TOKEN }}
15+
script: |
16+
await github.rest.repos.createDispatchEvent({
17+
owner: 'redasm-dev',
18+
repo: 'workspace',
19+
event_type: 'repo_updated',
20+
client_payload: {
21+
repo: context.repo.repo,
22+
sha: context.sha
23+
}
24+
})

CMakeLists.txt

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
cmake_minimum_required(VERSION 3.25)
2+
project(redasm-analyzers C)
3+
4+
if(NOT TARGET redasm::redasm)
5+
find_package(redasm REQUIRED)
6+
endif()
7+
8+
if(WIN32)
9+
set(REDASM_INSTALL_PLUGINS "plugins/analyzers")
10+
else()
11+
include(GNUInstallDirs)
12+
set(REDASM_INSTALL_PLUGINS "${CMAKE_INSTALL_LIBDIR}/redasm/plugins/analyzers")
13+
endif()
14+
15+
add_subdirectory(compilers)
16+
17+
get_property(subdirs DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" PROPERTY SUBDIRECTORIES)
18+
19+
foreach(subdir ${subdirs})
20+
get_property(targets DIRECTORY ${subdir} PROPERTY BUILDSYSTEM_TARGETS)
21+
22+
foreach(target ${targets})
23+
get_target_property(target_type ${target} TYPE)
24+
25+
if(target_type STREQUAL "SHARED_LIBRARY")
26+
if(NOT WIN32)
27+
set_target_properties(${target} PROPERTIES
28+
INSTALL_RPATH "$ORIGIN/../../../"
29+
)
30+
endif()
31+
32+
install(TARGETS ${target}
33+
LIBRARY DESTINATION "${REDASM_INSTALL_PLUGINS}"
34+
RUNTIME DESTINATION "${REDASM_INSTALL_PLUGINS}"
35+
)
36+
endif()
37+
endforeach()
38+
endforeach()

compilers/CMakeLists.txt

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
cmake_minimum_required(VERSION 3.25)
2+
3+
project(compilers C)
4+
5+
if(NOT TARGET redasm::redasm)
6+
find_package(redasm REQUIRED)
7+
endif()
8+
9+
add_library(${PROJECT_NAME} SHARED)
10+
11+
target_sources(${PROJECT_NAME}
12+
PRIVATE
13+
rtti/msvc/msvc.c
14+
rtti/msvc/types.c
15+
vb/components.c
16+
vb/decompiler.c
17+
vb/format.c
18+
plugin.c
19+
)
20+
21+
target_include_directories(${PROJECT_NAME}
22+
PRIVATE
23+
"${CMAKE_CURRENT_SOURCE_DIR}"
24+
)
25+
26+
target_link_libraries(${PROJECT_NAME}
27+
PRIVATE
28+
redasm::redasm
29+
)

compilers/plugin.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#include "rtti/msvc/msvc.h"
2+
#include "vb/decompiler.h"
3+
#include <redasm/redasm.h>
4+
5+
void rd_plugin_create(void) {
6+
rd_register_analyzer(&RTTI_MSVC);
7+
rd_register_analyzer(&VB_DECOMPILER);
8+
}
9+
10+
const char* rd_plugin_version(void) { return "1.0"; }

0 commit comments

Comments
 (0)