Function at 0x520800
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x57c028
mov eax, dword fs:[0]
push eax
sub esp, 0x40
mov eax, dword [0x5b107c]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, ecx
call fcn.005234c0
mov edi, eax
lea edx, [ebp + 8]
lea eax, [ebp - 0x38]
mov dword [ebp - 0x34], edi
mov dword [ebp - 0x38], edi
call fcn.005216f0
test al, al
je 0x52085a
lea eax, [ebp + 8]
push eax
call fcn.005231f0
add esp, 4
jmp 0x5209ef
mov ecx, esi
call dword [sym.imp.MSVCP100.dll_protected:_char____thiscall_std::basic_streambuf_char__struct_std::char_traits_char__::pptr_void_const]
test eax, eax
je 0x520898
mov ecx, esi
call dword [sym.imp.MSVCP100.dll_protected:_char____thiscall_std::basic_streambuf_char__struct_std::char_traits_char__::epptr_void_const]
mov ecx, esi
mov ebx, eax
call dword [sym.imp.MSVCP100.dll_protected:_char____thiscall_std::basic_streambuf_char__struct_std::char_traits_char__::pptr_void_const]
cmp eax, ebx
jae 0x520898
mov ecx, esi
call dword [sym.imp.MSVCP100.dll_protected:_char____thiscall_std::basic_streambuf_char__struct_std::char_traits_char__::_Pninc_void_]
mov esi, eax
lea eax, [ebp + 8]
call fcn.005231e0
mov byte [esi], al
mov eax, dword [ebp + 8]
jmp 0x5209ef
cmp dword [esi + 0x54], 0
je 0x5208c6
call fcn.00521670
lea eax, [ebp + 8]
call fcn.005231e0
cmp dword [esi + 0x44], 0
jne 0x5208cd
mov cl, al
mov eax, dword [esi + 0x54]
call fcn.0051dce0
test al, al
mov eax, dword [ebp + 8]
jne 0x5209ef
mov eax, edi
jmp 0x5209ef
mov byte [ebp - 0x2d], al
lea eax, [ebp - 0x2c]
call fcn.005231c0
lea ecx, [ebp - 0x3c]
push ecx
mov dword [ebp - 4], 0
mov edi, dword [ebp - 0x1c]
lea eax, [ebp - 0x40]
lea ecx, [ebp - 0x2c]
lea ebx, [esi + 0x4c]
call fcn.00523730
call fcn.005202a0
add eax, edi
push eax
lea eax, [ebp - 0x44]
lea ecx, [ebp - 0x2c]
call fcn.00523730
call fcn.005202a0
push eax
lea edx, [ebp - 0x38]
push edx
lea eax, [ebp - 0x2c]
push eax
lea ecx, [ebp - 0x2d]
push ecx
mov ecx, dword [esi + 0x44]
push ebx
call dword [sym.imp.MSVCP100.dll_public:_int___thiscall_std::codecvt_char__char__int_::out_int___char_const___char_const___char_const____char___char___char___const]
test eax, eax
js 0x5209e4
jmp 0x520930
cmp eax, 1
jg 0x520a0d
lea eax, [ebp - 0x4c]
lea ecx, [ebp - 0x2c]
call fcn.00523730
call fcn.005202a0
mov edi, dword [ebp - 0x3c]
sub edi, eax
je 0x520975
mov edx, dword [esi + 0x54]
push edx
push edi
push 1
lea eax, [ebp - 0x48]
lea ecx, [ebp - 0x2c]
call fcn.00523730
call fcn.005202a0
push eax
call dword [sym.imp.MSVCR100.dll_fwrite]
add esp, 0x10
cmp edi, eax
jne 0x5209e4
lea eax, [ebp - 0x2d]
mov byte [esi + 0x49], 1
cmp dword [ebp - 0x38], eax
jne 0x520a33
test edi, edi
jne 0x52099b
cmp dword [ebp - 0x1c], 0x20
jae 0x5209e4
push edi
lea eax, [edi + 8]
lea edi, [ebp - 0x2c]
call fcn.005230d0
mov edi, dword [ebp - 0x1c]
lea ecx, [ebp - 0x3c]
push ecx
lea eax, [ebp - 0x40]
lea ecx, [ebp - 0x2c]
call fcn.00523730
call fcn.005202a0
add eax, edi
push eax
lea eax, [ebp - 0x44]
lea ecx, [ebp - 0x2c]
call fcn.00523730
call fcn.005202a0
push eax
lea edx, [ebp - 0x38]
push edx
lea eax, [ebp - 0x2c]
push eax
lea ecx, [ebp - 0x2d]
push ecx
mov ecx, dword [esi + 0x44]
push ebx
call dword [sym.imp.MSVCP100.dll_public:_int___thiscall_std::codecvt_char__char__int_::out_int___char_const___char_const___char_const____char___char___char___const]
test eax, eax
jns 0x520930
lea esi, [ebp - 0x2c]
call fcn.004b7fa0
mov eax, dword [ebp - 0x34]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.005762ee
mov esp, ebp
pop ebp
ret 4
cmp eax, 3
jne 0x5209e4
mov eax, dword [esi + 0x54]
mov cl, byte [ebp - 0x2d]
call fcn.0051dce0
mov edi, dword [ebp + 8]
test al, al
jne 0x520a27
mov edi, dword [ebp - 0x34]
lea esi, [ebp - 0x2c]
call fcn.004b7fa0
mov eax, edi
jmp 0x5209ef
lea esi, [ebp - 0x2c]
call fcn.004b7fa0
mov eax, dword [ebp + 8]
jmp 0x5209ef