Function at 0x1004aec0
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x1006ef2b
mov eax, dword fs:[0]
push eax
sub esp, 0xd0
mov eax, dword [0x100bd8f4]
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 eax, dword [ebp + 8]
mov esi, dword [ebp + 0x18]
mov dword [ebp - 0xd8], eax
mov eax, dword [ebp + 0x10]
mov dword [ebp - 0xb0], eax
test esi, esi
jne 0x1004af11
mov eax, 0x80070057
jmp 0x1004b0a9
lea ecx, [ebp - 0xb4]
push ecx
push 0x94
lea ecx, [ebp - 0xa4]
push ecx
push dword [ebp + 0x14]
push eax
call fcn.1004b380
add esp, 0x14
test eax, eax
js 0x1004b0a9
push 0
push 0
push 2
push 0
push 0
push 0x40000000
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
xor eax, eax
cmp esi, 0xffffffff
cmove esi, eax
mov dword [ebp - 0xdc], esi
mov dword [ebp - 4], eax
test esi, esi
je 0x1004af88
mov edi, dword [ebp - 0xb4]
mov ebx, dword [sym.imp.KERNEL32.dll_WriteFile]
push eax
lea eax, [ebp - 0xa8]
push eax
push edi
lea eax, [ebp - 0xa4]
push eax
push esi
call ebx
test eax, eax
jne 0x1004afa6
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
test edi, edi
jle 0x1004b09c
movzx edi, di
or edi, 0x80070000
jmp 0x1004b09c
cmp dword [ebp - 0xa8], edi
jne 0x1004b097
mov edi, dword [ebp - 0xb0]
mov eax, dword [edi + 0x20]
cmp eax, 2
jl 0x1004b097
cmp eax, 3
jle 0x1004b1d1
cmp eax, 4
jne 0x1004b097
cmp dword [edi + 0xc], 1
jne 0x1004b097
mov edx, dword [edi + 8]
xor ecx, ecx
xor ebx, ebx
mov dword [ebp - 0xcc], edx
mov dword [ebp - 0xc8], ecx
mov dword [ebp - 0xb4], ebx
cmp dword [edi + 0x10], ecx
jbe 0x1004b36d
mov dword [ebp - 0xc4], 0
test edx, edx
je 0x1004b19e
mov ebx, dword [ebp - 0xd8]
lea eax, [ecx + ecx*2]
add ebx, 0x14
lea ebx, [ebx + eax*8]
mov dword [ebp - 0xac], ebx
nop dword [eax]
cmp ecx, dword [ebp + 0xc]
jae 0x1004b097
cmp dword [ebx], 0
je 0x1004b1c7
push 0
lea eax, [ebp - 0xb8]
push eax
lea eax, [ebp - 0xbc]
push eax
push dword [ebx - 0x10]
push dword [ebx - 0x14]
push dword [edi + 0x1c]
call fcn.1004cc50
mov eax, dword [ebp - 0xb8]
add esp, 0x18
cmp dword [ebx - 4], eax
jne 0x1004b0c5
push 0
lea ecx, [ebp - 0xa8]
push ecx
push eax
push dword [ebx]
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x1004af88
mov eax, dword [ebp - 0xa8]
cmp eax, dword [ebp - 0xb8]
je 0x1004b163
mov edi, 0x80004005
test esi, esi
je 0x1004b0a7
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, edi
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.1004d7a7
mov esp, ebp
pop ebp
ret
mov eax, dword [ebx - 8]
mov edi, dword [ebp - 0xbc]
mov dword [ebp - 0xd0], eax
cmp eax, edi
jb 0x1004b097
mov eax, dword [ebp - 0xac]
mov ebx, dword [ebx]
push dword [eax - 0x10]
mov eax, dword [ebp - 0xb0]
push dword [eax + 0x1c]
call fcn.1004adc0
add esp, 8
mov dword [ebp - 0xd4], eax
mov dword [ebp - 0xc0], 0
test eax, eax
je 0x1004b157
nop dword [eax + eax]
push 0
lea eax, [ebp - 0xa8]
push eax
push edi
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x1004af88
mov edi, dword [ebp - 0xbc]
cmp dword [ebp - 0xa8], edi
jne 0x1004b097
mov eax, dword [ebp - 0xc0]
add ebx, dword [ebp - 0xd0]
inc eax
mov dword [ebp - 0xc0], eax
cmp eax, dword [ebp - 0xd4]
jb 0x1004b110
mov edi, dword [ebp - 0xb0]
mov ebx, dword [ebp - 0xac]
mov edx, dword [ebp - 0xc4]
add ebx, 0x18
mov ecx, dword [ebp - 0xc8]
inc edx
inc ecx
mov dword [ebp - 0xc4], edx
mov dword [ebp - 0xc8], ecx
mov dword [ebp - 0xac], ebx
cmp edx, dword [ebp - 0xcc]
jb 0x1004b030
mov edx, dword [ebp - 0xcc]
mov ebx, dword [ebp - 0xb4]
mov eax, edx
inc ebx
shr eax, 1
cmp edx, 1
mov dword [ebp - 0xb4], ebx
cmovbe eax, edx
mov edx, eax
mov dword [ebp - 0xcc], edx
cmp ebx, dword [edi + 0x10]
jb 0x1004b002
xor edi, edi
jmp 0x1004b09c
mov edi, 0x80004003
jmp 0x1004b09c
xor eax, eax
xor ecx, ecx
mov dword [ebp - 0xbc], ecx
mov dword [ebp - 0xb8], eax
cmp dword [edi + 0xc], eax
jbe 0x1004b36d
nop word [eax + eax]
cmp dword [edi + 0x10], 0
mov dword [ebp - 0xc0], 0
jbe 0x1004b35d
mov edi, dword [ebp - 0xd8]
lea eax, [ecx + ecx*2]
add edi, 0x14
lea edi, [edi + eax*8]
mov eax, dword [ebp - 0xb0]
mov dword [ebp - 0xac], edi
nop
cmp ecx, dword [ebp + 0xc]
jae 0x1004b097
cmp dword [edi], 0
je 0x1004b1c7
push 0
lea ecx, [ebp - 0xb4]
push ecx
lea ecx, [ebp - 0xc8]
push ecx
push dword [edi - 0x10]
push dword [edi - 0x14]
push dword [eax + 0x1c]
call fcn.1004cc50
mov eax, dword [ebp - 0xb4]
add esp, 0x18
cmp dword [edi - 4], eax
jne 0x1004b288
push 0
lea ecx, [ebp - 0xa8]
push ecx
push eax
push dword [edi]
push esi
call ebx
test eax, eax
je 0x1004af88
mov eax, dword [ebp - 0xa8]
cmp eax, dword [ebp - 0xb4]
jne 0x1004b097
jmp 0x1004b323
mov eax, dword [edi - 8]
mov ebx, dword [ebp - 0xc8]
mov dword [ebp - 0xd4], eax
cmp eax, ebx
jb 0x1004b097
mov eax, dword [ebp - 0xac]
mov edi, dword [edi]
push dword [eax - 0x10]
mov eax, dword [ebp - 0xb0]
push dword [eax + 0x1c]
call fcn.1004adc0
add esp, 8
mov dword [ebp - 0xd0], eax
mov dword [ebp - 0xc4], 0
test eax, eax
je 0x1004b317
nop
push 0
lea eax, [ebp - 0xa8]
push eax
push ebx
push edi
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x1004af88
mov ebx, dword [ebp - 0xc8]
cmp dword [ebp - 0xa8], ebx
jne 0x1004b097
mov eax, dword [ebp - 0xc4]
add edi, dword [ebp - 0xd4]
inc eax
mov dword [ebp - 0xc4], eax
cmp eax, dword [ebp - 0xd0]
jb 0x1004b2d0
mov ebx, dword [sym.imp.KERNEL32.dll_WriteFile]
mov edi, dword [ebp - 0xac]
mov edx, dword [ebp - 0xc0]
add edi, 0x18
mov eax, dword [ebp - 0xb0]
inc edx
mov ecx, dword [ebp - 0xbc]
inc ecx
mov dword [ebp - 0xc0], edx
mov dword [ebp - 0xbc], ecx
mov dword [ebp - 0xac], edi
cmp edx, dword [eax + 0x10]
jb 0x1004b220
mov edi, eax
mov eax, dword [ebp - 0xb8]
inc eax
mov dword [ebp - 0xb8], eax
cmp eax, dword [edi + 0xc]
jb 0x1004b1f0
xor edi, edi
jmp 0x1004b09c