r/AskReverseEngineering • u/DoomTay • May 31 '25
Attempting to interface with a remote ColdFusion .cfc
This is a bit of a follow-up to another post from a few days ago
In retrospect, setting up a function to return hardcoded data was almost a waste of time, because though some of the data was able to be "captured" and passed to other functions, said other functions still return "empty" data objects (which include Success: 0) or simply return a blank page.
<cffunction name="bypassLogin" access="remote" returntype="any">
<cfargument name="login" type="array" required="true">
<cfargument name="loginDate" type="date" required="true">
<cfset var remoteUrl = "https://www.example.com/cfc/UserClass.cfc?method=bypassLogin">
<cfhttp url="#remoteUrl#" method="post" resolveurl="yes">
<cfhttpparam type="header" name="Cookie" value="#CGI.HTTP_COOKIE#">
<cfhttpparam type="formfield" name="userInfo" value="#SerializeJSON(arguments.login)#">
<cfhttpparam type="formfield" name="loginDate" value="#SerializeJSON(arguments.loginDate)#">
</cfhttp>
<cfreturn cfhttp.fileContent>
</cffunction>I suspect the "blank pages" cases are because of an argument not being "defined", which means I'm not getting the names of the arguments being passed to the "real" bypassLogin function right. And these .cfcs on the game's website are just showing blank pages instead of an error and ?wsdl isn't working either.
Okay fine, then just stick with the hardcoded version and use the results from that for the other functions the game makes use of, right?
Nope! As said before, what I implemented so far that interfaces with the real functions on the original website either returns a blank page or objects that are uselessly empty. My working theory there is that the "real" bypassLogin does something that "initiates" the user in the database (assuming it still works) that would enable the other functions to work.
So without any useful errors being returned and the WDSL approach not working, I can't think of any way to figure out what the arguments should be. Funny thing is, this wouldn't be much of a concern if I could get the Flash gateway to connect to the real .cfcs directly as if they were on the server.
Am I SOL?
1
u/DoomTay Jun 04 '25 edited Jun 04 '25
Funny thing is, going from GET experimentation, I have found that passing "numbered" params (i.e.1=3233&2=32434...) gets the same results as before, at least with the functions that actually showed something. At the same time, when experimenting with pointing this function at another internal function like I would an external one, if I serialize the first argument, it throws an error about the first argument not being an array, but if I don't serialize it, I get
Attribute validation error for CFHTTPPARAMBut changing the first one to
<cfhttpparam type="formfield" name="user" value="#SerializeJSON(arguments.login)#">means it gets processed without a hitchFurthermore, passing the whole
Flash.paramskaboodle in "body", even if I convert it into a struct first, results inComplex object types cannot be converted to simple values.1
u/DoomTay Jun 15 '25
Well I managed to find some other discoveries.
While /flashservices/gateway is down, it turns out it was moved /flashservices/gateway/ and for whatever reason, the Flash code was never updated accordingly. But, if I work some proxy magic to have data passed to and from the latter whenever calls are made to the latter the game can be played fully from start to finish.
I have also made two other peculiar discoveries about the
bypassLoginfunctionaccountType numberwould be 3logonIDthat is returned from a realbypassLoginis NOT the same as the number that is passed to it. It is something else roughly a tenth of thatThough I still haven't figured out how to make proper calls to the APIs through the method above, I have been able to use what I learned and put that in a hardcoded call, and then the other methods the game uses are able to return actual data
That said, I did notice that some of the methods return objects that include Recordset. And every return type I know of for third-party web method calls, return recordset columns in allcaps, even though the Flash app expects something else. I can substitute each column name, but that would be a LOT of work. Seems the proxy approach would have been better in the long run.
1
u/ConvenientOcelot May 31 '25
I don't really understand what you're trying to do here, why can't you just look at what messages the client expects and send that? You shouldn't really need the original server
1
u/tomysshadow May 31 '25
IMO, you are not sharing enough details about your environment.
What is preventing you from doing so? Can you clearly define what you mean here by "Flash gateway?" From what I can tell from your description, this is some kind of middleman that would normally be sitting between the request made in Flash and the server itself, but what is it? What protocol or technology does it use? Is it another SWF that you are missing that would've contained a library?