/* Composed copied original input/controller/facing/skip-prefix routines. Synthetic supported Jimmy/menu/vtables, zero devices, no body/render/scheduler. Base40E050 is replaced by actual facing43A420 only; motion/action methods are recorded shims. This is not full original skip or gameplay execution. */ #define main unused_scalar_main #include "grappler_scalar_probe.c" #undef main typedef struct {float x,y,z,w;} Vec; static uintptr_t game[0x450/4],outer[0x190/4],menu[0x500/4]; static unsigned char menu_object[16]; static int actions,moves,stops; static LONG CALLBACK exception(EXCEPTION_POINTERS*e){fprintf(stderr,"PROBE_EXCEPTION pc=%lx relative=%lx code=%lx\n",e->ContextRecord->Eip,e->ContextRecord->Eip-(uintptr_t)mapped+0x400000,e->ExceptionRecord->ExceptionCode);fprintf(stderr,"fault=%lx eax=%lx ecx=%lx edx=%lx esi=%lx esp=%lx\n",e->ExceptionRecord->ExceptionInformation[1],e->ContextRecord->Eax,e->ContextRecord->Ecx,e->ContextRecord->Edx,e->ContextRecord->Esi,e->ContextRecord->Esp);ExitProcess(2);return EXCEPTION_CONTINUE_SEARCH;} #define OF(o) (*(float*)(object+(o))) #define GF(o) OF(0xc0+(o)) #define MODE (*(short*)(object+0x7c4)) static void fix(uint32_t a,uint32_t b){ const uint32_t targets[]={/* RELOCATIONS */}; for(;a+4<=b;a++){uint32_t v;memcpy(&v,AT(a),4);for(unsigned i=0;i0?357:3;GF(0x274)=-40;GF(0x278)=153;GF(0x27c)=-sign*11.666668f; *(void**)(object+0xa18)=menu_object;*(int*)(object+0xa3c)=-1; actions=moves=stops=0; printf("CASE order=%s skip=%d sign=%d\n",after?"retained":"fresh",skip,sign);snap("before_entry"); flatten();snap("after_entry"); ((void(TC*)(void*,void*))AT(0x475a40))(NULL,NULL); for(int i=0;i<180;i++)((void(TC*)(void*,float))AT(0x437940))(object+0xc0,1.f/60); snap("locked"); if(skip)skip_prefix(); snap("after_skip_prefix"); ((void(TC*)(void*,void*))AT(0x475a40))(NULL,object+0xc0);*AT(0x4f83e4)=0;snap("control_granted"); if(after){((void(TC*)(void*,float))AT(0x437940))(object+0xc0,1.f/60);snap("first_player");((void(TC*)(void*,float))AT(0x438a60))(object+0xc0,1.f/60);snap("first_input");} else {((void(TC*)(void*,float))AT(0x438a60))(object+0xc0,1.f/60);snap("first_input");((void(TC*)(void*,float))AT(0x437940))(object+0xc0,1.f/60);snap("first_player");} for(int i=0;i<300;i++){ if(after)((void(TC*)(void*,float))AT(0x437940))(object+0xc0,1.f/60); ((void(TC*)(void*,float))AT(0x438a60))(object+0xc0,1.f/60); if(!after)((void(TC*)(void*,float))AT(0x437940))(object+0xc0,1.f/60); }snap("after_idle"); } int main(void){ setbuf(stdout,NULL);map_source();AddVectoredExceptionHandler(1,exception); const uint32_t ranges[][2]={{0x437940,0x437c3a},{0x438a60,0x438ba2},{0x439900,0x439e33},{0x43915d,0x4395cf},{0x43a420,0x43a5cd},{0x472480,0x472570},{0x475a40,0x475a4c},{0x431518,0x431590},{0x430f1d,0x430f5c},{0x429910,0x429963}}; for(unsigned i=0;i