getReferencesTo takes an address
toAddr() converts a string to Address you can combine both
like this
>>> getReferencesTo(toAddr("ZwCreateKey"))
array(ghidra.program.model.symbol.Reference,
[
From: 14095680c To: 1401b33c0 Type: DATA Op: 0 IMPORTED,
From: 140a22fbd To: 1401b33c0 Type: DATA Op: 0 DEFAULT,
From: Entry Point To: 1401b33c0 Type: EXTERNAL Op: -1 DEFAULT,
From: 140628dc5 To: 1401b33c0 Type: UNCONDITIONAL_CALL Op: 0 DEFAULT,
From: 1407478dd To: 1401b33c0 Type: UNCONDITIONAL_CALL Op: 0 DEFAULT,
From: 1406bdfcd To: 1401b33c0 Type: UNCONDITIONAL_CALL Op: 0 DEFAULT,
From: 1408db10c To: 1401b33c0 Type: UNCONDITIONAL_CALL Op: 0 DEFAULT,
From: 1406f5dec To: 1401b33c0 Type: UNCONDITIONAL_CALL Op: 0 DEFAULT,
From: 1407c7190 To: 1401b33c0 Type: UNCONDITIONAL_CALL Op: 0 DEFAULT,
From: 1407d01da To: 1401b33c0 Type: UNCONDITIONAL_CALL Op: 0 DEFAULT,
From: 1405a8745 To: 1401b33c0 Type: UNCONDITIONAL_CALL Op: 0 DEFAULT,
the function limits its display to max 4096 refs if there are more
use the recommended ReferenceManager
>>> refs = currentProgram.referenceManager.getReferencesTo(toAddr("ZwCreateKey"))
>>> for i in refs:
... print i
...
From: 14095680c To: 1401b33c0 Type: DATA Op: 0 IMPORTED
From: 140a22fbd To: 1401b33c0 Type: DATA Op: 0 DEFAULT
From: Entry Point To: 1401b33c0 Type: EXTERNAL Op: -1 DEFAULT
From: 140628dc5 To: 1401b33c0 Type: UNCONDITIONAL_CALL Op: 0 DEFAULT
From: 1407478dd To: 1401b33c0 Type: UNCONDITIONAL_CALL Op: 0 DEFAULT
From: 1406bdfcd To: 1401b33c0 Type: UNCONDITIONAL_CALL Op: 0 DEFAULT
From: 1408db10c To: 1401b33c0 Type: UNCONDITIONAL_CALL Op: 0 DEFAULT