Compaq AA-RH99A-TE Remote Starter User Manual


 
The next argument is the address of the next node in the list; for
example, the next node might be at address 0xffffffff8196d050.
3.2.16 Getting the Address of an Item in a Linked List
The list_nth_cell function returns the address of one of the items in a
linked list. This function has the following format:
Boolean list_nth_cell(
long addr,
char* type,
int n,
char* next_field,
Boolean do_check,
long* val_ret,
char** error);
Argument
Input/Output
Description
addr
Input Specifies the starting address of the linked list
type
Input Specifies the data type of the item for which
you are requesting an address
n
Input Supplies a number indicating which list
item’s address is being requested
next_field
Input Gives the name of the field that points to
the next item in the linked list
do_check
Input Determines whether kdbx checks the
arguments to ensure that correct information
is being sent (TRUE setting)
val_ret
Output Returns the address of the requested list item
error
Output Returns a pointer to an error message if
the return value is FALSE
For example:
long root_addr, addr;
if (!read_sym_val("rootfs", NUMBER, &root_addr, &error)){
.
.
.
}
if(!list_nth_cell(root_addr, "struct mount", i, "m_next", True, &addr,
&error)){
fprintf(stderr, "Couldnt get %dth element of mount table\n", i);
fprintf(stderr, "%s\n", error);
quit(1);
}
Writing Extensions to the kdbx Debugger 3–13