Function at 0x499d28
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
mov ecx, 0xa
push 0
push 0
dec ecx
jne 0x499d30
push ebx
push esi
push edi
mov dword [ebp - 8], eax
xor eax, eax
push ebp
push 0x49a1d5
push dword fs:[eax]
mov dword fs:[eax], esp
mov byte [ebp - 9], 1
xor eax, eax
mov dword [ebp - 4], eax
mov eax, dword [ebp - 8]
call fcn.00497b98
test al, al
jne 0x49a1ba
mov eax, dword [ebp - 8]
mov eax, dword [eax + 0x117c]
test eax, eax
je 0x499d7a
cmp byte [eax], 0
je 0x49a1ba
mov byte [ebp - 9], 0
push 1
mov eax, dword [ebp - 8]
add eax, 0x1118
push eax
call sub.kernel32.dll_InterlockedExchange
mov esi, eax
test byte [0x4a525c], 8
je 0x499da9
mov ecx, dword [esi*4 + 0x4a27d8]
mov edx, esi
mov al, 3
call fcn.004969d0
dec esi
je 0x49a1ba
xor edx, edx
push ebp
push 0x49a1b3
push dword fs:[edx]
mov dword fs:[edx], esp
mov eax, dword [ebp - 8]
mov eax, dword [eax + 0x1128]
call fcn.004994e4
test al, al
je 0x499dda
call fcn.00404070
jmp 0x49a1ba
mov eax, dword [ebp - 8]
cmp dword [eax + 0x112c], 0xffffffff
jne 0x499df0
call fcn.00404070
jmp 0x49a1ba
xor edx, edx
push ebp
push 0x49a171
push dword fs:[edx]
mov dword fs:[edx], esp
mov eax, dword [ebp - 8]
lea edx, [eax + 0x1168]
mov eax, dword [ebp - 8]
mov eax, dword [eax + 0x1128]
call fcn.00499418
mov esi, eax
test esi, esi
je 0x49a137
mov byte [ebp - 9], 1
mov eax, dword [ebp - 8]
call fcn.004977d8
test byte [0x4a525c], 8
je 0x499e59
lea eax, [ebp - 0x18]
push eax
mov eax, dword [ebp - 8]
mov eax, dword [eax + 0x1168]
mov ecx, esi
mov edx, 1
call fcn.00404b30
mov ecx, dword [ebp - 0x18]
mov edx, esi
mov al, 3
call fcn.004969d0
xor eax, eax
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 8]
cmp dword [eax + 0xa4], 2
jne 0x499e9e
mov eax, dword [ebp - 8]
add eax, 0x13c
push eax
lea eax, [ebp - 0x14]
push eax
push esi
mov eax, dword [ebp - 8]
mov eax, dword [eax + 0x1168]
call fcn.00404ad0
push eax
mov eax, dword [ebp - 8]
mov eax, dword [eax + 0x112c]
push eax
call sub.kernel32.dll_WriteFile_1
cmp eax, 1
sbb ebx, ebx
inc ebx
jmp 0x499ec9
push 0
lea eax, [ebp - 0x10]
push eax
push esi
mov eax, dword [ebp - 8]
mov eax, dword [eax + 0x1168]
call fcn.00404ad0
push eax
mov eax, dword [ebp - 8]
mov eax, dword [eax + 0x112c]
push eax
call sub.kernel32.dll_WriteFile_1
cmp eax, 1
sbb ebx, ebx
inc ebx
push ebp
mov eax, esi
call fcn.00499d00
pop ecx
test bl, bl
jne 0x499f06
call sub.kernel32.dll_GetLastError_1
cmp eax, 0x3e5
jne 0x499f06
push 0xffffffffffffffff
lea eax, [ebp - 0x10]
push eax
mov eax, dword [ebp - 8]
add eax, 0x13c
push eax
mov eax, dword [ebp - 8]
mov eax, dword [eax + 0x112c]
push eax
call sub.kernel32.dll_GetOverlappedResult
cmp eax, 1
sbb ebx, ebx
inc ebx
test bl, bl
je 0x49a025
xor ecx, ecx
mov edx, dword [ebp - 0x10]
mov al, 4
call fcn.004969d0
cmp esi, dword [ebp - 0x10]
je 0x499fca
push 0xffffffffffffffff
lea eax, [ebp - 0x10]
push eax
mov eax, dword [ebp - 8]
add eax, 0x13c
push eax
mov eax, dword [ebp - 8]
mov eax, dword [eax + 0x112c]
push eax
call sub.kernel32.dll_GetOverlappedResult
cmp eax, 1
sbb ebx, ebx
inc ebx
cmp esi, dword [ebp - 0x10]
jle 0x499fca
xor ecx, ecx
mov edx, dword [ebp - 0x10]
mov al, 0x17
call fcn.004969d0
push 0x49a1f0
mov eax, dword [ebp - 0x10]
xor edx, edx
push edx
push eax
lea eax, [ebp - 0x20]
call fcn.00408e04
push dword [ebp - 0x20]
push 0x49a220
lea edx, [ebp - 0x24]
mov eax, esi
call fcn.00408dd4
push dword [ebp - 0x24]
push 0x49a234
xor eax, eax
mov al, bl
mov edx, dword [0x4a2ac0]
push dword [edx + eax*4]
push 0x49a248
call sub.kernel32.dll_GetLastError_1
lea edx, [ebp - 0x28]
call fcn.0040b7c4
push dword [ebp - 0x28]
lea eax, [ebp - 0x1c]
mov edx, 8
call fcn.00404998
mov edx, dword [ebp - 0x1c]
mov eax, dword [ebp - 8]
call fcn.00496b50
mov eax, dword [ebp - 8]
mov byte [eax + 0x116c], 1
mov eax, dword [ebp - 8]
cmp byte [eax + 0x111d], 0
je 0x49a137
mov eax, dword [ebp - 8]
cmp word [eax + 0x1142], 0
je 0x49a137
push 0x49a254
lea edx, [ebp - 0x30]
mov eax, esi
call fcn.00408dd4
push dword [ebp - 0x30]
push 0x49a260
lea eax, [ebp - 0x2c]
mov edx, 3
call fcn.00404998
mov edx, dword [ebp - 0x2c]
mov eax, dword [ebp - 8]
mov eax, dword [eax + 0x1170]
mov ecx, dword [eax]
call dword [ecx + 0x38]
jmp 0x49a137
call sub.kernel32.dll_GetLastError_1
mov edi, eax
test edi, edi
je 0x49a03a
mov eax, dword [ebp - 8]
mov byte [eax + 0x116c], 1
push 0x49a270
mov eax, dword [ebp - 0x10]
xor edx, edx
push edx
push eax
lea eax, [ebp - 0x38]
call fcn.00408e04
push dword [ebp - 0x38]
push 0x49a29c
lea edx, [ebp - 0x3c]
mov eax, esi
call fcn.00408dd4
push dword [ebp - 0x3c]
push 0x49a2b0
call sub.kernel32.dll_GetLastError_1
lea edx, [ebp - 0x40]
call fcn.0040b7c4
push dword [ebp - 0x40]
lea eax, [ebp - 0x34]
mov edx, 6
call fcn.00404998
mov edx, dword [ebp - 0x34]
mov eax, dword [ebp - 8]
call fcn.00496b50
lea edx, [ebp - 0x44]
mov eax, edi
call fcn.0040b7c4
mov ecx, dword [ebp - 0x44]
mov eax, dword [ebp - 8]
mov edx, dword [eax + 0x68]
mov al, 5
call fcn.004969d0
mov eax, dword [ebp - 8]
add eax, 0x14
push eax
mov eax, dword [ebp - 8]
add eax, 0x68
push eax
mov eax, dword [ebp - 8]
mov eax, dword [eax + 0x112c]
push eax
call sub.kernel32.dll_ClearCommError
cmp eax, 1
sbb ebx, ebx
inc ebx
test bl, bl
jne 0x49a0f6
lea edx, [ebp - 0x4c]
mov eax, edi
call fcn.0040b7c4
mov ecx, dword [ebp - 0x4c]
lea eax, [ebp - 0x48]
mov edx, 0x49a2cc
call fcn.00404924
mov edx, dword [ebp - 0x48]
mov eax, dword [ebp - 8]
call fcn.00496b50
call sub.kernel32.dll_GetLastError_1
lea edx, [ebp - 0x50]
call fcn.0040b7c4
mov ecx, dword [ebp - 0x50]
mov eax, dword [ebp - 8]
mov edx, dword [eax + 0x68]
mov al, 5
call fcn.004969d0
mov eax, dword [ebp - 8]
mov edx, dword [eax + 0x18]
mov ecx, 0x49a300
mov al, 5
call fcn.004969d0
mov eax, dword [ebp - 8]
mov edx, dword [eax + 0x1c]
mov ecx, 0x49a318
mov al, 5
call fcn.004969d0
mov eax, dword [ebp - 8]
mov eax, dword [eax + 0x1170]
mov edx, dword [eax]
call dword [edx + 0x14]
test eax, eax
je 0x49a167
push 0
push 0
push 0x400
mov eax, dword [0x4a2b9c]
mov eax, dword [eax]
mov eax, dword [eax + 0x44]
call fcn.00445378
push eax
call sub.user32.dll_PostMessageA
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
jmp 0x49a19a
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x49a1ba
mov eax, dword [ebp - 8]
xor edx, edx
mov dword [eax + 0x1118], edx
ret
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x49a1dc
lea eax, [ebp - 0x50]
mov edx, 0xf
call fcn.00404628
ret