char VAssert_Init(void) { uint32 eax, ebx, ecx, edx; VA page_address = (VA) &vassert_state.inReplay, ph; if (!VAssert_IsInVM()) { return -1; } bzero((char*) &vassert_state, sizeof vassert_state); #ifndef __minix /* Lock the page. */ if (mlock(&vassert_state, sizeof vassert_state)) { return -1; } #endif /* vmware expects a linear address (or is simply forgetting * to adjust the given address for segments) */ if(sys_umap(SELF, D, page_address, 1, (phys_bytes *) &ph)) { printf("VAssert_Init: sys_umap failed\n"); return -1; } libvassert_process_backdoor(CMD_SET_ADDRESS, ph, MAGIC_PORT|(1<<16), &eax, &ebx, &ecx, &edx); return (eax != -1) ? 0 : -1; }
char VAssert_SetRecordingMain(char start) { uint32 eax, ebx, ecx, edx; if (!VAssert_IsInVM()) { return FALSE; } libvassert_process_backdoor(CMD_SET_RECORD, start ? 1 : 2, MAGIC_PORT, &eax, &ebx, &ecx, &edx); return (eax == 1) ? TRUE : FALSE; }
char VAssert_Uninit(void) { unsigned int eax, ebx, ecx, edx; if (!VAssert_IsInVM()) { return -1; } libvassert_process_backdoor(CMD_SET_ADDRESS, 0, MAGIC_PORT|(0<<16), &eax, &ebx, &ecx, &edx); return (eax != -1) ? 0 : 1; }
char VAssert_Init(void) { uint32 eax, ebx, ecx, edx; VA page_address = (VA) &vassert_state.inReplay; if (!VAssert_IsInVM()) { return -1; } bzero((char*) &vassert_state, sizeof vassert_state); #ifndef __minix /* Lock the page. */ if (mlock(&vassert_state, sizeof vassert_state)) { return -1; } #endif libvassert_process_backdoor(CMD_SET_ADDRESS, page_address, MAGIC_PORT|(1<<16), &eax, &ebx, &ecx, &edx); return (eax != -1) ? 0 : -1; }