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

Windows support #33

Merged
merged 85 commits into from
Jul 18, 2017
Merged

Windows support #33

merged 85 commits into from
Jul 18, 2017

Conversation

krx
Copy link
Contributor

@krx krx commented Jul 13, 2017

Adds support for building the challenges on Windows using clang-cl, and testing them with the included utilites

While the current build process works, some future work could include:

  • Building with Clang/C2 - this would allow us to use Microsoft CodeGen instead of clang
  • Getting more challenges to compile with cl

Closes #11
Closes #9 (see #27)

krx and others added 24 commits July 13, 2017 16:24
Change build location for cbs, add exclude option
No longer using __asm__ to explicitly name the symbol
A few challenges had a `-include cgc__defines.h` flag when compiling.
Now they explicitly include the header instead
This changes the signature of the main() function in the challenges and
POVs to be "int main(int cgc_argc, char *cgc_argv[])". The argument
names were chosen to avoid conflicts with challenges that use the names
argc/argv for their own purposes.

This should help out some analysis tools (specifically KLEE) that expect
main() to have at least two arguments.

This commit doesn't touch challenges that already had arguments to main.
Such challenges need a bit more careful handling, since they expect the
address of the flag page to be passed in the first argument.
As opposed to trying to run tests for everything in `challenges`, which
may not all be built
Instead of trying to connect to a separately running server, cb-replay
will now directly launch the challenge it's trying to test, gather the
results and kill it.

NOTE: as of this commit multibin support is still a WIP

POLLs can now be run on Windows
To accomplish this, minidumps are enabled and are kept in a known
directory. Then `cdb` is used to to get the registers from the crash
dumps
Use the `-msvc` flag to try building with normal cl
Similar to cb-replay, this now launches the challenges it needs instead
of connecting to a server

POVs now working on all OSs
@krx krx force-pushed the windows_support branch from 4e250cf to 9deaea5 Compare July 13, 2017 20:35
@withzombies
Copy link
Contributor

Rebase and merge please

@krx krx merged commit 29ae406 into master Jul 18, 2017
@krx krx deleted the windows_support branch July 18, 2017 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants