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

RzIL public API for core plugins #3145

Open
ogre2007 opened this issue Oct 31, 2022 · 1 comment
Open

RzIL public API for core plugins #3145

ogre2007 opened this issue Oct 31, 2022 · 1 comment
Assignees
Milestone

Comments

@ogre2007
Copy link
Contributor

ogre2007 commented Oct 31, 2022

Is your feature request related to a problem? Please describe.
If one wants to implement some work related to RZIL, but without intention to implement analysis plugin that will help with lifting (rz_analysis.h), there is no means to do it without digging into core_private.h or cmd_descs.h headers, that is private and not accessible by default. It provides useful things - Init and start VM on current addr for core pointer, print vm state and so on.
Public headers in rz_il.h provide only low-level VM procs
rz_core.h includes useful procs, but only for ESIL, and not RZIL

Describe the solution you'd like
Expose and describe useful RZIL API in public header rz_core.h, as its already done for ESIL, or implement it in some other way.

rz_core.h
/*cil.c */
// TODO : They should have been there, but require `static` vars inside canalysis.c
//      : Keep esil in canalysis.c, and split the rzil in cil.c
RZ_API void rz_core_analysis_esil(RzCore *core, ut64 addr, ut64 size, RZ_NULLABLE RzAnalysisFunction *fcn);
RZ_API bool rz_core_esil_cmd(RzAnalysisEsil *esil, const char *cmd, ut64 a1, ut64 a2);
RZ_API int rz_core_esil_step(RzCore *core, ut64 until_addr, const char *until_expr, ut64 *prev_addr, bool stepOver);
RZ_API int rz_core_esil_step_back(RzCore *core);
RZ_API bool rz_core_esil_dumpstack(RzAnalysisEsil *esil);
RZ_API bool rz_core_esil_continue_back(RZ_NONNULL RzCore *core);
RZ_API void rz_core_analysis_esil_step_over(RZ_NONNULL RzCore *core);
RZ_API void rz_core_analysis_esil_reinit(RZ_NONNULL RzCore *core);
RZ_API void rz_core_analysis_esil_deinit(RZ_NONNULL RzCore *core);
RZ_API void rz_core_analysis_esil_init_mem(RZ_NONNULL RzCore *core, RZ_NULLABLE const char *name, ut64 addr, ut32 size);
RZ_API void rz_core_analysis_esil_init_mem_del(RZ_NONNULL RzCore *core, RZ_NULLABLE const char *name, ut64 addr, ut32 size);
RZ_API void rz_core_analysis_esil_init_regs(RZ_NONNULL RzCore *core);

upd:
Such useful functions is already defined in cil.c, but they are not exposed in rz_core.

@ogre2007 ogre2007 changed the title RZIL public API RZIL public API for core plugins Oct 31, 2022
@XVilka
Copy link
Member

XVilka commented Jan 14, 2024

It will be done as a part of the ongoing transition (see the Second stage) since the first stage is almost complete now: #2080

@XVilka XVilka added this to the 0.8.0 milestone Jan 14, 2024
@XVilka XVilka changed the title RZIL public API for core plugins RzIL public API for core plugins Jan 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants