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

Generate all command api functions using json with hierarchical command types and handle the respective arguments #169

Closed
ddkwork opened this issue Jul 6, 2024 · 28 comments

Comments

@ddkwork
Copy link
Contributor

ddkwork commented Jul 6, 2024

This will parse the json with the longest example field too extract all the parameters and types, ideally like the current sdk's set breakpoint api function looks like, with all the parameters and types. This would make it easier to interact with ui widget events, as parsing the command return would require a temporary constructed structure? Some commands should not return anything at all, the execution structure and return value are not visible?

https://github.com/HyperDbg/gui/blob/main/sdk%2Fcc%2Fcommand_test.go#L44-L85

@ddkwork
Copy link
Contributor Author

ddkwork commented Jul 6, 2024

screenshots

@ddkwork
Copy link
Contributor Author

ddkwork commented Jul 6, 2024

screenshots

@ddkwork
Copy link
Contributor Author

ddkwork commented Jul 6, 2024

@ddkwork
Copy link
Contributor Author

ddkwork commented Jul 6, 2024

1f1081ee-b394-488d-86da-2fe852b19d9d.png

@ddkwork
Copy link
Contributor Author

ddkwork commented Jul 6, 2024

3c688721-4f43-40e0-a2b9-7d10165e757f.png

@ddkwork
Copy link
Contributor Author

ddkwork commented Jul 6, 2024

03d427e1-5beb-4756-a7e8-3fc04197c354.png

@ddkwork
Copy link
Contributor Author

ddkwork commented Jul 6, 2024

screenshots

@SinaKarvandi
Copy link
Member

Hi,
I'm here now. Are you going to make a parser for the commands in GO? Am right? or do you just want to show them in a list?

嗨,
我现在就在这里。你要为 GO 中的命令制作一个解析器吗?对吧?还是你只是想将它们显示在列表中?

@ddkwork
Copy link
Contributor Author

ddkwork commented Jul 7, 2024 via email

@SinaKarvandi
Copy link
Member

Ah, I got what you mean. Honestly, this is really hard to make because I created this JSON file manually. Unfortunately, we don't have a separate parser for the commands in libhyperdbg and it's been on the to-do list for a long time, so right now each command doesn't have structured arguments and parameters format, and making such a structure for commands probably needs months of work!

I suggest not to use a unique function for each command. Instead, we could create a box and pass all of the user inputs to the 'interpreter' function. I started to export all of the commands in the SDK gradually (for now, I'm working on exporting essential functionalities like reading/writing memory, and right now, I'm working on providing read/write into registers for you). I think having functionalities exported in the SDK is better than passing them to the 'interpreter' functions since this way we could remove the interpreting phase and make it faster.

What do you think of it?

啊,我明白你的意思了。老实说,这真的很难做,因为我手动创建了这个 JSON 文件。不幸的是,我们没有 libhyperdbg 中命令的单独解析器,而且它已经在待办事项列表中很长时间了,所以现在每个命令都没有结构化的参数和参数格式,而为命令创建这样的结构可能需要几个月的工作!

我建议不要为每个命令使用一个唯一的函数。相反,我们可以创建一个框并将所有用户输入传递给“解释器”函数。我开始逐步导出 SDK 中的所有命令(目前,我正在努力导出读取/写入内存等基本功能,现在,我正在努力为您提供对寄存器的读取/写入)。我认为在 SDK 中导出功能比将它们传递给“解释器”函数更好,因为这样我们可以删除解释阶段并使其更快。

你觉得怎么样?

@ddkwork
Copy link
Contributor Author

ddkwork commented Jul 7, 2024 via email

@ddkwork
Copy link
Contributor Author

ddkwork commented Jul 7, 2024

I think we should leave it as it is because that would increase the workload, meaning that the command parsing and checking stays for libhyperdbg to continue parsing. However, when interacting with the ui, it's a bit hard to remember the number and type of arguments for each command function, so what I've done is to write the number and type of arguments for the command function into the json, and then I've encapsulated them in the formal parameter of the call to each command, so that when calling the command function, it's equivalent to having a static syntax to check that I haven't passed the arguments by mistake, and I'll format all the arguments into the full command by their type before calling the command function.Before calling the command function, I will format all the parameters into full commands by parameter type and pass them to the dll, the rest of the checking is still done by the dll.

