Merge pull request #212 from hillu/c-api-content-size

api/c: Add explict size fields for extracted content fields
This commit is contained in:
Romain 2018-09-13 14:47:49 +02:00 committed by GitHub
commit c4524ea6f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 0 deletions

View File

@ -44,6 +44,7 @@ void init_c_segments(Macho_Binary_t* c_binary, Binary* binary) {
c_binary->segments[i]->numberof_sections = segment.numberof_sections();
c_binary->segments[i]->flags = segment.flags();
c_binary->segments[i]->content = content;
c_binary->segments[i]->size = segment_content.size();
c_binary->segments[i]->sections = nullptr; //TODO
}

View File

@ -43,6 +43,7 @@ void init_c_sections(Pe_Binary_t* c_binary, Binary* binary) {
c_binary->sections[i]->pointerto_line_numbers = b_section.pointerto_line_numbers();
c_binary->sections[i]->characteristics = b_section.characteristics();
c_binary->sections[i]->content = content;
c_binary->sections[i]->content_size = section_content.size();
c_binary->sections[i]->entropy = b_section.entropy();
}
c_binary->sections[sections.size()] = nullptr;

View File

@ -41,6 +41,7 @@ struct Macho_Segment_t {
uint32_t numberof_sections;
uint32_t flags;
uint8_t* content;
uint64_t size;
Macho_Section_t** sections;
};

View File

@ -43,6 +43,7 @@ struct Pe_Section_t {
uint32_t characteristics;
uint8_t* content;
uint64_t content_size;
double entropy;
};