NO

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

Offline John Z

  • Member
  • *
  • Posts: 986
Re: Exception in pocc.exe
« Reply #60 on: February 13, 2025, 04:44:06 AM »
Hi CandCPlusPlus

The downloads are from Pelles Site not Github.  Instructions for self modification are here too.

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.

Download a HEX editor - I use Hex Editor
https://mh-nexus.de/en/

then modify the two bytes.  Pelles Hex Editor might work too.
Create a copy to trial first - of course.

Instructions for poasm modifications are here too, from Master Sunshine:
Code: [Select]
For the poasm.exe v12.0.1.0, at file offset 0x4d3f4 and 0x4d41c, change 0x20 to 0x28.
Both of these are on page 3-4 of this thread...

John Z

Offline CandCPlusPlus

  • Member
  • *
  • Posts: 74
Re: Exception in pocc.exe
« Reply #61 on: February 13, 2025, 05:09:26 AM »
Hi CandCPlusPlus

The downloads are from Pelles Site not Github.  Instructions for self modification are here too.

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.

Download a HEX editor - I use Hex Editor
https://mh-nexus.de/en/

then modify the two bytes.  Pelles Hex Editor might work too.
Create a copy to trial first - of course.

Instructions for poasm modifications are here too, from Master Sunshine:
Code: [Select]
For the poasm.exe v12.0.1.0, at file offset 0x4d3f4 and 0x4d41c, change 0x20 to 0x28.
Both of these are on page 3-4 of this thread...

John Z

Thanks. I don't know how I didn't see that before.

Offline sunshine

  • Member
  • *
  • Posts: 9
Re: Exception in pocc.exe
« Reply #62 on: February 13, 2025, 11:33:44 AM »
Excuse me, I don't have the source code.

You can patch it yourself.

pocc.exe:
Code: [Select]
Hex Compare
Produced: 2025/2/13 18:14:36

Mode:  Differences
Left file: pocc.exe
Right file: pocc.patched.exe
000001D0 000001D0 00 00 00 00 40 00 00 40  2E 72 64 61 74 61 00 00  ....@..@.rdata..
------------------------------------------------------------------------------------
000001E0          50 4A 08 00 00 A0 25 00  00 4C 08 00 00 80 25 00  PJ... %..L...€%.
         000001E0 D0 4A 08 00 00 A0 25 00  00 4C 08 00 00 80 25 00  ÐJ... %..L...€%.
------------------------------------------------------------------------------------
000001F0 000001F0 00                                                .
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
0009C429 0009C429 BB CD 28 00 48 85 C9 74  05 E8 19 13 1B 00 89 D9  »Í(.H…Ét.è....‰Ù
------------------------------------------------------------------------------------
0009C439          E9 42 E7 16 00 48 83 C4  20 5B C3 0F 1F 00 66 0F  éBç..HƒÄ [Ã...f.
         0009C439 E8 42 E7 16 00 48 83 C4  20 5B C3 0F 1F 00 66 0F  èBç..HƒÄ [Ã...f.
------------------------------------------------------------------------------------
0009C449 0009C449 1F                                                .
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
0020ABE2 0020ABE2 00 50 72 DA 48 83 3D 12  9D 16 00 00 75 B0 89 D9  .PrÚHƒ=.....u°‰Ù
------------------------------------------------------------------------------------
0020ABF2          E9 59 30 00 00 48 83 C4  20 5B C3 CC CC CC 53 56  éY0..HƒÄ [ÃÌÌÌSV
         0020ABF2 E8 59 30 00 00 48 83 C4  20 5B C3 CC CC CC 53 56  èY0..HƒÄ [ÃÌÌÌSV
------------------------------------------------------------------------------------
0020AC02 0020AC02 57                                                W
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
0020C244 0020C244 C6 08 48 8D 05 03 1C 0D  00 48 39 C6 72 EE 89 D9  Æ.H......H9Ærî‰Ù
------------------------------------------------------------------------------------
0020C254          E9 27 E9 FF FF EB 16 B9  F0 FF FF FF E8 FB 19 00  é'éÿÿë.¹ðÿÿÿèû..
         0020C254 E8 27 E9 FF FF EB 16 B9  F0 FF FF FF E8 FB 19 00  è'éÿÿë.¹ðÿÿÿèû..
------------------------------------------------------------------------------------
0020C264 0020C264 00                                                .
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
0020DD75 0020DD75 0D 96 67 0B 00 FF 15 68  C6 0F 00 B9 FF 00 00 00  .–g..ÿ.hÆ..¹ÿ...
------------------------------------------------------------------------------------
0020DD85          E9 C6 FE FF FF 48 83 C4  20 5B C3 53 48 83 EC 20  éÆþÿÿHƒÄ [ÃSHƒì
         0020DD85 E8 C6 FE FF FF 48 83 C4  20 5B C3 53 48 83 EC 20  èÆþÿÿHƒÄ [ÃSHƒì
------------------------------------------------------------------------------------
0020DD95 0020DD95 48                                                H
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
002DCA50 002DCA50 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
------------------------------------------------------------------------------------
002DCA60                                                     00 00                ..
         002DCA60 73 75 62 20 72 73 70 2C  38 0A 6F 72 20 72 73 70  sub rsp,8.or rsp
         002DCA70 2C 38 0A 6D 6F 76 20 65  63 78 2C 25 30 0A 6A 6D  ,8.mov ecx,%0.jm
         002DCA80 70 20 5F 45 78 69 74 0A  00 73 75 62 20 72 73 70  p _Exit..sub rsp
         002DCA90 2C 38 0A 6F 72 20 72 73  70 2C 38 0A 6D 6F 76 20  ,8.or rsp,8.mov
         002DCAA0 65 63 78 2C 25 30 0A 6A  6D 70 20 65 78 69 74 0A  ecx,%0.jmp exit.
         002DCAB0 00 73 75 62 20 72 73 70  2C 38 0A 6F 72 20 72 73  .sub rsp,8.or rs
         002DCAC0 70 2C 38 0A 6A 6D 70 20  61 62 6F 72 74 0A 00 00  p,8.jmp abort...
------------------------------------------------------------------------------------
002DCA62 002DCAD0 00 00 00 00 00 00 00 00  00 00 00 00 00 00        ..............
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
002DCB82 002DCBF0 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
------------------------------------------------------------------------------------
002DCB92          00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
002DCBA2          00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
002DCBB2          00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
002DCBC2          00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
002DCBD2          00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
002DCBE2          00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
002DCBF2          00 00 00 00 00 00 00 00  00 00 00 00 00 00 40 B6  ..............@¶
         002DCC00                                            40 B6                @¶
------------------------------------------------------------------------------------
002DCC02 002DCC02 30 40 01 00 00 00 58 B6  30 40 01 00 00 00        0@....X¶0@....
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
002EF238 002EF238 4B 2F 2B 40 01 00 00 00  4B 2F 2B 40 01 00 00 00  K/+@....K/+@....
------------------------------------------------------------------------------------
002EF248          75 EC 2A 40 01 00 00 00  60 EC 2A 40 01 00 00 00  uì*@....`ì*@....
002EF258          4A EC 2A 40 01 00 00 00  3A EC 2A 40 01 00 00 00  Jì*@....:ì*@....
         002EF248 B1 EA 2D 40 01 00 00 00  89 EA 2D 40 01 00 00 00  ±ê-@....‰ê-@....
         002EF258 60 EA 2D 40 01 00 00 00  3A EC 2A 40 01 00 00 00  `ê-@....:ì*@....
------------------------------------------------------------------------------------
002EF268 002EF268 3A EC 2A                                          :ì*
------------------------------------------------------------------------------------

poasm.exe:
Code: [Select]
Hex Compare
Produced: 2025/2/13 18:24:33

Mode:  Differences
Left file: poasm.exe
Right file: poasm.patched.exe
00001748 00001748 03 00 00 00 E8 FF 4E 01  00 E8 7A F6 FF FF 89 D9  ....èÿN..èzöÿÿ‰Ù
------------------------------------------------------------------------------------
00001758          E9 23 C0 04 00 48 83 C4  20 5B C3 0F 1F 40 00 66  é#À..HƒÄ [Ã..@.f
         00001758 E8 23 C0 04 00 48 83 C4  20 5B C3 0F 1F 40 00 66  è#À..HƒÄ [Ã..@.f
------------------------------------------------------------------------------------
00001768 00001768 0F                                                .
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
0004D7E2 0004D7E2 00 50 72 DA 48 83 3D 32  C2 03 00 00 75 B0 89 D9  .PrÚHƒ=2Â...u°‰Ù
------------------------------------------------------------------------------------
0004D7F2          E9 89 36 00 00 48 83 C4  20 5B C3 CC CC CC 56 57  é‰6..HƒÄ [ÃÌÌÌVW
         0004D7F2 E8 89 36 00 00 48 83 C4  20 5B C3 CC CC CC 56 57  è‰6..HƒÄ [ÃÌÌÌVW
------------------------------------------------------------------------------------
0004D802 0004D802 48                                                H
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
0004F114 0004F114 C6 08 48 8D 05 4B D0 02  00 48 39 C6 72 EE 89 D9  Æ.H..KÐ..H9Ærî‰Ù
------------------------------------------------------------------------------------
0004F124          E9 57 E6 FF FF EB 16 B9  F0 FF FF FF E8 FB 20 00  éWæÿÿë.¹ðÿÿÿèû .
         0004F124 E8 57 E6 FF FF EB 16 B9  F0 FF FF FF E8 FB 20 00  èWæÿÿë.¹ðÿÿÿèû .
------------------------------------------------------------------------------------
0004F134 0004F134 00                                                .
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
00051345 00051345 0D 26 8E 02 00 FF 15 C0  C4 02 00 B9 FF 00 00 00  .&Ž..ÿ.ÀÄ..¹ÿ...
------------------------------------------------------------------------------------
00051355          E9 26 FB FF FF 48 83 C4  20 5B C3 53 56 57 41 54  é&ûÿÿHƒÄ [ÃSVWAT
         00051355 E8 26 FB FF FF 48 83 C4  20 5B C3 53 56 57 41 54  è&ûÿÿHƒÄ [ÃSVWAT
------------------------------------------------------------------------------------
00051365 00051365 48                                                H
------------------------------------------------------------------------------------

pocrt64.dll:
Code: [Select]
Hex Compare
Produced: 2025/2/13 18:26:09

Mode:  Differences
Left file: pocrt64.dll
Right file: pocrt64.patched.dll
00000870 00000870 00 B9 06 00 00 00 E8 A5  FB 02 00 B9 01 00 00 00  .¹....è¥û..¹....
------------------------------------------------------------------------------------
00000880          E9 5B F7 01 00 48 83 C4  38 41 5C 5F 5E 5B C3 CC  é[÷..HƒÄ8A\_^[ÃÌ
         00000880 E8 5B F7 01 00 48 83 C4  38 41 5C 5F 5E 5B C3 CC  è[÷..HƒÄ8A\_^[ÃÌ
------------------------------------------------------------------------------------
00000890 00000890 53                                                S
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
00001AED 00001AED 0D 1E 29 05 00 FF 15 D0  2B 06 00 B9 FF 00 00 00  ..)..ÿ.Ð+..¹ÿ...
------------------------------------------------------------------------------------
00001AFD          E9 AE 07 00 00 48 83 C4  20 5B C3 CC CC CC CC CC  é®...HƒÄ [ÃÌÌÌÌÌ
         00001AFD E8 AE 07 00 00 48 83 C4  20 5B C3 CC CC CC CC CC  è®...HƒÄ [ÃÌÌÌÌÌ
------------------------------------------------------------------------------------
00001B0D 00001B0D CC                                                Ì
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
00010410 00010410 E8 AB 45 01 00 48 C7 C0  FF FF FF FF EB 07 31 C9  è«E..HÇÀÿÿÿÿë.1É
------------------------------------------------------------------------------------
00010420          E9 8B 1E FF FF 48 81 C4  D8 00 00 00 41 5F 41 5E  é‹.ÿÿH.ÄØ...A_A^
         00010420 E8 8B 1E FF FF 48 81 C4  D8 00 00 00 41 5F 41 5E  è‹.ÿÿH.ÄØ...A_A^
------------------------------------------------------------------------------------
00010430 00010430 41                                                A
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
00019C5F 00019C5F E8 5C AD 00 00 48 C7 C0  FF FF FF FF EB 07 31 C9  è\­..HÇÀÿÿÿÿë.1É
------------------------------------------------------------------------------------
00019C6F          E9 3C 86 FE FF 48 81 C4  D8 00 00 00 41 5F 41 5E  é<†þÿH.ÄØ...A_A^
         00019C6F E8 3C 86 FE FF 48 81 C4  D8 00 00 00 41 5F 41 5E  è<†þÿH.ÄØ...A_A^
------------------------------------------------------------------------------------
00019C7F 00019C7F 41                                                A
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
0001A4C3 0001A4C3 28 B9 06 00 00 00 E8 52  5F 01 00 B9 01 00 00 00  (¹....èR_..¹....
------------------------------------------------------------------------------------
0001A4D3          E9 08 5B 00 00 48 83 C4  28 C3 CC CC CC 53 48 83  é.[..HƒÄ(ÃÌÌÌSHƒ
         0001A4D3 E8 08 5B 00 00 48 83 C4  28 C3 CC CC CC 53 48 83  è.[..HƒÄ(ÃÌÌÌSHƒ
------------------------------------------------------------------------------------
0001A4E3 0001A4E3 EC                                                ì
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
0001A523 0001A523 C9 9C 00 00 48 8D 0D 82  81 04 00 E8 7D 04 FF FF  Éœ..H..‚...è}.ÿÿ
------------------------------------------------------------------------------------
0001A533          E9 88 FF FF FF 48 83 C4  20 5B C3 CC CC 89 C8 F7  éˆÿÿÿHƒÄ [ÃÌ̉È÷
         0001A533 E8 88 FF FF FF 48 83 C4  20 5B C3 CC CC 89 C8 F7  èˆÿÿÿHƒÄ [ÃÌ̉È÷
------------------------------------------------------------------------------------
0001A543 0001A543 D8                                                Ø
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
0002005C 0002005C 00 00 75 B0 48 89 E2 31  C9 E8 16 00 00 00 89 D9  ..u°H‰â1Éè....‰Ù
------------------------------------------------------------------------------------
0002006C          E9 3F 22 FE FF 48 83 C4  20 5B C3 66 0F 1F 84 00  é?"þÿHƒÄ [Ãf..„.
         0002006C E8 3F 22 FE FF 48 83 C4  20 5B C3 66 0F 1F 84 00  è?"þÿHƒÄ [Ãf..„.
------------------------------------------------------------------------------------
0002007C 0002007C 00                                                .
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
000303DC 000303DC 00 00 75 B0 48 89 E2 31  C9 E8 16 00 00 00 89 D9  ..u°H‰â1Éè....‰Ù
------------------------------------------------------------------------------------
000303EC          E9 BF 1E FD FF 48 83 C4  20 5B C3 66 0F 1F 84 00  é¿.ýÿHƒÄ [Ãf..„.
         000303EC E8 BF 1E FD FF 48 83 C4  20 5B C3 66 0F 1F 84 00  è¿.ýÿHƒÄ [Ãf..„.
------------------------------------------------------------------------------------
000303FC 000303FC 00                                                .
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
00030572 00030572 8D 0D 38 21 03 00 E8 33  A4 FD FF B9 01 00 00 00  ..8!..è3¤ýÿ¹....
------------------------------------------------------------------------------------
00030582          E9 59 FA FE FF 48 83 C4  38 5E 5B C3 CC CC 53 48  éYúþÿHƒÄ8^[ÃÌÌSH
         00030582 E8 59 FA FE FF 48 83 C4  38 5E 5B C3 CC CC 53 48  èYúþÿHƒÄ8^[ÃÌÌSH
------------------------------------------------------------------------------------
00030592 00030592 83                                                ƒ
------------------------------------------------------------------------------------

Offline sunshine

  • Member
  • *
  • Posts: 9
Re: Exception in pocc.exe
« Reply #63 on: February 13, 2025, 11:34:40 AM »
crt64.lib:
Code: [Select]
Hex Compare
Produced: 2025/2/13 18:29:07

Mode:  Differences
Left file: crt64.lib
Right file: crt64.patched.lib
0000D37C 0000D37C 00 B9 06 00 00 00 E8 00  00 00 00 B9 01 00 00 00  .¹....è....¹....
------------------------------------------------------------------------------------
0000D38C          E9 00 00 00 00 48 83 C4  38 41 5C 5F 5E 5B C3 6E  é....HƒÄ8A\_^[Ãn
         0000D38C E8 00 00 00 00 48 83 C4  38 41 5C 5F 5E 5B C3 6E  è....HƒÄ8A\_^[Ãn
------------------------------------------------------------------------------------
0000D39C 0000D39C 00                                                .
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
0001112E 0001112E C6 08 48 8D 05 00 00 00  00 48 39 C6 72 EE 89 D9  Æ.H......H9Ærî‰Ù
------------------------------------------------------------------------------------
0001113E          E9 00 00 00 00 EB 16 B9  F0 FF FF FF E8 00 00 00  é....ë.¹ðÿÿÿè...
         0001113E E8 00 00 00 00 EB 16 B9  F0 FF FF FF E8 00 00 00  è....ë.¹ðÿÿÿè...
------------------------------------------------------------------------------------
0001114E 0001114E 00                                                .
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
00011C5E 00011C5E 0D 00 00 00 00 FF 15 00  00 00 00 B9 FF 00 00 00  .....ÿ.....¹ÿ...
------------------------------------------------------------------------------------
00011C6E          E9 00 00 00 00 48 83 C4  20 5B C3 15 00 00 00 18  é....HƒÄ [Ã.....
         00011C6E E8 00 00 00 00 48 83 C4  20 5B C3 15 00 00 00 18  è....HƒÄ [Ã.....
------------------------------------------------------------------------------------
00011C7E 00011C7E 00                                                .
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
00045F24 00045F24 C6 08 48 8D 05 00 00 00  00 48 39 C6 72 EE 89 D9  Æ.H......H9Ærî‰Ù
------------------------------------------------------------------------------------
00045F34          E9 00 00 00 00 EB 16 B9  F0 FF FF FF E8 00 00 00  é....ë.¹ðÿÿÿè...
         00045F34 E8 00 00 00 00 EB 16 B9  F0 FF FF FF E8 00 00 00  è....ë.¹ðÿÿÿè...
------------------------------------------------------------------------------------
00045F44 00045F44 00                                                .
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
0004CC58 0004CC58 C6 08 48 8D 05 00 00 00  00 48 39 C6 72 EE 89 D9  Æ.H......H9Ærî‰Ù
------------------------------------------------------------------------------------
0004CC68          E9 00 00 00 00 EB 16 B9  F0 FF FF FF E8 00 00 00  é....ë.¹ðÿÿÿè...
         0004CC68 E8 00 00 00 00 EB 16 B9  F0 FF FF FF E8 00 00 00  è....ë.¹ðÿÿÿè...
------------------------------------------------------------------------------------
0004CC78 0004CC78 00                                                .
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
0005661E 0005661E C6 08 48 8D 05 00 00 00  00 48 39 C6 72 EE 89 D9  Æ.H......H9Ærî‰Ù
------------------------------------------------------------------------------------
0005662E          E9 00 00 00 00 EB 16 B9  F0 FF FF FF E8 00 00 00  é....ë.¹ðÿÿÿè...
         0005662E E8 00 00 00 00 EB 16 B9  F0 FF FF FF E8 00 00 00  è....ë.¹ðÿÿÿè...
------------------------------------------------------------------------------------
0005663E 0005663E 00                                                .
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
000570D3 000570D3 28 B9 06 00 00 00 E8 00  00 00 00 B9 01 00 00 00  (¹....è....¹....
------------------------------------------------------------------------------------
000570E3          E9 00 00 00 00 48 83 C4  28 C3 0A 00 00 00 06 00  é....HƒÄ(Ã......
         000570E3 E8 00 00 00 00 48 83 C4  28 C3 0A 00 00 00 06 00  è....HƒÄ(Ã......
------------------------------------------------------------------------------------
000570F3 000570F3 00                                                .
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
0005732F 0005732F 0A 00 00 00 48 8D 15 00  00 00 00 E8 00 00 00 00  ....H......è....
------------------------------------------------------------------------------------
0005733F          E9 00 00 00 00 48 83 C4  20 5B C3 0B 00 00 00 0D  é....HƒÄ [Ã.....
         0005733F E8 00 00 00 00 48 83 C4  20 5B C3 0B 00 00 00 0D  è....HƒÄ [Ã.....
------------------------------------------------------------------------------------
0005734F 0005734F 00                                                .
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
0006EA76 0006EA76 00 50 72 DA 48 83 3D 00  00 00 00 00 75 B0 89 D9  .PrÚHƒ=.....u°‰Ù
------------------------------------------------------------------------------------
0006EA86          E9 00 00 00 00 48 83 C4  20 5B C3 0A 00 00 00 0D  é....HƒÄ [Ã.....
         0006EA86 E8 00 00 00 00 48 83 C4  20 5B C3 0A 00 00 00 0D  è....HƒÄ [Ã.....
------------------------------------------------------------------------------------
0006EA96 0006EA96 00                                                .
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
000AB056 000AB056 00 50 72 DA 48 83 3D 00  00 00 00 00 75 B0 89 D9  .PrÚHƒ=.....u°‰Ù
------------------------------------------------------------------------------------
000AB066          E9 00 00 00 00 48 83 C4  20 5B C3 0A 00 00 00 0D  é....HƒÄ [Ã.....
         000AB066 E8 00 00 00 00 48 83 C4  20 5B C3 0A 00 00 00 0D  è....HƒÄ [Ã.....
------------------------------------------------------------------------------------
000AB076 000AB076 00                                                .
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
000AB4B9 000AB4B9 8D 15 00 00 00 00 E8 00  00 00 00 B9 01 00 00 00  ......è....¹....
------------------------------------------------------------------------------------
000AB4C9          E9 00 00 00 00 48 83 C4  38 5E 5B C3 0E 00 00 00  é....HƒÄ8^[Ã....
         000AB4C9 E8 00 00 00 00 48 83 C4  38 5E 5B C3 0E 00 00 00  è....HƒÄ8^[Ã....
------------------------------------------------------------------------------------
000AB4D9 000AB4D9 0A                                                .
------------------------------------------------------------------------------------

crtmt64.lib:
Code: [Select]
Hex Compare
Produced: 2025/2/13 18:30:10

Mode:  Differences
Left file: crtmt64.lib
Right file: crtmt64.patched.lib
0000FE9A 0000FE9A 00 B9 06 00 00 00 E8 00  00 00 00 B9 01 00 00 00  .¹....è....¹....
------------------------------------------------------------------------------------
0000FEAA          E9 00 00 00 00 48 83 C4  38 41 5C 5F 5E 5B C3 6E  é....HƒÄ8A\_^[Ãn
         0000FEAA E8 00 00 00 00 48 83 C4  38 41 5C 5F 5E 5B C3 6E  è....HƒÄ8A\_^[Ãn
------------------------------------------------------------------------------------
0000FEBA 0000FEBA 00                                                .
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
000147AE 000147AE C6 08 48 8D 05 00 00 00  00 48 39 C6 72 EE 89 D9  Æ.H......H9Ærî‰Ù
------------------------------------------------------------------------------------
000147BE          E9 00 00 00 00 EB 22 B9  F0 FF FF FF E8 00 00 00  é....ë"¹ðÿÿÿè...
         000147BE E8 00 00 00 00 EB 22 B9  F0 FF FF FF E8 00 00 00  è....ë"¹ðÿÿÿè...
------------------------------------------------------------------------------------
000147CE 000147CE 00                                                .
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
000152FA 000152FA 0D 00 00 00 00 FF 15 00  00 00 00 B9 FF 00 00 00  .....ÿ.....¹ÿ...
------------------------------------------------------------------------------------
0001530A          E9 00 00 00 00 48 83 C4  20 5B C3 15 00 00 00 1A  é....HƒÄ [Ã.....
         0001530A E8 00 00 00 00 48 83 C4  20 5B C3 15 00 00 00 1A  è....HƒÄ [Ã.....
------------------------------------------------------------------------------------
0001531A 0001531A 00                                                .
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
0004FEB0 0004FEB0 C6 08 48 8D 05 00 00 00  00 48 39 C6 72 EE 89 D9  Æ.H......H9Ærî‰Ù
------------------------------------------------------------------------------------
0004FEC0          E9 00 00 00 00 EB 22 B9  F0 FF FF FF E8 00 00 00  é....ë"¹ðÿÿÿè...
         0004FEC0 E8 00 00 00 00 EB 22 B9  F0 FF FF FF E8 00 00 00  è....ë"¹ðÿÿÿè...
------------------------------------------------------------------------------------
0004FED0 0004FED0 00                                                .
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
00056DD8 00056DD8 C6 08 48 8D 05 00 00 00  00 48 39 C6 72 EE 89 D9  Æ.H......H9Ærî‰Ù
------------------------------------------------------------------------------------
00056DE8          E9 00 00 00 00 EB 22 B9  F0 FF FF FF E8 00 00 00  é....ë"¹ðÿÿÿè...
         00056DE8 E8 00 00 00 00 EB 22 B9  F0 FF FF FF E8 00 00 00  è....ë"¹ðÿÿÿè...
------------------------------------------------------------------------------------
00056DF8 00056DF8 00                                                .
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
000607D8 000607D8 C6 08 48 8D 05 00 00 00  00 48 39 C6 72 EE 89 D9  Æ.H......H9Ærî‰Ù
------------------------------------------------------------------------------------
000607E8          E9 00 00 00 00 EB 22 B9  F0 FF FF FF E8 00 00 00  é....ë"¹ðÿÿÿè...
         000607E8 E8 00 00 00 00 EB 22 B9  F0 FF FF FF E8 00 00 00  è....ë"¹ðÿÿÿè...
------------------------------------------------------------------------------------
000607F8 000607F8 00                                                .
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
000612C3 000612C3 28 B9 06 00 00 00 E8 00  00 00 00 B9 01 00 00 00  (¹....è....¹....
------------------------------------------------------------------------------------
000612D3          E9 00 00 00 00 48 83 C4  28 C3 0A 00 00 00 06 00  é....HƒÄ(Ã......
         000612D3 E8 00 00 00 00 48 83 C4  28 C3 0A 00 00 00 06 00  è....HƒÄ(Ã......
------------------------------------------------------------------------------------
000612E3 000612E3 00                                                .
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
00061537 00061537 00 00 00 00 48 8D 0D 00  00 00 00 E8 00 00 00 00  ....H......è....
------------------------------------------------------------------------------------
00061547          E9 00 00 00 00 48 83 C4  20 5B C3 0B 00 00 00 0A  é....HƒÄ [Ã.....
         00061547 E8 00 00 00 00 48 83 C4  20 5B C3 0B 00 00 00 0A  è....HƒÄ [Ã.....
------------------------------------------------------------------------------------
00061557 00061557 00                                                .
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
0007C3F0 0007C3F0 00 00 75 B0 48 89 E2 31  C9 E8 16 00 00 00 89 D9  ..u°H‰â1Éè....‰Ù
------------------------------------------------------------------------------------
0007C400          E9 00 00 00 00 48 83 C4  20 5B C3 66 0F 1F 84 00  é....HƒÄ [Ãf..„.
         0007C400 E8 00 00 00 00 48 83 C4  20 5B C3 66 0F 1F 84 00  è....HƒÄ [Ãf..„.
------------------------------------------------------------------------------------
0007C410 0007C410 00                                                .
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
000C1804 000C1804 00 00 75 B0 48 89 E2 31  C9 E8 16 00 00 00 89 D9  ..u°H‰â1Éè....‰Ù
------------------------------------------------------------------------------------
000C1814          E9 00 00 00 00 48 83 C4  20 5B C3 66 0F 1F 84 00  é....HƒÄ [Ãf..„.
         000C1814 E8 00 00 00 00 48 83 C4  20 5B C3 66 0F 1F 84 00  è....HƒÄ [Ãf..„.
------------------------------------------------------------------------------------
000C1824 000C1824 00                                                .
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
000C1E0E 000C1E0E 8D 0D 00 00 00 00 E8 00  00 00 00 B9 01 00 00 00  ......è....¹....
------------------------------------------------------------------------------------
000C1E1E          E9 00 00 00 00 48 83 C4  38 5E 5B C3 0E 00 00 00  é....HƒÄ8^[Ã....
         000C1E1E E8 00 00 00 00 48 83 C4  38 5E 5B C3 0E 00 00 00  è....HƒÄ8^[Ã....
------------------------------------------------------------------------------------
000C1E2E 000C1E2E 0C                                                .
------------------------------------------------------------------------------------

pocrt64.lib:
Code: [Select]
Hex Compare
Produced: 2025/2/13 18:31:15

Mode:  Differences
Left file: pocrt64.lib
Right file: pocrt64.patched.lib
0002DA9E 0002DA9E C6 08 48 8D 05 00 00 00  00 48 39 C6 72 EE 89 D9  Æ.H......H9Ærî‰Ù
------------------------------------------------------------------------------------
0002DAAE          E9 00 00 00 00 EB 0A B9  F0 FF FF FF E8 00 00 00  é....ë.¹ðÿÿÿè...
         0002DAAE E8 00 00 00 00 EB 0A B9  F0 FF FF FF E8 00 00 00  è....ë.¹ðÿÿÿè...
------------------------------------------------------------------------------------
0002DABE 0002DABE 00                                                .
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
0002F0D2 0002F0D2 C6 08 48 8D 05 00 00 00  00 48 39 C6 72 EE 89 D9  Æ.H......H9Ærî‰Ù
------------------------------------------------------------------------------------
0002F0E2          E9 00 00 00 00 EB 0A B9  F0 FF FF FF E8 00 00 00  é....ë.¹ðÿÿÿè...
         0002F0E2 E8 00 00 00 00 EB 0A B9  F0 FF FF FF E8 00 00 00  è....ë.¹ðÿÿÿè...
------------------------------------------------------------------------------------
0002F0F2 0002F0F2 00                                                .
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
0002F76C 0002F76C C6 08 48 8D 05 00 00 00  00 48 39 C6 72 EE 89 D9  Æ.H......H9Ærî‰Ù
------------------------------------------------------------------------------------
0002F77C          E9 00 00 00 00 EB 0A B9  F0 FF FF FF E8 00 00 00  é....ë.¹ðÿÿÿè...
         0002F77C E8 00 00 00 00 EB 0A B9  F0 FF FF FF E8 00 00 00  è....ë.¹ðÿÿÿè...
------------------------------------------------------------------------------------
0002F78C 0002F78C 00                                                .
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
0002FE72 0002FE72 C6 08 48 8D 05 00 00 00  00 48 39 C6 72 EE 89 D9  Æ.H......H9Ærî‰Ù
------------------------------------------------------------------------------------
0002FE82          E9 00 00 00 00 EB 0A B9  F0 FF FF FF E8 00 00 00  é....ë.¹ðÿÿÿè...
         0002FE82 E8 00 00 00 00 EB 0A B9  F0 FF FF FF E8 00 00 00  è....ë.¹ðÿÿÿè...
------------------------------------------------------------------------------------
0002FE92 0002FE92 00                                                .
------------------------------------------------------------------------------------

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2234
Re: Exception in pocc.exe
« Reply #64 on: February 13, 2025, 12:40:31 PM »
We need programs to test, where bug exists

Perhaps checking a crt64.lib for function name.
_assert.obj ?
__crt_assert:
Code: [Select]
  [0000000000000148] E900000000                   jmp               exit
  [000000000000014D] 4883C438                     add               rsp,38
  [0000000000000151] 415C                         pop               r12
  [0000000000000153] 5F                           pop               rdi
  [0000000000000154] 5E                           pop               rsi
  [0000000000000155] 5B                           pop               rbx
  [0000000000000156] C3                           ret               

this crash in Windows 7
Code: [Select]
#include <assert.h>

int main(void)
{
    int x = 7;
    assert (x==5);
    return 0;
}
Code: [Select]
CRT: unhandled exception (main) -- terminating
« Last Edit: February 13, 2025, 06:23:58 PM by TimoVJL »
May the source be with you

Offline John Z

  • Member
  • *
  • Posts: 986
Re: Exception in pocc.exe
« Reply #65 on: February 14, 2025, 11:17:11 PM »
Hi Master Sunshine,
You wrote -
You can patch it yourself.

I did patch pocc and poide as your instructions were concise and clear.  I'm afraid these other ones (crt64,crtmt64,pocrt64) are not so clear that I can do it.  Showing binary file comparisons in this manner they are hard (at least for me) to spot the differences, I have no confidence that I could successfully patch the files using those.  A patch mistake would be far worse than the issue I fear.

We all appreciate your efforts to patch these to improve the outcomes. Thank you very much.

John Z

Offline sunshine

  • Member
  • *
  • Posts: 9
Re: Exception in pocc.exe
« Reply #66 on: February 15, 2025, 09:46:33 AM »
Hi Sunshine,

Oh the patch is working I'm sure and in any case I'm on WIN 23H2 which does not show the issue.
I was just trying the patch to see if it affected a 64 bit build that causes the aforementioned error.

Most 64 bit program compile nicely, but a few run into the Access violation error.  In some cases rearranging the code can remove the access violation but it is hit and miss.  The 32 bit build of the same code never has an issue.

John Z

Hi John,

According to my recent research, pocc has a special optimization for functions such as exit, _Exit, and abort. It uses the JMP instruction to replace the CALL instruction, but does not align the function stack frame. This problem affects the toolchain and runtime library. I patched several tools that did not work properly and patched all the places that seemed to have problems in the runtime library. Of course, only the 64-bit version needs to be patched. Especially, I patched pocc, let it emit some instructions to align the stack pointer before jump to functions like exit, _Exit and abort. So the user code can call these functions without an access violation. You may find my latest patched version on the GitHub. https://github.com/fengyoulin/pellesc

After all, I don't have the source code. I can only make small patches based on these binaries. This may not completely solve the problem, or may introduce new problems. I'm doing all this just in the hope that the tool will be usable until Pelle releases his next version.

Good luck to Pelle. Good luck to us.

https://github.com/fengyoulin/pellesc/blob/main/patcher12/main.c

This is the patcher for several tools and libs that are obviously problematic, you can build it use your PellesC. Some other tools also contain problematic code, but may not necessarily need to be patched. The problem is caused by the stack pointer not being aligned. In some tools, the problem code may not be executed, or two adjacent misaligned function stack frames in the call chain may cause the stack pointer to be realigned. How magical!

On my computer, I patched all the tools that contained the problematic code, I never encountered *** Error code: -1073741819 *** in the past few days.

Offline Vortex

  • Member
  • *
  • Posts: 989
    • http://www.vortex.masmcode.com
Re: Exception in pocc.exe
« Reply #67 on: February 15, 2025, 11:33:58 AM »
Hi sunshine,

Thanks, could you provide the list of the patched Pelles tools?
Code it... That's all...

HellOfMice

  • Guest
Re: Exception in pocc.exe
« Reply #68 on: February 15, 2025, 11:56:09 AM »

I'm very happy that SunShine registered on the forum. Without him, no one would have realized that for 12 versions the Pelle Orinius tools were buggy. I use the assembler and debugger every day and I don't see where the problems are. I drew a circle with all the vertices of an octogon, I know I don't have very good eyesight, but what I drew is not a square or a diamond.
I don't understand what you're doing SunShine, it's good of you to want to make sure that the tools work correctly, even if there is an old fart who is complaining, you should ignore him.
« Last Edit: February 15, 2025, 12:26:18 PM by HellOfMice »

Offline John Z

  • Member
  • *
  • Posts: 986
Re: Exception in pocc.exe
« Reply #69 on: February 15, 2025, 09:02:35 PM »
Master Sunshine,


https://github.com/fengyoulin/pellesc/blob/main/patcher12/main.c

This is the patcher for several tools and libs that are obviously problematic, you can build it use your PellesC. Some other tools also contain problematic code, but may not necessarily need to be patched. The problem is caused by the stack pointer not being aligned. In some tools, the problem code may not be executed, or two adjacent misaligned function stack frames in the call chain may cause the stack pointer to be realigned. How magical!

On my computer, I patched all the tools that contained the problematic code, I never encountered *** Error code: -1073741819 *** in the past few days.

Thank you very much - this is extremely helpful!  Excellent help for us not so inclined to assembly and patching thusly.   Once I patch all, I'll try the code I know always fails when compiling for 64bit, hopefully the patches are involved. :)

Vortex - the list from the Pelle C patch program is
"poasm.exe"
"pocc.exe"
"pocrt64.dll"
"poedit.exe"
"crt64.lib"
"crtmt64.lib"
"pocrt64.lib"

HellOfMice - Let's not forget Micro$oft also, which until WIN 24H2 was insensitive to the method and alignments used in Pelle C .....

John Z

I also want to point out that it is the Pelles Tools that have the issue, not the code the tools produce.
AFAIK nothing that was built successfully has had any issue under WIN24H2


« Last Edit: February 15, 2025, 10:21:35 PM by John Z »

Offline Robert

  • Member
  • *
  • Posts: 249
Re: Exception in pocc.exe
« Reply #70 on: February 16, 2025, 12:00:22 AM »

https://github.com/fengyoulin/pellesc/blob/main/patcher12/main.c

This is the patcher for several tools and libs that are obviously problematic, you can build it use your PellesC. Some other tools also contain problematic code, but may not necessarily need to be patched. The problem is caused by the stack pointer not being aligned. In some tools, the problem code may not be executed, or two adjacent misaligned function stack frames in the call chain may cause the stack pointer to be realigned. How magical!

On my computer, I patched all the tools that contained the problematic code, I never encountered *** Error code: -1073741819 *** in the past few days.

Hi Sunshine:

Thank you for this. I compiled and ran the patch and now I can compile from Pelles C IDE. Like you, I get no more *** Error code: -1073741819 ***.

Good job !

Offline MrBcx

  • Global Moderator
  • Member
  • *****
  • Posts: 199
    • Bcx Basic to C/C++ Translator
Re: Exception in pocc.exe
« Reply #71 on: February 16, 2025, 12:20:16 AM »

According to my recent research, pocc has a special optimization for functions such as exit, _Exit, and abort. It uses the JMP instruction to replace the CALL instruction, but does not align the function stack frame.

This problem affects the toolchain and runtime library.

I patched several tools that did not work properly and patched all the places that seemed to have problems in the runtime library.

Of course, only the 64-bit version needs to be patched. Especially, I patched pocc, let it emit some instructions to align the stack pointer before jump to functions like exit, _Exit and abort. So the user code can call these functions without an access violation. You may find my latest patched version on the GitHub. https://github.com/fengyoulin/pellesc

After all, I don't have the source code. I can only make small patches based on these binaries. This may not completely solve the problem, or may introduce new problems. I'm doing all this just in the hope that the tool will be usable until Pelle releases his next version.

Good luck to Pelle. Good luck to us.

Hi Sunshine,

Thank you for your efforts fixing the Pelles C toolchain and libs.  I overwrote my V12 files with your patched files and confirm that the
*** Error code: -1073741819 ***  that I experienced in the Pelles IDE has vanished and numerous projects compiled using your patches
compile and execute normally on Windows 11 Pro 24H2.  It seems like things generally compile faster now too but I might be imaging things.

I don't know that we'll ever hear from Pelle Orinius, let alone see a new version of Pelles C released - I hope I'm wrong.
But you could not have come along at a better time for those of us that enjoy using Pelles C. 

Thank you very much ... I look forward to reading your posts.


Bcx Basic to C/C++ Translator
https://www.BcxBasicCoders.com

Offline John Z

  • Member
  • *
  • Posts: 986
Re: Exception in pocc.exe
« Reply #72 on: February 16, 2025, 01:07:24 AM »
Hi All,

Attached patch project zip, and output results for anyone interested.
This is Master Sunshine's work, I just packaged the program using Pelles ZIP. Included is a screen capture of the output results.

Still testing, although it fixes the major problem (*** Error code: -1073741819 ***) as others report, unfortunately it does not seem to eliminate the mysterious and intermittent
Code: [Select]

Fatal error: Internal error: 'Access violation' at 0x00007ff6251c3e99.
that some programs give when trying to compile as 64 bit, yet have no issue as 32 bit.

An amazing piece of work by Master Sunshine!! 

John Z


 
« Last Edit: February 16, 2025, 11:34:49 PM by John Z »

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2234
Re: Exception in pocc.exe
« Reply #73 on: February 16, 2025, 11:58:29 AM »
Code: [Select]
Fatal error: Internal error: 'Access violation' at 0x00007ff6251c3e99.are often an optimizer problem and possible to avoid by changing code,
like in miniz code ?


patch_poc64 is just sunshine's code compiled with Pelles C and using just OS msvcrt.dll and fprintf() to stderr changed to using printf()
Just for fun to avoid Pelles C crt64.lib
« Last Edit: February 16, 2025, 12:26:16 PM by TimoVJL »
May the source be with you

Online alderman2

  • Member
  • *
  • Posts: 80
    • Xmag
Re: Exception in pocc.exe
« Reply #74 on: February 16, 2025, 04:13:38 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.
It works but it goes slower.
Tested now again. Now go it faster than when I previously tested. Think it goes faster than original when it worked!