Function at 0x401525
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c
mov eax, dword [ebp + 8]
mov ecx, dword [ebp + 0x10]
push ebx
mov bl, byte [eax]
push esi
push edi
xor edi, edi
xor edx, edx
cmp dword [ecx], edi
mov dword [ebp - 0x2c], edi
mov dword [ebp - 0xc], edi
mov dword [ebp - 0x20], edi
mov dword [ebp - 8], edi
mov dword [ebp - 0x18], edx
mov byte [ebp - 1], bl
je 0x401559
inc edx
cmp dword [ecx + edx*4], edi
jne 0x401550
mov dword [ebp - 0x18], edx
push 0xd
pop esi
cmp dword [ebp + 0xc], esi
jb 0x4016ef
mov eax, dword [eax + 5]
mov ecx, edx
shl ecx, 2
cmp eax, 0xffffffff
mov dword [ebp - 0x14], eax
mov dword [ebp - 0x1c], ecx
je 0x4016ef
cmp eax, ecx
jb 0x4016ef
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
cmp eax, edi
mov dword [ebp - 0xc], eax
jne 0x4015a1
push 0xe
jmp 0x4016f0
cmp bl, 0xe1
jae 0x4016ef
cmp bl, 0x2d
mov dword [ebp - 0x28], edi
jb 0x4015c9
xor ah, ah
mov al, bl
mov cl, 0x2d
div cl
movzx eax, al
mov dword [ebp - 0x28], eax
add bl, 0xd3
dec eax
jne 0x4015c0
mov byte [ebp - 1], bl
mov cl, byte [ebp - 1]
xor ebx, ebx
cmp cl, 9
jb 0x4015e6
xor ah, ah
mov al, cl
mov dl, 9
div dl
movzx eax, al
mov ebx, eax
add cl, 0xf7
dec eax
jne 0x4015e0
movzx esi, cl
lea ecx, [esi + ebx]
mov edi, 0x300
shl edi, cl
lea edi, [edi + edi + 0xe6c]
push edi
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
test eax, eax
mov dword [ebp - 0x20], eax
je 0x40159a
lea ecx, [ebp - 0x10]
push ecx
push dword [ebp - 0x14]
mov ecx, dword [ebp + 0xc]
push dword [ebp - 0xc]
add ecx, 0xfffffff3
push ecx
mov ecx, dword [ebp + 8]
add ecx, 0xd
push ecx
push dword [ebp - 0x28]
push ebx
push esi
push edi
push eax
call fcn.00401f1e
add esp, 0x28
test eax, eax
jne 0x4016da
mov eax, dword [ebp - 0x10]
cmp eax, dword [ebp - 0x14]
jne 0x4016da
and dword [ebp + 0xc], 0
cmp dword [ebp - 0x18], 0
jbe 0x4016de
mov esi, dword [ebp - 0xc]
mov ebx, dword [ebp + 0x10]
sub ebx, esi
mov eax, dword [esi]
mov edi, dword [ebp - 0x1c]
mov dword [ebp - 0x10], eax
add eax, edi
cmp eax, dword [ebp - 0x14]
ja 0x4016da
push 0
push 0x8000080
push 2
push 0
push 1
push 0x40000000
push dword [ebx + esi]
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov dword [ebp - 8], eax
je 0x4016f6
push 0
lea eax, [ebp - 0x24]
push eax
push dword [ebp - 0x10]
mov eax, dword [ebp - 0xc]
add eax, edi
push eax
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4016f6
mov eax, dword [ebp - 0x24]
cmp eax, dword [esi]
jne 0x4016f6
add edi, dword [ebp - 0x10]
push dword [ebp - 8]
mov dword [ebp - 0x1c], edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
and dword [ebp - 8], 0
inc dword [ebp + 0xc]
mov eax, dword [ebp + 0xc]
add esi, 4
cmp eax, dword [ebp - 0x18]
jb 0x401662
jmp 0x4016e1
push 0xd
jmp 0x4016f0
mov edi, dword [ebp - 0x1c]
cmp edi, dword [ebp - 0x14]
jne 0x4016da
mov dword [ebp - 0x2c], 1
jmp 0x4016f6
push esi
call dword [sym.imp.KERNEL32.dll_SetLastError]
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, dword [sym.imp.KERNEL32.dll_HeapFree]
xor edi, edi
cmp dword [ebp - 0xc], edi
mov dword [ebp - 0x24], eax
je 0x401719
push dword [ebp - 0xc]
push edi
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call esi
cmp dword [ebp - 0x20], edi
je 0x40172b
push dword [ebp - 0x20]
push edi
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call esi
cmp dword [ebp - 8], edi
pop edi
pop esi
pop ebx
je 0x401742
cmp dword [ebp - 8], 0xffffffff
je 0x401742
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [ebp - 0x24]
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, dword [ebp - 0x2c]
leave
ret