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+
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>

_includes/pagination.html

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<div class="pagination clearfix mb1 mt4">
2+
<div class="left">
3+
{% if paginator.previous_page %}
4+
{% if paginator.page == 2 %}
5+
<a class="pagination-item" href="{{ site.baseurl }}/">Newer</a>
6+
{% else %}
7+
<a class="pagination-item" href="{{ site.baseurl }}/page{{paginator.previous_page}}/">Newer</a>
8+
{% endif %}
9+
{% else %}
10+
<span class="pagination-item disabled">Newer</span>
11+
{% endif %}
12+
</div>
13+
<div class="right">
14+
{% if paginator.next_page %}
15+
<a class="pagination-item" href="{{ site.baseurl }}/page{{paginator.next_page}}/">Older</a>
16+
{% else %}
17+
<span class="pagination-item disabled">Older</span>
18+
{% endif %}
19+
</div>
20+
</div>

_includes/post_footer.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<div class="py2 post-footer">
2+
<img src="/images/me.jpeg" alt="John Otander" class="avatar" />
3+
<p>
4+
Pixyll is an open-source Jekyll theme that's built by <a href="http://johnotander.com">John Otander</a>.
5+
When he's not writing code and building things, he likes to ski. A. Lot.
6+
</p>
7+
<p>
8+
Follow him on <a href="https://twitter.com/4lpine">Twitter</a>.
9+
</p>
10+
</div>

_includes/social_links.html

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<div class="social-icons">
2+
<div class="left">
3+
{% if site.github_username %}
4+
<a class="fa fa-github" href="https://github.com/{{ site.github_username }}"></a>
5+
{% endif %}
6+
<a class="fa fa-rss" href="{{ "/feed.xml" | prepend: site.baseurl }}"></a>
7+
{% if site.twitter_username %}
8+
<a class="fa fa-twitter" href="https://twitter.com/{{ site.twitter_username }}"></a>
9+
{% endif %}
10+
{% if site.google_plus_id %}
11+
<a class="fa fa-google-plus" href="https://plus.google.com/{{ site.google_plus_id }}/posts"></a>
12+
{% endif %}
13+
{% if site.email %}
14+
<a class="fa fa-envelope" href="mailto:{{ site.email }}"></a>
15+
{% endif %}
16+
{% if site.linkedin_username %}
17+
<a class="fa fa-linkedin" href="https://www.linkedin.com/in/{{ site.linkedin_username }}"></a>
18+
{% endif %}
19+
</div>
20+
<div class="right">
21+
{% if site.bitcoin_url %}
22+
<a class="fa fa-bitcoin" href="{{ site.bitcoin_url }}"></a>
23+
{% endif %}
24+
{% if site.paypal_url %}
25+
<a class="fa fa-paypal" href="{{ site.paypal_url }}"></a>
26+
{% endif %}
27+
{% if site.flattr_button %}
28+
{{ site.flattr_button }}
29+
{% endif %}
30+
</div>
31+
</div>
32+
<div class="clearfix"></div>

_layouts/center.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!DOCTYPE html>
2+
<html>
3+
{% include head.html %}
4+
<body>
5+
<div class="site-wrap center">
6+
{% include header.html %}
7+
8+
<div class="post p2 p-responsive wrap" role="main">
9+
<div class="measure">
10+
{{ content }}
11+
</div>
12+
</div>
13+
</div>
14+
15+
{% include footer.html %}
16+
</body>
17+
</html>

_layouts/default.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!DOCTYPE html>
2+
<html>
3+
{% include head.html %}
4+
<body class="{% if site.animated %}animated fade-in-down{% endif %}">
5+
<div class="site-wrap">
6+
{% include header.html %}
7+
8+
<div class="post p2 p-responsive wrap" role="main">
9+
<div class="measure">
10+
{{ content }}
11+
</div>
12+
</div>
13+
</div>
14+
15+
{% include footer.html %}
16+
</body>
17+
</html>

_layouts/page.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
layout: default
3+
---
4+
<div class="post">
5+
<header class="post-header">
6+
<h1 class="h2">{{ page.title }}</h1>
7+
</header>
8+
<article class="post-content">
9+
{{ content }}
10+
</article>
11+
</div>

_layouts/post.html

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
layout: default
3+
---
4+
5+
{% assign minutes = content | number_of_words | divided_by: 180 %}
6+
{% if minutes == 0 %}
7+
{% assign minutes = 1 %}
8+
{% endif %}
9+
10+
<div class="post-header mb2">
11+
<h1>{{ page.title }}</h1>
12+
<span class="post-meta">{{ page.date | date: "%b %-d, %Y" }}</span><br>
13+
{% if page.update_date %}
14+
<span class="post-meta">Updated: {{ page.update_date | date: "%b %-d, %Y" }}</span><br>
15+
{% endif %}
16+
<span class="post-meta small">{{ minutes }} minute read</span>
17+
</div>
18+
19+
<article class="post-content">
20+
{{ content }}
21+
</article>
22+
23+
{% if site.show_post_footers %}
24+
{% include post_footer.html %}
25+
{% endif %}
26+
27+
{% if site.show_related_posts %}
28+
<h3 class="related-post-title">Related Posts</h3>
29+
{% for post in site.related_posts %}
30+
<div class="post ml2">
31+
<a href="{{ post.url | prepend: site.baseurl }}" class="post-link">
32+
<h4 class="post-title">{{ post.title }}</h4>
33+
<p class="post-summary">{{ post.summary }}</p>
34+
</a>
35+
</div>
36+
{% endfor %}
37+
{% endif %}

0 commit comments

Comments
 (0)