Function at 0x4a9b20
Capabilities:
Write file on windows

Disassembly:
sub esp, 0x18
mov eax, dword [esp + 0x20]
push ebx
push ebp
push esi
push edi
mov edi, dword [esp + 0x2c]
xor ebp, ebp
mov dword [esp + 0x1c], edi
cmp eax, ebp
mov dword [esp + 0x10], ebp
mov dword [esp + 0x18], ebp
mov dword [esp + 0x14], eax
jne 0x4a9b4d
mov dword [esp + 0x14], 0xffffffff
mov ecx, dword [esp + 0x38]
lea eax, [esp + 0x10]
push ebp
push eax
lea edx, [esp + 0x1c]
push ecx
lea eax, [esp + 0x28]
push edx
lea ecx, [esp + 0x28]
push eax
push ecx
call fcn.004a90b0
mov esi, eax
add esp, 0x18
cmp esi, 0xffffffff
mov dword [esp + 0x38], esi
je 0x4a9f3a
mov eax, dword [esp + 0x10]
cmp eax, 0xffffffff
je 0x4a9f3a
cmp eax, ebp
je 0x4a9f3a
mov edx, dword [esp + 0x18]
cmp edi, ebp
lea ecx, [edx + 0x2000]
mov dword [esp + 0x20], ecx
jne 0x4a9bc5
push ebp
push ebp
push ebp
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov eax, dword [esp + 0x10]
push eax
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
mov eax, dword [esp + 0x18]
cmp eax, ebp
jmp 0x4a9e9d
mov eax, dword [esp + 0x1c]
mov ebx, eax
sub ebx, ecx
cmp eax, ebp
je 0x4a9db3
mov edx, dword [esp + 0x14]
test edx, edx
je 0x4a9db3
mov edi, dword [esp + 0x30]
test edi, edi
jne 0x4a9bf4
sub eax, edx
mov ebp, edx
add esi, eax
jmp 0x4a9e56
mov edi, dword [esp + 0x34]
test edi, edi
je 0x4a9d88
cmp byte [eax - 1], 0x3d
jne 0x4a9cb5
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
mov ebp, dword [esp + 0x14]
mov eax, dword [esp + 0x18]
not ecx
dec ecx
mov edx, ecx
add edx, 2
sub ebp, edx
mov dword [esp + 0x30], edx
cmp ebp, eax
jb 0x4a9c52
mov edi, dword [esp + 0x34]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, ebp
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov esi, dword [esp + 0x38]
jmp 0x4a9c92
mov ecx, dword [esp + 0x10]
push 0
push 0
push ebx
push ecx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov eax, dword [esp + 0x30]
mov ecx, dword [esp + 0x34]
lea edx, [esp + 0x2c]
push 0
add eax, 0xfffffffe
push edx
mov edx, dword [esp + 0x18]
push eax
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [esp + 0x14]
mov edx, dword [esp + 0x30]
lea ebp, [eax - 2]
mov eax, dword [esp + 0x2c]
add ebx, eax
mov ecx, dword [esp + 0x14]
mov byte [ecx - 2], 0xd
mov eax, dword [esp + 0x14]
mov byte [eax - 1], 0xa
mov edi, dword [esp + 0x14]
mov ecx, dword [esp + 0x1c]
sub edx, edi
add edx, ecx
add esi, edx
jmp 0x4a9e56
mov edi, dword [esp + 0x30]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
mov edi, dword [esp + 0x34]
not ecx
dec ecx
mov esi, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov eax, dword [esp + 0x18]
not ecx
dec ecx
lea esi, [esi + ecx + 3]
sub edx, esi
cmp edx, eax
jb 0x4a9cff
mov ecx, dword [esp + 0x34]
mov eax, dword [esp + 0x30]
push ecx
push eax
push str._s_s
push edx
call fcn.004c1941
mov ebp, dword [esp + 0x24]
add esp, 0x10
sub ebp, esi
jmp 0x4a9d5b
lea ecx, [esi + 1]
push ecx
call fcn.004db3f6
mov edx, dword [esp + 0x38]
add esp, 4
mov edi, eax
mov eax, dword [esp + 0x30]
push edx
push eax
push str._s_s
push edi
call fcn.004c1941
mov ecx, dword [esp + 0x20]
add esp, 0x10
push 0
push 0
push ebx
push ecx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov ecx, dword [esp + 0x10]
lea edx, [esp + 0x2c]
push 0
lea eax, [esi - 2]
push edx
push eax
push edi
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov edx, dword [esp + 0x2c]
push edi
add ebx, edx
call fcn.004db41f
add esp, 4
mov edx, dword [esp + 0x14]
mov byte [edx - 2], 0xd
mov eax, dword [esp + 0x14]
mov byte [eax - 1], 0xa
mov edx, dword [esp + 0x14]
mov ecx, dword [esp + 0x1c]
mov eax, dword [esp + 0x38]
sub esi, edx
add esi, ecx
add eax, esi
mov dword [esp + 0x38], eax
mov esi, eax
jmp 0x4a9e56
dec eax
cmp eax, ecx
mov dword [esp + 0x1c], eax
jbe 0x4a9d9f
cmp byte [eax], 0xa
je 0x4a9d9f
dec eax
cmp eax, ecx
mov dword [esp + 0x1c], eax
ja 0x4a9d91
inc eax
mov ebp, edx
mov dword [esp + 0x1c], eax
mov ebx, eax
sub eax, edx
sub ebx, ecx
add esi, eax
jmp 0x4a9e56
mov eax, dword [esp + 0x30]
test eax, eax
je 0x4a9f29
mov edx, dword [esp + 0x34]
test edx, edx
je 0x4a9f29
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
mov ebp, dword [esp + 0x30]
not ecx
dec ecx
mov edi, ebp
mov ebx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov edi, edx
add ebx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
dec ecx
cmp esi, 2
lea edi, [ebx + ecx + 9]
mov ebx, esi
jbe 0x4a9e2d
mov edx, dword [esp + 0x20]
cmp byte [edx + ebx - 1], 0xa
jne 0x4a9e29
mov al, byte [ebx + edx - 2]
cmp al, 0xa
jne 0x4a9e13
dec ebx
dec esi
jmp 0x4a9e24
cmp al, 0xd
jne 0x4a9e29
cmp byte [ebx + edx - 3], 0xa
jne 0x4a9e29
sub ebx, 2
sub esi, 2
cmp ebx, 2
ja 0x4a9dfc
mov edx, dword [esp + 0x34]
lea ecx, [esi + 0x2000]
cmp ecx, edi
jle 0x4a9eb5
mov eax, dword [esp + 0x18]
push edx
mov edx, dword [esp + 0x30]
push ebp
push edx
push str._r_n__s__r_n_s_s_r_n
push eax
call fcn.004c1941
mov ebp, dword [esp + 0x2c]
add esp, 0x14
add esi, edi
mov ecx, dword [esp + 0x10]
mov edi, dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
push 0
push ebx
push ecx
call edi
mov ecx, dword [esp + 0x10]
mov eax, esi
lea edx, [esp + 0x24]
push 0
sub eax, ebx
push edx
push eax
push ebp
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov edx, dword [esp + 0x10]
push 0
push 0
push esi
push edx
call edi
mov eax, dword [esp + 0x10]
push eax
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
mov eax, dword [esp + 0x18]
test eax, eax
je 0x4a9ea8
push eax
call fcn.004db41f
add esp, 4
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x18
ret
lea ecx, [edi + 1]
push ecx
call fcn.004db3f6
mov edx, dword [esp + 0x38]
add esp, 4
mov esi, eax
mov eax, dword [esp + 0x2c]
push edx
push ebp
push eax
push str._r_n__s__r_n_s_s_r_n
push esi
call fcn.004c1941
mov ecx, dword [esp + 0x24]
mov ebp, dword [sym.imp.KERNEL32.dll_SetFilePointer]
add esp, 0x14
push 0
push 0
push ebx
push ecx
call ebp
mov eax, dword [esp + 0x10]
lea edx, [esp + 0x30]
push 0
push edx
push edi
push esi
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov ecx, dword [esp + 0x10]
push 0
add edi, ebx
push 0
push edi
push ecx
call ebp
mov edx, dword [esp + 0x10]
push edx
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
push esi
call fcn.004db41f
add esp, 4
jmp 0x4a9e97
mov eax, dword [esp + 0x18]
test eax, eax
je 0x4a9f3a
push eax
call fcn.004db41f
add esp, 4
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x18
ret