or even better, if possible publish the patching procedure so i can try to patch executable for CEC PC-488 card?
You have seen this post ? :
https://www.eevblog.com/forum/testgear/automating-tektronix-field-adjustment-software-for-tds-oscilloscopes/msg1388658/#msg1388658Granted the details are bit vague if you're not used to reversing software. You need to
- find the docs for your ISA card and find the addresses of the control registers. See the table in the post I linked above
- is your address map more similar to a PC2 or PC2A ? i.e. a xxx8, xxx9, xxxA sequence vs 02xx,04xx,06xx ? pick one. I used PC2A; PC2 will require slightly different modifications
- Optional, if yours is going to be based on the PC2A : near file offset 0x6dcd1, modify two occurences of "PC2A" to an arbitrary string that you will use in the config file. I used just "AT".
Remember, you can't change the length of the .exe file, and string needs to be 0-terminated.
- tweak the code near file offset 0x346D1 . Any hex editor will do but it helps to look at disassembly to validate. See screenshot below; patched version is on the right.
Maybe this decompiled code will help understand what happens there :
iVar6 = strcmp_0d84(..., "PC2A");
if (iVar6 == 0) {
/* PC2A addresses */
p_bigstruct = (big_struct *)(iVar3 * 2);
iVar6 = p_bigstruct->GPIB_DIPswitch << 0x0d;
p_bigstruct->gpib_CDOR = iVar6 + 0x2e1;
p_bigstruct->gpib_IMR1 = iVar6 + 0x6e1;
p_bigstruct->gpib_IMR2 = iVar6 + 0xae1;
p_bigstruct->gpib_SPMR = iVar6 + 0xee1;
p_bigstruct->gpib_ADMR = iVar6 + 0x12e1;
p_bigstruct->gpib_AUXMR = iVar6 + 0x16e1;
p_bigstruct->gpib_ADR = iVar6 + 0x1ae1;
iVar6 = iVar6 + 0x1ee1;
}
else {
/* PC2 addresses */
tmp2 = (big_struct *)(iVar3 * 2);
uVar5 = *(undefined2 *)0x2e78;
tmp2->gpib_CDOR = tmp2->GPIB_DIPswitch << 3;
tmp2->gpib_IMR1 = *(int *)(iVar3 * 2 + 0x4a) + 1;
tmp2->gpib_IMR2 = *(int *)(iVar3 * 2 + 0x4a) + 2;
tmp2->gpib_SPMR = *(int *)(iVar3 * 2 + 0x4a) + 3;
tmp2->gpib_ADMR = *(int *)(iVar3 * 2 + 0x4a) + 4;
tmp2->gpib_AUXMR = *(int *)(iVar3 * 2 + 0x4a) + 5;
tmp2->gpib_ADR = *(int *)(iVar3 * 2 + 0x4a) + 6;
iVar6 = *(int *)(iVar3 * 2 + 0x4a) + 7;
}
}
[EDIT - typo in addresses]