1,260 karma · joined Nov 2, 2009 (17y ago) · 479 submissions
comment 15y ago · link · parent
Unfortunately there's still a lot decompilers can't do, mostly compiler tricks (e.g. storing a pointer to the middle of a structure instead of its beginning, and using negative offsets to access other struct members [3] - this is usually obvious when looking at it, but HexRays can't make sense of it so it falls back to raw pointer math).
[1] http://www.hex-rays.com/ [2] http://img824.imageshack.us/img824/1188/hexrayscpp.png [3] https://github.com/Laurelai/decompile-dump/blob/master/outpu...
comment 15y ago · link · parent
comment 16y ago · link · parent
.browser-support dd:nth-of-type(3) { background-image:url("img/opera-logo.png"); }
.browser-support dd.no-support:nth-of-type(3) { background-image:url("img/opera-logo-white.png"); }
And looking at the calculated width example reminded me of the box-sizing property [1], which would simplify that particular use case.comment 16y ago · link · parent
Oy. Not the best idea, generally speaking.
Edit: I used to read the localized paper version of http://xakep.ru/ several years ago, and practically every hacking story/tool roundup they had mentioned the annoying problem with ls --color, it was apparently present in almost every public rootkit at the time. It's kinda interesting to see that idiots still use outdated tools years later.
comment 16y ago · link · parent
For hosts that don't (i.e. we used to have one project running on a Windows server with nothing but Remote Desktop access and no permission to install any VCS), I use this:
alias gdate=date\ +%Y.%m.%d-%H.%M.%S
gitzip () { zip -ruv "$(gdate).zip" $(git diff $@ --name-only); }
Invoking `gitzip $commit` produces a zip file containing all the changed files since said commit. Unzip archive to wwwroot, check for files that need to be deleted, done.comment 16y ago · link · parent
Suvorov wrote a lot of books exploring WWII and demonstrating large amounts of evidence for his "Icebreaker" theory, claiming that Stalin intentionally led Hitler to power, planning to occupy Europe after Nazis and the Western countries were both weary and weakened. The theory has a lot of vocal opponents, but Suvorov never misses a chance to point out that most of them are (paid by) Soviet political/military figures, who are obviously biased and would never admit such a plan. It's a shame that these books are not all translated to English.
He also wrote two memoir books, (Tales of a) "Liberator", describing his service in the Soviet regular forces, and "Aquarium", covering the period after he got noticed by and accepted into the intelligence forces. The first one contains some rather fascinating stories of everyday Soviet life and dogma, well worth a read if you can find it. The second one is also good, even though it lacks those everyday stories.
Summa summarum, the book OP linked to is an interesting view into the old Soviet thinking. Might be an eye opener for those who believe the Soviets were anywhere near as humane as the Western countries.
comment 16y ago · link · parent
Excusing the Russians' war atrocities simply because they beat the Germans is quite like picking the frying pan instead of the fire - they are both very bad, just one is somewhat worse than the other. (Then again, I'm from the Baltic states, where we were actually stuck with the Russians until 1990, so I am probably biased.)
Did the Nazis have long distance bombers that could actually destroy the industrial complexes in Ural or further to the East? I am not aware of any.
comment 16y ago · link · parent
- carried out his orders blindly and without thinking ( see http://en.wikipedia.org/wiki/Battles_of_Rzhev where he blindly sent several hundred thousand troops into fortified German position - if you send your forces up the same road for two months straight without gaining any advances, wouldn't you at least try to find an alternate route that the enemy doesn't expect you to use? ) ,
- was very hungry for fame and glory (I can't find references now, but it was his initial reports to higher command during the first few days after 1941-06-22 that led Stalin to believe the German invasion was already mostly contained and delayed Russian defense deployments. In addition, Stalin demoted Zhukov later, citing "attributes others' achievements to himself" as a significant reason.), and
- was generally vain, sadistic and incompetent. Several high ranking officials and civilians reported his attitude towards his subordinates as nothing less than disgusting.
- He was also in charge of Totsk nuclear testing ( http://www.johnstonsarchive.net/nuclear/radevents/1954USSR1.... ), where he had over 40k soldiers split into two teams and engage each other moments after a nuke had been detonated above the battlefield.
Also, he had nothing to do with the German defeat at Stalingrad - he was still too busy headbutting Rzhev: http://en.wikipedia.org/wiki/Battle_for_Velikiye_Luki_(1943)
For more details, I suggest looking up Viktor Suvorov's "Shadow of Victory". And other Suvorov's books for a different view of WWII in general.
comment 16y ago · link · parent
comment 16y ago · link · parent
comment 16y ago · link · parent
Free time: reverse engineering a C++ game and extending it. http://img180.imageshack.us/img180/9215/devenv.png - IDA to rev/eng it, Eclipse C++ with a custom build tool to compile, Rose Tyler background just because.
comment 16y ago · link · parent
I have some experience with the C/C++ part, so I'll try to answer that. Though this is more of a "what to learn in what order" post than a "how to learn it" one. Sorry, I'm mostly self-taught so can't really recommend exhaustive resources.
0: Intel's manuals are great, but mind that they're a reference, not beginner's books. Also, Intel used to give away dead tree versions of their manuals for free, unfortunately I don't think they do that anymore.
1: I don't think you need to learn all the ins and outs of assembly at first - knowing the basic flow control and math/logic operations will be enough. Don't worry about interrupts, descriptor tables, and other magic yet.
2: Once you learn the basics, practice: try to write simple programs in C and step through them in an IDE while looking at the disassembly view. Add inline assembly and practice writing it too.
3: After that, you'll probably need to learn how C++ constructs get translated to assembly code, which is a really large topic. Stanley Lippman's "C++ Object Model" covers quite a lot of it by showing how C++ gets transformed into C-like code, which you should already be familiar with. Mind that each compiler does some things differently than the others, so you should look at at least G++ and MSVC++.
When you get here, it's a good idea to browse around blogs like http://www.nynaeve.net/ and http://www.pagetable.com/ .
4: OS specifics and abstractions. Learn what the OS won't let you do in user mode, why, and so on.
5: Code injection. If you want to add/change code in an existing program, you'll either need to patch its binaries or use an existing code injection program to do it automatically. The second approach is nicer when your changes need to be propagated to other installations of that program, and they don't require modifications to the actual program, which can be nice when it does checksumming/updates itself. Several "gray" methods exist to do this, something like [1] might be a good start.
Tools: Aside from a C/C++ toolchain (no assembler as such - I don't think raw assembly programs are a good idea, and prefer pieces of inline assembly in a C++ program, YMMV), you'll definitely need a disassembler and a debugger. Personally, I love IDA Pro (it does both) with its graphing features and extendability. Their decompiler is a fabulous piece of work too, even though it's not perfect.
(In fact, my friends and I are currently reverse-engineering a certain game and fixing/extending it. This is a really fun and enlightening hobby - we need to work out what the functions/objects do, map out their signatures in C++ , fix any inconsistencies with inline ASM, resulting in interesting macro collections like [2], and then write code using them without breaking stuff. Fun, for certain #define of fun.)
[1]http://www.memoryhacking.com/Misc/Tut/Injection%20Manager.ht... [2]http://svn.renegadeprojects.com/filedetails.php?repname=YR%2...
comment 16y ago · link · parent
Foo * pFoo = NULL;
if(x) {
// stuff
pFoo = Foo::p1;
} else {
// stuff
pFoo = Foo::p2;
}
if(pFoo) {
pFoo->bar();
}
I can't declare pFoo inside if(x) due to scoping, so I have to declare it before initializing it meaningfully. It has to be either a pointer to the object (references don't work without initialization) or an object copy, which would not modify the original object...comment 16y ago · link · parent
From the system I maintain:
/*
e - ExternalStatus
i - InternalStatus
e\i | D F N X
--------------------------
D | A B C D
F | E F G H
N | I J K L
X | M N O P
*/ switch( $inst->Status ) {
case 'A' : case 'D' : case 'M' :
$stats['d']++; break;
case 'E' : case 'F' : case 'G' : case 'H' :
case 'B' : case 'J' : case 'N' :
$stats['f']++; $stats['d']++; break;
default : $stats['n']++;
}comment 16y ago · link · parent
comment 16y ago · link · parent
Another British band, Porcupine Tree, explored LSD in their early works, from "Lynton Samuel Dawson" to the amazing "Voyage 34", which includes the following remark:
*They're not drug addicts
Wandering around, not knowing where they are
They're your most creative, most courageous
And like it or not, they're going to build you
A new civilization...*comment 16y ago · link · parent
Personally, I stick to PHP for new projects because it's what I know - trying RoR out would have to be a spare-time endeavor, and I already have tons of stuff I like to do in my spare time. If I had no prior experience, I'd probably pick RoR though.
[1] ignoring the old tired rant about function naming: object->badproperty just causes a notice and carries on, object->badfunction() crashes with a fatal error, null->property, null[property] and 1 + undefined are also just notices... basically you want an error handler that turns anything into a fatal error, but then you can't co-op with any older code as even older "frameworks" such as Joomla are full of that crap.
comment 16y ago · link · parent
comment 16y ago · link · parent
alias gdate=date\ +%Y.%m.%d-%H.%M.%S
gitzip () { zip -ruv "$(gdate).zip" $(git diff $@ --name-only); }
Produces a zip file of all files that changed since the commit you pass as the argument. Then I just transfer the resulting zip over, and unzip its contents to the root project folder. Haven't figured out how to deal with deleted files this way yet, fortunately that's not common.--
And a pre-commit hook for linting PHP source code when I'm not in an IDE. Yes, this came around because of a few commits made without testing.
#!/bin/sh
exitStatus=0
for i in $(git diff --name-only --staged HEAD); do
[ "$VERBOSE" != "" ] && echo "Validating file $i"
echo "$i"| grep -q '.php$'
if [ $? -eq 0 ]; then
[ "$VERBOSE" != "" ] && echo "... seems to be PHP, running php lint"
php -n -l "$i"| grep -q 'Errors parsing'
valid=$?
if [ $valid -eq 0 ]; then
echo "File $i is invalid."
exitStatus=1
fi
fi
done
exit $exitStatuscomment 16y ago · link · parent
Productivity, yes, GTA VC/Urban Chaos/UT2k3 helps me unwind after work and in turn makes me more productive the next day. A few times I even solved some work problem that was bothering me, while ingame.
Oddly, I noticed that I fare better in GTA VC racing courses when I'm paying absolutely minimal attention to the actual game and focus on the music or some thinking problem instead.