evoplus_cid icon indicating copy to clipboard operation
evoplus_cid copied to clipboard

macOS support?

Open gingerbeardman opened this issue 7 years ago • 61 comments

Depending on the model of Apple Mac, the SD card reader is either mapped to USB or PCIE interface (in this case in System Information it will show in card reader with speed measured in GT/s).

https://support.apple.com/en-gb/HT204384

On my Early-2013 Retina MacBook Pro the SD card reader is PCIE. So I wondered if I could do any investigation to see whether CID can be changed?

Any ideas?

gingerbeardman avatar Dec 23 '17 12:12 gingerbeardman

I have no experience with osx/bsd, but I'm sure it's possible. If the bsd api is similar to linux then probably won't take much adapting, but if it's completely different then it'd need a rewrite. Have you tried to compile it and see how far it gets?

raburton avatar Dec 27 '17 09:12 raburton

I've not tried it, but I will soon.

I confirmed my laptop can change the CID of my EVO card using Ubuntu so I'll try to figure out how to do it with only MacOS.

gingerbeardman avatar Dec 27 '17 12:12 gingerbeardman

To be able to compile on MacOS i need to replace

#include <linux/types.h>

in /jni/ioctl.h with:

#ifdef __linux__
# include "linux/types.h"
#else
# include <stdint.h>
typedef uint64_t __u64;
typedef uint32_t __u32;
typedef int32_t __s32;
typedef uint16_t __u16;
typedef uint8_t __u8;
#endif

avp90 avatar Oct 29 '18 06:10 avp90

It works, thanks.

pabgg avatar May 07 '19 17:05 pabgg

could somebody give a little how-to compile this on macos 10.14 or send a link to the compiled uploaded version?

3x3cut0r avatar Jun 27 '19 23:06 3x3cut0r

Sharing the stuff (binaries) for Mac OS X would be great

Tetonne avatar Jul 25 '19 11:07 Tetonne

Here's the macOS binary (built just now, untested on any SD cards).

evoplus_cid.zip

Screen shot 2019-07-25 at 13 08 03

gingerbeardman avatar Jul 25 '19 12:07 gingerbeardman

^thanks a lot for this share and the quick answer and how to. best regards.

Tetonne avatar Jul 25 '19 19:07 Tetonne

Did anybody use the above build successfully on macOS?

gingerbeardman avatar Jan 27 '20 19:01 gingerbeardman

hello gingerbeardman i try but without success

cd /Users/Shared/Downloads/

./evoplus_cid /dev/disk2/disk2s1 09415041462053460219f9cf37014101 Unable to open device /dev/disk2/disk2s1

./evoplus_cid /dev/disk2/disk2s1 09415041462053460219f9cf37014101 Unable to open device /dev/disk2

./evoplus_cid /Volumes/Untitled 09415041462053460219f9cf37014101 Unable to open device /Volumes/Untitled

Tetonne avatar Aug 15 '20 18:08 Tetonne

@Tetonne you need to unmount the device first (using terminal or disk utility)

Unmount is like a half eject

Then use the /dev device that matches your card

gingerbeardman avatar Aug 16 '20 16:08 gingerbeardman

Thanks gingerbeardman for your help unfortunately same result. i'm under 10.15.6 and the /Volumes/Untitled is ExFAT format (it's new)

terminal.app give me : /dev/disk2 (internal, physical): #: TYPE NAME SIZE IDENTIFIER 0: FDisk_partition_scheme *64.0 GB disk2 1: Windows_NTFS 64.0 GB disk2s1

i unmount the volume Untitled in diskutil.app then try again

tetonne@iMac cid % ./evoplus_cid /dev/disk2/disk2s1 09415041462053460219f9cf37014101 Unable to open device /dev/disk2/disk2s1 tetonne@iMac cid % ./evoplus_cid /dev/disk2/ 09415041462053460219f9cf37014101 Unable to open device /dev/disk2/

Tetonne avatar Aug 16 '20 19:08 Tetonne

OK, i recommend using a USB stick with Ubuntu Linux on it.

gingerbeardman avatar Aug 16 '20 19:08 gingerbeardman

@Tetonne can you confirm you are using an internal SD card reader connected to PCIE (USB card readers will not work)

gingerbeardman avatar Aug 17 '20 08:08 gingerbeardman

^thanks again gingerbeardman. Im' using it on my iMac i'll try to find a linux to solve it thanks again and thanks for this stuff and all other you provide :-) related to brew

Tetonne avatar Aug 17 '20 18:08 Tetonne

Thanks gingerbeardman for your help unfortunately same result. i'm under 10.15.6 and the /Volumes/Untitled is ExFAT format (it's new)

