Since you want all the call
instructions (and possibly fake call
s using push
and jmp
and similar using opaque predicates) you won't get around static analysis (static-analysis) of the binary. And if the binary is in any way packed or encrypted that means you need to get through that layer first.
Igor's solution will be your best bet short of loading the file into a good disassembler and finding all the cross-references to the function you are interested in. But it has the limitation that Igor already pointed out.
Static analysis has to deal with a lot of ambiguities and issues when distinguishing data and code. But good disassemblers are fairly good at making the right guess and will offer to interactively mark items one way or the other in case of doubt.
Conclusion
What this means is that PyDbg is probably not the right tool for the problem at hand unless you manage to coerce it into making use of a proper full-fledged disassembler to get all cross-references. But the better choice is probably something like radare2 and then, if you are more familiar with PyDbg, applying the gained knowledge to the debugged target in PyDbg.