Function at 0x409170
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x434c
call fcn.005241a0
mov eax, dword [0x596120]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
push ebx
push esi
push edi
mov edi, ecx
mov dword [ebp - 0x4348], eax
cmp dword [edi + 4], 0xffffffff
je 0x4091a2
mov ecx, dword [edi]
call fcn.00408880
mov ecx, dword [edi]
mov ebx, dword [ebp + 8]
mov dword [edi + 4], 0xffffffff
cmp ebx, dword [ecx + 4]
jl 0x4091cb
mov eax, 0x10000
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0051ef35
mov esp, ebp
pop ebp
ret 0x10
cmp ebx, dword [ecx + 0x10]
jge 0x4091d5
call fcn.00408310
mov eax, dword [edi]
cmp dword [eax + 0x10], ebx
jge 0x409230
lea esp, [esp]
mov esi, dword [edi]
test esi, esi
je 0x409229
cmp dword [esi + 0x18], 0
je 0x409229
mov edx, dword [esi + 0x10]
inc edx
cmp edx, dword [esi + 4]
je 0x409229
mov ecx, dword [esi + 0x50]
sub esp, 0x10
mov eax, dword [esi + 0x48]
add ecx, dword [esi + 0x4c]
add eax, 0x2e
add eax, ecx
mov dword [esi + 0x10], edx
add dword [esi + 0x14], eax
lea edx, [esi + 0x28]
push 0
lea eax, [esi + 0x78]
mov ecx, esi
push 0
push eax
call fcn.00407ed0
add esp, 0x1c
neg eax
sbb eax, eax
inc eax
mov dword [esi + 0x18], eax
mov eax, dword [edi]
cmp dword [eax + 0x10], ebx
jl 0x4091e0
lea eax, [ebp - 0x4340]
mov ecx, edi
push eax
push ebx
call fcn.004089a0
test byte [ebp - 0x4238], 0x10
je 0x4092a3
push 0x206
lea eax, [ebp - 0x210]
push 0
push eax
call fcn.00521b90
add esp, 0xc
lea eax, [ebp - 0x210]
push 0x103
push eax
push 0xffffffffffffffff
lea eax, [ebp - 0x433c]
push eax
push 0
push 0
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
lea ecx, [edi + 0x138]
lea edx, [ebp - 0x210]
call fcn.00409070
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0051ef35
mov esp, ebp
pop ebp
ret 0x10
mov ebx, dword [ebp - 0x4348]
mov edx, ebx
mov ecx, ebx
movzx eax, word [ebx]
test ax, ax
je 0x409398
lea esp, [esp]
cmp ax, 0x2f
je 0x4092cc
cmp ax, 0x5c
jne 0x4092cf
lea edx, [ecx + 2]
movzx eax, word [ecx + 2]
add ecx, 2
test ax, ax
jne 0x4092c0
cmp edx, ebx
je 0x409398
lea esi, [ebp - 0x210]
mov ecx, ebx
sub esi, ebx
lea ecx, [ecx]
movzx eax, word [ecx]
lea ecx, [ecx + 2]
mov word [esi + ecx - 2], ax
test ax, ax
jne 0x4092f0
sub edx, ebx
sar edx, 1
lea edx, [edx*2 - 2]
cmp edx, 0x208
jae 0x409485
xor eax, eax
mov word [ebp + edx - 0x210], ax
mov ax, word [ebp - 0x210]
cmp ax, 0x2f
je 0x409345
cmp ax, 0x5c
je 0x409345
cmp word [ebp - 0x20e], 0x3a
mov byte [ebp - 0x4341], 0
jne 0x40934c
mov byte [ebp - 0x4341], 1
lea eax, [ebp - 0x210]
push 0x578a98
push eax
call fcn.0052041e
mov esi, eax
lea eax, [ebp - 0x210]
push 0x578aa0
push eax
call fcn.0052041e
add esp, 0x10
test eax, eax
setne cl
test esi, esi
setne al
or cl, al
or cl, byte [ebp - 0x4341]
jne 0x409398
lea ecx, [edi + 0x138]
lea edx, [ebp - 0x210]
call fcn.00409070
push 0
push dword [ebp - 0x4238]
push 2
push 0
push 0
push 0x40000000
push ebx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
jne 0x4093d1
mov eax, 0x200
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0051ef35
mov esp, ebp
pop ebp
ret 0x10
mov ecx, dword [edi]
call fcn.004085d0
mov ecx, dword [edi]
lea edx, [ebp - 0x4210]
push 0x4000
xor bl, bl
call fcn.004086f0
add esp, 4
test eax, eax
js 0x40942a
je 0x40942c
push 0
lea ecx, [ebp - 0x4348]
push ecx
push eax
lea eax, [ebp - 0x4210]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40942a
mov ecx, dword [edi]
lea edx, [ebp - 0x4210]
push 0x4000
call fcn.004086f0
add esp, 4
test eax, eax
jns 0x4093f3
mov bl, 1
push esi
call dword [sym.imp.KERNEL32.dll_GetFileType]
cmp eax, 1
jne 0x409458
test bl, bl
jne 0x409458
lea eax, [ebp - 0x4224]
push eax
lea eax, [ebp - 0x4234]
push eax
lea eax, [ebp - 0x422c]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_SetFileTime]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [edi]
call fcn.00408880
xor eax, eax
mov ecx, 0x400
test bl, bl
pop edi
cmovne eax, ecx
mov ecx, dword [ebp - 4]
pop esi
xor ecx, ebp
pop ebx
call fcn.0051ef35
mov esp, ebp
pop ebp
ret 0x10
call fcn.0052098a
int3