News:

Download Pelles C here: http://www.smorgasbordet.com/pellesc/

Main Menu

Exception in pocc.exe

Started by dezmand07, January 05, 2025, 10:46:08 PM

Previous topic - Next topic

Vortex

Hi Timo and Philippe,

The project was created starting from a newly created empty folder, so no any remnants from an old project. My result is strange, any other one who experienced the same issue?
Code it... That's all...

Vortex

Hello,

I recompiled Timo's code to produce a 32-bit executable. I received the same error messages, unresolved externals and invalid machine types. Strangely, the compiler emits 64-bit code while the project is set to 32-bit.
Code it... That's all...

HellOfMice

If rather exceuting a process yould simply execute with WinExec : cmd /C "C:\Program Files\PellesC\Bin\poasm.exe" -AAMD64 -Gr -Fl"Asm.lst" -Fo"Asm.obj" "Asm.asm"
I try to set my batch files in the tools menu but it is not possible

TimoVJL

#33
Quote from: Vortex on January 21, 2025, 12:02:52 PM
Hello,

I recompiled Timo's code to produce a 32-bit executable. I received the same error messages, unresolved externals and invalid machine types. Strangely, the compiler emits 64-bit code while the project is set to 32-bit.
confirm, same effect in Window 10 with ANSI or UNICODE versions.
poide Verbose build show right command line

EDIT: an error found and fixed.

Minimal test environment without headers and libs for testing before making changes to original.
Run it with RunPellesC.cmd
Test code not using includes nor libs
// test.c
//int __cdecl main(void)
void __cdecl mainCRTStartup(void)
{
//int
return;
}
; ml.exe -coff hello.asm -link -subsystem:console
.386
.model flat
option casemap:none
exit PROTO C :DWORD
printf PROTO C :PTR,:VARARG
;INCLUDELIB msvcrt
.data
msg db "Hello ASM",10,0
.code
mainCRTStartup PROC C
;invoke printf, ADDR msg
;invoke exit,0
xor eax, eax
ret
mainCRTStartup ENDP
END mainCRTStartup
May the source be with you

Vortex

Congratulations Timo, great job. I managed to build 32-bit and 64-bit console applications with the new version of your tool. Many thanks.
Code it... That's all...

John Z

#35
Thanks TimoVJL,

Can you post an example PellesC.xml file for those of us that have never used the xml feature?

John Z

TimoVJL

Quote/x Turns off the 'single instance' check. [4.00]
/xml Stores all personal settings in the specified XML-file. [5.00]
with -x -xml let running poide same time to another session and store it settings to xml-file, not in register.
This way it might be possible to run test version from USB-stick, not touching other drives nor register.
May the source be with you

John Z

Ah, ok I got it - Thanks !

Thought it was part of the poccx fix.

John Z

TimoVJL

Quote from: John Z on January 22, 2025, 10:11:09 AM
Ah, ok I got it - Thanks !

Thought it was part of the poccx fix.

John Z
it is a testbed for it!
May the source be with you

Vortex

If I am correct, Timo's pocc is acting like a proxy, a very good idea.
Code it... That's all...

TimoVJL

Yes, only filters exception error 0xC0000005 off from return value from pocc.exe or poasm.exe

May the source be with you

sunshine

I found a solution that seems to fix this problem. By patching pocc.exe to enlarge the stack frame of one of the functions on the problematic call path by 8 bytes, then the memory addresses are aligned correctly.

You can use the pocc.exe patched by me or patch it by yourself. For version 12.0.1.0, only two bytes need to be modified.

First, at file offset 0x20ae64, change 0x20 to 0x28.
Second, at file offset 0x20ae8c, change 0x20 to 0x28.

TimoVJL

 8)
Now those Windows 11 24H2 users can test it.
Perhaps poasm.exe needs similar patch.
May the source be with you

HellOfMice

I have read in magazines that 25h2 is worst than 24H2 :o

sunshine

Quote from: sunshine on February 09, 2025, 03:27:18 PM
I found a solution that seems to fix this problem. By patching pocc.exe to enlarge the stack frame of one of the functions on the problematic call path by 8 bytes, then the memory addresses are aligned correctly.

You can use the pocc.exe patched by me or patch it by yourself. For version 12.0.1.0, only two bytes need to be modified.

First, at file offset 0x20ae64, change 0x20 to 0x28.
Second, at file offset 0x20ae8c, change 0x20 to 0x28.

For the poasm.exe v12.0.1.0, at file offset 0x4d3f4 and 0x4d41c, change 0x20 to 0x28.

Or use my patched poasm.exe in attachment.

The patched pocc.exe and poasm.exe, both tested on my Windows 11 Pro 24H2.

Really hope Pelle can continue to maintain this lightweight yet powerful tool. I really don't want to install the huge bloated VS.