Convert a string into integer.
| 85 | |
| 86 | // Convert a string into integer. |
| 87 | DWORD shellcode::str_toi(PSTR str) |
| 88 | { |
| 89 | // Init. |
| 90 | DWORD result = 0; |
| 91 | BYTE digit; |
| 92 | |
| 93 | // Convert. |
| 94 | for (; ; str += 1) { |
| 95 | digit = *str - '0'; |
| 96 | if (digit > 9) |
| 97 | break; |
| 98 | result = (10 * result) + digit; |
| 99 | }; |
| 100 | |
| 101 | // Return. |
| 102 | return result; |
| 103 | }; |
| 104 | |
| 105 | // Search for a char inside a string. |
| 106 | PCHAR shellcode::str_chr(PSTR str, CHAR chr) |
nothing calls this directly
no outgoing calls
no test coverage detected