Hadithcore
Mishkat al-Masabih, 3948

Al-Muhallab reported God’s Messenger as saying, “If the enemy attacks you at night let your war-cry be <i>Ha’ Mim</i>'. They will not be helped’.”* *These words may be taken from <i>sura</i> 41 which is one beginning with <i>Ha Mim</i>. The other words are in verse 16 of that <i>sura</i>. Cf. 44: 41. Tirmidhi and Abu Dawud transmitted it.

وَعَن الْمُهلب أَنَّ رَسُولَ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ قَالَ:

إِنْ بَيَّتَكُمُ الْعَدُوُّ فَلْيَكُنْ شِعَارُكُمْ: حم لَا ينْصرُونَ

. رَوَاهُ التِّرْمِذِيّ وَأَبُو دَاوُد

References1 variant
In-Book Reference
Book 19, Hadith 160