This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
projects:3dprinting:flashforge_creator_3_pro_fan_fix [2025/04/27 23:59] – [Examining the main application creator3-arm] admin | projects:3dprinting:flashforge_creator_3_pro_fan_fix [2025/05/02 22:57] (current) – [Examining the main application creator3-arm] admin | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | f | ||
====== Flashforge Creator 3 Pro - fan fix ====== | ====== Flashforge Creator 3 Pro - fan fix ====== | ||
Line 57: | Line 56: | ||
===== System Software Details ===== | ===== System Software Details ===== | ||
- | The Flashforge linux based system is made with an old version of [[https:// | + | The Flashforge linux based system is made with an old version of [[https:// |
+ | <code bash> | ||
+ | Welcome to flashforge | ||
+ | buildroot login: root | ||
+ | Password: | ||
+ | Login incorrect | ||
+ | </ | ||
- | Instructions about how to get root access, can be found on the internet.((See for example:\\ [[https:// | + | With the correct password, we would get an opportunity to analyze the system. It would be easier though if we can access |
- | Please click on [[projects: | + | Either way, without a username and password we will not get access to the system. Details about getting a username and password can be found on the internet.((See for example:\\ [[https:// |
+ | Please click on [[projects: | ||
- | Once a terminal connection is made to the printer, serious reverse engineering can start. There are several great tools for reverse engineering. I highly recommend [[https:// | + | Once a terminal connection is made to the printer, |
==== Reverse engineering - I ==== | ==== Reverse engineering - I ==== | ||
Line 120: | Line 125: | ||
</ | </ | ||
- | This contains a reference to the printer application which among others handles the user interface. Interestingly there are also arguments provided, from which -qws starts a qt windowing system. The application itself then serves as a front-end, sending commands to the motion controller, to control the printers' | + | This contains a reference to the printer application which among others handles the user interface. Interestingly there are also arguments provided, from which -qws let the application use the qt windowing system. The application itself then serves as a front-end, sending commands to the motion controller, to control the printers' |
/ | / | ||
Line 220: | Line 225: | ||
* [[https:// | * [[https:// | ||
- | When inspecting | + | When inspecting creator3-arm((Version 1.4.0)) |
<code bash> | <code bash> | ||
Line 229: | Line 234: | ||
</ | </ | ||
\\ | \\ | ||
- | Then to get more information about the ELF sections, we use: | + | The ELF program headers table describes |
+ | |||
+ | readelf --program-headers creator3-arm | ||
+ | |||
+ | Which outputs the following: | ||
+ | <code bash> | ||
+ | Elf file type is EXEC (Executable file) | ||
+ | Entry point 0x28199 | ||
+ | There are 8 program headers, starting at offset 52 | ||
+ | |||
+ | Program Headers: | ||
+ | Type Offset | ||
+ | EXIDX | ||
+ | PHDR 0x000034 0x00010034 0x00010034 0x000100 0x00100 | ||
+ | INTERP | ||
+ | [Requesting program interpreter: | ||
+ | LOAD 0x000000 0x00010000 0x00010000 0x330a88 0x330a88 R E 0x10000 | ||
+ | LOAD 0x331000 0x00351000 0x00351000 0x001798 0x047dc | ||
+ | DYNAMIC | ||
+ | NOTE 0x000148 0x00010148 0x00010148 0x000044 0x00044 | ||
+ | GNU_STACK 0x000000 0x00000000 0x00000000 0x000000 0x00000 | ||
+ | |||
+ | Section to Segment mapping: | ||
+ | Segment Sections... | ||
+ | 00 .ARM.exidx | ||
+ | 01 | ||
+ | 02 .interp | ||
+ | 03 .interp .note.ABI-tag .note.gnu.build-id .hash .dynsym .dynstr | ||
+ | .gnu.version .gnu.version_r .rel.dyn .rel.plt .init .plt .text | ||
+ | .fini .rodata .ARM.extab .ARM.exidx .eh_frame | ||
+ | 04 .init_array .fini_array .jcr .dynamic .got .data .bss | ||
+ | 05 .dynamic | ||
+ | 06 .note.ABI-tag .note.gnu.build-id | ||
+ | 07 | ||
+ | </ | ||
+ | |||
+ | From the output we can see this creator3-arm has nine program headers, from which the following is probably noteworthy: | ||
+ | |||
+ | * PHDR program header, which contains the program header table and its concerning metadata. | ||
+ | * INTERP program header, which tells the kernel that the file depends on an external loader file (/ | ||
+ | * LOAD program headers, tell the kernel and the loader how to get the program' | ||
+ | * DYNAMIC program header, which is used by the loader to create links to their shared library dependencies. It is also used by the loader to fix relocations for program code and pointers, if the program resides at a different place in memory than it expects based on its virtual address. | ||
+ | * NOTE program header potentially contains vendor-specific metadata about the program itself, describing a table of key-value pairs where each entry has a string name mapped to a sequence of bytes that describe the entry. | ||
+ | * GNU_STACK program header defining memory regions where the stack is marked with a no-execute flag. With this flag code cannot be executed if it is on the stack. | ||
+ | |||
+ | The section headers, in contrast to the program headers, describe in more detail how the ELF file is divided into logical units. To get more information about the ELF sections, we use: | ||
readelf --section-headers creator3-arm | readelf --section-headers creator3-arm | ||
Line 235: | Line 285: | ||
\\ | \\ | ||
which outputs the following: | which outputs the following: | ||
- | |There are 29 section headers, starting at offset 0x332934: | + | <code bash> |
- | ^ Section Headers: | + | There are 29 section headers, starting at offset 0x332934: |
- | ^ [Nr] | + | Section Headers: |
- | | [ 0] | + | [Nr] Name Type Addr |
- | | [ 1] | + | [ 0] |
- | | ... | ... | ... | ... | ... | ... | .. | .. | . | . | . | | + | [ 1] .interp |
- | | [ 5] | + | [ 2] .note.ABI-tag |
- | | [ 6] | + | [ 3] .note.gnu.build-i NOTE 00010168 000168 000024 00 |
- | | ... | ... | ... | ... | ... | + | [ 4] .hash |
- | | [ 9] | + | [ 5] .dynsym |
- | | [10] | + | [ 6] .dynstr |
- | | ... | ... | ... | ... | ... | ... | .. | .. | . | . | . | | + | [ 7] .gnu.version |
- | | [13] | + | [ 8] .gnu.version_r |
- | | [14] | + | [ 9] .rel.dyn |
- | | [15] | + | [10] .rel.plt |
- | | ... | ... | ... | ... | + | |
- | | [24] | + | [12] .plt PROGBITS |
- | | [25] | + | [13] .text |
- | | ... | ... | ... | + | [14] .fini |
- | | [28] | + | [15] .rodata |
- | | Key to Flags:\\ W (write), A (alloc), X (execute) | + | |
+ | [17] .ARM.exidx ARM_EXIDX | ||
+ | [18] .eh_frame | ||
+ | [19] .init_array | ||
+ | [20] .fini_array | ||
+ | [21] .jcr PROGBITS | ||
+ | [22] .dynamic | ||
+ | [23] .got PROGBITS | ||
+ | [24] .data | ||
+ | [25] .bss | ||
+ | | ||
+ | [27] .ARM.attributes | ||
+ | [28] .shstrtab | ||
+ | Key to Flags: | ||
+ | | ||
+ | L (link order), O (extra OS processing required), G (group), T (TLS), | ||
+ | C (compressed), | ||
+ | y (purecode), p (processor specific) | ||
+ | </ | ||
For clarity some sections have been left out. Most of the time the following sections are interesting for reverse engineering: | For clarity some sections have been left out. Most of the time the following sections are interesting for reverse engineering: | ||
Line 278: | Line 346: | ||
+ | When looking at the program headers in the ELF file, we can see the following information: | ||
+ | |||
+ | < | ||
+ | Start of program headers: | ||
+ | Size of this header: | ||
+ | Size of program headers: | ||
+ | Number of program headers: | ||
+ | </ | ||
+ | |||
+ | Then, when looking at the all of the eight program headers, and verifying the permissions at the p-flags, only program header 3 ist executable and contains the actual program. | ||
+ | |||
+ | < | ||
+ | # program header 3 | ||
+ | 00000094: 0100 0000 0000 0000 0000 0100 0000 0100 ................ | ||
+ | 000000a4: 880a 3300 880a 3300 0500 0000 0000 0100 ..3...3......... | ||
+ | p_type: | ||
+ | p_offset: (4 bytes) 0x000000 ( 0) | ||
+ | p_vaddr: | ||
+ | p_paddr: | ||
+ | p_filesz: (4 bytes) 0x330a88 (3345032) | ||
+ | p_memsz: | ||
+ | p_flags: | ||
+ | p_align: | ||
+ | p_data: | ||
+ | </ | ||
+ | |||
+ | Interestingly this program header has a p_align of 65536 bytes, which means that at the end 1398 bytes should be available: | ||
+ | |||
+ | With a hex Editor one can observe that this area indeed is filled with 0x00: | ||
+ | From 0x330a88 to 0x330fff (3345032 - 3346431 = 1399 bytes) | ||
+ | With that it should be possible to inject Code from the M104 command (979 bytes) into this area and adapt for the M106 command. | ||
===== Flashprint Wireshark ===== | ===== Flashprint Wireshark ===== | ||
When clicking a button in Flashprint to start or stop a fan, a network command is sent to the printer, which can be captured with tcpdump and analyzed with wireshark. Interestingly, | When clicking a button in Flashprint to start or stop a fan, a network command is sent to the printer, which can be captured with tcpdump and analyzed with wireshark. Interestingly, |