Skip to content

Unable to load multiple dll images #101

@posutsai

Description

@posutsai

Hi, I am trying to use loadlibrary to load a dll image which uses windows Component Object Model internally but some error happens. Seems like loadlibrary links multiple PE image incorrectly.

Since the function in my target PE image utilize COM, it is insufficient to load single PE image. Following is how I try to load both my target PE image and COM related symbols from ole32.dll.

int main() {
  struct pe_image images[2] = {
    {.entry = NULL, .name = "/path/to/my/taget.dll", },
    {.entry = NULL, .name = "ole32.dll"}
  };
  for (int i = 0; i < 2; i++) {
    pe_load_library(images[i].name, &images[i].image, &images[0].size);
  }
  link_pe_images(images, 2); // <- SegFault happens here.
}

I wonder if I link the images wrong. If so, how should I link multiple images?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions