1. 获取remote_debugging_port内存偏移

通过VS2022中查看C++类成员偏移这篇文章找到remote_debugging_port位于_cef_settings_t类的偏移量

2. x64dbg下断 or Hook

断下 or Hook cef_initialize 函数 ,即可找到settings类对象,再通过remote_debugging_port内存偏移,进行修改为你想要的远程端口即可。

///
// This function should be called on the main application thread to initialize
// the CEF browser process. The |application| parameter may be NULL. A return
// value of true (1) indicates that it succeeded and false (0) indicates that it
// failed. The |windows_sandbox_info| parameter is only used on Windows and may
// be NULL (see cef_sandbox_win.h for details).
///
CEF_EXPORT int cef_initialize(const struct _cef_main_args_t* args,
                              const struct _cef_settings_t* settings,
                              cef_app_t* application,
                              void* windows_sandbox_info);

3. 远程调试

访问 http://localhost:端口号 页面,即可查看远程调试界面