03 December 2013

Gametop.com Games without Gametop.com Redirection

I like this game library site, there are dozen HQ free racing (my favorite genre) games  for download. As we know the games upon exiting will launch your browser pointing to their site. There seems to be no catch here, no suspicious parameter etc. it's simply "open this url" call, although a googling for privacy concern of these games return a few security paranoid's comments.

Having a look from dependency walker I believe ShellExecute is responsible for the call. I try hex it with another same-length function name of shell32.dll (e.g. CheckEscapes) and yeah that's it.

EDIT:

Steps:
  1. Download and install free hex editor: WXHexeditor / HexEditor or HxD
    in this case I use HexEditor.
  2. Download the game, in this case Battle Rush.
  3. Browse battle rush executable, open it in HexEditor
  4. battle rush.exe
  5. In HexEditor pres Ctrl-H to bring Find and Replace dialog, find "ShellExecuteA" and for the replacement use "CheckEscapesA" click Replace All. You'll be asked to turn off read only mode, Click ok :
  6. Replace the function
  7. A confirmation of the function being replaced will shown like below. If not, it may be in another name e.g. "ShellExecuteW" -> "CheckEscapesW" just give it a try. You can now save the file. Try run it.
  8. Confirmation

05 November 2013

How to build PyGI AIO with Moluccas

Read about Moluccas first, its gcc has experimental CRT targeting for this guide.

MS CRT targeting initially laid by official mingw.org but still far incomplete. At first I thought it would be as easy as set cflag/cxxflag __MSVCRT_VERSION__=0x0900 and add -lmsvcr90 to GCC's specs file, well for a trivial program? yes it can but thats all it can get. As my experiment goes by there are many issues piling up (from incomplete msvcr implib to puzzled LFS/Y3K macros) that forcing me to modify mingw's crt and win32api files to allow a package completely linked to the new msvcrt dll. In the end I decided to add new GCC flags to simplify this: -vcr70 to -vcr110. The flags correspond msvcrt redist version bundled by each release of Visual C++. Even today it still far from complete.

What it has to do with this guide? there is an article wrote by win32 contributors of Gnome framework (or whatever you called it) that explain the concern. While my approach is far cry in comparison to use real thing (yeah I know MSVC has free express edition) it still useful in some cases at least for OSS zealot (even if they use Windoze).

This guide will focus on latest stable version of GTK-related (should be called GObject-related) libraries as this written. The main packages are Glib 2.38.1 + GTK 3.10.2 + GI 1.38.0 + PyGObject 3.10.1 and we are targeting python 3.3 (which use msvcr100.dll). I must tell you though, there is steady progress to support MSVC from upstream at least for major libraries including GI thingy.

If you don't need CRT targeting, you can use any GCC of your preference in moluccas by put it into moluccas root then switch over using setgcc [gcc folder name].

Download moluccas 0.8a, you need to download the following packages:

