Function at 0x477710
Capabilities:
Print debug messages
Terminate process
Write file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, dword fs:[0]
push 0xffffffffffffffff
push 0x592543
push eax
mov eax, 0x13a0
mov dword fs:[0], esp
call fcn.0056b4f0
mov eax, dword fs:[0x2c]
mov ecx, dword [0x6acca8]
mov ecx, dword [eax + ecx*4]
mov eax, dword [0x660fb4]
cmp eax, dword [ecx + 4]
jg 0x47796c
push esi
mov dword [ebp - 0x10], 0x660f94
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov esi, eax
cmp esi, dword [0x660f94]
je 0x477785
mov edx, esi
mov ecx, 0x660f94
xor eax, eax
lock cmpxchg dword [ecx], edx
test eax, eax
je 0x477785
pause
push esi
call fcn.00480e30
jmp 0x47778c
lock inc dword [0x660f98]
push ebx
push edi
mov dword [ebp - 4], 2
mov ebx, dword [ebp + 8]
cmp ebx, 2
je 0x4777a2
cmp ebx, 3
jne 0x4777a7
call fcn.004837d0
xor edi, edi
cmp ebx, 2
jne 0x477829
mov edx, dword [ebp + 0xc]
test edx, edx
je 0x477829
mov cl, byte [edx]
mov eax, edx
test cl, cl
je 0x4777f6
lea ecx, [ecx]
cmp cl, 0x2f
je 0x4777ca
cmp cl, 0x5c
jne 0x4777e9
cmp byte [eax + 1], 0x73
jne 0x4777e9
cmp byte [eax + 2], 0x72
jne 0x4777e9
cmp byte [eax + 3], 0x63
jne 0x4777e9
mov cl, byte [eax + 4]
cmp cl, 0x2f
je 0x4777f3
cmp cl, 0x5c
je 0x4777f3
mov cl, byte [eax + 1]
inc eax
test cl, cl
jne 0x4777c0
jmp 0x4777f6
lea edx, [eax + 1]
push dword [ebp + 0x10]
lea eax, [ebp - 0x13ac]
push edx
push str._s___d__:
push 0x139b
push eax
call fcn.004779e0
mov edi, eax
add esp, 0x14
cmp edi, 0x139a
jbe 0x477824
mov edi, 0x139a
jmp 0x477829
cmp edi, 0xffffffff
je 0x47786a
push dword [ebp + 0x18]
mov esi, 0x139b
lea eax, [ebp - 0x13ac]
push 0
push dword [ebp + 0x14]
sub esi, edi
add eax, edi
push esi
push eax
call fcn.0045a010
mov ecx, dword [eax]
push dword [eax + 4]
or ecx, 2
push ecx
call fcn.00579a74
or ecx, 0xffffffff
add esp, 0x1c
test eax, eax
cmovs eax, ecx
dec esi
cmp eax, esi
cmovle esi, eax
cmp esi, ecx
jne 0x477874
mov esi, 2
jmp 0x47793d
add edi, esi
cmp ebx, 2
je 0x477880
cmp ebx, 3
jne 0x4778eb
push 1
call fcn.0057a137
push eax
call fcn.0057d2c4
push 2
call fcn.0057a137
push eax
push edi
lea eax, [ebp - 0x13ac]
push 1
push eax
call fcn.0057bfc6
push 2
call fcn.0057a137
push eax
push 0xa
call fcn.0057d342
push 2
call fcn.0057a137
push eax
call fcn.0057d2c4
add esp, 0x30
cmp ebx, 2
jne 0x4778eb
lea eax, [ebp - 0x13ac]
add eax, edi
push 0x59471c
push eax
call fcn.00467af0
add esp, 8
lea eax, [ebp - 0x13ac]
push eax
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
lea eax, [ebp - 0x13ac]
push eax
push ebx
call dword [0x629518]
add esp, 8
mov esi, eax
sub eax, 0
je 0x47792d
sub eax, 2
jne 0x47793d
push str.Exiting_on_SPEW_ABORT_n
push 1
push str.console
call fcn.004776c0
add esp, 0xc
push 1
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.KERNEL32.dll_TerminateProcess]
jmp 0x47793d
cmp ebx, 2
je 0x47793d
call dword [sym.imp.KERNEL32.dll_IsDebuggerPresent]
test eax, eax
je 0x47793d
int3
mov dword [ebp - 4], 0xffffffff
mov ecx, dword [ebp - 0x10]
add ecx, 4
lock dec dword [ecx]
cmp dword [ecx], 0
pop edi
pop ebx
jne 0x47795b
mov ecx, dword [ebp - 0x10]
xor edx, edx
xchg dword [ecx], edx
mov ecx, dword [ebp - 0xc]
mov eax, esi
pop esi
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret
push 0x660fb4
call fcn.0056b8ad
add esp, 4
cmp dword [0x660fb4], 0xffffffff
jne 0x477752
mov dword [ebp - 4], 0
mov ecx, 0x660f9c
mov dword [0x660f94], 0
mov dword [0x660f98], 0
call fcn.00480a30
mov byte [ebp - 4], 0
push 0x5934c0
call fcn.0056b765
mov dword [ebp - 4], 0xffffffff
push 0x660fb4
call fcn.0056b863
add esp, 8
jmp 0x477752