3

Using C#, I have driver = new ChromeDriver();

It gives:

System.ComponentModel.Win32Exception: The specified executable is not a valid application for this OS platform.

It worked before I changed something. This answer specifies that to improve undetectability of Selenium, you have to run a certain PERL script. I ran it like so:

perl -pi -e 's/cdc_/dog_/g' C:\Users\user\source\repos\SleeveAce\packages\Selenium.WebDriver.ChromeDriver.91.0.4472.10100\driver\win32\chromedriver.exe

What do I do now? Before, the C# app was working perfectly, now it has that error. When I open the .exe as a notepad++ and search for cdc_, I find multiple instances, so I suppose the script is not working? I might be wrong though if the script was not supposed to do that.

EDIT: I have just tried changing all the cdc_ values in a hex editor as well with dog_. They were modified successfully. However, the error is still there.

EDIT2: Solved! See comments for explanation.

Additional info

  • Using Perl 5 v32
  • After running the script, nothing was shown (no errors too!)
Eric
  • 329
  • 2
  • 20
  • what is version of chrome and chrome driver are you using. – Sonali Das Jun 26 '21 at 22:08
  • ```Selenium WebDriver 3.141.0```, ```Chrome WebDriver 91.0.4472.10100``` – Eric Jun 26 '21 at 22:11
  • Google Chrome Version 91.0.4472.114 (Official Build) (64-bit) – Eric Jun 26 '21 at 22:11
  • 3
    Ok, I reinstalled Chrome WebDriver, did NOT run the Perl script, instead ran hex editor and everything works now. Devs, don't make the same mistake as me of running that script; I have no idea what's wrong with it and have no time to check, but it didn't work. Find+Replace in Hex Editor instead! – Eric Jun 26 '21 at 22:17
  • If this is a Windows build of Perl, the command will turn 0A into 0D 0A, breaking the binary. Add `BEGIN { binmode STDOUT }`, and you might have to avoid `-i`. – ikegami May 20 '22 at 19:44
  • If this is a Windows build of Perl, the input and output would need to be `binmode` to prevent CRLF<->LF conversions. – ikegami May 20 '22 at 21:25

0 Answers0