Function at 0x40b5e0
Capabilities:
Get file attributes
Write file on windows

Disassembly:
sub esp, 0xc
push ebx
push ebp
push esi
mov esi, dword [esp + 0x20]
push edi
mov edi, dword [esp + 0x20]
xor ebx, ebx
push edi
mov dword [esi], ebx
mov dword [esp + 0x14], ebx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp dword [esi], ebx
jne 0x40b609
call fcn.0040eb70
mov dword [esi], eax
push ebx
push ebx
push 2
push ebx
push 1
push 0xc0000000
push edi
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ebp, eax
cmp ebp, 0xffffffff
je 0x40b672
cmp dword [esi], ebx
jne 0x40b65b
push 0x1a0
call fcn.0042a10c
mov edi, eax
xor eax, eax
mov dword [esp + 0x14], edi
mov ecx, 0x68
rep stosd dword es:[edi], eax
mov eax, dword [esp + 0x14]
add esp, 4
cmp eax, ebx
jne 0x40b65b
pop edi
mov dword [esi], 8
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0xc
ret
push ebx
lea eax, [esp + 0x1c]
push eax
push ebx
push ebp
mov dword [esp + 0x28], ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x40b684
call dword [sym.imp.KERNEL32.dll_GetLastError]
pop edi
mov dword [esi], eax
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0xc
ret
mov esi, dword [esp + 0x28]
cmp esi, 0x40000
jbe 0x40b697
mov esi, 0x40000
jmp 0x40b6a1
cmp esi, 4
jae 0x40b6a1
mov esi, 4
mov edi, dword [esp + 0x24]
cmp dword [edi], ebx
jne 0x40b7ee
mov edi, dword [esp + 0x10]
mov ecx, 0x68
xor eax, eax
rep stosd dword es:[edi], eax
mov ecx, dword [esp + 0x20]
mov edx, dword [esp + 0x10]
mov al, byte [ecx]
inc ecx
mov byte [edx], al
inc edx
cmp al, bl
jne 0x40b6c2
mov ecx, dword [esp + 0x10]
mov dword [ecx + 0x108], ebp
mov edx, dword [esp + 0x10]
mov dword [edx + 0x138], 0x1000
mov ecx, dword [esp + 0x10]
mov eax, 0x200
mov dword [ecx + 0x110], eax
mov edx, dword [esp + 0x10]
mov dword [edx + 0x114], ebx
mov ecx, dword [esp + 0x10]
mov dword [ecx + 0x118], eax
mov edx, dword [esp + 0x10]
mov dword [edx + 0x11c], ebx
mov eax, dword [esp + 0x10]
mov dword [eax + 0x128], ebx
mov ecx, dword [esp + 0x10]
mov dword [ecx + 0x12c], ebx
mov eax, dword [esp + 0x10]
lea edi, [esi + esi*2]
lea edx, [eax + 0x158]
shl edi, 2
push edi
mov dword [eax + 0x14c], edx
call fcn.0042a10c
mov ecx, dword [esp + 0x14]
mov dword [ecx + 0x150], eax
mov edx, dword [esp + 0x14]
mov ecx, edi
mov edi, dword [edx + 0x150]
mov edx, ecx
shr ecx, 2
or eax, 0xffffffff
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
rep stosb byte es:[edi], al
lea edi, [esi + esi*4]
shl edi, 2
push edi
call fcn.0042a10c
mov ecx, dword [esp + 0x18]
mov dword [ecx + 0x154], eax
mov edx, dword [esp + 0x18]
mov ecx, edi
mov edi, dword [edx + 0x154]
mov edx, ecx
shr ecx, 2
xor eax, eax
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
rep stosb byte es:[edi], al
mov eax, dword [esp + 0x18]
mov ecx, dword [eax + 0x138]
push ecx
call fcn.0042a10c
mov edx, dword [esp + 0x1c]
mov dword [edx + 0x144], eax
mov edx, dword [esp + 0x1c]
mov ecx, dword [edx + 0x138]
mov edi, dword [edx + 0x144]
mov edx, ecx
shr ecx, 2
xor eax, eax
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
rep stosb byte es:[edi], al
mov eax, dword [esp + 0x1c]
mov ecx, dword [eax + 0x198]
mov edi, dword [esp + 0x30]
add esp, 0xc
or ecx, 1
mov dword [eax + 0x198], ecx
mov eax, dword [esp + 0x10]
cmp dword [eax + 0x150], ebx
je 0x40b80a
cmp dword [eax + 0x154], ebx
je 0x40b80a
cmp dword [eax + 0x144], ebx
jne 0x40b816
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [edi], eax
mov eax, dword [esp + 0x10]
cmp dword [edi], ebx
jne 0x40b8e9
mov edx, dword [eax + 0x14c]
xor eax, eax
mov ecx, 0xd
mov edi, edx
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
mov eax, dword [esp + 0x2c]
mov dword [edx + 0x26], esi
mov dword [edx + 0x2e], eax
mov dword [edx + 0x2a], esi
mov dword [edx], 0x1a4d504b
mov dword [edx + 4], 0x36
mov dword [edx + 8], ebx
mov dword [edx + 0xc], ebx
mov dword [edx + 0x10], 0x578
mov word [edx + 0x14], 3
mov dword [edx + 0x32], 0x100000
mov ecx, dword [esp + 0x10]
mov dword [ecx + 0x130], ebx
mov eax, dword [esp + 0x10]
mov dword [eax + 0x134], ebx
mov eax, dword [esp + 0x10]
mov ecx, eax
mov esi, dword [ecx + 0x110]
mov dword [eax + 0x118], esi
mov eax, dword [ecx + 0x114]
mov ecx, dword [esp + 0x10]
mov dword [ecx + 0x11c], eax
mov eax, dword [edx + 0x26]
lea eax, [eax + eax*2]
shl eax, 2
mov dword [edx + 0x16], ebx
mov dword [edx + 0x1a], ebx
mov ecx, eax
mov eax, dword [esp + 0x10]
mov ebp, dword [eax + 0x118]
mov edi, dword [eax + 0x11c]
xor esi, esi
add ecx, ebp
mov dword [eax + 0x120], ecx
mov eax, dword [esp + 0x10]
adc esi, edi
mov edi, dword [esp + 0x24]
mov dword [eax + 0x124], esi
mov eax, dword [edx + 0x26]
lea ecx, [eax + eax*2]
shl ecx, 2
mov dword [edx + 0x1e], ecx
mov dword [edx + 0x22], ebx
mov eax, dword [esp + 0x10]
cmp dword [edi], ebx
mov dword [esp + 0x14], ebx
jne 0x40b9f9
mov ecx, dword [eax + 0x14c]
mov eax, dword [eax + 0x108]
push ebx
lea edx, [esp + 0x18]
push edx
mov edx, dword [ecx + 4]
push edx
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [esp + 0x10]
mov ecx, dword [eax + 0x14c]
mov edx, dword [esp + 0x14]
cmp edx, dword [ecx + 4]
je 0x40b92c
mov dword [edi], 0x70
mov ecx, dword [eax + 0x14c]
mov edx, dword [ecx + 4]
mov dword [eax + 0x128], edx
mov eax, dword [esp + 0x10]
mov dword [eax + 0x12c], ebx
cmp dword [edi], ebx
jne 0x40b9f9
mov ecx, dword [esp + 0x10]
push ecx
call fcn.0040bb60
mov eax, dword [edi]
add esp, 4
cmp eax, ebx
jne 0x40b9f9
mov edx, dword [esp + 0x10]
push edx
call fcn.0040dea0
add esp, 4
cmp eax, ebx
mov dword [edi], eax
jne 0x40b9f9
mov eax, dword [esp + 0x10]
push str._list_
push eax
call fcn.0040a600
add esp, 8
cmp eax, ebx
mov dword [edi], eax
jne 0x40b9f9
mov eax, dword [esp + 0x10]
mov ecx, dword [eax + 0x186]
mov esi, 2
cmp ecx, esi
jne 0x40b9b4
push ebx
push eax
call fcn.0040d660
mov eax, dword [esp + 0x18]
add esp, 8
cmp dword [edi], ebx
jne 0x40b9f9
push eax
call fcn.0040def0
add esp, 4
cmp eax, ebx
mov dword [edi], eax
jne 0x40b9f9
mov ecx, dword [esp + 0x10]
push str._attr_
push ecx
call fcn.0040a600
add esp, 8
cmp eax, ebx
mov dword [edi], eax
jne 0x40b9f9
mov eax, dword [esp + 0x10]
cmp dword [eax + 0x186], esi
jne 0x40b9f5
push ebx
push eax
call fcn.0040d9a0
add esp, 8
cmp dword [edi], ebx
je 0x40ba06
lea edx, [esp + 0x10]
push edx
call fcn.0040d350
add esp, 4
mov eax, dword [esp + 0x10]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret