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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x11c
mov eax, dword [ebp + 8]
push ebx
push esi
push edi
xor edi, edi
mov dword [esp + 0x1c], edi
mov esi, 0x412950
lea ecx, [ecx]
mov dl, byte [eax]
mov bl, byte [esi]
mov cl, dl
cmp dl, bl
jne 0x403fc8
test cl, cl
je 0x403fc4
mov dl, byte [eax + 1]
mov bl, byte [esi + 1]
mov cl, dl
cmp dl, bl
jne 0x403fc8
add eax, 2
add esi, 2
test cl, cl
jne 0x403fa0
xor eax, eax
jmp 0x403fcd
sbb eax, eax
sbb eax, 0xffffffff
cmp eax, edi
jne 0x40426d
mov eax, dword [ebp + 0x10]
push edi
push edi
push 3
push edi
push edi
push 0xc0000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x40426d
lea ecx, [esp + 0x3c]
push ecx
push ebx
call dword [sym.imp.KERNEL32.dll_GetCommState]
test eax, eax
je 0x404266
mov eax, dword [esp + 0x44]
mov ecx, dword [ebp + 0x14]
and eax, 0xfffffffd
cmp ecx, 1
mov dword [esp + 0x40], 0x1c200
mov byte [esp + 0x4e], 8
mov dword [esp + 0x44], eax
mov byte [esp + 0x50], 0
jne 0x404041
and eax, 0xffffefff
or eax, 0x6084
mov dword [esp + 0x44], eax
mov byte [esp + 0x4f], 0
lea edx, [esp + 0x3c]
push edx
push ebx
call dword [sym.imp.KERNEL32.dll_SetCommState]
test eax, eax
je 0x404266
push 0x7d0
call dword [sym.imp.KERNEL32.dll_Sleep]
xor eax, eax
mov dword [esp + 0x28], eax
mov dword [esp + 0x2c], eax
mov dword [esp + 0x30], eax
mov dword [esp + 0x34], eax
lea ecx, [esp + 0x28]
mov dword [esp + 0x38], eax
mov eax, 0x3e8
push ecx
push ebx
mov dword [esp + 0x38], eax
mov dword [esp + 0x40], eax
call dword [sym.imp.KERNEL32.dll_SetCommTimeouts]
lea esi, [esp + 0x58]
sub esi, 0x412440
mov dword [esp + 0x20], edi
mov dword [esp + 0x18], str.ATGMI_r_r_nGMI:_LG_Electronics_Inc._r_n_r_nOK_r_n
mov dword [esp + 0x24], esi
lea esp, [esp]
mov al, byte [0x412958]
mov edx, dword [str.ATZ_r]
mov byte [esp + 0x5c], al
xor eax, eax
mov dword [esp + 0x58], edx
mov ecx, 0x17
lea edi, [esp + 0x5d]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
xor eax, eax
mov ecx, 0x19
lea edi, [esp + 0xc0]
rep stosd dword es:[edi], eax
lea eax, [esp + 0x58]
lea edx, [eax + 1]
lea ebx, [ebx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4040f0
push 0
sub eax, edx
lea ecx, [esp + 0x18]
push ecx
push eax
lea edx, [esp + 0x64]
push edx
mov edi, 0x64
push ebx
mov dword [esp + 0x28], eax
mov dword [esp + 0x24], edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov ecx, dword [esp + 0x10]
push 0
lea eax, [esp + 0x14]
push eax
push ecx
lea edx, [esp + 0xcc]
push edx
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [esp + 0x14]
test eax, eax
je 0x4041fd
mov eax, dword [esp + 0x10]
test eax, eax
je 0x4041fd
lea eax, [esp + 0xc0]
push 0x41295c
push eax
call fcn.00407d90
add esp, 8
test eax, eax
je 0x4041fd
mov eax, dword [esp + 0x18]
add eax, 0xffffff00
mov cl, byte [eax]
mov byte [esi + eax], cl
inc eax
test cl, cl
jne 0x404173
lea eax, [esp + 0x58]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x404184
sub eax, edx
lea ecx, [esp + 0x10]
push ecx
lea edx, [esp + 0x18]
push edx
mov dword [esp + 0x1c], eax
lea eax, [esp + 0xc8]
push eax
lea ecx, [esp + 0x64]
push ecx
push ebx
mov dword [esp + 0x24], edi
call fcn.00403f30
add esp, 0x14
test eax, eax
je 0x4041fd
mov esi, dword [esp + 0x18]
lea eax, [esp + 0xc0]
mov dl, byte [eax]
mov cl, dl
cmp dl, byte [esi]
jne 0x4041e8
test cl, cl
je 0x4041e4
mov dl, byte [eax + 1]
mov cl, dl
cmp dl, byte [esi + 1]
jne 0x4041e8
add eax, 2
add esi, 2
test cl, cl
jne 0x4041c4
xor eax, eax
jmp 0x4041ed
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
je 0x404237
mov esi, dword [esp + 0x24]
mov dword [esp + 0x1c], 0
inc dword [esp + 0x20]
mov eax, dword [esp + 0x18]
add eax, 0x270
sub esi, 0x270
cmp eax, 0x412a20
mov dword [esp + 0x24], esi
mov dword [esp + 0x18], eax
jl 0x4040b0
mov edi, dword [esp + 0x1c]
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [esp + 0x20]
mov edx, dword [ebp + 0xc]
imul eax, eax, 0x270
lea eax, [eax + str.LSP_340E]
sub edx, eax
lea esp, [esp]
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x404250
mov dword [esp + 0x1c], 1
mov edi, dword [esp + 0x1c]
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret