Function at 0x401000
Capabilities:
Read file on windows
Write file on windows

Disassembly:
sub esp, 0x10c
mov ecx, dword [esp + 0x110]
push ebp
push esi
push edi
lea eax, [esp + 0x14]
push 0x100
push eax
push ecx
mov dword [esp + 0x1c], 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea edx, [esp + 0x14]
push 0x2e
push edx
call fcn.00407ef0
mov byte [eax + 1], 0
mov edi, 0x40b028
or ecx, 0xffffffff
xor eax, eax
add esp, 8
lea edx, [esp + 0x14]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
push eax
mov esi, edi
mov ebp, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebp
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
push pe_nt_image_headers32
push 3
mov ecx, ebp
push eax
push eax
and ecx, 3
lea eax, [esp + 0x28]
push 0xc0000000
rep movsb byte es:[edi], byte [esi]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
cmp esi, 0xffffffff
je 0x401378
mov edi, dword [sym.imp.KERNEL32.dll_ReadFile]
lea ecx, [esp + 0xc]
push 0
push ecx
push 0x200
push 0x410720
push esi
call edi
test eax, eax
jne 0x4010bb
mov word [0x410725], 0x90
jmp 0x401257
cmp byte [0x410724], 0x63
jne 0x401193
push 0x410920
push 0x410924
push 0x410928
push 0x41092c
call fcn.00401390
push 0
push 0
push 0
push esi
mov dword [esp + 0x20], eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov edi, dword [sym.imp.KERNEL32.dll_WriteFile]
lea edx, [esp + 0xc]
push 0
push edx
push 4
push 0x41092c
push esi
call edi
lea eax, [esp + 0xc]
push 0
push eax
push 4
push 0x410928
push esi
call edi
lea ecx, [esp + 0xc]
push 0
push ecx
push 4
push 0x410924
push esi
call edi
lea edx, [esp + 0xc]
push 0
push edx
push 4
push 0x410920
push esi
call edi
lea eax, [esp + 0xc]
push 0
push eax
push 4
push 0x4106f8
push esi
call edi
lea ecx, [esp + 0xc]
push 0
push ecx
push 4
push 0x4106f4
push esi
call edi
lea edx, [esp + 0xc]
push 0
push edx
push 4
push 0x410700
push esi
call edi
lea eax, [esp + 0xc]
push 0
push eax
push 4
push 0x4106fc
push esi
call edi
lea ecx, [esp + 0xc]
push 0
push ecx
lea edx, [esp + 0x18]
push 4
push edx
jmp 0x40136e
lea eax, [esp + 0xc]
push 0
push eax
push 1
push 0x410930
push esi
call edi
lea ecx, [esp + 0xc]
push 0
push ecx
push 4
push 0x4106f8
push esi
call edi
lea edx, [esp + 0xc]
push 0
push edx
push 4
push 0x4106f4
push esi
call edi
lea eax, [esp + 0xc]
push 0
push eax
push 4
push 0x410700
push esi
call edi
lea ecx, [esp + 0xc]
push 0
push ecx
push 4
push 0x4106fc
push esi
call edi
lea edx, [esp + 0xc]
push 0
push edx
push 0x101
push 0x410940
push esi
call edi
mov eax, dword [0x410869]
test eax, eax
je 0x40126c
mov cx, word [0x410867]
test cx, cx
je 0x40126c
mov edx, dword [str.DDAT]
mov dword [0x410704], eax
mov al, byte [0x410724]
mov dword [0x410520], edx
cmp al, 1
mov dword [0x410869], 0x410520
jne 0x40126c
xor edx, edx
lea eax, [esp + 0xc]
push 0
mov dx, cx
push eax
push edx
push 0x410524
push esi
call edi
test eax, eax
jne 0x40126c
mov word [0x410725], 0x91
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x10], eax
mov ebp, dword [esp + 0x10]
mov dword [0x410727], eax
jmp 0x4012da
push 0x410720
call fcn.004014fa
cmp eax, 0x7c
mov dword [esp + 0x10], eax
jne 0x401285
mov word [0x410725], ax
mov eax, dword [0x410869]
test eax, eax
je 0x4012a2
cmp word [0x410867], 0
je 0x4012a2
mov eax, dword [0x410704]
mov dword [0x410869], eax
mov eax, dword [0x40b2c2]
xor ebp, ebp
test eax, eax
je 0x4012bf
mov edi, 0x40b156
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov ebp, ecx
inc ebp
mov eax, dword [0x40be8d]
mov dword [0x410861], ebp
test eax, eax
mov byte [0x410873], 0
je 0x4012da
mov byte [0x410873], al
push 0
push 0
push 0
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov edi, dword [sym.imp.KERNEL32.dll_WriteFile]
lea ecx, [esp + 0xc]
push 0
push ecx
push 0x200
push 0x410720
push esi
call edi
mov eax, dword [0x410869]
test eax, eax
je 0x40133a
mov ax, word [0x410867]
test ax, ax
je 0x40133a
mov cl, byte [0x410724]
cmp cl, 1
je 0x40133a
cmp cl, 6
je 0x40133a
xor ecx, ecx
lea edx, [esp + 0xc]
push 0
mov cx, ax
push edx
push ecx
push 0x410524
push esi
call edi
mov eax, dword [0x40b2c2]
test eax, eax
je 0x401353
lea edx, [esp + 0xc]
push 0
push edx
push ebp
push 0x40b156
push esi
call edi
mov eax, dword [0x40be8d]
test eax, eax
je 0x401371
lea ecx, [esp + 0xc]
push 0
add eax, 0x100
push ecx
push eax
push 0x40be91
push esi
call edi
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
xor eax, eax
pop ebp
add esp, 0x10c
ret 0x10