What can you do when you can't chmod /system/bin/chmod? I have changed the permissions of the file \system\bin\chmod from 777(-rwxrwxrwx) to 644 (-rw-r--r--), how can I turn back to 777?

I don't know is this may be relevant, but I'm using a samsung J5 running android 9.

Thank you in advance.
I wonder how you can change /system without read-write access. Usually a reboot will restore permissions, but you can also change it on-the-fly  

chmod is most likely a symlink to toybox and you have changed permissions of toybox instead. this will affect most (if not all) of the commands. you can maybe fix this with busybox  

external MicroSD Card permissions are -rwxrwx--x per default, so maybe this trick works (untested). copy binary to external MicroSD Card first, then move the file into /data/local/tmp (moving a file does keep permissions)  

adb push busybox-armv7l /sdcard/busybox
adb shell
su
ls -1 /storage
cp /sdcard/busybox /storage/????-????
cd /data/local/tmp
mv /storage/????-????/busybox .
./busybox mount -o remount,rw /
./busybox chmod a+x /system/bin/toybox


if you really just changed permissions of chmod (which must a binary in this case) you can just use toybox applets with prefix toybox chmod  



in case ls mount cp and mv not working, run the following commands in termux (thx @ Irfan Latif)  

pkg install busybox
su
export PATH=/data/data/com.termux/files/usr/bin:$PATH
busybox mount -o remount,rw /
busybox chmod a+x /system/bin/toybox