Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Design API v3 #94

Merged
merged 2 commits into from
Dec 6, 2019
Merged

Design API v3 #94

merged 2 commits into from
Dec 6, 2019

Conversation

RadWolfie
Copy link
Member

@RadWolfie RadWolfie commented Aug 25, 2019

Design API v3.0

Closes #10

New features: (see XbSymbolDatabase.h file for functions' details)

  • XbSymbolDatabase_GenerateLibraryFilter
  • XbSymbolDatabase_GenerateSectionFilter
  • XbSymbolDatabase_CreateXbSymbolContext
  • XbSymbolContext_ScanLibrary (design for multi-thread safe support)
    • If there is a dependency on another library's symbols. Such as XACTENG library do depend on DSOUND's symbols. Then second or later libraries will not perform the scan until the library is done scanning in the active thread.
  • XbSymbolContext_ScanAllLibraryFilter (design for single-threading only)
    • May will change to support multi-thread usage internally.
  • XbSymbolContext_RegisterXRefs (currently is a stub function)
  • XbSymbolContext_Release

Currently, the design is backward compatibility. Until final stage will move the old APIs into new APIs.

@RadWolfie
Copy link
Member Author

Currently, multi-thread support is not enabled for MSVC due to the developers haven't implemented C11 support in their compiler. From what I had read in the recent past, they're working on it and should be bundle in future Visual Studio 2019 update.

@RadWolfie
Copy link
Member Author

Plus most importantly, include pointer to kernel thunk's address to translate internally for make stronger OOVPA signatures easier. 😄

@RadWolfie
Copy link
Member Author

If the team want to make the final decision for API's names later, please let me know here or on discord. Otherwise, we need to continue discussion what's need to be add/remove/update the parameters and/or API's names.

XbSymbolDatabase.h Outdated Show resolved Hide resolved
XbSymbolDatabase.h Outdated Show resolved Hide resolved
XbSymbolDatabase.h Outdated Show resolved Hide resolved
XbSymbolDatabase.h Outdated Show resolved Hide resolved
XbSymbolDatabase.h Outdated Show resolved Hide resolved
@RadWolfie RadWolfie added enhancement New feature or request priority-high High priority labels Nov 18, 2019
XbSymbolDatabase.h Outdated Show resolved Hide resolved
XbSymbolDatabase.h Outdated Show resolved Hide resolved
XbSymbolDatabase.h Outdated Show resolved Hide resolved
XbSymbolDatabase.h Outdated Show resolved Hide resolved
XbSymbolDatabase.h Outdated Show resolved Hide resolved
XbSymbolDatabase.h Outdated Show resolved Hide resolved
@RadWolfie RadWolfie changed the title Design API v3 Design API v3 (stage 1) Nov 22, 2019
@RadWolfie
Copy link
Member Author

Since the API naming and comments was changed since initialize commit. I do know initialize commit is working and had been verified using my unit test project locally.

@RadWolfie RadWolfie marked this pull request as ready for review November 22, 2019 17:43
@RadWolfie RadWolfie changed the title Design API v3 (stage 1) Design API v3 Nov 24, 2019
@RadWolfie
Copy link
Member Author

RadWolfie commented Nov 24, 2019

What's been change:

Added:

  • XbSymbolDatabase_GetKernelThunkAddress

Renamed:

  • XbSymbolContext_RegisterLibrary
  • XbSymbolContext_SetBypassBuildVersionLimit
  • XbSymbolContext_SetContinuousSigScan
  • XbSymbolContext_SetFirstDetectAddressOnly
  • XbSymbolDatabase_LibraryVersion
  • XbSymbolDatabase_SetOutputMessage
  • XbSymbolDatabase_LibraryToFlag
  • XbSymbolDatabase_TestOOVPAs
  • XbSymbolDatabase_SetOutputVerbosity

EDIT: Also I have added a check to ensure steps are process correctly in order. Watch for error messages if you didn't perform the calls in right order.


Internal functions has been renamed in second commit.

Plus added:

  • iXbSymbolContext_Lock
  • iXbSymbolContext_Unlock
  • iXbSymbolContext_AllowSetParameter
  • iXbSymbolContext_AllowScanLibrary

@RadWolfie
Copy link
Member Author

RadWolfie commented Nov 24, 2019

NOTE: XbSymbolScan function has not been remove yet. It is now deprecated function.

EDIT: I also had reran test with no issues.

XbSymbolDatabase.c Outdated Show resolved Hide resolved
XbSymbolDatabase.c Outdated Show resolved Hide resolved
XbSymbolDatabase.c Outdated Show resolved Hide resolved
XbSymbolDatabase.h Outdated Show resolved Hide resolved
XbSymbolDatabase.c Outdated Show resolved Hide resolved
XbSymbolDatabase.c Outdated Show resolved Hide resolved
@RadWolfie
Copy link
Member Author

Fixed all reviews by @PatrickvL except one which is working as intended.

Plus I discover a warning message from Visual Studio about memcpy usage over the limit. I have replaced memcpy to strncpy function for prevent warning and null'd the overflow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority-high High priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TASK: Design API
3 participants