Skip to content

Commit 44ff0cf

Browse files
committed
Add workflow for identifying TerminateProcess(GetCurrentProcess)
1 parent a8725d0 commit 44ff0cf

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

view/pe/peview.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2782,6 +2782,16 @@ bool PEView::Init()
27822782
m_logger->LogWarn("Failed to parse resource directory: %s\n", e.what());
27832783
}
27842784

2785+
Ref<Settings> programSettings = Settings::Instance();
2786+
if (programSettings->Contains("core.function.analyzeConditionalNoReturns") &&
2787+
opt.subsystem != IMAGE_SUBSYSTEM_NATIVE && (
2788+
GetSymbolByRawName("TerminateProcess", GetExternalNameSpace()) ||
2789+
GetSymbolByRawName("_TerminateProcess@8", GetExternalNameSpace())))
2790+
{
2791+
// TerminateProcess is imported and this is a user mode file
2792+
programSettings->Set("corePlugins.workflows.conditionalNoReturn", true);
2793+
}
2794+
27852795
// Add a symbol for the entry point
27862796
if (m_entryPoint)
27872797
DefineAutoSymbol(new Symbol(FunctionSymbol, "_start", m_imageBase + m_entryPoint));

0 commit comments

Comments
 (0)