Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with mingw32-compiled PE32 #47

Open
rjzak opened this issue Nov 22, 2019 · 0 comments
Open

Issues with mingw32-compiled PE32 #47

rjzak opened this issue Nov 22, 2019 · 0 comments

Comments

@rjzak
Copy link

rjzak commented Nov 22, 2019

I wrote a simple test app:

#include<stdio.h>
#include<stdlib.h>
int main(int argc, char* argv[]) {
    printf("Test! Hello World!\n");
    return EXIT_SUCCESS;
}

It compiles cleanly on mingw32 and Visual Studio. The VS version runs without issue in binee, but the mingw32 version has some issues reporting state, but seems to run anyway:

[1] 0x217625d0: F GetSystemTimeAsFileTime(lpSystemTimeAsFileTime = 0xb7feffc4) = 0xb7feffc4
[1] 0x21769350: P GetCurrentProcessId() = 0xb7feffc4
[1] 0x201233b0: P GetCurrentProcessId() = 0xb7feffc4
[1] 0x2175bc80: P GetCurrentThreadId() = 0x1001
[1] 0x21768950: F GetTickCount() = 0x5dd80d68
[1] 0x21760d70: F QueryPerformanceCounter(lpPerformanceCount = 0xb7feffcc) = 0x1
[1] 0x214094c0: F _initterm(PVPV = 0x40700c, PVPV = 0x407018) = 0x0
[1] 0x214094c0: F _initterm(PVPV = 0x407000, PVPV = 0x407008) = 0x1
[1] 0x217658d0: F SetUnhandledExceptionFilter(lpTopLevelExceptionFilter = 0x401e30) = 0x4
[1] 0x213ea580: F malloc(size = 0x4) = 0xa000072e
[1] 0x21409e30: F _lock(locknum = 0x8) = 0x0
[1] 0x213f9dd0: P __dllonexit(func = 0x401520, pbegin = 0xb7fefec8, pend = 0xb7fefecc) = 0x401520
[1] 0x21409e30: F _lock(locknum = 0x8) = 0xb7fefe98
[1] 0x213ea100: F _msize(memblock = 0x0) = 0x0
[1] 0x213ea670: F realloc(memblock = 0x0, size = 0x0) = 0x0
[1] 0x213ea670: F realloc(memblock = 0x0, size = 0x10) = 0x0
[1] 0x21409fe0: F _unlock(locknum = 0x8) = 0x0
[1] 0x21409fe0: F _unlock(locknum = 0x8) = 0x0
[1] 0x21409e30: F _lock(locknum = 0x8) = 0x0
[1] 0x213f9dd0: P __dllonexit(func = 0x401640, pbegin = 0xb7fefee8, pend = 0xb7fefeec) = 0x401640
[1] 0x21409e30: F _lock(locknum = 0x8) = 0xb7fefeb8
[1] 0x213ea100: F _msize(memblock = 0x0) = 0x0
[1] 0x213ea670: F realloc(memblock = 0x0, size = 0x0) = 0x0
[1] 0x213ea670: F realloc(memblock = 0x0, size = 0x10) = 0x0
[1] 0x21409fe0: F _unlock(locknum = 0x8) = 0x0
[1] 0x21409fe0: F _unlock(locknum = 0x8) = 0x0
[1] 0x2141d0e0:  **puts**() = 0x1
[1] 0x21416700:  **_fileno**() = 0xb7feff08
[1] 0x21409e30: F _lock(locknum = 0x11) = 0x11
[1] 0x21416700:  **_fileno**() = 0x21457620
[1] 0x213edbe0:  **_isatty**() = 0x1
[1] 0x213d91a0:  **_errno**() = 0x1
[1] 0x200f7330: P GetLastError() = 0x1
[1] 0x20117760: F FlsGetValue(dwFlsIndex = 0xffffffff) = 0x0
[1] 0x200ead70: F GetModuleHandleW(lpModuleName = '') = 0x400000
[1] 0x2012b0d0: F GetVersionExW(lpVersionInformation = 0xb7fefd1c) = 0x12
[1] 0x20130900: F HeapCreate(flOptions = 0x0, dwInitialSize = 0x1000, dwMaximumSize = 0x0) = 0x123456
[1] 0x201b8ac7: F EncodePointer(Ptr = 0x0) = 0x0
[1] 0x213d2840: P _CrtSetDbgBlockType() = 0x0
[1] 0x201b8ac7: F EncodePointer(Ptr = 0x213dd670) = 0x213dd670
[1] 0x20125840: F InitializeCriticalSectionEx(lpCriticalSection = 0x214571cc, dwSpinCount = 0xfa0, Flags = 0x4000000) = 0x1
[1] 0x20125840: F InitializeCriticalSectionEx(lpCriticalSection = 0x21457204, dwSpinCount = 0xfa0, Flags = 0x4000000) = 0x1
[1] 0x20125840: F InitializeCriticalSectionEx(lpCriticalSection = 0x2145723c, dwSpinCount = 0xfa0, Flags = 0x4000000) = 0x1
[1] 0x20125840: F InitializeCriticalSectionEx(lpCriticalSection = 0x21457274, dwSpinCount = 0xfa0, Flags = 0x4000000) = 0x1
[1] 0x20125840: F InitializeCriticalSectionEx(lpCriticalSection = 0x214572ac, dwSpinCount = 0xfa0, Flags = 0x4000000) = 0x1
[1] 0x20125840: F InitializeCriticalSectionEx(lpCriticalSection = 0x214572e4, dwSpinCount = 0xfa0, Flags = 0x4000000) = 0x1
[1] 0x20125840: F InitializeCriticalSectionEx(lpCriticalSection = 0x2145731c, dwSpinCount = 0xfa0, Flags = 0x4000000) = 0x1
[1] 0x20125840: F InitializeCriticalSectionEx(lpCriticalSection = 0x21457354, dwSpinCount = 0xfa0, Flags = 0x4000000) = 0x1
[1] 0x20125840: F InitializeCriticalSectionEx(lpCriticalSection = 0x2145738c, dwSpinCount = 0xfa0, Flags = 0x4000000) = 0x1
[1] 0x20125840: F InitializeCriticalSectionEx(lpCriticalSection = 0x214573c4, dwSpinCount = 0xfa0, Flags = 0x4000000) = 0x1
[1] 0x20125840: F InitializeCriticalSectionEx(lpCriticalSection = 0x214573fc, dwSpinCount = 0xfa0, Flags = 0x4000000) = 0x1
[1] 0x20125840: F InitializeCriticalSectionEx(lpCriticalSection = 0x21457434, dwSpinCount = 0xfa0, Flags = 0x4000000) = 0x1
[1] 0x20125840: F InitializeCriticalSectionEx(lpCriticalSection = 0x2145746c, dwSpinCount = 0xfa0, Flags = 0x4000000) = 0x1
[1] 0x20125840: F InitializeCriticalSectionEx(lpCriticalSection = 0x214574a4, dwSpinCount = 0xfa0, Flags = 0x4000000) = 0x1
[1] 0x20132470: F FlsAlloc(lpCallback = 0x21409760) = 0x0
[1] 0x201bbb73: F HeapAlloc(hHeap = 0x123456, dwFlags = 0x8, dwBytes = 0x214) = 0xa0000742
[1] 0x20116d90: F FlsSetValue(dwFlsIndex = 0x0, lpFlsData = 0xa0000742) = 0x1
[1] 0x21409e30: F _lock(locknum = 0xd) = 0x201b865d
[1] 0x21409fe0: F _unlock(locknum = 0xd) = 0x214581c0
[1] 0x21409e30: F _lock(locknum = 0xc) = 0x214581c0
[1] 0x21409fe0: F _unlock(locknum = 0xc) = 0x2145793c
[1] 0x200ead70: F GetModuleHandleW(lpModuleName = '') = 0x400000
[1] 0x201bbb73: F HeapAlloc(hHeap = 0x123456, dwFlags = 0x8, dwBytes = 0x214) = 0xa0000966
[1] 0x20116d90: F FlsSetValue(dwFlsIndex = 0x0, lpFlsData = 0xa0000966) = 0x1
[1] 0x21409e30: F _lock(locknum = 0xd) = 0x201b865d
[1] 0x21409fe0: F _unlock(locknum = 0xd) = 0x214581c0
[1] 0x21409e30: F _lock(locknum = 0xc) = 0x214581c0
[1] 0x21409fe0: F _unlock(locknum = 0xc) = 0x2145793c
[1] 0x201bf791: F SetLastError(dwErrCode = 0x0) = 0x2145793c
[1] 0x213fb4b0:  **_invalid_parameter**() = 0x0
[1] 0x20121d90: F OutputDebugStringA(lpOutputString = 'Invalid parameter passed to C runtime function.\n') = 0xb7fefec0
[1] 0x21416740:  **_flsbuf**() = 0x54
[1] 0x21416700:  **_fileno**() = 0x54
[1] 0x213edbe0:  **_isatty**() = 0x1
[1] 0x213d91a0:  **_errno**() = 0x1
[1] 0x200f7330: P GetLastError() = 0x1
[1] 0x20117760: F FlsGetValue(dwFlsIndex = 0x0) = 0xa0000966
[1] 0x201bf791: F SetLastError(dwErrCode = 0x0) = 0xa0000966
[1] 0x213fb4b0:  **_invalid_parameter**() = 0x0
[1] 0x20121d90: F OutputDebugStringA(lpOutputString = 'Invalid parameter passed to C runtime function.\n') = 0xb7fefe88
[1] 0x201bbb73: F HeapAlloc(hHeap = 0x123456, dwFlags = 0x8, dwBytes = 0x1000) = 0xa0000b8a
[1] 0x2142c190: P memcpy(dest = 0xa0000b8b, char = 0x404001, count = 0x11) = 0x11
[1] 0x21409fe0: F _unlock(locknum = 0x11) = 0x11
[1] 0x214096f0: F exit() = 0x0

I also noticed that the mingw32 version has a lot of extra sections, and is 350K vs. 9K from VS2019.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant