| 252 | } |
| 253 | |
| 254 | void DllInjectionPlugin::updateImportsWithPluginResult( PUNRESOLVED_IMPORT firstUnresImp, std::map<DWORD_PTR, ImportModuleThunk> & moduleList ) |
| 255 | { |
| 256 | std::map<DWORD_PTR, ImportModuleThunk>::iterator iterator1; |
| 257 | std::map<DWORD_PTR, ImportThunk>::iterator iterator2; |
| 258 | ImportModuleThunk * moduleThunk = 0; |
| 259 | ImportThunk * importThunk = 0; |
| 260 | ApiInfo * apiInfo = 0; |
| 261 | bool isSuspect = 0; |
| 262 | |
| 263 | iterator1 = moduleList.begin(); |
| 264 | |
| 265 | while (iterator1 != moduleList.end()) |
| 266 | { |
| 267 | moduleThunk = &(iterator1->second); |
| 268 | |
| 269 | iterator2 = moduleThunk->thunkList.begin(); |
| 270 | |
| 271 | while (iterator2 != moduleThunk->thunkList.end()) |
| 272 | { |
| 273 | importThunk = &(iterator2->second); |
| 274 | |
| 275 | if (importThunk->valid == false) |
| 276 | { |
| 277 | if (apiReader->isApiAddressValid(firstUnresImp->InvalidApiAddress)) |
| 278 | { |
| 279 | apiInfo = apiReader->getApiByVirtualAddress(firstUnresImp->InvalidApiAddress,&isSuspect); |
| 280 | |
| 281 | importThunk->suspect = isSuspect; |
| 282 | importThunk->valid = true; |
| 283 | importThunk->apiAddressVA = firstUnresImp->InvalidApiAddress; |
| 284 | importThunk->hint = (WORD)apiInfo->hint; |
| 285 | importThunk->ordinal = apiInfo->ordinal; |
| 286 | strcpy_s(importThunk->name, apiInfo->name); |
| 287 | wcscpy_s(importThunk->moduleName, apiInfo->module->getFilename()); |
| 288 | |
| 289 | if (moduleThunk->moduleName[0] == L'?') |
| 290 | { |
| 291 | wcscpy_s(moduleThunk->moduleName, _countof(importThunk->moduleName), apiInfo->module->getFilename()); |
| 292 | } |
| 293 | } |
| 294 | |
| 295 | firstUnresImp++; |
| 296 | } |
| 297 | |
| 298 | iterator2++; |
| 299 | } |
| 300 | |
| 301 | iterator1++; |
| 302 | } |
| 303 | } |
nothing calls this directly
no test coverage detected