static BOOL net_io_id_info2(char *desc, NET_ID_INFO_2 *id, prs_struct *ps, int depth) { if (id == NULL) return False; prs_debug(ps, depth, desc, "net_io_id_info2"); depth++; if(!prs_align(ps)) return False; if(!prs_uint32("ptr_id_info2", ps, depth, &id->ptr_id_info2)) return False; if (id->ptr_id_info2 != 0) { if(!smb_io_unihdr("unihdr", &id->hdr_domain_name, ps, depth)) return False; if(!prs_uint32("param_ctrl", ps, depth, &id->param_ctrl)) return False; if(!smb_io_logon_id("", &id->logon_id, ps, depth)) return False; if(!smb_io_unihdr("unihdr", &id->hdr_user_name, ps, depth)) return False; if(!smb_io_unihdr("unihdr", &id->hdr_wksta_name, ps, depth)) return False; if(!prs_uint8s (False, "lm_chal", ps, depth, id->lm_chal, 8)) /* lm 8 byte challenge */ return False; if(!smb_io_strhdr("hdr_nt_chal_resp", &id->hdr_nt_chal_resp, ps, depth)) return False; if(!smb_io_strhdr("hdr_lm_chal_resp", &id->hdr_lm_chal_resp, ps, depth)) return False; if(!smb_io_unistr2("uni_domain_name", &id->uni_domain_name, id->hdr_domain_name.buffer, ps, depth)) return False; if(!smb_io_unistr2("uni_user_name ", &id->uni_user_name, id->hdr_user_name.buffer, ps, depth)) return False; if(!smb_io_unistr2("uni_wksta_name ", &id->uni_wksta_name, id->hdr_wksta_name.buffer, ps, depth)) return False; if(!smb_io_string2("nt_chal_resp", &id->nt_chal_resp, id->hdr_nt_chal_resp.buffer, ps, depth)) return False; if(!smb_io_string2("lm_chal_resp", &id->lm_chal_resp, id->hdr_lm_chal_resp.buffer, ps, depth)) return False; } return True; }
static BOOL net_io_id_info1(char *desc, NET_ID_INFO_1 *id, prs_struct *ps, int depth) { if (id == NULL) return False; prs_debug(ps, depth, desc, "net_io_id_info1"); depth++; if(!prs_align(ps)) return False; if(!prs_uint32("ptr_id_info1", ps, depth, &id->ptr_id_info1)) return False; if (id->ptr_id_info1 != 0) { if(!smb_io_unihdr("unihdr", &id->hdr_domain_name, ps, depth)) return False; if(!prs_uint32("param_ctrl", ps, depth, &id->param_ctrl)) return False; if(!smb_io_logon_id("", &id->logon_id, ps, depth)) return False; if(!smb_io_unihdr("unihdr", &id->hdr_user_name, ps, depth)) return False; if(!smb_io_unihdr("unihdr", &id->hdr_wksta_name, ps, depth)) return False; if(!smb_io_owf_info("", &id->lm_owf, ps, depth)) return False; if(!smb_io_owf_info("", &id->nt_owf, ps, depth)) return False; if(!smb_io_unistr2("unistr2", &id->uni_domain_name, id->hdr_domain_name.buffer, ps, depth)) return False; if(!smb_io_unistr2("unistr2", &id->uni_user_name, id->hdr_user_name.buffer, ps, depth)) return False; if(!smb_io_unistr2("unistr2", &id->uni_wksta_name, id->hdr_wksta_name.buffer, ps, depth)) return False; } return True; }
/******************************************************************* reads or writes a structure. ********************************************************************/ char* samr_io_r_unknown_24(BOOL io, SAMR_R_UNKNOWN_24 *r_u, char *q, char *base, int align, int depth) { if (r_u == NULL) return NULL; DEBUG(5,("%s%04x samr_io_r_unknown_24\n", tab_depth(depth), PTR_DIFF(q, base))); depth++; q = align_offset(q, base, align); DBG_RW_IVAL("ptr ", depth, base, io, q, r_u->ptr ); q += 4; DBG_RW_SVAL("unknown_0 ", depth, base, io, q, r_u->unknown_0 ); q += 2; DBG_RW_SVAL("unknown_1 ", depth, base, io, q, r_u->unknown_1 ); q += 2; DBG_RW_PCVAL(False, "padding_0 ", depth, base, io, q, r_u->padding_0 , sizeof(r_u->padding_0)); q += sizeof(r_u->padding_0); q = smb_io_time(io, &(r_u->expiry), q, base, align, depth); DBG_RW_PCVAL(False, "padding_1 ", depth, base, io, q, r_u->padding_1 , sizeof(r_u->padding_1)); q += sizeof(r_u->padding_1); q = smb_io_unihdr (io, &(r_u->hdr_mach_acct), q, base, align, depth); DBG_RW_IVAL("padding_2 ", depth, base, io, q, r_u->padding_2 ); q += 4; DBG_RW_IVAL("ptr_1 ", depth, base, io, q, r_u->ptr_1 ); q += 4; DBG_RW_PCVAL(False, "padding_3 ", depth, base, io, q, r_u->padding_3 , sizeof(r_u->padding_3)); q += sizeof(r_u->padding_3); DBG_RW_IVAL("padding_4 ", depth, base, io, q, r_u->padding_4 ); q += 4; DBG_RW_IVAL("ptr_2 ", depth, base, io, q, r_u->ptr_2 ); q += 4; DBG_RW_IVAL("padding_5 ", depth, base, io, q, r_u->padding_5 ); q += 4; DBG_RW_IVAL("ptr_3 ", depth, base, io, q, r_u->ptr_3 ); q += 4; DBG_RW_PCVAL(False, "padding_6 ", depth, base, io, q, r_u->padding_6 , sizeof(r_u->padding_6)); q += sizeof(r_u->padding_6); DBG_RW_IVAL("unknown_id_0", depth, base, io, q, r_u->unknown_id_0); q += 4; DBG_RW_SVAL("unknown_2 ", depth, base, io, q, r_u->unknown_2 ); q += 2; DBG_RW_IVAL("unknown_3 ", depth, base, io, q, r_u->unknown_3 ); q += 4; DBG_RW_SVAL("unknown_4 ", depth, base, io, q, r_u->unknown_4 ); q += 2; DBG_RW_SVAL("unknown_5 ", depth, base, io, q, r_u->unknown_5 ); q += 2; DBG_RW_PCVAL(False, "padding_7 ", depth, base, io, q, r_u->padding_7 , sizeof(r_u->padding_7)); q += sizeof(r_u->padding_7); DBG_RW_IVAL("padding_8 ", depth, base, io, q, r_u->padding_8 ); q += 4; q = smb_io_unistr2(io, &(r_u->uni_mach_acct), q, base, align, depth); q = align_offset(q, base, align); DBG_RW_PCVAL(False, "padding_9 ", depth, base, io, q, r_u->padding_9 , sizeof(r_u->padding_9)); q += sizeof(r_u->padding_9); DBG_RW_IVAL("status", depth, base, io, q, r_u->status); q += 4; return q; }
/******************************************************************* reads or writes a structure. ********************************************************************/ char* samr_io_q_unknown_32(BOOL io, SAMR_Q_UNKNOWN_32 *q_u, char *q, char *base, int align, int depth) { if (q_u == NULL) return NULL; DEBUG(5,("%s%04x samr_io_q_unknown_32\n", tab_depth(depth), PTR_DIFF(q, base))); depth++; q = align_offset(q, base, align); q = smb_io_pol_hnd(io, &(q_u->pol), q, base, align, depth); q = align_offset(q, base, align); q = smb_io_unihdr (io, &(q_u->hdr_mach_acct), q, base, align, depth); q = smb_io_unistr2(io, &(q_u->uni_mach_acct), q, base, align, depth); q = align_offset(q, base, align); DBG_RW_IVAL("unknown_0", depth, base, io, q, q_u->unknown_0); q += 4; DBG_RW_SVAL("unknown_1", depth, base, io, q, q_u->unknown_1); q += 2; DBG_RW_SVAL("unknown_2", depth, base, io, q, q_u->unknown_2); q += 2; return q; }
/******************************************************************* reads or writes a structure. ********************************************************************/ char* samr_io_q_lookup_rids(BOOL io, SAMR_Q_LOOKUP_RIDS *q_u, char *q, char *base, int align, int depth) { if (q_u == NULL) return NULL; DEBUG(5,("%s%04x samr_io_q_lookup_rids\n", tab_depth(depth), PTR_DIFF(q, base))); depth++; q = align_offset(q, base, align); q = smb_io_pol_hnd(io, &(q_u->pol), q, base, align, depth); q = align_offset(q, base, align); DBG_RW_IVAL("num_rids1", depth, base, io, q, q_u->num_rids1); q += 4; DBG_RW_IVAL("rid ", depth, base, io, q, q_u->rid ); q += 4; DBG_RW_IVAL("ptr ", depth, base, io, q, q_u->ptr ); q += 4; DBG_RW_IVAL("num_rids2", depth, base, io, q, q_u->num_rids2); q += 4; q = smb_io_unihdr (io, &(q_u->hdr_mach_acct), q, base, align, depth); q = smb_io_unistr2(io, &(q_u->uni_mach_acct), q, base, align, depth); q = align_offset(q, base, align); return q; }
static BOOL net_io_user_info3(char *desc, NET_USER_INFO_3 *usr, prs_struct *ps, int depth) { int i; if (usr == NULL) return False; prs_debug(ps, depth, desc, "lsa_io_lsa_user_info"); depth++; if(!prs_align(ps)) return False; if(!prs_uint32("ptr_user_info ", ps, depth, &usr->ptr_user_info)) return False; if (usr->ptr_user_info == 0) return True; if(!smb_io_time("time", &usr->logon_time, ps, depth)) /* logon time */ return False; if(!smb_io_time("time", &usr->logoff_time, ps, depth)) /* logoff time */ return False; if(!smb_io_time("time", &usr->kickoff_time, ps, depth)) /* kickoff time */ return False; if(!smb_io_time("time", &usr->pass_last_set_time, ps, depth)) /* password last set time */ return False; if(!smb_io_time("time", &usr->pass_can_change_time , ps, depth)) /* password can change time */ return False; if(!smb_io_time("time", &usr->pass_must_change_time, ps, depth)) /* password must change time */ return False; if(!smb_io_unihdr("unihdr", &usr->hdr_user_name, ps, depth)) /* username unicode string header */ return False; if(!smb_io_unihdr("unihdr", &usr->hdr_full_name, ps, depth)) /* user's full name unicode string header */ return False; if(!smb_io_unihdr("unihdr", &usr->hdr_logon_script, ps, depth)) /* logon script unicode string header */ return False; if(!smb_io_unihdr("unihdr", &usr->hdr_profile_path, ps, depth)) /* profile path unicode string header */ return False; if(!smb_io_unihdr("unihdr", &usr->hdr_home_dir, ps, depth)) /* home directory unicode string header */ return False; if(!smb_io_unihdr("unihdr", &usr->hdr_dir_drive, ps, depth)) /* home directory drive unicode string header */ return False; if(!prs_uint16("logon_count ", ps, depth, &usr->logon_count)) /* logon count */ return False; if(!prs_uint16("bad_pw_count ", ps, depth, &usr->bad_pw_count)) /* bad password count */ return False; if(!prs_uint32("user_id ", ps, depth, &usr->user_id)) /* User ID */ return False; if(!prs_uint32("group_id ", ps, depth, &usr->group_id)) /* Group ID */ return False; if(!prs_uint32("num_groups ", ps, depth, &usr->num_groups)) /* num groups */ return False; if(!prs_uint32("buffer_groups ", ps, depth, &usr->buffer_groups)) /* undocumented buffer pointer to groups. */ return False; if(!prs_uint32("user_flgs ", ps, depth, &usr->user_flgs)) /* user flags */ return False; if(!prs_uint8s(False, "user_sess_key", ps, depth, usr->user_sess_key, 16)) /* unused user session key */ return False; if(!smb_io_unihdr("unihdr", &usr->hdr_logon_srv, ps, depth)) /* logon server unicode string header */ return False; if(!smb_io_unihdr("unihdr", &usr->hdr_logon_dom, ps, depth)) /* logon domain unicode string header */ return False; if(!prs_uint32("buffer_dom_id ", ps, depth, &usr->buffer_dom_id)) /* undocumented logon domain id pointer */ return False; if(!prs_uint8s (False, "padding ", ps, depth, usr->padding, 40)) /* unused padding bytes? */ return False; if(!prs_uint32("num_other_sids", ps, depth, &usr->num_other_sids)) /* 0 - num_sids */ return False; if(!prs_uint32("buffer_other_sids", ps, depth, &usr->buffer_other_sids)) /* NULL - undocumented pointer to SIDs. */ return False; if(!smb_io_unistr2("unistr2", &usr->uni_user_name, usr->hdr_user_name.buffer, ps, depth)) /* username unicode string */ return False; if(!smb_io_unistr2("unistr2", &usr->uni_full_name, usr->hdr_full_name.buffer, ps, depth)) /* user's full name unicode string */ return False; if(!smb_io_unistr2("unistr2", &usr->uni_logon_script, usr->hdr_logon_script.buffer, ps, depth)) /* logon script unicode string */ return False; if(!smb_io_unistr2("unistr2", &usr->uni_profile_path, usr->hdr_profile_path.buffer, ps, depth)) /* profile path unicode string */ return False; if(!smb_io_unistr2("unistr2", &usr->uni_home_dir, usr->hdr_home_dir.buffer, ps, depth)) /* home directory unicode string */ return False; if(!smb_io_unistr2("unistr2", &usr->uni_dir_drive, usr->hdr_dir_drive.buffer, ps, depth)) /* home directory drive unicode string */ return False; if(!prs_align(ps)) return False; if(!prs_uint32("num_groups2 ", ps, depth, &usr->num_groups2)) /* num groups */ return False; SMB_ASSERT_ARRAY(usr->gids, usr->num_groups2); for (i = 0; i < usr->num_groups2; i++) { if(!smb_io_gid("", &usr->gids[i], ps, depth)) /* group info */ return False; } if(!smb_io_unistr2("unistr2", &usr->uni_logon_srv, usr->hdr_logon_srv.buffer, ps, depth)) /* logon server unicode string */ return False; if(!smb_io_unistr2("unistr2", &usr->uni_logon_dom, usr->hdr_logon_srv.buffer, ps, depth)) /* logon domain unicode string */ return False; if(!smb_io_dom_sid2("", &usr->dom_sid, ps, depth)) /* domain SID */ return False; SMB_ASSERT_ARRAY(usr->other_sids, usr->num_other_sids); for (i = 0; i < usr->num_other_sids; i++) { if(!smb_io_dom_sid2("", &usr->other_sids[i], ps, depth)) /* other domain SIDs */ return False; } return True; }