如何判断Windows PE文件是控制台子系统还是Windows子系统? [英] How to tell if a windows PE file is a console subsystem or a windows subsystem programmatically?

查看:361
本文介绍了如何判断Windows PE文件是控制台子系统还是Windows子系统?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

基本上,我需要一个程序,将从控制台对应的Windows .exe。

Basically I need a program that will sort windows .exe's from the console counterparts.

档案扫描器:

SortExe(file exe) 
{
 if (IsPeWindows(exe)) 
    {
      AddToList1(exe); 
    }
 else if (IsPeConsole())
    {
    AddToList2(exe); 
    }
 }

如何实现IsPeWindows或IsPeConsole

How do I implement IsPeWindows or IsPeConsole() ?

我不特别介意什么语言解决方案,只要它是c,c ++,c#或视觉基础之一。

I do not particularly mind what language solutions come in so long as it's one of c, c++, c# or visual basic.

推荐答案

SHGFI_EXETYPE 传递给 SHGetFileInfo() & ;按照链接中的说明检查返回值的hi / loword。

Pass SHGFI_EXETYPE to SHGetFileInfo() & examine the hi/loword of the return value as explained in the link.

这篇关于如何判断Windows PE文件是控制台子系统还是Windows子系统?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