Rev 4874 | Rev 5190 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4874 | Rev 5022 | ||
---|---|---|---|
Line 515... | Line 515... | ||
515 | else |
515 | else |
516 | return 0; |
516 | return 0; |
517 | } |
517 | } |
518 | 518 | ||
Line -... | Line 519... | ||
- | 519 | static void send_dbg_msg(void *msg) |
|
- | 520 | { |
|
- | 521 | __asm__ __volatile__( |
|
- | 522 | "int $0x40" |
|
- | 523 | ::"a"(69), |
|
- | 524 | "b"(10), |
|
- | 525 | "S"(msg)); |
|
- | 526 | }; |
|
- | 527 | ||
- | 528 | ||
519 | int link_app() |
529 | int link_app() |
520 | { |
530 | { |
521 | struct app_hdr *header = NULL; |
531 | struct app_hdr *header = NULL; |
522 | PIMAGE_IMPORT_DESCRIPTOR imp; |
532 | PIMAGE_IMPORT_DESCRIPTOR imp; |
Line 523... | Line 533... | ||
523 | 533 | ||
Line 524... | Line 534... | ||
524 | imp = (PIMAGE_IMPORT_DESCRIPTOR)header->__idata_start; |
534 | imp = (PIMAGE_IMPORT_DESCRIPTOR)header->__idata_start; |
- | 535 | ||
- | 536 | if(link_image(NULL, imp)) |
|
- | 537 | { |
|
- | 538 | ||
- | 539 | #ifdef DEBUG_INFO |
|
- | 540 | struct |
|
- | 541 | { |
|
- | 542 | void *start; |
|
- | 543 | uint32_t end; |
|
- | 544 | char name[24]; |
|
- | 545 | } dbg_msg; |
|
Line -... | Line 546... | ||
- | 546 | ||
- | 547 | module_t *mod = &libc_dll; |
|
- | 548 | ||
- | 549 | do |
|
- | 550 | { |
|
- | 551 | printf("%s %x - %x\n", |
|
- | 552 | mod->img_name, mod->start, mod->end); |
|
- | 553 | ||
- | 554 | // asm volatile("int3"); |
|
- | 555 | ||
- | 556 | dbg_msg.start = mod->start; |
|
- | 557 | dbg_msg.end = mod->end; |
|
- | 558 | strcpy(dbg_msg.name, mod->img_name); |
|
- | 559 | send_dbg_msg(&dbg_msg); |
|
- | 560 | mod = (module_t*)mod->list.next; |
|
- | 561 | }while(mod != &libc_dll); |
|
- | 562 | #endif |
|
- | 563 | ||
- | 564 | return 1; |
|
525 | 565 | }; |
|
Line 526... | Line 566... | ||
526 | return link_image(NULL, imp); |
566 | |
527 | 567 | return 0; |