proxychains-ng
proxychains-ng copied to clipboard
Cannot run on Mac M1: incompatible cpu-subtype
Hello, my system config is Apple Macbook Pro with M1 chip (which uses ARM), and the OS version is macOS BigSur (11.1). I install proxychains from source, by using
./configure --prefix=/usr/local --bindir=/usr/local/bin --libdir=/usr/local/lib --fat-binary
make
sudo make install
and everything looks fine at this moment. However, even if I disable SIP, it still raises
$ proxychains4 curl cip.cc
[proxychains] config file found: /usr/local/etc/proxychains.conf
[proxychains] preloading /usr/local/lib/libproxychains4.dylib
dyld: could not load inserted library '/usr/local/lib/libproxychains4.dylib' because no suitable image found. Did find:
/usr/local/lib/libproxychains4.dylib: incompatible cpu-subtype: 0x00000000 in /usr/local/lib/libproxychains4.dylib
/usr/local/lib/libproxychains4.dylib: stat() failed with errno=1
[1] 18021 abort proxychains4 curl cip.cc
I also tried the version at homebrew, it raises the same thing:
$ ./proxychains4 curl cip.cc
[proxychains] config file found: /opt/homebrew/etc/proxychains.conf
[proxychains] preloading /opt/homebrew/Cellar/proxychains-ng/4.14/lib/libproxychains4.dylib
dyld: could not load inserted library '/opt/homebrew/Cellar/proxychains-ng/4.14/lib/libproxychains4.dylib' because no suitable image found. Did find:
/opt/homebrew/Cellar/proxychains-ng/4.14/lib/libproxychains4.dylib: incompatible cpu-subtype: 0x00000000 in /opt/homebrew/Cellar/proxychains-ng/4.14/lib/libproxychains4.dylib
/opt/homebrew/Cellar/proxychains-ng/4.14/lib/libproxychains4.dylib: stat() failed with errno=1
[1] 15173 abort ./proxychains4 curl cip.cc
I also tried not add --fat-binary flag in ./configure, but it still doesn't work.
Could you please help me figure out what happened and give me some advice? Thanks in advance!
--fat-binary is definitely wrong, as you can see from the configure output "Configuring a fat binary for i386 and x86_64" - oh, actually you only get that when __x86_64__ is found in the compiler's predefined macros, so actually nothing platform-specific should leak into the build. can you paste the contents of your config.mak after you run ./configure without --fat-binary?
$ ./configure --prefix=/usr/local --bindir=/usr/local/bin --libdir=/usr/local/lib
checking whether C compiler works ... yes
checking whether we have GNU-style getservbyname_r() ... no
checking whether we have pipe2() and O_CLOEXEC ... no
checking whether we have SOCK_CLOEXEC ... no
checking whether $CC defines __APPLE__ ... yes
checking whether $CC defines __x86_64__ ... no
checking whether $CC defines __FreeBSD__ ... no
checking whether $CC defines __OpenBSD__ ... no
checking whether $CC defines __sun ... no
checking whether $CC defines __HAIKU__ ... no
checking whether we can use -Wl,--no-as-needed ... no
checking what's the option to use in linker to set library name ... -install_name
Done, now run make && make install
$ cat config.mak
CC=cc
prefix=/usr/local
exec_prefix=/usr/local
bindir=/usr/local/bin
libdir=/usr/local/lib
includedir=/usr/local/include
sysconfdir=/usr/local/etc
CPPFLAGS+= -DSUPER_SECURE
NO_AS_NEEDED=
LD_SET_SONAME = -Wl,-install_name,
LDSO_SUFFIX=dylib
MAC_CFLAGS+=-DIS_MAC=1
(still raises the same thing after make clean; make; make install)
according to https://www.tfzx.net/article/151144.html it appears that the xcode toolchain can be configured/switched for specific architectures. the solution proposed there is :
- Set Architecture to default 2) Set Valid Architectures to: armv7, armv7s and armv64 (as Apple suggests armv64 is needed to have Embedded Frameworks working).
since there's nothing arch-specific in your config, it's very likely the toolchain is misconfigured and you couldn't even run a hello-world compiled with it.
since there's nothing arch-specific in your config, it's very likely the toolchain is misconfigured and you couldn't even run a hello-world compiled with it.
How can I check this?
$ cat try.cpp
#include <cstdio>
int main() {
printf("Hello World\n");
}
$ g++ try.cpp -oa; ./a
Hello World
$ g++ -v
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 12.0.0 (clang-1200.0.32.28)
Target: arm64-apple-darwin20.2.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
$ cat try.c
#include <stdio.h>
int main() {
printf("Hello World\n");
}
$ cc try.c -o a; ./a
Hello World
#include <stdio.h> int main() { printf("Hello World\n"); }
That can also successfully run.
$ cc try.c -oa;./a
Hello World
$ cc -v
Apple clang version 12.0.0 (clang-1200.0.32.28)
Target: arm64-apple-darwin20.2.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
ok, then please show how your dylib file is compiled in proxychains build (output from make) and output of readelf -a on that dylib file
make's log
trinkle23897@JiayideMacBook-Pro ~/github/proxychains-ng
☺ ./configure --prefix=/usr/local --bindir=/usr/local/bin --libdir=/usr/local/lib master ✗
checking whether C compiler works ... yes
checking whether we have GNU-style getservbyname_r() ... no
checking whether we have pipe2() and O_CLOEXEC ... no
checking whether we have SOCK_CLOEXEC ... no
checking whether $CC defines __APPLE__ ... yes
checking whether $CC defines __x86_64__ ... no
checking whether $CC defines __FreeBSD__ ... no
checking whether $CC defines __OpenBSD__ ... no
checking whether $CC defines __sun ... no
checking whether $CC defines __HAIKU__ ... no
checking whether we can use -Wl,--no-as-needed ... no
checking what's the option to use in linker to set library name ... -install_name
Done, now run make && make install
trinkle23897@JiayideMacBook-Pro ~/github/proxychains-ng
☺ make clean; make master ✗
rm -f libproxychains4.dylib
rm -f proxychains4 proxychains4-daemon
rm -f src/common.o src/main.o src/nameinfo.o src/version.o src/core.o src/common.o src/libproxychains.o src/allocator_thread.o src/rdns.o src/hostsreader.o src/hash.o src/debug.o src/daemon/hsearch.o src/daemon/sblist.o src/daemon/sblist_delete.o src/daemon/daemon.o src/daemon/udpserver.o
rm -f src/version.h
cc -DSUPER_SECURE -Wall -O0 -g -std=c99 -D_GNU_SOURCE -pipe -DIS_MAC=1 -DLIB_DIR=\"/usr/local/lib\" -DSYSCONFDIR=\"/usr/local/etc\" -DDLL_NAME=\"libproxychains4.dylib\" -fPIC -c -o src/nameinfo.o src/nameinfo.c
printf '#define VERSION "%s"\n' "$(sh tools/version.sh)" > src/version.h
cc -DSUPER_SECURE -Wall -O0 -g -std=c99 -D_GNU_SOURCE -pipe -DIS_MAC=1 -DLIB_DIR=\"/usr/local/lib\" -DSYSCONFDIR=\"/usr/local/etc\" -DDLL_NAME=\"libproxychains4.dylib\" -fPIC -c -o src/version.o src/version.c
cc -DSUPER_SECURE -Wall -O0 -g -std=c99 -D_GNU_SOURCE -pipe -DIS_MAC=1 -DLIB_DIR=\"/usr/local/lib\" -DSYSCONFDIR=\"/usr/local/etc\" -DDLL_NAME=\"libproxychains4.dylib\" -fPIC -c -o src/core.o src/core.c
cc -DSUPER_SECURE -Wall -O0 -g -std=c99 -D_GNU_SOURCE -pipe -DIS_MAC=1 -DLIB_DIR=\"/usr/local/lib\" -DSYSCONFDIR=\"/usr/local/etc\" -DDLL_NAME=\"libproxychains4.dylib\" -fPIC -c -o src/common.o src/common.c
cc -DSUPER_SECURE -Wall -O0 -g -std=c99 -D_GNU_SOURCE -pipe -DIS_MAC=1 -DLIB_DIR=\"/usr/local/lib\" -DSYSCONFDIR=\"/usr/local/etc\" -DDLL_NAME=\"libproxychains4.dylib\" -fPIC -c -o src/libproxychains.o src/libproxychains.c
src/libproxychains.c:599:32: warning: equality comparison with extraneous parentheses [-Wparentheses-equality]
if((dnats[i].orig_dst.s_addr == p_addr_in->s_addr))
~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
src/libproxychains.c:599:32: note: remove extraneous parentheses around the comparison to silence this warning
if((dnats[i].orig_dst.s_addr == p_addr_in->s_addr))
~ ^ ~
src/libproxychains.c:599:32: note: use '=' to turn this equality comparison into an assignment
if((dnats[i].orig_dst.s_addr == p_addr_in->s_addr))
^~
=
1 warning generated.
cc -DSUPER_SECURE -Wall -O0 -g -std=c99 -D_GNU_SOURCE -pipe -DIS_MAC=1 -DLIB_DIR=\"/usr/local/lib\" -DSYSCONFDIR=\"/usr/local/etc\" -DDLL_NAME=\"libproxychains4.dylib\" -fPIC -c -o src/allocator_thread.o src/allocator_thread.c
src/allocator_thread.c:327:9: warning: 'PTHREAD_STACK_MIN' macro redefined [-Wmacro-redefined]
#define PTHREAD_STACK_MIN 64*1024
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/limits.h:115:9: note: previous definition is here
#define PTHREAD_STACK_MIN 16384
^
1 warning generated.
cc -DSUPER_SECURE -Wall -O0 -g -std=c99 -D_GNU_SOURCE -pipe -DIS_MAC=1 -DLIB_DIR=\"/usr/local/lib\" -DSYSCONFDIR=\"/usr/local/etc\" -DDLL_NAME=\"libproxychains4.dylib\" -fPIC -c -o src/rdns.o src/rdns.c
cc -DSUPER_SECURE -Wall -O0 -g -std=c99 -D_GNU_SOURCE -pipe -DIS_MAC=1 -DLIB_DIR=\"/usr/local/lib\" -DSYSCONFDIR=\"/usr/local/etc\" -DDLL_NAME=\"libproxychains4.dylib\" -fPIC -c -o src/hostsreader.o src/hostsreader.c
cc -DSUPER_SECURE -Wall -O0 -g -std=c99 -D_GNU_SOURCE -pipe -DIS_MAC=1 -DLIB_DIR=\"/usr/local/lib\" -DSYSCONFDIR=\"/usr/local/etc\" -DDLL_NAME=\"libproxychains4.dylib\" -fPIC -c -o src/hash.o src/hash.c
cc -DSUPER_SECURE -Wall -O0 -g -std=c99 -D_GNU_SOURCE -pipe -DIS_MAC=1 -DLIB_DIR=\"/usr/local/lib\" -DSYSCONFDIR=\"/usr/local/etc\" -DDLL_NAME=\"libproxychains4.dylib\" -fPIC -c -o src/debug.o src/debug.c
cc -fPIC -ldl -lpthread -Wl,-install_name,libproxychains4.dylib \
-shared -o libproxychains4.dylib src/nameinfo.o src/version.o src/core.o src/common.o src/libproxychains.o src/allocator_thread.o src/rdns.o src/hostsreader.o src/hash.o src/debug.o
cc -DSUPER_SECURE -Wall -O0 -g -std=c99 -D_GNU_SOURCE -pipe -DIS_MAC=1 -DLIB_DIR=\"/usr/local/lib\" -DSYSCONFDIR=\"/usr/local/etc\" -DDLL_NAME=\"libproxychains4.dylib\" -fPIC -c -o src/main.o src/main.c
cc src/common.o src/main.o -ldl -o proxychains4
cc -DSUPER_SECURE -Wall -O0 -g -std=c99 -D_GNU_SOURCE -pipe -DIS_MAC=1 -DLIB_DIR=\"/usr/local/lib\" -DSYSCONFDIR=\"/usr/local/etc\" -DDLL_NAME=\"libproxychains4.dylib\" -fPIC -c -o src/daemon/hsearch.o src/daemon/hsearch.c
cc -DSUPER_SECURE -Wall -O0 -g -std=c99 -D_GNU_SOURCE -pipe -DIS_MAC=1 -DLIB_DIR=\"/usr/local/lib\" -DSYSCONFDIR=\"/usr/local/etc\" -DDLL_NAME=\"libproxychains4.dylib\" -fPIC -c -o src/daemon/sblist.o src/daemon/sblist.c
In file included from src/daemon/sblist.c:3:
src/daemon/sblist.h:90:9: warning: unknown pragma ignored [-Wunknown-pragmas]
#pragma RcB2 DEP "sblist.c" "sblist_delete.c"
^
1 warning generated.
cc -DSUPER_SECURE -Wall -O0 -g -std=c99 -D_GNU_SOURCE -pipe -DIS_MAC=1 -DLIB_DIR=\"/usr/local/lib\" -DSYSCONFDIR=\"/usr/local/etc\" -DDLL_NAME=\"libproxychains4.dylib\" -fPIC -c -o src/daemon/sblist_delete.o src/daemon/sblist_delete.c
In file included from src/daemon/sblist_delete.c:1:
src/daemon/sblist.h:90:9: warning: unknown pragma ignored [-Wunknown-pragmas]
#pragma RcB2 DEP "sblist.c" "sblist_delete.c"
^
1 warning generated.
cc -DSUPER_SECURE -Wall -O0 -g -std=c99 -D_GNU_SOURCE -pipe -DIS_MAC=1 -DLIB_DIR=\"/usr/local/lib\" -DSYSCONFDIR=\"/usr/local/etc\" -DDLL_NAME=\"libproxychains4.dylib\" -fPIC -c -o src/daemon/daemon.o src/daemon/daemon.c
src/daemon/daemon.c:8:9: warning: '_GNU_SOURCE' macro redefined [-Wmacro-redefined]
#define _GNU_SOURCE
^
<command line>:2:9: note: previous definition is here
#define _GNU_SOURCE 1
^
In file included from src/daemon/daemon.c:20:
src/daemon/udpserver.h:11:9: warning: unknown pragma ignored [-Wunknown-pragmas]
#pragma RcB2 DEP "udpserver.c"
^
In file included from src/daemon/daemon.c:21:
src/daemon/sblist.h:90:9: warning: unknown pragma ignored [-Wunknown-pragmas]
#pragma RcB2 DEP "sblist.c" "sblist_delete.c"
^
3 warnings generated.
cc -DSUPER_SECURE -Wall -O0 -g -std=c99 -D_GNU_SOURCE -pipe -DIS_MAC=1 -DLIB_DIR=\"/usr/local/lib\" -DSYSCONFDIR=\"/usr/local/etc\" -DDLL_NAME=\"libproxychains4.dylib\" -fPIC -c -o src/daemon/udpserver.o src/daemon/udpserver.c
In file included from src/daemon/udpserver.c:1:
src/daemon/udpserver.h:11:9: warning: unknown pragma ignored [-Wunknown-pragmas]
#pragma RcB2 DEP "udpserver.c"
^
1 warning generated.
cc src/daemon/hsearch.o src/daemon/sblist.o src/daemon/sblist_delete.o src/daemon/daemon.o src/daemon/udpserver.o -o proxychains4-daemon
can you execute proxychains4-daemon ? also still waiting for readelf -a output...
☺ file libproxychains4.dylib master ✗
libproxychains4.dylib: Mach-O 64-bit dynamically linked shared library arm64
trinkle23897@JiayideMacBook-Pro ~/github/proxychains-ng
☺ /opt/homebrew/opt/binutils/bin/readelf -a libproxychains4.dylib master ✗
readelf:错误:不是 ELF 文件 - 它开头的 magic 字节错误
(it says it is not an ELF file because the magic number is wrong)
trinkle23897@JiayideMacBook-Pro ~/github/proxychains-ng
☹ ./proxychains4-daemon curl cip.cc master ✗
^C
(it gets stuck)
$ binwalk libproxychains4.dylib
DECIMAL HEXADECIMAL DESCRIPTION
--------------------------------------------------------------------------------
46405 0xB545 Base64 standard index table
47385 0xB919 Unix path: /usr/local/etc/proxychains.conf
98872 0x18238 Unix path: /Users/trinkle23897/github/proxychains-ng/src/
The dylib is attached: libproxychains4.zip
(it gets stuck)
that's good, it means the binary can be executed...
The dylib is attached: libproxychains4.zip
unfortunately my linux tools don't recognize the format. if readelf doesn't work on it, objdump -f libproxychain4.dylib should. please provide output of the command.
otool -l a output might also be interesting.
trinkle23897@JiayideMacBook-Pro ~/github/proxychains-ng
☹ objdump -f libproxychains4.dylib master ✗
libproxychains4.dylib: file format Mach-O arm64
/Library/Developer/CommandLineTools/usr/bin/objdump: error: 'libproxychains4.dylib': Invalid/Unsupported object file format
trinkle23897@JiayideMacBook-Pro ~/github/proxychains-ng
☹ otool -l -a libproxychains4.dylib master ✗
libproxychains4.dylib:
Load command 0
cmd LC_SEGMENT_64
cmdsize 552
segname __TEXT
vmaddr 0x0000000000000000
vmsize 0x000000000000c000
fileoff 0
filesize 49152
maxprot 0x00000005
initprot 0x00000005
nsects 6
flags 0x0
Section
sectname __text
segname __TEXT
addr 0x0000000000003b88
size 0x00000000000072a0
offset 15240
align 2^2 (4)
reloff 0
nreloc 0
flags 0x80000400
reserved1 0
reserved2 0
Section
sectname __stubs
segname __TEXT
addr 0x000000000000ae28
size 0x0000000000000378
offset 44584
align 2^2 (4)
reloff 0
nreloc 0
flags 0x80000408
reserved1 0 (index into indirect symbol table)
reserved2 12 (size of stubs)
Section
sectname __stub_helper
segname __TEXT
addr 0x000000000000b1a0
size 0x0000000000000390
offset 45472
align 2^2 (4)
reloff 0
nreloc 0
flags 0x80000400
reserved1 0
reserved2 0
Section
sectname __const
segname __TEXT
addr 0x000000000000b530
size 0x0000000000000084
offset 46384
align 2^0 (1)
reloff 0
nreloc 0
flags 0x00000000
reserved1 0
reserved2 0
Section
sectname __cstring
segname __TEXT
addr 0x000000000000b5b4
size 0x000000000000093f
offset 46516
align 2^0 (1)
reloff 0
nreloc 0
flags 0x00000002
reserved1 0
reserved2 0
Section
sectname __unwind_info
segname __TEXT
addr 0x000000000000bef4
size 0x000000000000010c
offset 48884
align 2^2 (4)
reloff 0
nreloc 0
flags 0x00000000
reserved1 0
reserved2 0
Load command 1
cmd LC_SEGMENT_64
cmdsize 232
segname __DATA_CONST
vmaddr 0x000000000000c000
vmsize 0x0000000000004000
fileoff 49152
filesize 16384
maxprot 0x00000003
initprot 0x00000003
nsects 2
flags 0x10
Section
sectname __got
segname __DATA_CONST
addr 0x000000000000c000
size 0x0000000000000028
offset 49152
align 2^3 (8)
reloff 0
nreloc 0
flags 0x00000006
reserved1 74 (index into indirect symbol table)
reserved2 0
Section
sectname __mod_init_func
segname __DATA_CONST
addr 0x000000000000c028
size 0x0000000000000008
offset 49192
align 2^3 (8)
reloff 0
nreloc 0
flags 0x00000009
reserved1 0
reserved2 0
Load command 2
cmd LC_SEGMENT_64
cmdsize 392
segname __DATA
vmaddr 0x0000000000010000
vmsize 0x0000000000048000
fileoff 65536
filesize 16384
maxprot 0x00000003
initprot 0x00000003
nsects 4
flags 0x0
Section
sectname __la_symbol_ptr
segname __DATA
addr 0x0000000000010000
size 0x0000000000000250
offset 65536
align 2^3 (8)
reloff 0
nreloc 0
flags 0x00000007
reserved1 79 (index into indirect symbol table)
reserved2 0
Section
sectname __data
segname __DATA
addr 0x0000000000010250
size 0x0000000000000098
offset 66128
align 2^3 (8)
reloff 0
nreloc 0
flags 0x00000000
reserved1 0
reserved2 0
Section
sectname __bss
segname __DATA
addr 0x00000000000102e8
size 0x000000000000036c
offset 0
align 2^3 (8)
reloff 0
nreloc 0
flags 0x00000001
reserved1 0
reserved2 0
Section
sectname __common
segname __DATA
addr 0x0000000000010658
size 0x0000000000044688
offset 0
align 2^3 (8)
reloff 0
nreloc 0
flags 0x00000001
reserved1 0
reserved2 0
Load command 3
cmd LC_SEGMENT_64
cmdsize 72
segname __LINKEDIT
vmaddr 0x0000000000058000
vmsize 0x0000000000008000
fileoff 81920
filesize 20882
maxprot 0x00000001
initprot 0x00000001
nsects 0
flags 0x0
Load command 4
cmd LC_ID_DYLIB
cmdsize 48
name libproxychains4.dylib (offset 24)
time stamp 1 Thu Jan 1 08:00:01 1970
current version 0.0.0
compatibility version 0.0.0
Load command 5
cmd LC_DYLD_INFO_ONLY
cmdsize 48
rebase_off 81920
rebase_size 16
bind_off 81936
bind_size 112
weak_bind_off 0
weak_bind_size 0
lazy_bind_off 82048
lazy_bind_size 1320
export_off 83368
export_size 1536
Load command 6
cmd LC_SYMTAB
cmdsize 24
symoff 85040
nsyms 626
stroff 95672
strsize 6200
Load command 7
cmd LC_DYSYMTAB
cmdsize 80
ilocalsym 0
nlocalsym 479
iextdefsym 479
nextdefsym 69
iundefsym 548
nundefsym 78
tocoff 0
ntoc 0
modtaboff 0
nmodtab 0
extrefsymoff 0
nextrefsyms 0
indirectsymoff 95056
nindirectsyms 153
extreloff 0
nextrel 0
locreloff 0
nlocrel 0
Load command 8
cmd LC_UUID
cmdsize 24
uuid 364223E9-E70E-3820-A281-FF39F1959D96
Load command 9
cmd LC_BUILD_VERSION
cmdsize 32
platform 1
minos 11.0
sdk 11.1
ntools 1
tool 3
version 609.8
Load command 10
cmd LC_SOURCE_VERSION
cmdsize 16
version 0.0
Load command 11
cmd LC_LOAD_DYLIB
cmdsize 56
name /usr/lib/libSystem.B.dylib (offset 24)
time stamp 2 Thu Jan 1 08:00:02 1970
current version 1292.60.1
compatibility version 1.0.0
Load command 12
cmd LC_FUNCTION_STARTS
cmdsize 16
dataoff 84904
datasize 136
Load command 13
cmd LC_DATA_IN_CODE
cmdsize 16
dataoff 85040
datasize 0
Load command 14
cmd LC_CODE_SIGNATURE
cmdsize 16
dataoff 101872
datasize 930
I also tried other dylib files with readelf and objdump, the behavior is the same as above: the magic number is not recognized
trinkle23897@JiayideMacBook-Pro /opt/homebrew/lib
☹ ../opt/binutils/bin/readelf -a libgettextlib-0.21.dylib stable ✔
readelf:错误:不是 ELF 文件 - 它开头的 magic 字节错误
trinkle23897@JiayideMacBook-Pro /opt/homebrew/lib
☹ objdump -f libidn2.0.dylib stable ✔
libidn2.0.dylib: file format Mach-O arm64
/Library/Developer/CommandLineTools/usr/bin/objdump: error: 'libidn2.0.dylib': Invalid/Unsupported object file format
i asked some helpful persons from mac homebrew ( https://github.com/Homebrew/homebrew-core/commit/bfd6fe6609e9ad72788e9e605289b6aae9ffca3e#r45740033 ) and it would appear they can get it both to build and run a successful test. maybe you could try to update your toolchain or try the homebrew build ?
Did they disable SIP for the test? If I don't disable SIP, the proxychains can definitely run but without any function, i.e., it cannot use any proxy provided in config, like nothing.
good observation. i added a comment to the above linked homebrew question, let's see what we get as a reply.
https://github.com/Homebrew/homebrew-core/commit/bfd6fe6609e9ad72788e9e605289b6aae9ffca3e#r45938787
I can help with my M1.
ok thanks, can you try to run otool on the files mentioned in my comment there?
Already in this comment: https://github.com/rofl0r/proxychains-ng/issues/357#issuecomment-754976479
there is no info about cpu type / subtype in there, which is what i'm after. i think otool might need some additional options to display it. please consult the help output/manpage of the tool.
$ otool -h libproxychains4.dylib
libproxychains4.dylib:
Mach header
magic cputype cpusubtype caps filetype ncmds sizeofcmds flags
0xfeedfacf 16777228 0 0x00 6 15 1624 0x00100085
ok, and regular binaries, or systemwide-installed dylibs ?
(base) [] ~ otool -h ~/github/proxychains-ng/libproxychains4.dylib
/Users/trinkle23897/github/proxychains-ng/libproxychains4.dylib:
Mach header
magic cputype cpusubtype caps filetype ncmds sizeofcmds flags
0xfeedfacf 16777228 0 0x00 6 15 1624 0x00100085
(base) [] ~ otool -h /opt/homebrew/Cellar/proxychains-ng/4.14/lib/libproxychains4.dylib
/opt/homebrew/Cellar/proxychains-ng/4.14/lib/libproxychains4.dylib:
Mach header
magic cputype cpusubtype caps filetype ncmds sizeofcmds flags
0xfeedfacf 16777228 0 0x00 6 15 1744 0x00100085
sigh. i meant you run it on a .dylib that's provided by your OS itself. for example /lib/libc.dylib, libssl.dylib or whatever the equivalent in macos. and a regular binary, which means an executable. also on the the proxychains4 executable, please.
[] ~/github/proxychains-ng <master> ✗ otool -h proxychains4
proxychains4:
Mach header
magic cputype cpusubtype caps filetype ncmds sizeofcmds flags
0xfeedfacf 16777228 0 0x00 2 17 1464 0x00200085
[] ~/github/proxychains-ng <master> ✗ otool -h proxychains4-daemon
proxychains4-daemon:
Mach header
magic cputype cpusubtype caps filetype ncmds sizeofcmds flags
0xfeedfacf 16777228 0 0x00 2 17 1464 0x00200085
[] /usr/lib otool -h libgmalloc.dylib
libgmalloc.dylib (architecture x86_64):
Mach header
magic cputype cpusubtype caps filetype ncmds sizeofcmds flags
0xfeedfacf 16777223 3 0x00 6 16 1824 0x02100085
libgmalloc.dylib (architecture arm64e):
Mach header
magic cputype cpusubtype caps filetype ncmds sizeofcmds flags
0xfeedfacf 16777228 2 0x80 6 17 1728 0x02100085
but some system packages also have cpu subtype==0:
[] /usr/lib/system otool -h libsystem_kernel.dylib
libsystem_kernel.dylib:
Mach header
magic cputype cpusubtype caps filetype ncmds sizeofcmds flags
0xfeedfacf 16777228 0 0x00 6 18 1728 0x0a100085
magic cputype cpusubtype caps filetype ncmds sizeofcmds flags0xfeedfacf 16777228 2 0x80 6 17 1728 0x02100085
that's interesting. can you find out which compiler flags gets us cpusubtype 2 into the binaries ?
[] ~/github/proxychains-ng <master> ✗ cat try.cpp
#include <cstdio>
int main(){
puts("233");
}
[] ~/github/proxychains-ng <master> ✗ g++ try.cpp -oa -arch arm64
[] ~/github/proxychains-ng <master> ✗ ./a
233
[] ~/github/proxychains-ng <master> ✗ otool -h a
a:
Mach header
magic cputype cpusubtype caps filetype ncmds sizeofcmds flags
0xfeedfacf 16777228 0 0x00 2 18 1432 0x00200085
[] ~/github/proxychains-ng <master> ✗ g++ try.cpp -oa -arch arm64e
[] ~/github/proxychains-ng <master> ✗ ./a
[1] 36238 killed ./a
[] ~/github/proxychains-ng <master> ✗ otool -h a
a:
Mach header
magic cputype cpusubtype caps filetype ncmds sizeofcmds flags
0xfeedfacf 16777228 2 0x80 2 17 1120 0x00200085
the output of the other arm64e binaries you showed have flags = 0x02100085. can you figure out what they mean?