Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build issue with new SDK #380

Closed
ddkwork opened this issue Jun 13, 2024 · 30 comments
Closed

Build issue with new SDK #380

ddkwork opened this issue Jun 13, 2024 · 30 comments

Comments

@ddkwork
Copy link
Contributor

ddkwork commented Jun 13, 2024

Describe the bug
这是一个一直以来都存在的问题,每次编译我都要注释掉这三个结构体,vs2022提示这三个结构体重定义

To Reproduce
Steps to reproduce the behavior:
clone 仓库编译即可看到错误

Expected behavior
0错误0警告的编译

Screenshots
Screenshot_20240613_133119_com.realvnc.viewer.android.jpg

Desktop (please complete the following information):
Windows X-Lite (22621.1928) 'Micro 11' By FBConan

Additional context
no more

@SinaKarvandi
Copy link
Member

This is not a problem with HyperDbg, we didn't define such a structure _FILE_STAT_LX_INFORMATION. It seems to be a problem with your SDK or VS 2022 configuration as you modified an NT SDK file (ntioapi.h).
image

@ddkwork
Copy link
Contributor Author

ddkwork commented Jun 13, 2024

不,这个文件来自依赖而不是sdk,https://github.com/HyperDbg/phnt/blob/master/ntioapi.h

我的感觉是这个头文件内的结构体和sdk内的某个文件内定义的结构体重复导致编译错误,可能来自ntifs.h,我还没来得及搜索

@SinaKarvandi
Copy link
Member

Agree. By the way, in this casem it's an issue with phnt. I think it should be fixed by them: https://github.com/winsiderss/phnt
It would be best if you could report it to their repo.

@ddkwork
Copy link
Contributor Author

ddkwork commented Jun 13, 2024 via email

@SinaKarvandi
Copy link
Member

No, this error never happens to me. I also asked a couple of friends and they didn't encounter this error. It seems that you're the first one that got this error. 🤔

@ddkwork
Copy link
Contributor Author

ddkwork commented Jun 13, 2024 via email

@SinaKarvandi
Copy link
Member

That's not a big problem. If that's how it works on your computer, it's pretty fine. Fixing it by commenting the code doesn't hurt the code since this function is not used in HyperDbg. I think it's better to fix it this way and later once you install Visual Studio again, the problem will be solved for you.

这不是什么大问题。如果它在你的电脑上就是这样工作的,那就没问题了。通过注释代码来修复它不会损害代码,因为这个函数在 HyperDbg 中没有使用。我认为最好以这种方式修复它,稍后一旦你再次安装 Visual Studio,问题就会为你解决。

@ddkwork
Copy link
Contributor Author

ddkwork commented Jun 13, 2024

vs2022是昨天才新装的新版本,不过这确实可以解决,所以我关闭此议题。我将抽空更新gui,似乎一切准备就绪。

@ddkwork ddkwork closed this as not planned Won't fix, can't repro, duplicate, stale Jun 13, 2024
@SinaKarvandi
Copy link
Member

Maybe it's an issue with the newest version. I'll check it. 🤔

@ddkwork
Copy link
Contributor Author

ddkwork commented Jun 13, 2024

Maybe it's an issue with the newest version. I'll check it. 🤔

hi,请看
HyperDbg/gui#59

我这边是否需要实现模拟运行时?

@SinaKarvandi SinaKarvandi reopened this Jun 21, 2024
@SinaKarvandi
Copy link
Member

This issue (compile issue) was also mentioned in the HyperDbg telegram group. So, it seems that this problem happens to everyone who uses the latest SDK. I'll reopen it to be fixed.

HyperDbg 电报群中也提到了这个问题(编译问题)。所以,似乎每个使用最新 SDK 的人都会遇到这个问题。我会重新打开它进行修复。

@xmaple555
Copy link
Member

#if !defined(NTDDI_WIN11_GE)
// private
typedef struct _FILE_STAT_INFORMATION
{
    LARGE_INTEGER FileId;
    LARGE_INTEGER CreationTime;
    LARGE_INTEGER LastAccessTime;
    LARGE_INTEGER LastWriteTime;
    LARGE_INTEGER ChangeTime;
    LARGE_INTEGER AllocationSize;
    LARGE_INTEGER EndOfFile;
    ULONG FileAttributes;
    ULONG ReparseTag;
    ULONG NumberOfLinks;
    ACCESS_MASK EffectiveAccess;
} FILE_STAT_INFORMATION, *PFILE_STAT_INFORMATION;
#endif

