diff --git a/dep/dbmgr b/dep/dbmgr
index 8a5126c..8fbdd4a 160000
--- a/dep/dbmgr
+++ b/dep/dbmgr
@@ -1 +1 @@
-Subproject commit 8a5126cd1a2769780bd4e05c18d553f2bcb60f56
+Subproject commit 8fbdd4aba7438c7d3eace1308476597460d0aeed
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 9d6edf4..8b20433 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -10,3 +10,6 @@ target_link_libraries(obj_extractor DatabaseManager)
file(GLOB script2txt_src "script2txt/*")
add_executable(script2txt ${script2txt_src})
+
+file(GLOB mmp_extractor_src "mmp_extractor/*")
+add_executable(mmp_extractor ${mmp_extractor_src})
diff --git a/src/mmp_extractor/mmp.cpp b/src/mmp_extractor/mmp.cpp
new file mode 100644
index 0000000..4e74e84
--- /dev/null
+++ b/src/mmp_extractor/mmp.cpp
@@ -0,0 +1,57 @@
+/*
+ * AIM mmp_extractor
+ * Copyright (C) 2015 lzwdgc
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+#include "mmp.h"
+
+#define FREAD(var) fread(&var, 1, sizeof(var), f)
+#define FREAD_N(var, n) fread(&var, 1, n, f)
+
+size_t file_size(FILE *f)
+{
+ auto old = ftell(f);
+ fseek(f, 0, SEEK_END);
+ auto sz = ftell(f);
+ fseek(f, old, SEEK_SET);
+ return sz;
+}
+
+void mmp::load(FILE *f)
+{
+ FREAD(unk1);
+ FREAD(unk2);
+ FREAD(width);
+ FREAD(height);
+ FREAD(unk3);
+ FREAD(unk4);
+ FREAD(unk5);
+ FREAD(unk6);
+ FREAD(unk7);
+ FREAD(unk8);
+
+ int n_seg = width / 64 * height / 64;
+ int sz = n_seg * sizeof(segment);
+ int fsz = file_size(f);
+ int off = fsz - sz;
+ fseek(f, off, SEEK_SET);
+
+ segments = vector(n_seg);
+ for (int i = 0; i < n_seg; i++)
+ FREAD(segments[i]);
+
+ assert(ftell(f) == fsz);
+}
\ No newline at end of file
diff --git a/src/mmp_extractor/mmp.h b/src/mmp_extractor/mmp.h
new file mode 100644
index 0000000..4650a5f
--- /dev/null
+++ b/src/mmp_extractor/mmp.h
@@ -0,0 +1,60 @@
+/*
+ * AIM mmp_extractor
+ * Copyright (C) 2015 lzwdgc
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+#include
+#include
+#include