Function at 0x403a97
Capabilities:
Write file on windows

Disassembly:
push ebp
mov edx, 0x41ac50
mov ebp, esp
push edi
mov edi, 0x8000
push esi
push ebx
sub esp, 0x9c
mov eax, dword [ebp + 8]
mov esi, dword [ebp + 0x14]
cmp dword [ebp + 0x10], 0
cmovne edx, dword [ebp + 0x10]
cmovne edi, esi
test eax, eax
mov dword [ebp - 0x70], edx
js 0x403ad4
add eax, dword [0x431838]
mov dword [esp], eax
call fcn.00403a65
push eax
lea eax, [ebp - 0x20]
mov dword [esp + 4], 4
mov dword [esp], eax
call fcn.00403a19
test eax, eax
push ebx
push ebx
mov ebx, 0xfffffffd
je 0x403d54
mov eax, dword [ebp - 0x20]
test eax, eax
jns 0x403cbc
mov esi, dword [sym.imp.KERNEL32.dll_GetTickCount]
xor ebx, ebx
call esi
mov edx, dword [ebp - 0x20]
mov dword [0x422c60], 8
mov dword [0x42317c], 0
mov dword [0x423178], 0
and edx, 0x7fffffff
mov dword [0x42c808], 0x424800
mov dword [ebp - 0x78], eax
mov dword [0x42c804], 0x424800
mov dword [0x42c800], 0x42c800
mov dword [ebp - 0x74], edx
mov dword [ebp - 0x20], edx
mov dword [ebp - 0x6c], esi
jmp 0x403cac
cmp eax, 0x4000
mov esi, 0x4000
cmovle esi, eax
mov dword [esp + 4], esi
mov dword [esp], 0x416c50
call fcn.00403a19
test eax, eax
push ecx
push ecx
je 0x403d48
sub dword [ebp - 0x20], esi
mov dword [0x422c50], 0x416c50
mov dword [0x422c54], esi
mov edx, dword [ebp - 0x70]
mov dword [0x422c5c], edi
mov dword [esp], 0x422c50
mov dword [0x422c58], edx
call fcn.004088f7
test eax, eax
push edx
mov dword [ebp - 0x7c], eax
js 0x403d41
mov esi, dword [0x422c58]
sub esi, dword [ebp - 0x70]
call dword [ebp - 0x6c]
test byte [0x4317f0], 1
mov ecx, eax
je 0x403c48
sub eax, dword [ebp - 0x78]
cmp eax, 0xc8
ja 0x403be9
cmp dword [ebp - 0x20], 0
jne 0x403c48
mov edx, dword [ebp - 0x74]
mov dword [ebp - 0x80], ecx
mov dword [esp + 4], 0x64
mov eax, edx
sub eax, dword [ebp - 0x20]
mov dword [esp + 8], edx
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_MulDiv]
lea edx, [ebp - 0x60]
mov dword [ebp - 0x84], edx
sub esp, 0xc
mov dword [esp], edx
mov dword [esp + 8], eax
mov dword [esp + 4], str....__d__
call dword [sym.imp.USER32.dll_wsprintfA]
mov edx, dword [ebp - 0x84]
mov dword [esp], 0
mov dword [esp + 4], edx
call fcn.00406bba
mov ecx, dword [ebp - 0x80]
mov dword [ebp - 0x78], ecx
push eax
push eax
test esi, esi
je 0x403cac
cmp dword [ebp + 0x10], 0
jne 0x403c90
mov edx, dword [ebp - 0x70]
lea eax, [ebp - 0x1c]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], eax
mov dword [esp + 8], esi
mov dword [esp + 4], edx
mov edx, dword [ebp + 0xc]
mov dword [esp], edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
sub esp, 0x14
test eax, eax
je 0x403d4f
cmp dword [ebp - 0x1c], esi
jne 0x403d4f
add ebx, esi
jmp 0x403c9d
mov edx, dword [0x422c58]
add ebx, esi
sub edi, esi
mov dword [ebp - 0x70], edx
cmp dword [ebp - 0x7c], 1
jne 0x403b9b
jmp 0x403d54
mov eax, dword [ebp - 0x20]
test eax, eax
jg 0x403b61
jmp 0x403d54
cmp dword [ebp + 0x10], 0
jne 0x403d24
jmp 0x403d19
cmp edi, esi
cmovle esi, edi
mov dword [esp + 4], esi
mov dword [esp], 0x416c50
call fcn.00403a19
test eax, eax
push ecx
push ecx
je 0x403d48
mov edx, dword [ebp + 0xc]
lea eax, [ebp - 0x1c]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], eax
mov dword [esp + 8], esi
mov dword [esp + 4], 0x416c50
mov dword [esp], edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
sub esp, 0x14
test eax, eax
je 0x403d4f
cmp esi, dword [ebp - 0x1c]
jne 0x403d4f
add ebx, esi
sub dword [ebp - 0x20], esi
jmp 0x403d1b
xor ebx, ebx
mov esi, dword [ebp - 0x20]
test esi, esi
jg 0x403cc4
jmp 0x403d54
mov edx, dword [ebp + 0x10]
cmp esi, eax
cmovg esi, eax
mov dword [esp + 4], esi
mov dword [esp], edx
call fcn.00403a19
test eax, eax
push edx
cmovne ebx, esi
push edx
jmp 0x403d54
mov ebx, 0xfffffffc
jmp 0x403d54
mov ebx, 0xfffffffd
jmp 0x403d54
mov ebx, 0xfffffffe
lea esp, [ebp - 0xc]
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret 0x10