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

Disassembly:
push ebp
mov ebp, esp
mov eax, dword fs:[0]
push 0xffffffffffffffff
push 0x5914a3
push eax
mov eax, 0x13a0
mov dword fs:[0], esp
call fcn.0056bac0
mov eax, dword fs:[0x2c]
mov ecx, dword [0x6abc48]
mov ecx, dword [eax + ecx*4]
mov eax, dword [0x65ff1c]
cmp eax, dword [ecx + 4]
jg 0x47815e
push esi
mov dword [ebp - 0x10], 0x65fefc
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov esi, eax
cmp esi, dword [0x65fefc]
je 0x477f8a
mov edx, esi
mov ecx, 0x65fefc
xor eax, eax
lock cmpxchg dword [ecx], edx
test eax, eax
sete al
test al, al
jne 0x477f8a
pause
push esi
call fcn.00481ab0
jmp 0x477f91
lock inc dword [0x65ff00]
push ebx
push edi
mov dword [ebp - 4], 2
xor edi, edi
mov ebx, dword [ebp + 8]
cmp ebx, 2
jne 0x47801c
mov esi, dword [ebp + 0xc]
test esi, esi
je 0x47801c
mov cl, byte [esi]
mov eax, esi
test cl, cl
je 0x477fe7
cmp cl, 0x2f
je 0x477fbd
cmp byte [eax], 0x5c
jne 0x477fdf
cmp byte [eax + 1], 0x73
lea edx, [eax + 1]
jne 0x477fdf
cmp byte [eax + 2], 0x72
jne 0x477fdf
cmp byte [eax + 3], 0x63
jne 0x477fdf
mov cl, byte [eax + 4]
cmp cl, 0x2f
je 0x477fe9
cmp cl, 0x5c
je 0x477fe9
mov cl, byte [eax + 1]
inc eax
test cl, cl
jne 0x477fb3
mov edx, esi
push dword [ebp + 0x10]
lea eax, [ebp - 0x13ac]
push edx
push str._s___d__:
push 0x139b
push eax
call fcn.004781d0
mov edi, eax
add esp, 0x14
cmp edi, 0x139a
jbe 0x478017
mov edi, 0x139a
jmp 0x47801c
cmp edi, 0xffffffff
je 0x47805d
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.0045a030
mov ecx, dword [eax]
push dword [eax + 4]
or ecx, 2
push ecx
call fcn.0057980e
or ecx, 0xffffffff
add esp, 0x1c
test eax, eax
cmovs eax, ecx
dec esi
cmp eax, esi
cmovle esi, eax
cmp esi, ecx
jne 0x478067
mov esi, 2
jmp 0x478130
add edi, esi
cmp ebx, 2
je 0x478073
cmp ebx, 3
jne 0x4780de
push 1
call fcn.00579ed1
push eax
call fcn.0057d1e4
push 2
call fcn.00579ed1
push eax
push edi
lea eax, [ebp - 0x13ac]
push 1
push eax
call fcn.0057beea
push 2
call fcn.00579ed1
push eax
push 0xa
call fcn.0057d262
push 2
call fcn.00579ed1
push eax
call fcn.0057d1e4
add esp, 0x30
cmp ebx, 2
jne 0x4780de
lea eax, [ebp - 0x13ac]
add eax, edi
push 0x593714
push eax
call fcn.0046a7a0
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 [0x628500]
add esp, 8
mov esi, eax
sub eax, 0
je 0x478120
sub eax, 2
jne 0x478130
push str.Exiting_on_SPEW_ABORT_n
push 1
push str.console
call fcn.00477ec0
add esp, 0xc
push 1
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.KERNEL32.dll_TerminateProcess]
jmp 0x478130
cmp ebx, 2
je 0x478130
call dword [sym.imp.KERNEL32.dll_IsDebuggerPresent]
test eax, eax
je 0x478130
int3
mov dword [ebp - 4], 0xffffffff
mov ecx, dword [ebp - 0x10]
lock dec dword [ecx + 4]
cmp dword [ecx + 4], 0
pop edi
pop ebx
jne 0x47814d
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 0x65ff1c
call fcn.0056bdc6
add esp, 4
cmp dword [0x65ff1c], 0xffffffff
jne 0x477f52
mov dword [ebp - 4], 0
mov ecx, 0x65ff04
mov dword [0x65fefc], 0
mov dword [0x65ff00], 0
call fcn.00481660
mov byte [ebp - 4], 0
push 0x5923b0
call fcn.0056bd35
mov dword [ebp - 4], 0xffffffff
push 0x65ff1c
call fcn.0056bd75
add esp, 8
jmp 0x477f52