willox / auxtools

Rust library for low-level interfacing with BYOND's virtual machine. Includes a remote debugger for the BYOND DreamMaker language.
MIT License
28 stars 32 forks source link

1616 debugging #79

Closed vvvv-vvvv closed 11 months ago

vvvv-vvvv commented 11 months ago

75 added some sigs but not for execute_instruction, so let's add it and also fix incorrect sigs for suspended_procs. Linux untested.

Fixes #78

1616 execute_instruction disasm ```asm execute_instruction: ;XREF[170,0]: 1013152e,10131545,1013154e,10131557 ; 101315d7,101315e5,10131613,101316da ; 10131b21,10131f6d,10132010,101320c4 ; 101322e5,101325a6,10132aab,10132b61 ; 10132c49,10132c60,10132e95,10133105 ; 101331bc,101331d3,101335f2,10133a19 ; 10134100,10134501,10134515,10134585 ; 1013460f,101349e4,10135066,10135197 ; 101351a8,1013525f,10135276,10135646 ; 101356fa,10135711,10135abb,10135b6f ; 10135b86,101363e2,101366ec,1013686a ; 101373c6,10137893,10137bb3,10137ed3 ; 10138494,101384d1,101384ef,10138570 ; 101385d7,101385f4,1013861e,1013863b ; 10138665,10138694,101386d5,10138d4f ; 10138efb,10138f8f,10139075,1013919e ; 101391ac,10139245,101392ca,1013936d ; 1013938d,101393bf,101395db,10139702 ; 1013987a,101398db,1013993c,1013999d ; 101399fe,10139a5e,10139abe,10139b1e ; 10139b7e,10139d14,10139d8c,10139fbe ; 1013a024,1013a0a0,1013a114,1013a190 ; 1013a200,1013a289,1013a2a7,1013a345 ; 1013a3f6,1013a50b,1013a5b2,1013a659 ; 1013a700,1013a7a7,1013a8bc,1013aeed ; 1013affa,1013b6d0,1013b9fc,1013bedb ; 1013c00e,1013c0c8,1013c127,1013c177 ; 1013c6c5,1013c9a1,1013cb99,1013cc59 ; 1013d298,1013d56f,1013dab2,1013e3c5 ; 1013e469,1013e684,1013e84e,1013e92f ; 1013e981,1013ea62,1013eba3,1013ed59 ; 1013eff8,1013f0ad,1013f190,1013f2dd ; 1013f3fc,1013f482,1013f78f,1013f836 ; 1013f87a,1014142f,101415fd,1014181c ; 10141ad6,10141c7d,10141d7f,101422ed ; 101423db,1014243a,10142482,101424ea ; 10142534,1014257a,101425d8,1014260c ; 1014267f,101426d4,10142724,10142777 ; 10142853,10142a52,10142ab1,10142ad4 ; 10142c13,10142c89,10142d04,10142d7a ; 10142df0,101430a8,10144f43,10145048 ; 101450a4,101450d4,10145122,10145333 ; 10145b61,10145bdd .text:101314f4 0fb74714 MOVZX EAX,word ptr [EDI + 0x14] .text:101314f8 8b4f10 MOV ECX,dword ptr [EDI + 0x10] .text:101314fb 8bf0 MOV ESI,EAX .text:101314fd 8b14b1 MOV EDX,dword ptr [ECX + ESI*0x4] .text:10131500 8995bcfdffff MOV dword ptr [EBP + local_254+0x10],EDX .text:10131506 81fa78010000 CMP EDX,0x178 .text:1013150c 0f87b3460100 JA LAB_10145bc5 .text:10131512 ff2495a86... JMP dword ptr [EDX*0x4 + DAT_10146ca8] ;= 5Dh ] ``` ```asm execute_instruction: ;XREF[1,0]: 0061b11c .text:00343ad5 0fb74742 MOVZX EAX,word ptr [EDI + 0x42] .text:00343ad9 8b573c MOV EDX,dword ptr [EDI + 0x3c] .text:00343adc 83e801 SUB EAX,0x1 .text:00343adf 66894742 MOV word ptr [EDI + 0x42],AX .text:00343ae3 8b3578bc6e00 MOV ESI,dword ptr [.bss:current_execution...;= ?? .text:00343ae9 0fb7c0 MOVZX EAX,AX .text:00343aec 8d14c2 LEA EDX,[EDX + EAX*0x8] .text:00343aef 8b02 MOV EAX,dword ptr [EDX] .text:00343af1 8b5204 MOV EDX,dword ptr [EDX + 0x4] .text:00343af4 8b4e30 MOV ECX,dword ptr [ESI + 0x30] .text:00343af7 8b5e34 MOV EBX,dword ptr [ESI + 0x34] .text:00343afa 894630 MOV dword ptr [ESI + 0x30],EAX .text:00343afd 895634 MOV dword ptr [ESI + 0x34],EDX .text:00343b00 890c24 MOV dword ptr [ESP],ECX .text:00343b03 895c2404 MOV dword ptr [ESP + 0x4],EBX .text:00343b07 e8349bf8ff CALL FUN_002cd640 ;undefined FUN_002cd640(undefined4 pa... .text:00343b0c 8b3d78bc6e00 MOV EDI,dword ptr [.bss:current_execution...;= ?? .text:00343b12 e94519ffff JMP LAB_0033545c ```