M08.exe
M08-basemsys.7z
M08-basetools.7z
M08-ccomp.7z and newer gcc
M08-tex.7z
  1. Saves all of them in the same folder,
  2. Run M08.exe and specify install path (it's a portable installation). Click OK. Correction: If you have conemu instance(s) already run you need to quit all before clicking OK, see Maximus comment.
  3. The installer dialog will vanish quickly to bootstrap conemu and continue with extraction. Due to the sheer number of files, the extraction (write to harddisk) will be way slower than what the CPU capable of.
  4. Once completed, run conemu.exe to start
  5. Moluccas will try to detect any presence of Visual C++ and try to integrate the latest version you have. During first run it also initialize Miktex installation
  6. In the end conemu panel will bring the <^> prompt
  7. Type spawn to start an instance of conemu. The panel will hide and still accessible via systray icon.
edit:

I will put latest patches and buildscript at https://github.com/tumagonx/pygi-mingw-patches

20 October 2013

PyGI 3.10 Windows

In my attempt to update MyPaint I need to update PyGI as well as GTK. During compiling there is worrying result the glib 2.38.1 failed on 7 tests! The tests a bit different from previous versions though (in he past usually it passed all tests). GTK 3.10.2 seems missing def files and the new one isn't look any stabler than 3.6, the usual crashes still there despite major win32 fixes in cairo 1.12.16. Lastly I can't use new bindings (gir/typelib) as it always throw gmem.c overflow error during initialize in addition to that I need to comment PollFD override chunk in gi\overrides\GLib.py. Anyhow the new generated girs will still need diff/merge from those linux version...

So here is the new binaries using older typelibs (from pygi aio 3.4.2). This means no new features at python level, plus bugfixes and probably new bugs in the runtime. Currently only bare gtk included if new typelibs become usable I will add others.

pygi-aio-3.10_win32.7z (python 2.6 unsupported)

EDIT: rev2 and further revisions goes here https://sourceforge.net/p/pygobjectwin32/files

07 September 2013

Resuming Download from Depositfiles

Don't know if someone has wrote this before (cause it's so simple). This weekend I desperately need several downloads from one of major filesharing survivor DepositFiles. The files are big and my ISP is slow (worse with shared IP). Don't want to mess with eternal redownload or mess around with onion network, I'm looking for a way to resume the download (without their downloader of course).

I found at least two ways: First to use free URL uploader service which offer resumable download or secondly using wget (or whatever downloader with resume ability).

We will need to get Depositfiles' actual link to do it, as we know the url is in this kind of form http://fileshare*depositfiles* we can use source view or built-in browser inspector to get it. Of course we should never click the download button.

Free URL uploader is probably quite risky business, I have seen this kind service very hard to survive in the past. This time I found http://d-h.st/, the site seems clean and modest but not without problem. As expected, the download is very unstable, keep broken every 1 MB. Don't worry wget will deal with it. Interestingly registration appear to be optional. Just upload and the resumable download link will be provided.

The second way need tool to kill specific TCP connection ala task manager or taskkill, I'm not aware of the availability of the tools under Windows out of box but 3rd party tools such Sysinternals TCPView or ProcessHacker will do.

Essentially what happened is when wget issue resume command the server will get "stuck" but only initially, this is when we need to close wget tcp connection. FYI, closing tcp connection is treated as disconnection from the server so wget will do retry instead of giving up. Upon retrying the "stuck" is "unlocked" and download become resumable.

Enjoy!

21 August 2013

Weeks of Maps and TPX

I've been spending 2 weeks dealing with maps for several related projects, exploring several (new to me) better projections such Cahill-Keyes-Waterman and Fuller. Probably GIS guys already knew this stuff but in case anyone (newly) interested in maps I have some tips.

OK first what about google maps, google earth or wikimapia? well if you ever find a reason for not using online resources then read on.

Since many Earth datasets has fall under public use, there are many efforts to bring "open source" friendly yet highly detailed maps for mere mortals. Unless you're GIS guys you may not need SRTM, Landsat, VMAP, WVS, CDC's shapefiles and others as there are several ready to use (or easy to setup) maps for people with zero GIS experience.

Vector maps:
- Wikipedia users have made accessible vector maps here (the most detailed svg): http://commons.wikimedia.org/wiki/File:World98%2B.svg
- Duncan Webb's Cahill-Keyes World Map (draft) : http://www.genekeyes.com/DW/DW-1.html
- Gene Keyes's map sources also made available in OOo draw format (need GIS knowledge) : http://www.genekeyes.com/MEGAMAP-BETA-2/
- CIA's factbook (less detailed but up to date) : https://www.cia.gov/library/publications/download/‎

Raster maps (not ready to use but easy to setup) :
- http://www.paulillsley.com/gia/index.html

