Compaq AA-RH99A-TE Remote Starter User Manual


 
3.2.27 Reading Symbol Representations
The read_sym function returns a representation of the named symbol. This
function has the following format:
DataStruct read_sym(
char* name);
Argument
Input/Output
Description
name
Input Names the symbol, which is normally
a pointer to a structure or an array of
structures inside the kernel
Often you use the result returned by the read_sym function as the
input argument of the array_element, array_element_val,or
read_field_vals function.
For example:
busses = read_sym("bus_list");
3.2.28 Reading a Symbol’s Address
The read_sym_addr function reads the address of the specified symbol.
This function has the following format:
Boolean read_sym_addr(
char* name,
long* ret_val,
char** error);
Argument Input/Output Description
name
Input Names the symbol for which an address
is required
ret_val
Output Returns the address of the symbol
error
Output Returns a pointer to an error message when
the return status is FALSE
For example:
if(argc == 0) fil = read_sym("file");
if(!read_sym_val("nfile", NUMBER, &nfile, &error) ||
!read_sym_addr("vnops", &vn_addr, &error) ||
!read_sym_addr("socketops", &socket_addr, &error)){
fprintf(stderr, "Couldnt read nfile:\n");
fprintf(stderr, "%s\n", error);
quit(1);
}
3–20 Writing Extensions to the kdbx Debugger