|
The following functions work just like their counterparts from Clib, only they are safer, system independent, and they set qerrno (see get_qerrno()).
|
idaman THREAD_SAFE const char * | format |
idaman THREAD_SAFE va_list | va |
| See qsscanf()
|
idaman THREAD_SAFE const char va_list | va |
int | code = qvfprintf(fp, format, va) |
idaman THREAD_SAFE | AS_PRINTF (1, 0) void ida_export vqperror(const char *format |
| Print error message to stderr (analog of perror)
|
THREAD_SAFE | AS_PRINTF (1, 2) inline void qperror(const char *format |
| See vqperror()
|
THREAD_SAFE | va_start (va, format) |
| va_end (va) |
idaman THREAD_SAFE FILE *ida_export | qfopen (const char *file, const char *mode) |
idaman THREAD_SAFE ssize_t ida_export | qfread (FILE *fp, void *buf, size_t n) |
idaman THREAD_SAFE ssize_t ida_export | qfwrite (FILE *fp, const void *buf, size_t n) |
idaman THREAD_SAFE qoff64_t ida_export | qftell (FILE *fp) |
idaman THREAD_SAFE int ida_export | qfseek (FILE *fp, qoff64_t offset, int whence) |
idaman THREAD_SAFE int ida_export | qfclose (FILE *fp) |
idaman THREAD_SAFE int ida_export | qflush (FILE *fp) |
idaman THREAD_SAFE int ida_export | qfputc (int chr, FILE *fp) |
idaman THREAD_SAFE int ida_export | qfgetc (FILE *fp) |
idaman THREAD_SAFE char *ida_export | qfgets (char *s, size_t len, FILE *fp) |
idaman THREAD_SAFE int ida_export | qfputs (const char *s, FILE *fp) |
idaman FILE *ida_export | qtmpfile (void) |
idaman THREAD_SAFE int ida_export | qunlink (const char *fname) |
idaman THREAD_SAFE int ida_export | qaccess (const char *fname, int mode) |
idaman THREAD_SAFE char *ida_export | qgets (char *line, size_t linesize) |
idaman THREAD_SAFE uint64 ida_export | qfsize (FILE *fp) |
idaman THREAD_SAFE | AS_PRINTF (2, 0) int ida_export qvfprintf(FILE *fp |
idaman THREAD_SAFE | AS_SCANF (2, 0) int ida_export qvfscanf(FILE *fp |
THREAD_SAFE | AS_PRINTF (2, 3) inline int qfprintf(FILE *fp |
| Display a dialog box and wait for the user to input an segment name (ui_ask_seg).
|
THREAD_SAFE | AS_SCANF (2, 3) inline int qfscanf(FILE *fp |
Our definitions of sprintf-like functions support one additional format specifier
Usual optional fields like the width can be used too: %04a. The width specifier will be doubled for 64-bit version. These function return the number of characters actually written to the output string. excluding the terminating zero. (which is different from the snprintf). They always terminate the output with a zero byte (if n > 0).
THREAD_SAFE AS_PRINTF |
( |
1 | , |
|
|
0 | ) const |
Print error message to stderr (analog of perror)
Output a formatted string to the output window [analog of printf()].
Display "no memory for module ..." dialog box and exit.
Display info dialog box and wait for the user to press Enter or Esc.
Display warning dialog box and wait for the user to press Enter or Esc.
See show_wait_box()
This messagebox will by default contain a "Don't display this message again"
checkbox if the message is repetitively displayed. If checked, the message
won't be displayed anymore during the current IDA session.
- Parameters
-
format | printf() style format string. It may have some prefixes, see 'Format of dialog box' for details. |
va | pointer to variadic arguments. |
- Returns
- < 0 in case the warning was inhibited, >= 0 otherwise
This messagebox will by default contain a "Don't display this message again"
checkbox. If checked, the message will never be displayed anymore (state saved
in the Windows registry or the idareg.cfg file for a non-Windows version).
- Parameters
-
format | printf() style format string. It may have some prefixes, see 'Format of dialog box' for details. |
va | pointer to variadic arguments. |
- Returns
- < 0 in case the message was inhibited, >= 0 otherwise
- Parameters
-
format | printf() style message string. |
va | pointer to variadic arguments. |
Everything appearing on the output window may be written to a text file. For this the user should define the following environment variable:
set IDALOG=idalog.txt
- Parameters
-
format | printf() style message string. |
va | pointer to variadic arguments. |
- Returns
- number of bytes output
THREAD_SAFE AS_PRINTF |
( |
1 | , |
|
|
2 | ) const |
See vqperror()
Display error dialog box and exit.
Show a message box asking to send the input file to suppo.nosp@m.rt@h.nosp@m.ex-ra.nosp@m.ys.c.nosp@m.om.
Replace the label of "Please wait dialog box".
Display a dialog box with "Please wait...".
The behavior of the dialog box can be configured with well-known
tokens, that should be placed at the start of the format string:
"NODELAY\n": the dialog will show immediately, instead of
appearing after usual grace threshold
"HIDECANCEL\n": the cancel button won't be added to the dialog box
and user_cancelled() will always return false (but
can be called to refresh UI)
Using "HIDECANCEL" implies "NODELAY"
Plugins must call hide_wait_box() to close the dialog box, otherwise
the user interface will remain disabled.
Note that, if the wait dialog is already visible, show_wait_box() will
1) push the currently-displayed text on a stack
2) display the new text
Then, when hide_wait_box() is called, if that stack isn't empty its top
label will be popped and restored in the wait dialog.
This implies that a plugin should call hide_wait_box() exactly as many
times as it called show_wait_box(), or the wait dialog might remain
visible and block the UI.
Also, in case the plugin knows the wait dialog is currently displayed,
alternatively it can call replace_wait_box(), to replace the text of the
dialog without pushing the currently-displayed text on the stack.
- Parameters
-
format | the reason why the input file is bad |
If you just want to display an error message and let IDA continue, do NOT use this function! Use warning() or info() instead.
- Parameters
-
format | printf() style message string. It may have some prefixes, see 'Format of dialog box' for details. |
Display a dialog box and wait for the user to input an segment name (ui_ask_seg).
Display a dialog box and wait for the user to input an identifier.
Display a dialog box and get choice from "Yes", "No", "Cancel".
Display a dialog box and wait for the user to input an number (ui_ask_long).
This function allows to enter segment register names, segment base paragraphs, segment names to denote a segment.
- Parameters
-
sel | in/out parameter. contains selector of the segment |
format | printf() style format string with the question |
- Return values
-
0 | if the user pressed Esc.
|
1 | ok, the user entered an segment name |
The number is represented in C-style. This function allows to enter any IDC expression and properly calculates it.
- Parameters
-
value | in/out parameter. contains pointer to the number |
format | printf() style format string with the question |
- Return values
-
0 | if the user pressed Esc.
|
1 | ok, the user entered a valid number. |
- Parameters
-
deflt | default choice: one of Button IDs |
format | The question in printf() style format |
- Returns
- the selected button (one of Button IDs). Esc key returns #ASKBTN_CANCEL.
If the user enters a non-valid identifier, this function displays a warning and allows the user to correct it. CPU register names are usually forbidden.
- Parameters
-
str | qstring to fill. Can contain the default value. Cannot be nullptr. |
format | printf() style format string with the question |
- Returns
- false if the user cancelled the dialog, otherwise returns true.
If the user enters a non-valid identifier, this function displays a warning and allows the user to correct it. CPU register names are permitted.
- Parameters
-
str | qstring to fill. Can contain the default value. Cannot be nullptr. |
format | printf() style format string with the question |
- Returns
- false if the user cancelled the dialog, otherwise returns true.