PutInNdFilter based get_nd_value detection (using a custom routine) plus GetUsableAvRange detection for newer DryOS cams (result untested).
Index: tools/finsig_dryos.c
===================================================================
--- tools/finsig_dryos.c (revision 5084)
+++ tools/finsig_dryos.c (working copy)
@@ -335,6 +335,8 @@
{ "exmem_alloc" },
{ "exmem_free", OPTIONAL|LIST_ALWAYS },
{ "free" },
+ { "get_nd_value", OPTIONAL },
+ { "GetUsableAvRange", OPTIONAL|UNUSED },
{ "kbd_p1_f" },
{ "kbd_p1_f_cont" },
@@ -1542,6 +1544,49 @@
return 0;
}
+int find_get_nd_value(firmware *fw)
+{
+
+ int f1 = get_saved_sig(fw,"PutInNdFilter_FW");
+ int f2 = get_saved_sig(fw,"ClearEventFlag");
+ int f3 = find_saved_sig("get_nd_value");
+ if ((f3 >= 0) && (func_names[f3].val != 0)) // return if func already found
+ return 0;
+ if ((f1 < 0) || (f2 < 0))
+ return 0;
+ f1 = adr2idx(fw, func_names[f1].val);
+ f2 = adr2idx(fw, func_names[f2].val);
+ int k1 = find_Nth_inst(fw,isBL,f1,10,2);
+ int k2 = find_inst(fw,isBL,f1,6);
+ if ((k1 == -1) || (k2 == -1))
+ return 0;
+ // note for the following line: same address can have different index on cams with multiple fw regions
+ // followBranch2 is for veneer support (s110)
+ if ( followBranch2(fw,idx2adr(fw,k2),0x01000001) != idx2adr(fw,f2) ) // ClearEventFlag?
+ return 0;
+ k1 = idxFollowBranch(fw,k1,0x01000001); // PutInNdFilter_low
+ k2 = find_inst(fw,isBL,k1,6);
+ if (k2 == -1)
+ return 0;
+ // check for signs of other functions (GetUsableAvRange, etc)
+ int k3;
+ int k4 = 0;
+ for (k3=k2-1;k3>k2-3;k3--)
+ {
+ uint32_t v1 = fwval(fw, k3);
+ k4 += (v1 == 0xe28d0004)?1:(v1 == 0xe1a0100d)?4: // add r0,sp,#4 ; mov r1,sp - GetUsableAvRange
+ ((v1 & 0xffffff00) == 0xe3a00000)?0x10:0; // mov r0, #small_imm - sx400
+ }
+ if (k4 == 0) // probably get_nd_value
+ {
+ k2 = idxFollowBranch(fw,k2,0x01000001);
+ fwAddMatch(fw,idx2adr(fw,k2),32,0,122);
+ return 1;
+ }
+
+ return 0;
+}
+
int find_getcurrentmachinetime(firmware *fw)
{
int f1 = get_saved_sig(fw,"SetHPTimerAfterTimeout");
@@ -2086,6 +2131,7 @@
{ 22, "SetHPTimerAfterTimeout", (char*)find_sethptimeraftertimeout, 0},
{ 22, "GetCurrentMachineTime", (char*)find_getcurrentmachinetime, 0},
{ 22, "get_self_task_errno_pointer", (char*)find_get_self_task_errno_pointer, 0},
+ { 22, "get_nd_value", (char*)find_get_nd_value, 0},
// R20 R23 R31 R39 R43 R45 R47 R49 R50 R51 R52 R54 R55 R57 R58 R59
{ 23, "UnregisterInterruptHandler", "HeadInterrupt1", 76, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 },
@@ -2092,6 +2138,8 @@
{ 23, "get_string_by_id", "NoError", 16, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, -2 },
{ 23, "EnableHDMIPower", "HDMIConnectCnt", 9, 99, 99, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,},
{ 23, "DisableHDMIPower", "HDMIConnectCnt", 9, 99, 99, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,},
+ { 23, "get_nd_value", "IrisSpecification.c", 25, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,},
+ { 23, "GetUsableAvRange", "[AE]Prog Line Error!\n", 20, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,},
// R20 R23 R31 R39 R43 R45 R47 R49 R50 R51 R52 R54 R55 R57 R58 R59
{ 24, "get_string_by_id", "StringID[%d] is not installed!!\n", 64, 0xf000, 0xf000, 0xf000, 0xf000, 0xf000, 0xf000, 0xf000, 0xf000, 0xf000, 0xf000, 0xf000, 0xf000, 0x0000, 0x0000, 0x0000, 0xf000 },
Index: tools/finsig_vxworks.c
===================================================================
--- tools/finsig_vxworks.c (revision 5084)
+++ tools/finsig_vxworks.c (working copy)
@@ -338,6 +338,8 @@
{ "exmem_alloc" },
{ "exmem_free", OPTIONAL },
{ "free" },
+ { "get_nd_value", OPTIONAL },
+ { "get_current_nd_value", OPTIONAL },
{ "kbd_p1_f" },
{ "kbd_p1_f_cont" },
@@ -1066,6 +1068,8 @@
{20, "MFOff", "MFOff_FW", 1 },
{20, "GetAdChValue", "GetAdChValue_FW", 0 },
{20, "HwOcReadICAPCounter", "GetCurrentMachineTime", 3 },
+ {20, "get_nd_value", "NdActuator.GetNdFilterDeltaEvAdjustValue_FW", 0 }, // old vx
+ {20, "get_current_nd_value", "NdActuator.GetNdFilterDeltaEv_FW", 0 }, // old vx
{ 1, "ExportToEventProcedure_FW", "ExportToEventProcedure", 1 },
{ 1, "AllocateMemory", "AllocateMemory", 1 },
@@ -1312,6 +1316,7 @@
{ 15, "wrapped_malloc", "\n malloc error \n", 0x01000001, 0x0010 },
{ 15, "IsStrobeChargeCompleted", "\r\nCaptSeq::ChargeNotCompleted!!", 0x01000001 }, // ixus30, 40
{ 15, "get_resource_pointer", "Not found icon resource.\r\n", 0x01000001, 0x0008 },
+ { 15, "get_nd_value", "IrisSpecification.c", 0x01000001, 0x0014 },
{ 16, "DeleteDirectory_Fut", (char*)DeleteDirectory_Fut_test, 0x01000001 },
{ 16, "MakeDirectory_Fut", (char*)MakeDirectory_Fut_test, 0x01000001 },
edit:
false positive on sx400 removed