Function at 0x4051c0
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x593b46
mov eax, dword fs:[0]
push eax
sub esp, 0x220
mov eax, dword [0x5fedec]
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 edi, dword [ebp + 8]
lea eax, [ebp - 0x110]
push 0xff
push 0
push eax
call fcn.00570bf0
add esp, 0xc
lea eax, [ebp - 0x22c]
push 0
push eax
push 4
push str.ATI_r
push dword [edi]
call dword [sym.imp.KERNEL32.dll_WriteFile]
push 0xff
lea eax, [ebp - 0x110]
push 0
push eax
call fcn.00570bf0
mov ebx, dword [sym.imp.KERNEL32.dll_ReadFile]
lea eax, [ebp - 0x22c]
add esp, 0xc
push 0
push eax
push 0xff
lea eax, [ebp - 0x110]
push eax
push dword [edi]
call ebx
cmp byte [ebp - 0x110], 0
mov dword [ebp - 0x214], 0xf
mov dword [ebp - 0x218], 0
mov byte [ebp - 0x228], 0
jne 0x40527c
xor ecx, ecx
jmp 0x40528e
lea ecx, [ebp - 0x110]
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x405285
sub ecx, edx
push ecx
lea eax, [ebp - 0x110]
push eax
lea ecx, [ebp - 0x228]
call fcn.00406e30
lea esi, [edi + 0x9c]
lea eax, [ebp - 0x228]
cmp esi, eax
je 0x4052ef
mov eax, dword [esi + 0x14]
cmp eax, 0x10
jb 0x4052c4
inc eax
mov ecx, esi
push eax
push dword [esi]
call fcn.00437b40
mov dword [esi + 0x14], 0xf
cmp dword [esi + 0x14], 0x10
mov dword [esi + 0x10], 0
jb 0x4052dc
mov eax, dword [esi]
jmp 0x4052de
mov eax, esi
mov byte [eax], 0
mov ecx, esi
lea eax, [ebp - 0x228]
push eax
call fcn.004065b0
mov eax, dword [ebp - 0x214]
mov dword [ebp - 4], 0xffffffff
cmp eax, 0x10
jb 0x405314
inc eax
lea ecx, [ebp - 0x228]
push eax
push dword [ebp - 0x228]
call fcn.00437b40
push 0xff
lea eax, [ebp - 0x110]
push 0
push eax
call fcn.00570bf0
add esp, 0xc
lea eax, [ebp - 0x22c]
push 0
push eax
push 0xff
lea eax, [ebp - 0x110]
push eax
push dword [edi]
call ebx
push 0xff
lea eax, [ebp - 0x210]
push 0
push eax
call fcn.00570bf0
add esp, 0xc
lea eax, [ebp - 0x22c]
push 0
push eax
push 7
push str.ATCSQ_r
push dword [edi]
call dword [sym.imp.KERNEL32.dll_WriteFile]
push 0xff
lea eax, [ebp - 0x210]
push 0
push eax
call fcn.00570bf0
add esp, 0xc
lea eax, [ebp - 0x22c]
push 0
push eax
push 0xff
lea eax, [ebp - 0x210]
push eax
push dword [edi]
call ebx
lea eax, [ebp - 0x210]
push 0x3a
push eax
call fcn.0056fe90
add esp, 8
mov esi, eax
xor ecx, ecx
cmp byte [ecx + esi], 0xd
je 0x4053f4
cmp byte [ecx + esi + 1], 0xd
je 0x4053f3
cmp byte [ecx + esi + 2], 0xd
je 0x4053ee
cmp byte [ecx + esi + 3], 0xd
je 0x4053e9
cmp byte [ecx + esi + 4], 0xd
je 0x4053e4
add ecx, 5
cmp ecx, 0xff
jl 0x4053b5
jmp 0x4053f4
add ecx, 4
jmp 0x4053f4
add ecx, 3
jmp 0x4053f4
add ecx, 2
jmp 0x4053f4
inc ecx
mov byte [ecx + esi], 0
cmp ecx, 1
jle 0x4053fe
inc esi
cmp byte [esi], 0
jne 0x405407
xor ecx, ecx
jmp 0x405419
mov ecx, esi
lea edx, [ecx + 1]
nop dword [eax]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x405410
sub ecx, edx
push ecx
push esi
lea ecx, [edi + 0x68]
call fcn.00406e30
lea eax, [edi + 0xbc]
push eax
lea eax, [edi + 0xb8]
push eax
push str._d__d
push esi
call fcn.00407930
add esp, 0x10
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.0056b237
mov esp, ebp
pop ebp
ret