Function at 0x5dad80
Capabilities:
Write file on windows

Disassembly:
sub esp, 8
cmp word [esi + 0x208], 0
push ebx
mov ebx, dword [esp + 0x14]
push ebp
mov ebp, dword [esp + 0x14]
push edi
mov edi, eax
mov eax, dword [esi + 0x410]
setne cl
cmp byte [eax + 0xc], 0
mov byte [esp + 0xc], cl
jne 0x5dadfa
cmp dword [eax + 0x1676], 0
je 0x5dadbf
mov word [esi + 0x418], 3
jmp 0x5dae03
test cl, cl
je 0x5dadce
mov word [esi + 0x418], 2
jmp 0x5dae03
mov eax, dword [esi + 0x414]
mov eax, dword [eax]
xor ecx, ecx
test eax, eax
je 0x5dadfa
lea esp, [esp]
mov eax, dword [eax + 8]
add ecx, 1
test eax, eax
jne 0x5dade0
cmp ecx, 1
jbe 0x5dadfa
mov word [esi + 0x418], 1
jmp 0x5dae03
mov word [esi + 0x418], 0
mov edx, dword [edi]
push 0
lea ecx, [esp + 0x20]
push ecx
push 2
lea eax, [esi + 0x418]
push eax
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
cmp dword [esp + 0x1c], 2
jne 0x5db1c6
mov edx, dword [edi]
push 0
lea eax, [esp + 0x1c]
push eax
push 4
lea ecx, [esp + 0x28]
push ecx
push edx
mov dword [esp + 0x30], 0
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov ecx, 4
cmp dword [esp + 0x18], ecx
jne 0x5db1c6
mov eax, dword [esi + 0x410]
mov dword [esp + 0x1c], 0
cmp byte [eax + 0xc], 0
je 0x5dae73
mov dword [esp + 0x1c], 1
jmp 0x5dae8f
cmp byte [esp + 0xc], 0
je 0x5dae82
mov dword [esp + 0x1c], 2
cmp dword [eax + 0x1676], 0
je 0x5dae8f
or dword [esp + 0x1c], ecx
mov edx, dword [edi]
push 0
lea eax, [esp + 0x1c]
push eax
push ecx
lea ecx, [esp + 0x28]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
cmp dword [esp + 0x18], 4
jne 0x5db1c6
mov eax, dword [esi + 0x410]
mov ecx, dword [eax + 4]
push 0
lea edx, [esp + 0x1c]
push edx
push 4
lea eax, [esp + 0x28]
mov dword [esp + 0x28], ecx
mov ecx, dword [edi]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
cmp dword [esp + 0x18], 4
je 0x5daefb
mov edx, dword [ebx]
mov eax, dword [edx + 0x1c]
push str.File_write_failed
mov ecx, ebx
call eax
mov dword [ebp], 2
mov eax, ebp
pop edi
pop ebp
pop ebx
add esp, 8
ret 8
mov ecx, dword [esi + 0x410]
mov edx, dword [ecx + 8]
push 0
lea eax, [esp + 0x1c]
push eax
push 4
lea ecx, [esp + 0x28]
mov dword [esp + 0x28], edx
mov edx, dword [edi]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
cmp dword [esp + 0x18], 4
jne 0x5db1c6
mov eax, dword [esi + 0x410]
cmp byte [eax + 0xc], 0
jne 0x5db1b4
cmp byte [esp + 0xc], 0
je 0x5daf68
lea ecx, [esi + 0x208]
call fcn.005da600
push edi
mov ecx, 1
lea edx, [esp + 0x20]
mov byte [esp + 0x20], al
call fcn.00402180
cmp eax, 1
jne 0x5daedb
mov ecx, 4
cmp word [esi + 0x418], cx
jb 0x5daf91
push edi
lea edx, [esp + 0x20]
mov dword [esp + 0x20], 0
call fcn.00402180
cmp eax, 4
jne 0x5daedb
mov ecx, dword [esi + 0x410]
mov edx, dword [ecx + 0x1665]
mov dword [esp + 0x1c], edx
push edi
mov ecx, 4
lea edx, [esp + 0x20]
call fcn.00402180
cmp eax, 4
jne 0x5db1c6
mov edx, dword [esi + 0x410]
add edx, 0x145d
call fcn.005da790
mov edx, dword [esi + 0x410]
add edx, 0xd
call fcn.005da790
test al, al
je 0x5db1c6
mov edx, dword [esi + 0x410]
add edx, 0x215
call fcn.005da790
test al, al
je 0x5db1c6
mov edx, dword [esi + 0x410]
add edx, 0x41d
call fcn.005da790
test al, al
je 0x5db1c6
mov edx, dword [esi + 0x410]
add edx, 0x625
call fcn.005da790
test al, al
je 0x5db1c6
mov edx, dword [esi + 0x410]
add edx, 0x82d
call fcn.005da790
test al, al
je 0x5db1c6
mov edx, dword [esi + 0x410]
add edx, 0xa35
call fcn.005da790
test al, al
je 0x5db1c6
mov edx, dword [esi + 0x410]
add edx, 0xc3d
call fcn.005da790
test al, al
je 0x5db1c6
mov edx, dword [esi + 0x410]
add edx, 0xe45
call fcn.005da790
test al, al
je 0x5db1c6
mov edx, dword [esi + 0x410]
add edx, 0x104d
call fcn.005da790
test al, al
je 0x5db1c6
mov edx, dword [esi + 0x410]
add edx, 0x1255
call fcn.005da790
test al, al
je 0x5db1c6
mov edx, dword [esi + 0x410]
add edx, 0x1669
push edi
mov ecx, 1
call fcn.00402180
cmp eax, 1
jne 0x5db1c6
mov eax, dword [esp + 0xc]
mov ecx, dword [esi + 0x410]
push eax
add ecx, 0x166a
push ecx
push edi
push esi
call fcn.005da8f0
test al, al
je 0x5daedb
mov edx, dword [esi + 0x410]
mov eax, dword [edx + 0x1676]
xor ecx, ecx
test eax, eax
je 0x5db12d
mov eax, dword [eax + 8]
add ecx, 1
test eax, eax
jne 0x5db114
cmp ecx, 0xff
jbe 0x5db12d
mov byte [esp + 0x1c], 0xff
jmp 0x5db135
test cl, cl
mov byte [esp + 0x1c], cl
jbe 0x5db1b4
push edi
mov ecx, 1
lea edx, [esp + 0x20]
call fcn.00402180
cmp eax, 1
jne 0x5db1c6
mov eax, dword [esi + 0x410]
mov eax, dword [eax + 0x1676]
test eax, eax
mov dword [esp + 0x18], eax
je 0x5db1b4
jmp 0x5db164
mov eax, dword [esp + 0x18]
lea edx, [eax + 0xc]
call fcn.005da790
test al, al
je 0x5db1c6
mov ecx, dword [esp + 0x18]
mov edx, dword [ecx + 4]
mov dword [esp + 0x10], edx
push edi
mov ecx, 4
lea edx, [esp + 0x14]
call fcn.00402180
cmp eax, 4
jne 0x5db1c6
mov eax, dword [esp + 0xc]
mov ecx, dword [esp + 0x18]
push eax
push ecx
push edi
mov ecx, esi
call fcn.005dac70
test al, al
je 0x5db1c6
mov edx, dword [esp + 0x18]
mov eax, dword [edx + 8]
test eax, eax
mov dword [esp + 0x18], eax
jne 0x5db160
mov dword [ebp], 0
mov eax, ebp
pop edi
pop ebp
pop ebx
add esp, 8
ret 8
mov eax, dword [ebx]
mov edx, dword [eax + 0x1c]
push str.File_write_failed
mov ecx, ebx
call edx
pop edi
mov dword [ebp], 2
mov eax, ebp
pop ebp
pop ebx
add esp, 8
ret 8