@SinaKarvandi
Copy link
Member

okay, so anything else you need on my side? Right now, I'm working on providing the SDK APIs for the reading/writing registers. It's available here (https://github.com/HyperDbg/HyperDbg/tree/register-api), but it's not done yet. I need to make a comprehensive test to see if it works or not. I'll let you know once it's ready.

好的,您还需要我提供什么吗?目前,我正在努力提供用于读取/写入寄存器的 SDK API。它可在此处获得(https://github.com/HyperDbg/HyperDbg/tree/register-api),但尚未完成。我需要进行全面测试以查看它是否有效。一旦准备好,我会通知您。

@ddkwork
Copy link
Contributor Author

ddkwork commented Jul 7, 2024 via email

@SinaKarvandi
Copy link
Member

ok

@SinaKarvandi
Copy link
Member

I send you an updated version of the JSON (in email). We don't have such a thing as arguments separately in HyperDbg since it's not standard available in HyperDbg so other than the arguments, I think other issues are fixed.

我会向您发送 JSON 的更新版本(通过电子邮件)。HyperDbg 中没有单独的参数,因为它不是 HyperDbg 中的标准配置,因此除了参数之外,我认为其他问题都已修复。

@ddkwork
Copy link
Contributor Author

ddkwork commented Jul 7, 2024 via email

@ddkwork
Copy link
Contributor Author

ddkwork commented Jul 7, 2024 via email

ddkwork added a commit to ddkwork/codeEditor that referenced this issue Jul 8, 2024
ddkwork added a commit to ddkwork/StructView that referenced this issue Jul 8, 2024
ddkwork added a commit to ddkwork/tabledemo that referenced this issue Jul 8, 2024
ddkwork added a commit to ddkwork/colorView that referenced this issue Jul 8, 2024
ddkwork added a commit to ddkwork/DecodeRaw that referenced this issue Jul 8, 2024
ddkwork added a commit to ddkwork/selector that referenced this issue Jul 8, 2024
ddkwork added a commit to ddkwork/jsontree that referenced this issue Jul 8, 2024
ddkwork added a commit to ddkwork/explorer that referenced this issue Jul 8, 2024
ddkwork added a commit to ddkwork/Markdown that referenced this issue Jul 8, 2024
ddkwork added a commit to ddkwork/CodeView that referenced this issue Jul 8, 2024
ddkwork added a commit to ddkwork/toolbar that referenced this issue Jul 8, 2024
ddkwork added a commit to ddkwork/vstart that referenced this issue Jul 8, 2024
ddkwork added a commit to ddkwork/vsplit that referenced this issue Jul 8, 2024
ddkwork added a commit to ddkwork/hsplit that referenced this issue Jul 8, 2024
ddkwork added a commit to ddkwork/button that referenced this issue Jul 8, 2024
ddkwork added a commit to ddkwork/radio that referenced this issue Jul 8, 2024
ddkwork added a commit to ddkwork/godoc that referenced this issue Jul 8, 2024
ddkwork added a commit to ddkwork/Field that referenced this issue Jul 8, 2024
ddkwork added a commit to ddkwork/list that referenced this issue Jul 8, 2024
ddkwork added a commit to ddkwork/tag that referenced this issue Jul 8, 2024
ddkwork added a commit to ddkwork/md2 that referenced this issue Jul 8, 2024
ddkwork added a commit to ddkwork/env that referenced this issue Jul 8, 2024
ddkwork added a commit to ddkwork/crypt that referenced this issue Jul 8, 2024
ddkwork added a commit to ddkwork/tls that referenced this issue Jul 8, 2024
ddkwork added a commit to ddkwork/explorer that referenced this issue Jul 8, 2024
ddkwork added a commit to ddkwork/crypt that referenced this issue Jul 8, 2024
@ddkwork ddkwork closed this as completed Jul 8, 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

2 participants