Among above vector maps, wikipedia map probably the one that readily editable. For inkscape users, 15MB file is quite common/average but 15MB of just polyline is really heavy one! I have been using Tpx for some months now and it fulfill my need of semi-technical drawing. When I try to open World98+ map above, I thought it will suffocated but Tpx handle this file with just 60MB of RAM. Trying to do this with inkscape will freeze your computer winamp's playback -_-! But then how to edit this file efficiently?

Well in Tpx the drawing area is "barely" movable and zoomable, redraw takes several seconds (at any zoom) but no redraw for undo though. So maybe with more powerful CPU it may do. But there is easier way. Since Tpx spend little memory, you don't need to worry of running out of memory (how convenient).

Tpx don't have layering system like inkscape nor understand xref like CAD. So we do chunked file management.

- break the groups

 - copy-paste each region into new session of Tpx


remember that copy-pasted chunk will preserve coordinate/location, so to merge back simply use copy paste operation again.

- the ideal editing workspace is at country/states level:



Lesson learned:

Good application is the one that have good combination of stability and features not bloatness, and part of the stability is smart memory management. Tpx may lack much of SVG features such as gradient ramp/mesh but talk about mission critical apps: "before you can edit you need to open it!". Sorry if I sounds like making a dig to inkscape, but damn they sure know how to make bloat. I want my old sodipodi back!

 Additional note: In case you wonder how the world98+.svg created from http://commons.wikimedia.org/wiki/File:World98.svg. The metadata says:

"Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 43363)"

yeah a real world app huh!?

19 July 2013

The Moluccas 0.8

Version 0.8 is here. I now called it Moluccas (not to be confused as some kind of mollusca).  It can be grabbed at https://sourceforge.net/projects/tumagcc/files/0.8/

The installer is M08.exe and you can pick up which 7z packages to install (categorized) but at least "base" is mandatory. Put all in the same folder and you're ready to install. There is brief overview of what's inside in each package at the link above. It still lack of documentation though only man included.

Enjoy my biggest OSS Collection with build environment!
All suggestions are welcome.

Main changelog:

- Fixes many typos and silly mistakes when tested in Windows 7
- All executable flagged with LAA
- Simplified startup: run conemu to start (old mode console, no longer supported though possible)
- Isolation: this version use ReactOS's cmd completely so it can be run independently of Windows' cmd.
- Installation speedup: Installer will use all cores (1 core/package)
- Explorer integration is disabled to provide zero host modification during startup (can be enabled by invoke molumenu). But many gui apps still write registry entries especially MFC based one.
- Fix integration with MSVS 2010 or (later?)
- Lots of manual tweaking in GUI apps to make it tight and blend in
- Small fixes in mingw headers and xtraposix libraries

06 July 2013

Preparing version 0.8

I knew it will be more belated than previous version, this is getting bigger... Tuma MinGW 0.8 will focus on integration fixes and aim to become more established collection. On gcc side there is very little changes and will be the last with 4.7.x series (barebone 4.8.1 is provided though), originally I want to bundle static gtk libraries, but decided that's not worthy enough (I will put it up separately).

This version will have serious GUI apps addition and I have evaluate dozens of FOSS each weekend to find apps that lean and fast (avoiding .net/java whenever possible). But they're just alternative workflow from commandline counterpart which has considerable advatage. I still not quite done with cleanup so I dumped those in extratool package.

Oh yeah I want to drop the name, I think it's not a problem since it's not popular at all anyway. Candidates: celebes, moluccas or rangrang (the last is meaningful cause I love ants, they are the oldest architect)

I hope could finish it on sunday tomorrow.

27 June 2013

Node.js with posix path support

It was Mat Sutcliffe who sent me a patch to compile node.js with mingw last weekend, if I recalled node.js used to be compilable with mingw via scons but apparently they switch to gyp entirely and mingw support became broken since then. I though it was a bit weird to sent it to me, but it turn out the process would involve msys python (needed by gyp to work properly).

The patch itself is a win-win solution as it will build native win32 binary but with support for posix path (MSYS and CYGWIN) via generic mount mechanism. He further explain why he choose mount over cygpath, that is because node.js operate asynchronously so by using mount path would settled once rather repeatedly as with cygpath.

This is binary of node.js 0.10.12 (built as ./configure --gdb --without-etw --without-perfctr)
nodejs-0.10.12.7z
original patch for mingw by Mat -> replace msysmnt with mount
modified patch for mingw-w64
python msys

The functionality is implemented in path.js which is bundled inside the executable. So actually you could modify (if you wish) that part (look for mingwToWindowsPath resolvedPath) with your favorite hex editor if you don't want to recompile. Just make sure you don't add and reduce the string block length. Or if you think mingw is such mundane task feel free to apply patch only to path.js and then compile it with M$VS as usual :-)

How to build with mingw:
1. extract the source file for node.js homepage
2. download python for msys and extract to msys installation
3. download one of appropriate patches (above) put in source tree
3. start mingw, navigate to source tree and apply patch
4. ./configure [your options] (make sure that python for msys is the active one)
5. python tools/gyp_node -f make
6. LINK=g++ make -C out BUILDTYPE=Release V=1

Notes:
- I'm not sure about etw and perfctr whether those compilable with mingw but both don't compile out of box. 
- The download is contain official installation hierarchy with node.exe replaced. Since it's not installer (it make no sense anyway) I'll assume you know what to do next ;-)

Enjoy!

16 June 2013

Pinpoint, another approach for presentation

Previously I've tried fluxus for live presentation using a basically game engine + scheme scripting. Due to unresolved issue and the need to learn new language, I'm giving up and looking for much simpler alternative despite I still consider fluxus as a novel apps with no equal alternative.

Pinpoint is small, light and opengl accelerated presentation tool with a kind of magicpoint approach (you write down tagged text representation). It's similar to OSG's Present3D which is between pinpoint and fluxus in term of features, but Present3D require you to write a not-that-readable XML file instead which is nasty without the help of WYSIWYG editor. Pinpoint is simple, it has no advanced timeline/layer like in office software and geared for quick and dirty presentation. Pinpoint also feature extendable transition FX system (powered by clutter) by writing your own FX via loadable json file.

Here you go:

Static build win32, patched to make it more standalone :-)
download: pinpoint and sample+patch

notes:
- to test just drag and drop introduction.pp to pinpoint.exe
- no video support (I'm still figuring out how to build gst-ffmpeg statically) seems played but not rendered by cluttersink
- image support: png, jpg, gif
- basic FX are bundled in the executable, if you make new fx put the json file alongside the executable
- export: pdf only
- pinpoint.exe has console window, pinpointw.exe doesn't
- if you want to compile it yourself, please use gnome libraries released circa 2011 and avoid cairo 1.12.x

see their homepage to learn how to write a presentation file https://live.gnome.org/Pinpoint
Enjoy!


28 May 2013

CMD restriction bypass

Alright since I have skipped nearly the whole month, I need to buzz something at least. The tittle isn't that real, I mean I'm bored with black hack stuff at my age anyway, so this one is too obvious, legal and easy too.

How to bypass CMD restriction? Well, by using another compatible cmd of course, like the open source ReactOS (wine?) cmd.exe replacement from the ISO file (version 0.3.14 works with XP and 7). However the problem soon arise when COMSPEC get tangled in the way, for example standard system() call will still use system-wide COMSPEC (not session one). So things like for /f ... ('command') do ... wont work since it will ask blocked system's cmd.exe to launch something a.k.a %windir%\system32\cmd.exe /c bla bla.

I stumble on this case when I use my previous 7z-sfx wrapper for bat files. So I decide to put ReactOS's cmd.exe inside the sfx as workaround.

That also apply to regedit restriction which ReactOS also has the replacement, but of course there is no "such restriction" to just access registry whatsoever.