I have a Jwasm example using the INCBIN statement reading from .res files to setup binary resource templates. The same example reassembled with HJwasm 32-bit v2.21 is crashing. Is there an option that I miss while using the INCBIN statement?
The attached project contains the project assembled with Jwasm v2.12pre and HJwasm 2.21
I've tried using both hjwasm32 and hjwasm64(version 2.21) to build this and it's been absolutely fine.
Habran can you try your side as well ?
Hi johnsa,
The project is built on a XP 64-bit system.
Just to clarify, is it the final exe that crashes not the assembly process?
You could use RC_DATA instead.
I don't believe it's INCBIN , I've taken that out and the exe still crashes.. the problem comes from here:
invoke GetModuleHandle,NULL
008D101C 6A 00 push 0
008D101E FF 15 34 60 8D 00 call dword ptr ds:[8D6034h]
invoke DialogBoxIndirectParam,eax,ADDR Dlgbox,NULL,ADDR DlgProc,NULL
008D1024 6A 00 push 0
008D1026 68 05 10 8D 00 push 8D1005h
008D102B 6A 00 push 0
008D102D 68 00 50 8D 00 push 8D5000h
008D1032 50 push eax
008D1033 FF 15 74 60 8D 00 call dword ptr ds:[8D6074h]
invoke ExitProcess,eax
008D1039 50 push eax
008D103A FF 15 38 60 8D 00 call dword ptr ds:[8D6038h]
DlgProc PROC hWnd:HWND,uMsg:UINT,wParam:WPARAM,lParam:LPARAM
008D1040 55 push ebp
008D1041 8B EC mov ebp,esp
The pushed address and the address of DlgProc are not the same
HJWasm32 INCBIN forgot OFFSET ?
INCBIN filename [, starting offset[, max size]]
Easy to check with PEView from obj-file.
Quote from: johnsa on March 23, 2017, 08:02:56 AM
I don't believe it's INCBIN , I've taken that out and the exe still crashes.. the problem comes from here:
invoke GetModuleHandle,NULL
008D101C 6A 00 push 0
008D101E FF 15 34 60 8D 00 call dword ptr ds:[8D6034h]
invoke DialogBoxIndirectParam,eax,ADDR Dlgbox,NULL,ADDR DlgProc,NULL
008D1024 6A 00 push 0
008D1026 68 05 10 8D 00 push 8D1005h
008D102B 6A 00 push 0
008D102D 68 00 50 8D 00 push 8D5000h
008D1032 50 push eax
008D1033 FF 15 74 60 8D 00 call dword ptr ds:[8D6074h]
invoke ExitProcess,eax
008D1039 50 push eax
008D103A FF 15 38 60 8D 00 call dword ptr ds:[8D6038h]
DlgProc PROC hWnd:HWND,uMsg:UINT,wParam:WPARAM,lParam:LPARAM
008D1040 55 push ebp
008D1041 8B EC mov ebp,esp
The pushed address and the address of DlgProc are not the same
From what I have seen in WinDbg the first 64 bytes of the resource file are not skipped as expected. In JWasm they are.
Quote from: johnsa on March 23, 2017, 06:15:01 AM
I've tried using both hjwasm32 and hjwasm64(version 2.21) to build this and it's been absolutely fine.
Habran can you try your side as well ?
I suspect Habran will find everything shinning and well lubricated.
Attached a version that uses RC_DATA - plain Masm32. You can play with the useRcData switch on top.
It works fine with useRcData=1, built with JWasm, HJWasm or MASM.
It works fine with useRcData=0 and JWasm.
I suggest building it with HJWasm with useRcData=0. and an int 3 here:
mov ecx, offset Dlgbox
int 3
add ecx, 64
invoke DialogBoxIndirectParam,eax, ecx, NULL, ADDR DlgProc,NULL
Quote from: jj2007 on March 23, 2017, 07:55:10 PM
add ecx, 64
invoke DialogBoxIndirectParam,eax, ecx, NULL, ADDR DlgProc,NULL
add ecx, 64 will properly fix the INCBIN malfunction. :t
Hi,
I believe this is all fixed now.
I've created a test / beta version of this which you can grab from:
www.terraspace.co.uk/hjwasm32.zip (http://www.terraspace.co.uk/hjwasm32.zip)
Nb this is now v2.22 (it includes a LOT of other new stuff which I won't tell you about yet until we know the bugs are fixed ) :)
Quote from: aw27 on March 23, 2017, 08:20:30 PM
add ecx, 64 will properly fix the INCBIN malfunction. :t
No, that's not enough, see screenshots below: important parts are missing, see "About" at 403060.
Anyway, @johnsa: New version works like a charm :t
Quote from: jj2007 on March 23, 2017, 10:42:26 PM
No, that's not enough, see screenshots below
You are right! :t
Excellent :)
I'll close this one on my side and continue looking into the other issues. Hopefully we can get the rest resolved today and put out the 2.22 update plus details of the new features.
Hi johnsa,
The final executable was crashing because of the INCBIN issue. Thanks for the new version 2.22, it works fine. :t