Solved! My way is long but work perfectly. Compiller now maked instructions BL <My_label>
1. Look at sections on target file (systeminformation.exe).
.text 00011000-0001E000
.rdata 0001E000-0001F000
.pdata 00021000-00022000
.idata 0001F000-0001F184
.data 0001F184-00021000
2. In my Pelles C project I adder this 000.asm:
...
EXPORT _0x1DEF8; addr of FindWindow in systeminformation.exe
...
AREA .content, DATA
_0x11000: dcd 0
_0x11004: dcd 0
_0x11008: dcd 0
_0x1100C: dcd 0
_0x11010: dcd 0
...
_0x1DEF8: dcd 0
...
_0x209F8: dcd 0
_0x209FC: dcd 0
align 0x1000
dcd 0,0,0,0
3. In main.c:
#pragma comment(linker,"/BASE:0x10000")
#pragma comment(linker,"/align:0x1000")
#pragma comment(linker,"/merge:.data=.SIL.")
#pragma comment(linker,"/merge:.text=.SIL.")
#pragma comment(linker,"/merge:.pdata=.content")
#pragma comment(linker,"/noentry")
...
#define chunk_declare2(adr, func) extern void adr(void); typedef func;
...
chunk_declare2(_0x1DEF8, HWND __stdcall FindWindowW_(LPCWSTR lpClassName, LPCWSTR lpWindowName));
#define FindWindowW (*(FindWindowW_*)_0x1DEF8)
...
extern void HideTaskBar(void){
HWND hwnd=FindWindow(L"HHTaskBar",0);
if(hwnd) ShowWindow(hwnd,0);
}
...
4. Done. Sections in my project.exe: .content: 00011000-00022000, .SIL.: 00022000-00025000.
Copy section .SIL. from project.exe to systeminformation.exe (start address of sections is same!)
Look at IDA on my function HideTaskBar:
...
.SIL.:00022220 sub_22220
.SIL.:00022220 var_4 = -4
.SIL.:00022220 STR LR, [SP,#var_4]!
.SIL.:00022224 LDR R0, =aHhtaskbar
.SIL.:00022228 MOV R1, #0
.SIL.:0002222C BL FindWindowW
.SIL.:00022230 CMP R0, #0
.SIL.:00022234 BEQ locret_22240
.SIL.:00022238 MOV R1, #0
.SIL.:0002223C BL ShowWindow
.SIL.:00022240 locret_22240
.SIL.:00022240 LDR PC, [SP+4+var_4],#4
...
.text:0001DEF8 FindWindowW
.text:0001DEF8 LDR R12, =__imp_FindWindowW
.text:0001DEFC LDR PC, [R12]
.text:0001DF00 off_1DF00 DCD __imp_FindWindowW
...[color=red][/color]