Skip to content

Commit a42fee5

Browse files
committed
migrate test site to bap main site
1 parent 691af45 commit a42fee5

28 files changed

+2303
-0
lines changed

404.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
layout: center
3+
permalink: /404.html
4+
---
5+
6+
# 404
7+
8+
Sorry, we can't seem to find this page.
9+
10+
<div class="mt3">
11+
<a href="{{ site.baseurl }}/" class="button button-blue button-big">Home</a>
12+
</div>

CNAME

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dbrumley.github.io

Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
source 'https://rubygems.org'
2+
gem 'github-pages'

_config.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Site settings
2+
title: The BAP Blog
3+
# email: dbrumley@cmu.edu
4+
author: David Brumley
5+
description: "The Binary Analysis Platform Blog"
6+
baseurl: ""
7+
url: "http://binaryanalysisplatform.github.io"
8+
9+
# Google analytics
10+
google_analytics:
11+
12+
# Optional features
13+
animated: false
14+
show_related_posts: false
15+
show_post_footers: false
16+
17+
# Social icons
18+
show_social_icons: false
19+
github_username:
20+
twitter_username:
21+
google_plus_id:
22+
linkedin_username:
23+
bitcoin_url:
24+
paypal_url:
25+
flattr_button:
26+
27+
# Build settings
28+
markdown: redcarpet #kramdown
29+
permalink: pretty
30+
paginate: 3
31+
sass:
32+
compressed: true

