Code Monkey home page Code Monkey logo

crinkler's People

Contributors

askeksa avatar runestubbe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

crinkler's Issues

Wine: crash for all /COMPMODE modes other than INSTANT

Tested in Wine 7, Wine 9, 32-bit

Regardless of object inputs, Crinkler gets no further than

Linking...

Forced alignment of 1 code hunk to 1 (including entry point).

Uncompressed size of code:   192
Uncompressed size of data:    10

|-- Estimating models for code ----------------------------|

Oops! Crinkler has crashed.
Dump files written to dump0000_mini.dmp and dump0000_full.dmp

The created dmp files are 0 bytes in size.

When /COMPMODE:INSTANT is specified, Crinkler completes, producing a working executable.
releases/crinkler14/crinkler.exe works in all /COMPMODE options, producing a working executable.
releases/crinkler20/crinkler.exe without /COMPMODE:INSTANT crashes as above.

From the version history, Switched from Intel OpenMP to MSVC concurrency API. looks to be a suspect.

The DLL and LIB used are copied from Windows and MSVC; the test is a minimal asm:

extern _MessageBoxA@16
extern _ExitProcess@4

global _WinMainCRTStartup

_WinMainCRTStartup:
  push 0
  push msg
  push msg
  push 0
  call _MessageBoxA@16
  push 0
  call _ExitProcess@4

msg: db "hello win32",0

exe file icon disappeared

I used the res file to import the icon. When I use vc6 link.exe, everything is normal, but after compiling with Crinkler, the exe icon disappears, and other rc resources cannot be read.

Document msbuild's LinkToolPath property

It is possible to specify a custom linker if you are using msbuild (for example on CI) by specifying the LinkToolPath property. It works like this:

msbuild /p:LinkToolPath:crinkler.exe ...

It might also be possible to hack this into a vcxproj file but I didn't try.

Support for kkp compression reports

It would be cool if crinkler could support the kkp format we use with rekkrunchy for 64k analysis. The format basically lists the source files, the symbols and then for each byte in the original executable the symbol located there, where in the source code it came from and the how many bytes it was stored as.

More info and the viewer app can be found here

Crinkler stuck on forwarded RVA import loop.

Hi,
I'm trying to build with Crinkler, but it seems to be stuck in an RVA forwarding loop. Is there a way to disable RVA forwardig with a command line switch? And if not, could anyone to point me to the place in source code where I can disable this myself?

This is what the output looks like:

1>LINK : warning LNK: Import 'CoCreateFreeThreadedMarshaler' from 'ole32' uses forwarded RVA. Replaced by 'CoCreateFreeThreadedMarshaler' from 'api-ms-win-core-com-l1-1-0'
1>
1>LINK : warning LNK: Import 'CoCreateFreeThreadedMarshaler' from 'api-ms-win-core-com-l1-1-0' uses forwarded RVA. Replaced by 'CoCreateFreeThreadedMarshaler' from 'ole32'
1>
1>LINK : warning LNK: Import 'CoCreateFreeThreadedMarshaler' from 'ole32' uses forwarded RVA. Replaced by 'CoCreateFreeThreadedMarshaler' from 'api-ms-win-core-com-l1-1-0'
1>
1>LINK : warning LNK: Import 'CoCreateFreeThreadedMarshaler' from 'api-ms-win-core-com-l1-1-0' uses forwarded RVA. Replaced by 'CoCreateFreeThreadedMarshaler' from 'ole32'
1>
1>LINK : warning LNK: Import 'CoCreateFreeThreadedMarshaler' from 'ole32' uses forwarded RVA. Replaced by 'CoCreateFreeThreadedMarshaler' from 'api-ms-win-core-com-l1-1-0'
1>
1>LINK : warning LNK: Import 'CoCreateFreeThreadedMarshaler' from 'api-ms-win-core-com-l1-1-0' uses forwarded RVA. Replaced by 'CoCreateFreeThreadedMarshaler' from 'ole32'
1>

and it just goes on forever like this in an endless loop

First it couldn't find the api-ms-win-core-com-l1-1-0.dll, but I copied it over from SysWOW64 and then it did that. I am on Visual Studio 2022.

APPCRASH: Segmentation Fault

I was trying to compress a win32 application with crinkler. I ran the following commands -
cl /c /O1 /GS- /Oi- /Gs9999 main.c
crinkler /TINYHEADER /SUBSYSTEM:WINDOWS main.obj kernel32.lib user32.lib gdi32.lib

It generates out.exe. But when I run the executable, it crashes with exception code c0000005. I ran the same executable in git bash where it showed segmentation fault. I googled the problem and found that it was trying to access some inaccessible memory region.

The program runs just fine when linked by link.exe

Handling the edge case of interval_size == 0x80000000

Hi,

I think there's a "practically never to expected" corner case how the arithmetic coding is ended:

if(interval_min + interval_size >= interval_min) // Not carry

Namely, I believe that if interval_size == 0x80000000 and interval_min == 0, then one should skip the ending altogether, as appending a 1 would get you halfway of the interval, but with interval_min == 0 and interval_size == 0x80000000, the half-way point is not included.

I think also interval_size == 0x80000000 and interval_min > 0 should be handled somehow differently.

I don't know how much thermal cooling of the universe would have to take place for this to occur in practice :) But I was reimplementing arithmetic coding and ran into this when my probabilities were getting messed up and got into the point that interval_size = 1, which got scaled to 0x80000000.

Crinkler crashes

I was trying to compress a application using the following commands:

cl /c /O1 /GS- main.c
crinkler /nodefaultlib /entry:main /subsystem:console /out:tiktak.exe main.obj kernel32.lib user32.lib ucrt.lib libcmt.lib libucrt.lib libvcruntime.lib

Crinkler tries to link the libraries but crashes. Here are the dump + obj files.
dump-files.zip
Hope that helps finding the issue.

Unsupported file type

Whenever I try to use Crinkler I get the following error message:

C:\CODE\SML\EXAMPLE\4K.OBJ: error LNK: Unsupported file type

I am running an example from this repository that should work with no trouble.
Please tell me what I am doing wrong. Everything I am reading is telling me the following command should work:

cl /c /W4 /O1 /Os /GS- 4k.cpp

crinkler /ENTRY:EntryPoint  ^
         /SUBSYSTEM:windows ^
         /COMPMODE:SLOW     ^
         /HASHSIZE:100      ^
         /UNSAFEIMPORT      ^
         /OUT:4k.exe        ^
         4k.obj gdi32.lib kernel32.lib user32.lib winmm.lib

I am on a 64bit machine on Windows 10

Any interest in CMake

Hi Rune,

Would you be interested in migrating to CMakeLists.txt instead of .vcxproj for builds? This would be the first step towards porting Crinkler to other platforms, or at least supporting other compilers than Microsoft (e.g. MinGW). Visual Studio users would not have to worry as:

  • Visual Studio 2019 has a good support for CMake projects
  • CMake supports nasm / yasm out of the box
  • CMake could generate Visual Studio solution / project files if you really really need them.

Any thoughts? I can have a shot at this if you want.

[Feature Request] /STUB option

I was going to use this linker to build a program with a custom stub, but I have noticed there's no STUB option, would it be possible to add one?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.