Jump to content

David Heffernan

Members
  • Content Count

    3711
  • Joined

  • Last visited

  • Days Won

    185

Posts posted by David Heffernan


  1. 1 hour ago, Lars Fosdal said:

    I have an affection for Shell's sort - but it has a weakness as it does not preserve order for equal rows, which is easily worked around - but then again, it is not recursive and does not degrade on already sorted or partially sorted lists.

    Timsort is stable, and performs well on partially ordered data. It's the default sort for Python and Java.

    • Like 1

  2. It seems odd to me that you won't use the solution that I outlined above which is known to work.

     

    But if you won't entertain that then you are probably asking in the wrong place. Because what you are asking is really a numpy question. I'd ask the question on SO and tag it python and numpy. Doesn't matter at all that the array is from Delphi. It's just an array of double. 


  3. 2 hours ago, Fr0sT.Brutal said:

    You of course can feed Python with the pointer to your Delphi array but what you can do with it depends on what you want Python to do with it.

    What @fjames wants to do in Python is to use numpy without copying data between Delphi and Python. Are you aware of a way to do this with numpy that I have missed?


  4. 3 hours ago, Mahdi Safsafi said:

    HRESULT. In fact ReadProcessMemory calls an internal function that returns a HRESULT and then checks the value and returns the bytes count.

    
    # ReadProcessMemory:
    # ...
    203BF56E            | 8B45 E8                 | mov eax,dword ptr ss:[ebp-18]                                                                                                                     
    203BF571            | 50                      | push eax                                                                                                                                          
    203BF572            | 8B00                    | mov eax,dword ptr ds:[eax]                                                                                                                        
    203BF574            | FF50 40                 | call dword ptr ds:[eax+40]    # InternalReadProcessMemoryFunction that reads the bytes and returns a HRESULT                                                 
    203BF577            | E8 7096FAFF             | call <dbkdebugide260.@Dbkhelper@CheckRetVal$qqrxl>   # check HRESULT    
    # ...
    203BF599            | 8B45 FC                 | mov eax,dword ptr ss:[ebp-4]  # result = bytes count                                                                                                         

     

    Seems unlikely. The winapi functions return a BOOL and call SetLastError. HRESULT seems very implausible. 


  5. 3 hours ago, Mahdi Safsafi said:

    I clearly understand the requirement. What I discussed with you is different thing than what I suggested to Thomas. My answers were based on your statement which used a word output (BTW you still didn't explain what you mean by that) that makes me think to binary graph.

    By output I mean what is produced by the compiler. 


  6. 17 minutes ago, Mahdi Safsafi said:

    It just seems to me that you didn't understand my comment.

    I don't think so. I think that you don't seem to understand the requirement. You certainly can't achieve the functionality shown in the original post from a native executable file (like the ones that Delphi produce).  


  7. 25 minutes ago, Mahdi Safsafi said:

    I use external debugger heavily and all what I need to find references to a given function is the executable only ... map/pdb is just a sugar.  

    If map wasn't that in your mind ... what's the actual one ?

    A map file doesn't list functions calls. You can't map the graph of function calls from a map file.

    27 minutes ago, Mahdi Safsafi said:

    if you parse all units you can than get the information.

    Parsing isn't enough. You also need to interpret the tokens that the parser emits, using the syntax of the language.

     

    For sure you need a parser. But it's not enough. You need more.


  8. 8 minutes ago, Mahdi Safsafi said:

    The output ... you mean map file ?

    No. You need way more than a map file to find all the incoming references to a function.

     

    12 minutes ago, Mahdi Safsafi said:

    You can use DelphiAST (by Roman Yankovsky) to parse the unit. 

    This won't tell you the information either.


  9. 18 hours ago, Mike Torrettinni said:

    I very rarely use anonymous functions, so I assume the limitation (compared to callback) is that it can only be used within already executed code. You can't just assign it to something, because it's anonymous (not defined anywhere). Right?

    No. That makes no sense. Anonymous methods are just procedural types with variable capture. 

×