I'm reversing a binary and I found this strange keyword I haven't seen before called 'code'. I looked up the C++ keywords and there doesn't seem to be one. Could anyone provide me with more information about this keyword?
if (*(int *)(param_1 + 4) != 0) {
(*(code *)(&PTR_thunk_FUN_005a7840_008dd8b8)[(int)param_2[4]])(*(int *)(param_1 + 4));
}
In Assembly.
00491b95 85 c0 TEST EAX ,EAX
00491b97 74 10 JZ LAB_00491ba9
00491b99 8b 4e 10 MOV ECX ,dword ptr [ESI + 0x10 ]
00491b9c 8b 14 8d MOV EDX ,dword ptr [ECX *0x4 + -> thunk_FUN_005a7840 ] = 00401c30
b8 d8 8d
00
00491ba3 50 PUSH EAX
00491ba4 ff d2 CALL EDX
CALLto the address pointed to by your code. It doesn't know its prototype but it does know that this is called as a function. You can't normallyCALLavoid *, socode *is the way to show it. Consider it a cast to unknown-prototyped function. – Yotamz Jun 15 '20 at 21:00