U need to below two functions
A : l_pubkey_verify
B : scl_lc_checkout
You need to fetch functions A and B.
Since 32-bit binaries have too many inconsistencies, only 64-bit binaries should be considered for this process. Before using the tools, set the user shell environment variable VCS_TARGET_ARCH to linux64. Within the VCS installation directory, generate a list of ELF 64-bit binaries.
For each binary in the list, use dasm to generate assembly code.
From the generated ***/XX/VVV/AAA.dasm files, locate functions A and B and extract about 100 bytes (approximately 15 lines) starting from the function entry point.
Save this extracted assembly to a file. From the extracted dasm code, generate a single-line string that contains only the binary instruction codes.
Even if you extract the same number of lines (e.g., 15 lines), the length of the binary string may vary depending on the actual instructions, since the instruction lengths are different.
Adjust the extraction to get approximately 100 bytes of binary code to make their lengths reasonably consistent. Sort the resulting binary strings. You will typically find about three unique patterns among them. For example, suppose you extract a pattern like this: 41574989cf41564589c6415541544189d455534889fb4881ec08010000488b87980200004889742418be140000004c894c2410488b80f01c0000488ba8300600
And you want to replace it with:
31c0c389cf41564589c6415541544189d455534889fb4881ec08010000488b87980200004889742418be140000004c894c2410488b80f01c0000488ba8300600
Create a replacement pattern file using the syntax for the sfk tool. You can find the exact syntax by searching for how to use sfk replace -bylist. Assuming your replacement pattern file is named replace.pat, use the following command to apply the patch: sfk replace -bylist replace.pat -nowarn -yes -dir install_directory
There are four unique patterns for each of function A and B.
So, prepare replace_A.pat and replace_B.pat files respectively, and run:
sfk replace -bylist replace_A.pat -nowarn -yes -dir install_directory
sfk replace -bylist replace_B.pat -nowarn -yes -dir install_directory
This is not only VCS but all other S family.
|