We can see on main function most of the function called looks like "stripped". If we take a look on one of those called functions (sub_140004d60) we can see that it looks like statically compiled then stripped.
To recover the function name i did debugging then analyze the input and output. After knowing what the function do i rename the function name to make it easier to understand.
Program validate if input has preifx ASCIS and suffix }
Split value wrapped by ASCIS by -
There must be 6 value after splitted
Each index on splitted value will be processed with several operation like xor, add, rc4, and substraction
Because all operation are reversible, we just need to reverse the operation and leak value index by index to get the flag.
Get flag5
Get flag4 because we know flag5
Get flag2 and flag3 because we know flag4 and flag5
Given PE file, open it using IDA. IDA can't detect main function but there is start function.
Analyzing start function i can't find "main" function, so i tried to look at available strings.
Go to address for each reference, we will find out that the main function is sub_7FF61CE8D7A0.
There is something weird on decompiled code (sub_7FF61CE8B8E0).
Through trial and error i found the solution, we can just put change the second call to nop then decompile again.
Program will listening at port 1337
If there is connection, it will print "gimmy oxygen!"
Program will receive our input and call function unk_14002D000
if function unk_14002D000 return 1, it will call sub_1400114C9 (RC4)
From above analysis we can conclude that we need to find input that return 1 for function unk_14002D000. At first i tried to disassemble unk_14002D000 and it looks like not a valid assembly.
So lets take a look on cross reference.
Looks like it just basic xor, use idapython to automatically patch the values.
Now it looks like valid assembly, lets decompile the code and rename known variables.
v9 = input - target
target[v9] == target + input - target
target[v9] == input
if counter is odd, substract
if counter is even, add
Now, lets write the script to bruteforce valid input.