summaryrefslogtreecommitdiff
path: root/reverse-engineering/work/notes.txt
diff options
context:
space:
mode:
Diffstat (limited to 'reverse-engineering/work/notes.txt')
-rw-r--r--reverse-engineering/work/notes.txt121
1 files changed, 121 insertions, 0 deletions
diff --git a/reverse-engineering/work/notes.txt b/reverse-engineering/work/notes.txt
new file mode 100644
index 0000000..825c889
--- /dev/null
+++ b/reverse-engineering/work/notes.txt
@@ -0,0 +1,121 @@
+// Interrupts
+http://spike.scu.edu.au/~barry/interrupts.html#ah25
+
+// IO ports
+http://wiki.osdev.org/I/O_Ports
+http://bochs.sourceforge.net/techspec/PORTS.LST
+
+// General Memory Map
+http://webpages.charter.net/danrollins/techhelp/0094.HTM
+
+// Dosbox debug code
+http://code.google.com/p/dosbox-wii/source/browse/trunk/src/debug/debug.cpp?spec=svn115&r=115
+
+HELP
+F5 : Continue
+F9 : Toggle BP
+F10 : Step over
+F11 : Step into
+
+MEMDUMPBIN 0000:0000 FFFFFF
+BPLIST
+IV [seg]:[off] [name] - Create var name for memory address.
+SV [filename]
+LV [filename]
+
+0208:10D9 video_update() {
+
+0208:1108 } (bp here!)
+
+0208:0EC8 mainloop_skip1
+
+
+
+Tentative à 0EC8 :
+SR IP 0ECB Jump to :0ECB code adress (current seg)
+Le lemming a bougé quand même
+
+Tentative à 0ED7 :
+SR IP 0EDA
+Le lemming a bougé quand même
+
+Tentative à 0EDA :
+SR IP 0EE8
+Le lemming a bougé quand même
+
+
+Tentative à 0EEC :
+SR IP 0F0A
+Le lemming a bougé quand même
+
+Tentative à 0F0A
+SR IP 0F17
+Le lemming a changé de sprite mais ne s'est pas déplacé !
+
+
+Tentative d'injection de nop pour trouver la procedure qui fait bouger les lemmings
+
+SM 0274:0EEC 90 90 90
+
+Les lemmings se multiplient (tout est dessiné, les sprites se MAJ mais on voit un effet ghost)
+
+// Restauration du call
+SM 0274:0EEC E8 BF 66
+
+
+SM 0208:0EEF 90 90 90
+SM 0208:0EEF E8 BD 5E
+
+
+OK, la fonction qui update les lemmings va de 0208:182F à 0208:26F8
+
+Extraction du code bourine :
+echo -n "MZ" > move_lemmings.com
+dd if=MEMDUMP.BIN bs=1 skip=$(h2d 0X38AF) count=3785 seek=256 of=move_lemmings.com
+
+Décompileur vers du C n'aime pas trop ca... bon, faudrait faire mieux.
+
+Remarque, il y a bcp d'accès a une structure (celle d'un lemming probablement) à divers endroits du code, ce grep le montre :
+
+!grep 'si+0x12' -A3 -B3 seg_code_0208.txt
+
+
+La structure de donnée du tout premier lemming se situe en 0B55:0085 (ds:si)
+La structure du second commence 0x2d octets plus loin
+
+struct lemm_data {
+/* +0x00 */ uint16 x; /* L'origine est a gauche */
+/* +0x02 */ uint16 y; /* L'origine est en haut */
+/* +0x04 */ uint8 unk1, unk2;
+/* +0x06 */ uint8 lemmtype;
+//...
+/* +0x2c */ uint8 lastbyte;
+}
+
+
+enum lemmtype { WALKER=0xF6, CLIMBER=0XF4, ... }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+