Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,29 @@ on:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
workflow_dispatch:
schedule:
- cron: "0 0 1 * *"

jobs:
build:
runs-on: windows-latest
strategy:
matrix:
os: [windows-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4

- name: Build (install LLVM)
if: ${{ runner.os == 'Windows' }}
run: ./build.ps1 -install_llvm

- name: Build
if: ${{ runner.os != 'Windows' }}
run: ./build.ps1

- uses: actions/upload-artifact@v4
with:
name: binaries
path: ~build/deploy/*.zip
name: fakepdb-${{ runner.os }}-${{ runner.arch }}
path: ~build/deploy/
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
build/
~build/
cmake-build-*/
CMakeFiles/
/CMakeCache.txt
/cmake_install.cmake
/Makefile

.idea/
.vscode/
Expand Down
17 changes: 12 additions & 5 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,23 @@
Tool for PDB generation from IDA Pro database

Supports:
* IDA >= 7.4

* IDA >= 7.4

## Download

* [Windows AMD64](https://nightly.link/Mixaill/FakePDB/workflows/CI/master/binaries.zip)
### GitHub Actions CI downloads

* [Windows x86_64](https://nightly.link/Mixaill/FakePDB/workflows/CI/master/fakepdb-Windows-X64.zip)
* [Linux x86_64](https://nightly.link/Mixaill/FakePDB/workflows/CI/master/fakepdb-Linux-X64.zip)

How to install: copy contents of `fakepdb-*.zip/ida` to `<IDA_directory>/plugins`

### Third-party Linux packages

## How to install
* [Arch Linux (AUR)](https://aur.archlinux.org/packages/ida-pro-plugin-fakepdb-git)

* IDA
* copy content of `binaries.zip/ida` to `<IDA_directory>/plugins`
How to install: `paru -S ida-pro-plugin-fakepdb-git`

## How to use

Expand Down
51 changes: 36 additions & 15 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@
# Config
#

$build_llvm = $true
$generate_msvc = $false
param (
[switch] $build_llvm = $false,
[switch] $install_llvm = $false,
[switch] $generate_msvc = $false
)

#
# Set root dir
Expand All @@ -30,15 +33,15 @@ function Get-OS()
return "windows"
}

if($PSVersionTable.OS.StartsWith("Linux"))
if(Get-Command "uname" -errorAction SilentlyContinue)
{
return "linux"
return "$(uname -s)".ToLower()
}

return "unknown"
}


# the return value needs to match Python's platform.machine().lower()
function Get-Architecture()
{
$os = Get-OS
Expand All @@ -55,18 +58,16 @@ function Get-Architecture()
{
return "i686"
}
}
}
elseif($os -eq "linux")
{
switch ($(uname -m))
{
x86_64
ARM64
{
return "amd64"
return "arm64"
}
}
}
elseif(Get-Command "uname" -errorAction SilentlyContinue)
{
return "$(uname -m)".ToLower()
}

return "Unknown"
}
Expand Down Expand Up @@ -164,6 +165,23 @@ function Build-LLVM(){
cmake --install "./~build/llvm_build"
}

function Install-LLVM(){
#$llvm_version = "$(llvm-cov --version)" -replace '[^\d]*(\d+(\.\d+){1,3})[^\d]*', '$1'
$llvm_version = "21.1.5"
$url = "https://github.com/llvm/llvm-project/releases/download/llvmorg-$llvm_version/clang+llvm-$llvm_version-x86_64-pc-windows-msvc.tar.xz"
Invoke-WebRequest -Uri $url -OutFile llvm.tar.xz
tar -xzf llvm.tar.xz
mkdir -p "$root/~build/llvm_install"
Move-Item "clang+llvm-$llvm_version-x86_64-pc-windows-msvc/*" "$root/~build/llvm_install"
Get-ChildItem "$root/~build/llvm_install"
$env:PATH = "$(Get-Location)\~build\llvm_install\bin;" + $env:PATH
#llvm-config --version

# workaround
mkdir -p "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\DIA SDK\lib\amd64"
Copy-Item "$env:VSINSTALLDIR\DIA SDK\lib\amd64\diaguids.lib" "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\DIA SDK\lib\amd64\diaguids.lib"
}

function Build-FakePDB(){
if ($generate_msvc -eq $true) {
cmake "./src_cpp/" `
Expand Down Expand Up @@ -195,6 +213,9 @@ function Build(){
if($true -eq $build_llvm){
Build-LLVM
}
elseif($true -eq $install_llvm){
Install-LLVM
}

Build-FakePDB

Expand All @@ -220,8 +241,8 @@ function Build(){
#
# Pack files
#
Remove-Item -Path "./~build/deploy/fakepdb.zip" -ErrorAction SilentlyContinue
Compress-Archive -Path "./~build/deploy/*" -DestinationPath "./~build/deploy/fakepdb.zip"
Remove-Item -Path "./~build/fakepdb.zip" -ErrorAction SilentlyContinue
Compress-Archive -Path "./~build/deploy/*" -DestinationPath "./~build/fakepdb.zip"

}

Expand Down
15 changes: 9 additions & 6 deletions src_cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,19 @@ find_package(LLVM REQUIRED CONFIG)
# Compiler settings
#

if (MSVC)
if (WIN32)
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
add_compile_definitions(_SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING)
add_compile_definitions(__STDC_WANT_SECURE_LIB__=1)

endif()

if (MSVC)
add_compile_options(/Wall)
add_compile_options(/wd4061 /wd4100 /wd4146 /wd4242 /wd4244 /wd4245 /wd4266 /wd4267 /wd4324 /wd4365 /wd4458 /wd4459 /wd4514 /wd4582 /wd4583 /wd4623 /wd4624 /wd4625 /wd4626 /wd4702 /wd4710 /wd4711 /wd4774 /wd4800 /wd4820 /wd5026 /wd5027 /wd5045)
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
add_compile_options(-Wall -Wextra -Wno-unused-parameter)
endif()



#
# LLVM
#
Expand Down Expand Up @@ -88,8 +88,11 @@ target_compile_definitions(fakepdb_common PUBLIC JSON_DIAGNOSTICS=1)
target_include_directories(fakepdb_common PUBLIC src_common)
target_include_directories(fakepdb_common PUBLIC ${LLVM_INCLUDE_DIRS})

target_link_libraries(fakepdb_common PUBLIC ${llvm_libs})

if (WIN32)
target_link_libraries(fakepdb_common PUBLIC ${llvm_libs})
else()
llvm_config(fakepdb_common USE_SHARED ${llvm_libs})
endif()


#
Expand Down
Loading