terminal.app give me : /dev/disk2 (internal, physical): #: TYPE NAME SIZE IDENTIFIER 0: FDisk_partition_scheme *64.0 GB disk2 1: Windows_NTFS 64.0 GB disk2s1

i unmount the volume Untitled in diskutil.app then try again

tetonne@iMac cid % ./evoplus_cid /dev/disk2/disk2s1 09415041462053460219f9cf37014101 Unable to open device /dev/disk2/disk2s1 tetonne@iMac cid % ./evoplus_cid /dev/disk2/ 09415041462053460219f9cf37014101 Unable to open device /dev/disk2/

I found how to overpass this problem:

  1. Determine the disk device corresponding to the SD Card you want to change to: Execute diskutil list before you plug your SD card and then repeat this after you've plugged it in. Take notice that /dev/disk2 is the one you need.
  2. Unmount the disk diskutil unmountDisk /dev/disk2
  3. Zero out the partition map: sudo dd if=/dev/zero of=/dev/rdisk2 bs=1024 count=1 (now you are accessing the disk in raw, so the device name is /dev/rdisk2 and not /dev/disk2). (Be aware of the r character before disk2)
  4. sudo ./evoplus_cid /dev/rdisk2 09415041462053460219f9cf37014101

jdelatorre72 avatar Nov 29 '21 18:11 jdelatorre72

I got an error: Failed to enter vendor mode. Genuine Samsung Evo Plus?

jdelatorre72 avatar Nov 29 '21 18:11 jdelatorre72

@jdelatorre72 did you read the error?

  • your SD card may not be genuine or
  • your SD card may not be the correct type

Also, confirm you are using an internal SD card slot not a USB SD card reader.

gingerbeardman avatar Nov 29 '21 19:11 gingerbeardman

It's a microSD with adaptor

jdelatorre72 avatar Nov 29 '21 19:11 jdelatorre72

I think my mac sd reader goes through USB

jdelatorre72 avatar Nov 29 '21 19:11 jdelatorre72

@jdelatorre72 it needs to be an internal SD slot (like in a MacBook Pro) for technical reasons.

gingerbeardman avatar Nov 29 '21 19:11 gingerbeardman

@jdelatorre72 it needs to be an internal SD slot (like in a MacBook Pro) for technical reasons.

It is so, but I guessed it could go by usb bus because of this error. It's a iMac from middle 2011.

I purchased a new sd card to test again. If I succeed I'll let you notice.

jdelatorre72 avatar Nov 29 '21 20:11 jdelatorre72

That computer should be OK.

There is no need to guess what SD hardware you have. You can check the type of the SD card hardware by checking System Information (PCIE hardware will show in card reader with speed measured in GT/s)

gingerbeardman avatar Nov 29 '21 20:11 gingerbeardman

Well, it looks like USB:

Unidad física:
  Nombre del dispositivo:	SD Card Reader
  Nombre del soporte:	APPLE SD Card Reader Media
  Protocolo:	USB
  Interno:	Sí
  Tipo de mapa de particiones:	MBR (Registro maestro de arranque)

jdelatorre72 avatar Nov 30 '21 05:11 jdelatorre72

Interesting! Sorry to read that, you'll need to find a compatible computer with PCIE SD slot.

gingerbeardman avatar Nov 30 '21 09:11 gingerbeardman

Grrrrr, I’ve started to try on a netbook until I saw it’s also connected through USB Host controller

jdelatorre72 avatar Nov 30 '21 15:11 jdelatorre72

Hi, I finally tried to attach my old Xperia M2, after rooting it and access to it by adb. When I launch the command ./evoplus_cid /dev/block/mmcblk1 NEW_CID_NUMBER I get this message from console: ./evoplus_cid[1]: ??????: not found ./evoplus_cid[25]: no closing quote

I don't know what does it mean.

jdelatorre72 avatar Dec 03 '21 19:12 jdelatorre72

Interesting idea to use the phone!

Here there are two errors

  1. not found, I guess evoplus_cid cannot see the card?
  2. no closing quote, given that you did not use quotes in your command it seems that evoplus_cid is not running correctly or at least not seeing data correctly

Maybe doing this over adb is messing up things? Bad luck.

gingerbeardman avatar Dec 03 '21 19:12 gingerbeardman

This looks to me like an error from the shell, like it's possibly trying to execute the program as a shell script. Check your compiled copy has transferred properly, e.g. use md5, make sure it's not on a fat partition and that it has execute permission.

raburton avatar Dec 03 '21 19:12 raburton

Well, I don’t know much how to fix it. I placed the program in several folders in primary storage unit of the phone. I run it remotely by adb and then directly in the phone with material terminal. The both cases I got the same answer. Maybe I did not root correctly the cellular?

jdelatorre72 avatar Dec 04 '21 00:12 jdelatorre72