+void change_properties(unsigned char *fw, int len, struct propaction *paction)
+{
+ int i;
+ struct propaction *cpaction;
+
+ for (i = 0; i < (len-100 /* XXX */); i++) {
+ cpaction = paction;
+ while (cpaction != NULL) {
+ if (FINDSTR(fw + i, cpaction->property)) {
+ break;
+ }
+ cpaction = cpaction->next;
+ }
+ if (cpaction != NULL) {
+ struct properties *prop;
+ unsigned char *pos = fw + i;
+
+ prop = (struct properties*)(pos + strlen((char*)pos) + 1);
+
+ if (prop->magic != 0x83011111) {
+ continue;
+ }
+
+ if (cpaction->action & (PROP_ACTION_TRUE|PROP_ACTION_FALSE)) {
+ if (prop->type1 == 0x01 && prop->type2 == 0x01) {
+ if (cpaction->action & PROP_ACTION_TRUE) {
+ if (*prop->val == 0x00) {
+ *prop->val = 0x01;
+ cpaction->status |= PROP_STATUS_SUCCESS;
+ } else {
+ cpaction->status |= PROP_STATUS_SAMEVAL;
+ }
+ } else {
+ if (*prop->val == 0x01) {
+ *prop->val = 0x00;
+ cpaction->status |= PROP_STATUS_SUCCESS;
+ } else {
+ cpaction->status |= PROP_STATUS_SAMEVAL;
+ }
+ }
+ } else {
+ cpaction->status = PROP_STATUS_WRONGTYPE;
+ }
+ }
+ if (cpaction->action & PROP_ACTION_RW) {
+ if (prop->right_rw == 0x00 && prop->rw_mask == 0x00) {
+ prop->right_rw = 0x01;
+ prop->rw_mask = 0x02;
+ cpaction->status |= PROP_STATUS_SUCCESS;
+ } else {
+ cpaction->status |= PROP_STATUS_WRONGRIGHTS;
+ }
+ }
+ if (cpaction->action & PROP_ACTION_RO) {
+ if (prop->right_rw == 0x01 && prop->rw_mask == 0x02) {
+ prop->right_rw = 0x00;
+ prop->rw_mask = 0x00;
+ cpaction->status |= PROP_STATUS_SUCCESS;
+ } else {
+ cpaction->status |= PROP_STATUS_WRONGRIGHTS;
+ }
+ }
+ }
+ }
+}
+
+void print_boarddescription(unsigned char *bd)
+{
+ int j;
+
+ for (j = 0; j < 32; j++) {
+ printf("%02x ", *(bd+j));
+ }
+ printf("\n");
+
+ /* com/agilent/rmc/amr/AmrMaster.class
+ * com/agilent/rmc/mgui/RmcPanel.class
+ * com/agilent/rmc/mgui/panels/AvrManualConfig.class
+ * com/agilent/rmc/mgui/panels/CardConf.jad
+ * com/agilent/rmc/mgui/panels/PowerMgmtConf.jad
+ * com/agilent/rmc/mgui/panels/RemoteDiskConf.jad
+ */
+ printf("\tserial1Present\t\t: %s\n", ((bd[20] & 2) ? "TRUE" : "FALSE"));
+ printf("\ticmbPresent\t\t: %s\n", ((bd[20] & 4) ? "TRUE" : "FALSE"));
+ printf("\tlanPresent\t\t: %s\n", ((bd[20] & 8) ? "TRUE" : "FALSE"));
+ printf("\tserial2Present\t\t: %s\n", ((bd[20] & 0x10) ? "TRUE" : "FALSE"));
+ printf("\tserial3Present\t\t: %s\n", ((bd[20] & 0x20) ? "TRUE" : "FALSE"));
+ printf("\tusbPresent\t\t: %s\n", ((bd[20] & 0x40) ? "TRUE" : "FALSE"));
+ printf("\tpciPresent\t\t: %s\n", ((bd[21] & 3) ? "TRUE" : "FALSE"));
+ printf("\tlpcPresent\t\t: %s\n", ((bd[21] & 4) ? "TRUE" : "FALSE"));
+ printf("\tvgaPresent\t\t: %s\n", ((bd[21] & 8) ? "TRUE" : "FALSE"));
+ printf("\tbatteryPresent\t\t: %s\n", ((bd[21] & 0x10) ? "TRUE" : "FALSE"));
+ printf("\tacdcPresent\t\t: %s\n", ((bd[21] & 0x20) ? "TRUE" : "FALSE"));
+ printf("\tstandbyPresent\t\t: %s\n", ((bd[21] & 0x40) ? "TRUE" : "FALSE"));
+ printf("\thasPowerConnectors\t: %s\n", ((bd[21] & 0x70) ? "TRUE" : "FALSE"));
+ printf("\tdviPresent\t\t: %s\n", ((bd[21] & 0x80) ? "TRUE" : "FALSE"));
+ printf("\tpowerSwitchATX\t\t: %s\n", ((bd[22] & 1) ? "TRUE" : "FALSE"));
+ printf("\tpowerSwitchRelay\t: %s\n", ((bd[22] & 2) ? "TRUE" : "FALSE"));
+ /* 22 & 4 */
+ printf("\tps2aPresent\t\t: %s\n", ((bd[25]) ? "TRUE" : "FALSE"));
+}
+