Adding macro define like this way can solve the problem to avoid redefinition . Follow this winsiderss/systeminformer@060790a

@SinaKarvandi
Copy link
Member

Isn't it a problem with phnt? I think it should be solved by phnt authors, I created an issue here: winsiderss/phnt#34

@SinaKarvandi
Copy link
Member

Sure we could solve it by commenting it on our fork of phnt since we're not using this structure in HyperDbg.

@ddkwork
Copy link
Contributor Author

ddkwork commented Jun 21, 2024 via email

@ddkwork
Copy link
Contributor Author

ddkwork commented Jun 21, 2024 via email

@SinaKarvandi SinaKarvandi changed the title 重复的结构体导致编译错误 Build issue with new SDK Jun 21, 2024
@SinaKarvandi
Copy link
Member

SinaKarvandi commented Jun 24, 2024

I updated the 'dev' branch to fix phnt error.
Please clone HyperDbg again (either update submodules) or clone it like this:

git clone -b dev --recursive https://github.com/HyperDbg/HyperDbg.git

And confirm if it builds successfully in the latest SDK?

@SinaKarvandi
Copy link
Member

I'm working on it now.

@ddkwork
Copy link
Contributor Author

ddkwork commented Jun 24, 2024

I updated the 'dev' branch to fix phnt error.
Please clone HyperDbg again (either update submodules) or clone it like this:

git clone -b dev --recursive https://github.com/HyperDbg/HyperDbg.git

And confirm if it builds successfully in the latest SDK?

中国的网络太糟糕了,假如你在仓库根目录下写入go模块,那么任何中国这边的开发者都可以使用go模块代理来加速下载。克隆和下载是一样的,go模块可以指定提交id拉取。

skia就是这样的:
https://github.com/google/skia/blob/main/go.mod

@SinaKarvandi
Copy link
Member

It is not ready yet, I'm currently working on renaming HPRDBGCTRL to 'libhyperdbg' (as I previously told you) and redesigning SDK functions to export your needed functions (such as memory read), it will be finished tonight. I'll let you know, once it's finished so you can use your requested functionalities (+ any new needed functions).

它还没有准备好,我目前正在将 HPRDBGCTRL 重命名为“libhyperdbg”(正如我之前告诉您的),并重新设计 SDK 函数以导出您所需的函数(例如内存读取),它将在今晚完成。一旦完成,我会通知您,以便您可以使用您请求的功能(+任何新的所需功能)。

@ddkwork
Copy link
Contributor Author

ddkwork commented Jun 24, 2024 via email

@ddkwork
Copy link
Contributor Author

ddkwork commented Jun 24, 2024 via email

@SinaKarvandi
Copy link
Member

此外,为什么不把我在gui仓库论坛支出的两个目录全部都导出到dll呢,一次性全部都导出不是更好吗?

Not sure if I understand what you mean. 🤔

不确定我是否明白你的意思。🤔

@ddkwork
Copy link
Contributor Author

ddkwork commented Jun 24, 2024 via email

@SinaKarvandi
Copy link
Member

No, that's not a good idea since there are lots of internal functions that are designed for internal use, and don't make sense to be exported. Let's just export those functions that are really useful to the SDK.
Anyway, did you check whether the build problem (commenting those structures in phnt) was fixed or not? If it's fixed, please close this issue as completed.

不,这不是一个好主意,因为有很多内部函数是为内部使用而设计的,导出毫无意义。我们只导出那些对 SDK 真正有用的函数。
无论如何,您是否检查过构建问题(在 phnt 中注释这些结构)是否已修复?如果已修复,请将此问题关闭为已完成。

@ddkwork
Copy link
Contributor Author

ddkwork commented Jun 24, 2024 via email

@SinaKarvandi
Copy link
Member

Did you removed an re-clone it using this command?
git clone -b dev --recursive https://github.com/HyperDbg/HyperDbg.git

@ddkwork
Copy link
Contributor Author

ddkwork commented Jun 24, 2024 via email

@SinaKarvandi
Copy link
Member

No, the problem is that I removed 'phnt' as a submodule. So, I'm not sure if updating modules works or not. No problem, you can test it later once the network is stable.

不,问题是我删除了“phnt”作为子模块。所以,我不确定更新模块是否有效。没问题,您可以在网络稳定后稍后进行测试。

@ddkwork
Copy link
Contributor Author

ddkwork commented Jun 24, 2024

Now, build success, can be close.

@ddkwork ddkwork closed this as completed Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants