Re:Function hooking in Swift
by thinkpad20 on Wednesday June 18, 2014 @11:29PM
(#7914266)
Very interesting write-up, thanks! Makes me want to get back into C programming :) How did you manage to learn all of this stuff, for a new, closed-source and relatively undocumented (e.g. @asmname) language?
[ Parent
| on HN ]
It's all about reverse-engineering stuff; my usual workflow looks like:
(1) Complile some Swift program & look at the disasembler listing of it (I use IDA and — for Objective-C — Hopper Disassembler);
(2) Do some changes in source code in the program, compile it again, and see diffs in disassembler listing;
that way I can see what is changed and how.
About the @asmname thing: you can easily dump every default Swift module using a REPL command:
repl> :print_module Swift
There you can find a lot of interesting language lexems and more, so all you have to do is to try using them in your code until you don't figure it out ;)