STM8 IDA processor module for STMicroelectronics' STM8 series of microcontrollers. Known working on IDA 7.2 and known to compile with Visual C++ 2019 and the IDA 7.2 SDK.
-
Autocomments spam the output window with a warning:
Exception in IDP Hook function: SWIG director type mismatch in output value of type 'int' in method 'ev_get_autocmt' TypeError: SWIG director type mismatch in output value of type 'int' in method 'ev_get_autocmt'
I don't know how to fix this.
-
No stack variable tracing :(
-
Place this repo in a folder in idasdk/module/
Example file path of stm8.hpp:
D:\idasdk72\module\STM8-IDA\stm8.hpp
-
Open Visual Studio solution file or use the Visual Studio project creation instructions
-
Ctrl+B to build
-
You may see a linker warning:
warning LNK4197: export 'LPH' specified multiple times; using first specification
Don't worry about it.
-
Copy the output file /x64/Debug/stm8.dll to your IDA proc directory
-
Copy the STM8 config file stm8.cfg to your IDA cfg directory
-
Start IDA :)
-
The processor type is "STMicroelectronics STM8"
Even though ida32 is used to work on 32-bit files, it is also an x64 application. Therefore, ida32 plugins must be built for the x64 platform.
-
Open Visual Studio
-
In the 2019 version, you may have to click "Continue without code ->"
-
File > New > Project From Existing Code...
-
What type of project would you like to create: Visual C++
Press Next
-
Project file location: the folder containing this repo
Project name: STM8-IDA or whatever you like
Press Finish
-
Once the project is initialized, go to Project > Properties or hit Alt+F7
-
Open the Configuration Manager
-
Active solution platform: select "x64"
-
Press Close
-
General > Configuration Type
Set to Dynamic Library (.dll)
-
C/C++ > General > Additional Include Directories
Enter the SDK's include folder eg. C:\idasdk\include;
Or use a relative path such as ../../include
-
Linker > Command Line > Additional options
Write: /EXPORT:LPH
-
C/C++ > Preprocessor > Preprocessor Definitions
Add to beginning: NT;
-
Linker > Input > Additional Dependencies
Add to beginning: \lib\x64_win_vc_32\ida.lib;
Or use a relative path such as ..\..\lib\x64_win_vc_32\ida.lib;