MCPcopy Create free account
hub / github.com/GJDuck/e9patch / entry

Function entry

examples/cfi.c:118–149  ·  view source on GitHub ↗

* Entry point. */

Source from the content-addressed store, hash-verified

116 * Entry point.
117 */
118void entry(const void *loc, const void *target, const char *_asm)
119{
120 switch (target_check((uintptr_t)target))
121 {
122 case INVALID:
123 message("%s%p%s: %s%s%s: target %s%p%s is %sINVALID%s",
124 MAGENTA, loc, OFF,
125 GREEN, _asm, OFF,
126 YELLOW, target, OFF,
127 RED, OFF);
128 if (!option_debug)
129 abort();
130 break;
131 case VALID:
132 if (!option_debug)
133 return;
134 message("%s%p%s: %s%s%s: target %s%p%s is %sVALID%s",
135 MAGENTA, loc, OFF,
136 GREEN, _asm, OFF,
137 YELLOW, target, OFF,
138 GREEN, OFF);
139 break;
140 case UNKNOWN:
141 if (!option_debug)
142 return;
143 message("%s%p%s: %s%s%s: target %s%p%s is not tracked",
144 MAGENTA, loc, OFF,
145 GREEN, _asm, OFF,
146 YELLOW, target, OFF);
147 break;
148 }
149}
150
151/*
152 * Init.

Callers

nothing calls this directly

Calls 2

target_checkFunction · 0.85
abortFunction · 0.85

Tested by

no test coverage detected