Compile time string hashing.
| 56 | |
| 57 | // Compile time string hashing. |
| 58 | DWORD shellcode::hash_string(PCHAR str) |
| 59 | { |
| 60 | // Init value. |
| 61 | DWORD hash = 0; |
| 62 | |
| 63 | // Loop on the chars. |
| 64 | while (*str) |
| 65 | { |
| 66 | // Build it. |
| 67 | hash += *str++; |
| 68 | hash += hash << 10; |
| 69 | hash ^= hash >> 6; |
| 70 | }; |
| 71 | |
| 72 | // Finish. |
| 73 | hash += hash << 3; |
| 74 | hash ^= hash >> 11; |
| 75 | hash += hash << 15; |
| 76 | return hash; |
| 77 | }; |
| 78 | |
| 79 | // Copy string to a buffer. |
| 80 | VOID shellcode::str_cpy(PCHAR out, PSTR in) |
nothing calls this directly
no outgoing calls
no test coverage detected