_drafts/bap-ocaml-tips.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
layout: post
3+
title: BAP Conventions
4+
---
5+
6+
In this blog post we will give several tips for using BAP on your system.
7+
8+
9+
10+
# Use baptop
11+
12+
BAP comes with a program called `baptop`, which is an excellent way to
13+
explore BAP modules. `baptop` is a
14+
[`utop`](https://opam.ocaml.org/blog/about-utop/) interface that loads
15+
the BAP. `utop` provides a bunch of useful directives, that can help
16+
you to explore BAP library interactively. You can find the type of
17+
any type, module or expression or in `baptop` by using the `#typeof`
18+
directive followed by the name of the expression in quotes. For
19+
example, to find the type of `Image.t`, in `baptop` type:
20+
21+
{% highlight ocaml %}
22+
(* using a fully-qualified name. *)
23+
utop # open Bap.Std;;
24+
utop # #typeof "image";;
25+
type Bap.Std.image = Bap.Std.Image.t
26+
{% endhighlight %}
27+
28+
29+
# Module hierarchy management
30+
31+
We have spent quite a bit of time thinking about the BAP module
32+
hierarchy. Inside BAP, all types and definitions are belong to a
33+
`Bap.Std` module hierarchy. The structure mimics OCaml `Core` library
34+
quite closely.
35+
36+
Underneath the hood we use somewhat mangled names for actual files
37+
that are not as clean as the compiled BAP hierarchy. The mangling is
38+
to overcome some problems with linking and `ocamlfind` that posed a
39+
challenge to preserving hierarchy purity. As a result, often the name
40+
of a module (e.g.,
41+
[`Elf`](https://github.com/BinaryAnalysisPlatform/bap/blob/master/lib/bap_elf/bap_elf.ml))
42+
does not correspond to a single file of the same name (e.g., there is
43+
no elf.ml). A BAP developer will have to work their way through the
44+
file redirection space, but no BAP user should have to.
45+
46+
47+
# Setting up your editor
48+
49+
50+

_drafts/why-ocaml.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
---
2+
layout: post
3+
title: Why ocaml?
4+
permalink: why_ocaml
5+
---
6+
7+
BAP is written in OCaml, and I often get asked why. Often the person
8+
asking has good reasons to prefer another language. For example,
9+
Python has more libraries and is quicker to prototype, C is faster,
10+
and so on.
11+
12+
We do not take this question lightly. BAP has undergone several
13+
significant rewrites, and for the last three iterations we have chosen
14+
OCaml. To understand why, first a little history
15+
16+
## Compilers at CMU
17+
18+
In the mid 2000's I (David Brumley) was a TA for the CMU undergraduate
19+
compiler course (course number: 15-411). Peter Lee was the instructor.
20+
(Peter is a former CMU Computer Science Departmet Head, now a Vice
21+
President at Microsoft, and one of the co-inventors of Proof Carrying
22+
Code.) We use the excellent Appel book for compilers, which comes in
23+
three forms: one for C, one for Java, and one for SML.
24+
25+
At the beginning of semester Peter told all the students that in his
26+
experience, final grades historically roughly corresponded to the
27+
language chosen. He also emphasized it didn't matter what language you
28+
were familiar with now: he had seen many people who had never used ML
29+
before write the course compiler in SML, and do quite well.
30+
31+
At the end of the semester, Peter's observations seemed quite
32+
true. Students who programmed in C received a C or lower (often
33+
fighting with hard-to-debug memory management issues that lead to
34+
crashing compilers), students in Java received a B (lots of template
35+
code, unexpected NULL exceptions), and students who wrote in ML got
36+
As. I do not remember whether this was true in every case, but it was
37+
certainly a strong enough sign that I remember it.
38+
39+
## OCaml for Binary Analysis
40+
41+
As a graduate student, I worked with Dawn Song and created Vine, the
42+
static analysis part of [BitBlaze](http://bitblaze.eecs.berkeley.edu).
43+
That architecture underwent 3 main revisions. The first was in C, then
44+
C++, and then OCaml. Just like in compilers, I found C memory safety
45+
was hard to get right, my C++ relied on a huge amount of template code
46+
(we tried using the visitor design pattern as specified in the Appel
47+
compiler book), while OCaml seemed to be a sweet spot.
48+
49+
### Win: Static Type Safety
50+
51+
Others have spoken at length at the benefit of type safety.
52+
53+
54+
Type safety is a big deal, not just for correctness but also because
55+
it makes programs easier to debug.
56+
57+
### Win: Pattern Matching
58+
Beyond the well-discussed benefits of type safety covered elsewhere
59+
(Hello [Jane Street](http://janestreet.com)), the ability to
60+
**pattern match** ended up being a huge advantage.
61+
62+
Compilers, and most binary analysis platforms, desugar assembly
63+
statements into an intermediate representation (IR). The majority of
64+
code analysis is a pattern match on IR statements. For example, in
65+
def-use analysis you first match on assignment statements, and then
66+
set anything on the left-hand side as a definition and on the
67+
right-hand side as a use. Pattern matching rules.

_includes/footer.html

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<footer class="footer">
2+
<div class="p2 wrap">
3+
<div class="measure mt1 center">
4+
<small>
5+
BAP has been funded in part by grants from
6+
the NSF and DARPA, as well as internal funds.
7+
</small>
8+
</div>
9+
</div>
10+
</footer>
11+
12+
<!-- {% if site.google_analytics %} -->
13+
<!-- <script> -->
14+
<!-- (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ -->
15+
<!-- (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), -->
16+
<!-- m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) -->
17+
<!-- })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); -->
18+
19+
<!-- ga('create', '{{ site.google_analytics }}', 'auto'); -->
20+
<!-- ga('send', 'pageview'); -->
21+
22+
<!-- </script> -->
23+
<!-- {% endif %} -->

_includes/head.html

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<head>
2+
<meta charset="utf-8">
3+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
4+
<title>{% if page.title %}{{ page.title }} &#8211; {% endif %}{{ site.title }}</title>
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<meta name="description" content="{% if page.summary %}{{ page.summary }}{% else %}{{ site.description }}{% endif %}">
7+
<meta name="author" content="{{ site.author }}">
8+
{% if page.categories %}<meta name="keywords" content="{{ page.categories | join: ', ' }}">{% endif %}
9+
<link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}">
10+
11+
<!-- Custom CSS -->
12+
<link rel="stylesheet" href="{{ "/css/pixyll.css" | prepend: site.baseurl }}" type="text/css">
13+
14+
<!-- Fonts -->
15+
<link href='//fonts.googleapis.com/css?family=Merriweather:900,900italic,300,300italic' rel='stylesheet' type='text/css'>
16+
<link href='//fonts.googleapis.com/css?family=Lato:900,300' rel='stylesheet' type='text/css'>
17+
{% if site.show_social_icons %}
18+
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
19+
{% endif %}
20+
21+
<!-- Open Graph -->
22+
<!-- From: https://github.com/mmistakes/hpstr-jekyll-theme/blob/master/_includes/head.html -->
23+
<meta property="og:locale" content="en_US">
24+
<meta property="og:type" content="article">
25+
<meta property="og:title" content="{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}">
26+
<meta property="og:description" content="{% if page.description %}{{ page.description }}{% else %}{{ site.description }}{% endif %}">
27+
<meta property="og:url" content="{{ site.url }}{{ page.url }}">
28+
<meta property="og:site_name" content="{{ site.title }}">
29+
</head>

_includes/header.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<header class="site-header px2 px-responsive">
2+
<div class="mt2 wrap">
3+
<div class="measure">
4+
<a href="{{ site.baseurl }}/" class="site-title">{{ site.title }}</a>
5+
<nav class="site-nav right">
6+
{% include navigation.html %}
7+
</nav>
8+
<div class="clearfix"></div>
9+
{% if site.show_social_icons %}
10+
{% include social_links.html %}
11+
{% endif %}
12+
</div>
13+
</div>
14+
</header>

_includes/navigation.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<a href="{{ site.baseurl}}/archive/">Archive</a> <a href="{{ site.baseurl }}/about/">About</a>

0 commit comments

Comments
 (0)