NO

Author Topic: Exception in pocc.exe  (Read 38200 times)

Offline Vortex

  • Member
  • *
  • Posts: 989
    • http://www.vortex.masmcode.com
Re: Exception in pocc.exe
« Reply #30 on: January 20, 2025, 08:37:46 PM »
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...

Offline Vortex

  • Member
  • *
  • Posts: 989
    • http://www.vortex.masmcode.com
Re: Exception in pocc.exe
« Reply #31 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.
Code it... That's all...

HellOfMice

  • Guest
Re: Exception in pocc.exe
« Reply #32 on: January 21, 2025, 12:30:15 PM »
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

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2234
Re: Exception in pocc.exe
« Reply #33 on: January 21, 2025, 12:57:42 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
Code: [Select]
// test.c
//int __cdecl main(void)
void __cdecl mainCRTStartup(void)
{
//int
return;
}
Code: [Select]
; 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
« Last Edit: January 23, 2025, 08:56:21 AM by TimoVJL »
May the source be with you

Offline Vortex

  • Member
  • *
  • Posts: 989
    • http://www.vortex.masmcode.com
Re: Exception in pocc.exe
« Reply #34 on: January 21, 2025, 02:16:01 PM »
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...

Offline John Z

  • Member
  • *
  • Posts: 986
Re: Exception in pocc.exe
« Reply #35 on: January 22, 2025, 12:37:52 AM »
Thanks TimoVJL,

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

John Z
« Last Edit: January 22, 2025, 10:09:39 AM by John Z »

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2234
Re: Exception in pocc.exe
« Reply #36 on: January 22, 2025, 06:03:11 AM »
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

Offline John Z

  • Member
  • *
  • Posts: 986
Re: Exception in pocc.exe
« Reply #37 on: January 22, 2025, 10:11:09 AM »
Ah, ok I got it - Thanks !

Thought it was part of the poccx fix.

John Z

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2234
Re: Exception in pocc.exe
« Reply #38 on: January 22, 2025, 10:33:20 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

Offline Vortex

  • Member
  • *
  • Posts: 989
    • http://www.vortex.masmcode.com
Re: Exception in pocc.exe
« Reply #39 on: January 22, 2025, 01:13:11 PM »
If I am correct, Timo's pocc is acting like a proxy, a very good idea.
Code it... That's all...

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2234
Re: Exception in pocc.exe
« Reply #40 on: January 22, 2025, 01:29:41 PM »
Yes, only filters exception error 0xC0000005 off from return value from pocc.exe or poasm.exe

May the source be with you

Offline sunshine

  • Member
  • *
  • Posts: 9
Re: Exception in pocc.exe
« Reply #41 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.

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2234
Re: Exception in pocc.exe
« Reply #42 on: February 09, 2025, 03:38:49 PM »
 8)
Now those Windows 11 24H2 users can test it.
Perhaps poasm.exe needs similar patch.
May the source be with you

HellOfMice

  • Guest
Re: Exception in pocc.exe
« Reply #43 on: February 09, 2025, 06:08:15 PM »
I have read in magazines that 25h2 is worst than 24H2 :o

Offline sunshine

  • Member
  • *
  • Posts: 9
Re: Exception in pocc.exe
« Reply #44 on: February 10, 2025, 02:00:10 AM »
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.