![]() |
|
[C] Dynamic Function Resolving GetApi - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [C] Dynamic Function Resolving GetApi (/showthread.php?tid=6073385) |
Dynamic Function Resolving GetApi - SIM-3437924 - May 1, 2020 I have recently been learning about dynamically resolving function to help malware evade AV. Because of this, I was looking though the source of Carberp's "GetApi" files. I understood most of it until I found the function "GetApiAddr". Because it is called "GetApiAddr" i'm guessing that it's getting the api's address, but can somebody explain how this code is able to do that. Code #define RVATOVA( base, offset ) ( (DWORD)base + (DWORD)offset )also can somebody explain what the hashes are about? how/why they are used? Sources: GetApi.cpp GetApi.h RE: Dynamic Function Resolving GetApi - saltycracker - May 1, 2020 Are you looking for what a hash is and how to use one? The function CalcHash looks like its just generating a hash value from the character pointer. The hash value is used as a index value into a data structure(usually a array with added features). Why a hash and hash value? Its fast. RE: Dynamic Function Resolving GetApi - dracx - May 1, 2020 basically runs thru the IMAGE_EXPORT_DIRECTORY structure of the module and hash every function name and see if the hash (of that function name) matches the hash that was passed as the argument. Another reason why hash: t get's rid of those ascii strings in your binary. |